.TH "MPSImageCopyToMatrix" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSImageCopyToMatrix .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:sourceImage:destinationMatrix:\fP" .br .ti -1c .RI "(void) \- \fBencodeBatchToCommandBuffer:sourceImages:destinationMatrix:\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "MTLOrigin \fBdestinationMatrixOrigin\fP" .br .ti -1c .RI "NSUInteger \fBdestinationMatrixBatchIndex\fP" .br .ti -1c .RI "\fBMPSDataLayout\fP \fBdataLayout\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP \fBMPSImageCopy\&.h\fP MetalPerformanceShaders\&.framework .PP \fBCopyright:\fP .RS 4 Copyright (c) 2017 Apple Inc\&. All rights reserved\&. MetalPerformanceShaders histogram filters .RE .PP The \fBMPSImageCopyToMatrix\fP copies image data to a \fBMPSMatrix\fP\&. The image data is stored in a row of a matrix\&. The dataLayout specifies the order in which the feature channels in the \fBMPSImage\fP get stored in the matrix\&. If \fBMPSImage\fP stores a batch of images, the images are copied into multiple rows, one row per image\&. .PP The number of elements in a row in the matrix must be >= image width * image height * number of featureChannels in the image\&. .SH "Method Documentation" .PP .SS "\- (void) encodeBatchToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull \fBMPSImageBatch\fP *) sourceImages(nonnull \fBMPSMatrix\fP *) destinationMatrix" Encode a kernel that copies a MPSImageBatch to a \fBMPSMatrix\fP 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 \fIsourceImages\fP \fBA\fP valid MPSImageBatch describing the images to copy from\&. .br \fIdestinationMatrix\fP \fBA\fP valid \fBMPSMatrix\fP or \fBMPSTemporaryMatrix\fP object describing the matrix to copy to\&. .RE .PP .SS "\- (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull \fBMPSImage\fP *) sourceImage(nonnull \fBMPSMatrix\fP *) destinationMatrix" Encode a kernel that copies a \fBMPSImage\fP to a \fBMPSMatrix\fP 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\&. .PP NOTE: The destinationMatrix\&.dataType must match the feature channel data type in sourceImage\&. .PP \fBParameters:\fP .RS 4 \fIcommandBuffer\fP \fBA\fP valid MTLCommandBuffer\&. .br \fIsourceImage\fP \fBA\fP valid \fBMPSImage\fP describing the image to copy from\&. .br \fIdestinationMatrix\fP \fBA\fP valid \fBMPSMatrix\fP or \fBMPSTemporaryMatrix\fP object describing the matrix 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 \fBMPSMatrixCopy\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 \fBMPSMatrixCopy\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 \fBMPSImage\fP to a \fBMPSMatrix\fP, this describes the order in which the image values are stored in the buffer associated with the \fBMPSMatrix\fP\&. Default: MPSDataLayoutFeatureChannelsxHeightxWidth .SS "\- destinationMatrixBatchIndex\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The index of the destination matrix in the batch\&. This property is modifiable and defaults to 0 at initialization time\&. .SS "\- destinationMatrixOrigin\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The origin, relative to [0, 0] in the destination matrix, at which to start writing results\&. 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\&.