MPSMatrixDescriptor(3)

NAME
MPSMatrixDescriptor -

SYNOPSIS

#import <MPSMatrix.h>

Inherits NSObject.

  Class Methods
(__nonnull instancetype) + matrixDescriptorWithDimensions:columns:rowBytes:dataType:
(size_t) + rowBytesFromColumns:dataType:

  Properties
NSUInteger rows
NSUInteger columns
MPSDataType dataType
NSUInteger rowBytes

Detailed Description

This depends on Metal.framework

A MPSMatrixDescriptor describes the sizes, strides, and data type of a 2-dimensional array of data. All storage is assumed to be in row-major order.

Method Documentation

  + (__nonnull instancetype) matrixDescriptorWithDimensions: (NSUInteger) rows(NSUInteger) columns(NSUInteger) rowBytes(MPSDataType) dataType
Create a MPSMatrixDescriptor with the specified dimensions and data type.

Parameters:
    rows The number of rows of the matrix.
    columns The number of columns of the matrix.
    rowBytes The number of bytes between starting elements of consecutive rows. Must be a multiple of the element size.
    dataType The type of the data to be stored in the matrix.

For performance considerations the optimal row stride may not necessarily be equal to the number of columns in the matrix. The MPSMatrix class provides a method which may be used to determine this value, see the rowBytesFromColumns API in the MPSMatrix class.

  + (size_t) rowBytesFromColumns: (NSUInteger) columns(MPSDataType) dataType
Return the recommended row stride, in bytes, for a given number of columns.

Parameters:
    columns The number of columns in the matrix for which the recommended row stride, in bytes, is to be determined.
    dataType The type of matrix data values.

To achieve best performance the optimal stride between rows of a matrix is not necessarily equivalent to the number of columns. This method returns the row stride, in bytes, which gives best performance for a given number of columns. Using this row stride to construct your array is recommended, but not required (provided that the stride used is still large enough to allocate a full row of data).

Property Documentation

  - columns [read], [write], [nonatomic], [assign]
The number of columns in the matrix.

  - dataType [read], [write], [nonatomic], [assign]
The type of the data which makes up the values of the matrix.

  - rowBytes [read], [write], [nonatomic], [assign]
The stride, in bytes, between corresponding elements of consecutive rows. Must be a multiple of the element size.

  - rows [read], [write], [nonatomic], [assign]
The number of rows in the matrix.

Author

Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.