MPSMatrixCopyToImage(3)

NAME
MPSMatrixCopyToImage

SYNOPSIS

#import <MPSImageCopy.h>

Inherits MPSKernel.

  Instance Methods
(nonnull instancetype) - initWithDevice:dataLayout:
(nullable instancetype) - initWithCoder:device:
(void) - encodeToCommandBuffer:sourceMatrix:destinationImage:
(void) - encodeBatchToCommandBuffer:sourceMatrix:destinationImages:

  Properties
MTLOrigin sourceMatrixOrigin
NSUInteger sourceMatrixBatchIndex
MPSDataLayout dataLayout

  Additional Inherited Members

Detailed Description

The MPSMatrixCopyToImage copies matrix data to a MPSImage. The operation is the reverse of MPSImageCopyToMatrix.

Method Documentation

  - (void) encodeBatchToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull MPSMatrix *) sourceMatrix(nonnull MPSImageBatch *) destinationImages
Encode a kernel that copies a MPSMatrix 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.

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:
    commandBuffer A valid MTLCommandBuffer.
    sourceMatrix A valid MPSMatrix or MPSTemporaryMatrix object describing the source matrix.
    destinationImages A valid MPSImageBatch describing the images to copy to.

  - (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull MPSMatrix *) sourceMatrix(nonnull MPSImage *) destinationImage
Encode a kernel that copies a MPSMatrix to a MPSImage 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.

NOTE: The sourceMatrix.dataType must match the feature channel data type in destinationImage.

Parameters:
    commandBuffer A valid MTLCommandBuffer.
    sourceMatrix A valid MPSMatrix or MPSTemporaryMatrix object describing the source matrix.
    destinationImage A valid MPSImage describing the image to copy to.

  - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device
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:
    aDecoder The NSCoder subclass with your serialized MPSKernel
    device The MTLDevice on which to make the MPSKernel

Returns:
    A new MPSKernel object, or nil if failure.

Reimplemented from MPSKernel.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(MPSDataLayout) dataLayout
Initialize a MPSMatrixCopyToImage object on a device

Parameters:
    device The device the kernel will run on
    dataLayout The data layout

Returns:
    A valid MPSMatrixCopyToImage object or nil, if failure.

Property Documentation

  - dataLayout [read], [nonatomic], [assign]
The data layout to use Returns the data layout. When copying from a MPSMatrix to a MPSImage, this describes the order in which the image values are to be stored in the buffer associated with the MPSMatrix. Default: MPSDataLayoutFeatureChannelsxHeightxWidth

  - sourceMatrixBatchIndex [read], [write], [nonatomic], [assign]
The index of the source matrix in the batch. This property is modifiable and defaults to 0 at initialization time.

  - sourceMatrixOrigin [read], [write], [nonatomic], [assign]
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.

Author

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