MPSImageCopyToMatrix(3) | MetalPerformanceShaders.framework | MPSImageCopyToMatrix(3) |
MPSImageCopyToMatrix
#import <MPSImageCopy.h>
Inherits MPSKernel.
(nonnull instancetype) - initWithDevice:dataLayout:
(nullable instancetype) - initWithCoder:device:
(void) - encodeToCommandBuffer:sourceImage:destinationMatrix:
(void) - encodeBatchToCommandBuffer:sourceImages:destinationMatrix:
MTLOrigin destinationMatrixOrigin
NSUInteger destinationMatrixBatchIndex
MPSDataLayout dataLayout
MPSImageCopy.h MetalPerformanceShaders.framework
Copyright:
The MPSImageCopyToMatrix copies image data to a MPSMatrix. The image data is stored in a row of a matrix. The dataLayout specifies the order in which the feature channels in the MPSImage get stored in the matrix. If MPSImage stores a batch of images, the images are copied into multiple rows, one row per image.
The number of elements in a row in the matrix must be >= image width * image height * number of featureChannels in the image.
Encode a kernel that copies a MPSImageBatch to a MPSMatrix 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.
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.
Parameters:
Encode a kernel that copies a MPSImage to a MPSMatrix 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.
NOTE: The destinationMatrix.dataType must match the feature channel data type in sourceImage.
Parameters:
NSSecureCoding 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.
Parameters:
Returns:
Reimplemented from MPSKernel.
Initialize a MPSMatrixCopy object on a device
Parameters:
Returns:
The data layout to use Returns the data layout. When copying from a MPSImage to a MPSMatrix, this describes the order in which the image values are stored in the buffer associated with the MPSMatrix. Default: MPSDataLayoutFeatureChannelsxHeightxWidth
The index of the destination matrix in the batch. This property is modifiable and defaults to 0 at initialization time.
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.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |