.TH "MPSMatrixCopyToImage" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSMatrixCopyToImage .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits \fBMPSKernel\fP\&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:dataLayout:\fP" .br .ti -1c .RI "(nullable instancetype) \- \fBinitWithCoder:device:\fP" .br .ti -1c .RI "(void) \- \fBencodeToCommandBuffer:sourceMatrix:destinationImage:\fP" .br .ti -1c .RI "(void) \- \fBencodeBatchToCommandBuffer:sourceMatrix:destinationImages:\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "MTLOrigin \fBsourceMatrixOrigin\fP" .br .ti -1c .RI "NSUInteger \fBsourceMatrixBatchIndex\fP" .br .ti -1c .RI "\fBMPSDataLayout\fP \fBdataLayout\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBMPSMatrixCopyToImage\fP copies matrix data to a \fBMPSImage\fP\&. The operation is the reverse of \fBMPSImageCopyToMatrix\fP\&. .SH "Method Documentation" .PP .SS "\- (void) encodeBatchToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull \fBMPSMatrix\fP *) sourceMatrix(nonnull \fBMPSImageBatch\fP *) destinationImages" Encode a kernel that copies a \fBMPSMatrix\fP to a MPSImageBatch into a command buffer using a MTLComputeCommandEncoder\&. The kernel copies feature channels from sourceImage to the buffer associated with destinationMatrix\&. The kernel will not begin to execute until after the command buffer has been enqueued and committed\&. Each image will be copied to its own row in the matrix, starting with row destinationMatrixOrigin\&.x\&. .PP NOTE: The destinationMatrix\&.dataType must match the feature channel data type in sourceImage\&. NOTE: All the images in the source batch should be of the same size and have numberOfImages = 1\&. .PP \fBParameters:\fP .RS 4 \fIcommandBuffer\fP \fBA\fP valid MTLCommandBuffer\&. .br \fIsourceMatrix\fP \fBA\fP valid \fBMPSMatrix\fP or \fBMPSTemporaryMatrix\fP object describing the source matrix\&. .br \fIdestinationImages\fP \fBA\fP valid MPSImageBatch describing the images to copy to\&. .RE .PP .SS "\- (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull \fBMPSMatrix\fP *) sourceMatrix(nonnull \fBMPSImage\fP *) destinationImage" Encode a kernel that copies a \fBMPSMatrix\fP to a \fBMPSImage\fP into a command buffer using a MTLComputeCommandEncoder\&. The kernel copies feature channels from sourceMatrix to the destinationImage\&. The kernel will not begin to execute until after the command buffer has been enqueued and committed\&. .PP NOTE: The sourceMatrix\&.dataType must match the feature channel data type in destinationImage\&. .PP \fBParameters:\fP .RS 4 \fIcommandBuffer\fP \fBA\fP valid MTLCommandBuffer\&. .br \fIsourceMatrix\fP \fBA\fP valid \fBMPSMatrix\fP or \fBMPSTemporaryMatrix\fP object describing the source matrix\&. .br \fIdestinationImage\fP \fBA\fP valid \fBMPSImage\fP describing the image to copy to\&. .RE .PP .SS "\- (nullable instancetype) \fBinitWithCoder:\fP (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device" \fBNSSecureCoding\fP compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly\&. To avoid that problem, use initWithCoder:device instead\&. .PP \fBParameters:\fP .RS 4 \fIaDecoder\fP The NSCoder subclass with your serialized \fBMPSKernel\fP .br \fIdevice\fP The MTLDevice on which to make the \fBMPSKernel\fP .RE .PP \fBReturns:\fP .RS 4 \fBA\fP new \fBMPSKernel\fP object, or nil if failure\&. .RE .PP .PP Reimplemented from \fBMPSKernel\fP\&. .SS "\- (nonnull instancetype) \fBinitWithDevice:\fP (nonnull id< MTLDevice >) device(\fBMPSDataLayout\fP) dataLayout" Initialize a \fBMPSMatrixCopyToImage\fP object on a device .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device the kernel will run on .br \fIdataLayout\fP The data layout .RE .PP \fBReturns:\fP .RS 4 \fBA\fP valid \fBMPSMatrixCopyToImage\fP object or nil, if failure\&. .RE .PP .SH "Property Documentation" .PP .SS "\- dataLayout\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The data layout to use Returns the data layout\&. When copying from a \fBMPSMatrix\fP to a \fBMPSImage\fP, this describes the order in which the image values are to be stored in the buffer associated with the \fBMPSMatrix\fP\&. Default: MPSDataLayoutFeatureChannelsxHeightxWidth .SS "\- sourceMatrixBatchIndex\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The index of the source matrix in the batch\&. This property is modifiable and defaults to 0 at initialization time\&. .SS "\- sourceMatrixOrigin\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The origin, relative to [0, 0] in the source matrix\&. This property is modifiable and defaults to [0, 0] at initialization time\&. If a different origin is desired then this should be modified prior to encoding the kernel\&. The z value must be 0\&. .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.