Skip to content

Commit

Permalink
introduce descriptor property for MPSImage
Browse files Browse the repository at this point in the history
  • Loading branch information
s1ddok committed Apr 22, 2022
1 parent a990064 commit 73a0e16
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import MetalPerformanceShaders
/* Utility functions for converting of MPSImages to floating point arrays. */
public extension MPSImage {

var descriptor: MPSImageDescriptor {
MPSImageDescriptor(channelFormat: self.featureChannelFormat,
width: self.width,
height: self.height,
featureChannels: self.featureChannels,
numberOfImages: self.numberOfImages,
usage: self.usage)
}

/// Utility function for converting of MPSImages to floating point arrays.
///
/// - Returns: Array of floats containing each pixel of MPSImage's texture.
Expand Down

0 comments on commit 73a0e16

Please sign in to comment.