Updated formatting

This commit is contained in:
Prianka Liz Kariat 2023-02-14 20:51:51 +05:30
parent 3a7aa29226
commit 55e5377c08
2 changed files with 9 additions and 9 deletions

View File

@ -18,12 +18,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** Helper utility for performing operations on MPPImage specific to the /**
* MediaPipe Vision library. * Helper utility for performing operations on MPPImage specific to the MediaPipe Vision library.
*/ */
@interface MPPImage (Utils) @interface MPPImage (Utils)
// /** Bitmap size of the image. */ /** Bitmap size of the image. */
@property(nonatomic, readonly) CGSize bitmapSize; @property(nonatomic, readonly) CGSize bitmapSize;
/** /**

View File

@ -24,7 +24,7 @@
@interface MPPPixelDataUtils : NSObject @interface MPPPixelDataUtils : NSObject
+ (uint8_t *)rgbPixelDatafromPixelData:(uint8_t *)pixelData + (uint8_t *)rgbPixelDataFromPixelData:(uint8_t *)pixelData
withWidth:(size_t)width withWidth:(size_t)width
height:(size_t)height height:(size_t)height
stride:(size_t)stride stride:(size_t)stride
@ -55,7 +55,7 @@
@implementation MPPPixelDataUtils : NSObject @implementation MPPPixelDataUtils : NSObject
+ (uint8_t *)rgbPixelDatafromPixelData:(uint8_t *)pixelData + (uint8_t *)rgbPixelDataFromPixelData:(uint8_t *)pixelData
withWidth:(size_t)width withWidth:(size_t)width
height:(size_t)height height:(size_t)height
stride:(size_t)stride stride:(size_t)stride
@ -120,11 +120,11 @@
@implementation MPPCVPixelBufferUtils @implementation MPPCVPixelBufferUtils
+ (uint8_t *)rgbPixelDatafromCVPixelBuffer:(CVPixelBufferRef)pixelBuffer error:(NSError **)error { + (uint8_t *)rgbPixelDataFromCVPixelBuffer:(CVPixelBufferRef)pixelBuffer error:(NSError **)error {
CVPixelBufferLockBaseAddress(pixelBuffer, 0); CVPixelBufferLockBaseAddress(pixelBuffer, 0);
uint8_t *rgbPixelData = [MPPPixelDataUtils uint8_t *rgbPixelData = [MPPPixelDataUtils
rgbPixelDatafromPixelData:(uint8_t *)CVPixelBufferGetBaseAddress(pixelBuffer) rgbPixelDataFromPixelData:(uint8_t *)CVPixelBufferGetBaseAddress(pixelBuffer)
withWidth:CVPixelBufferGetWidth(pixelBuffer) withWidth:CVPixelBufferGetWidth(pixelBuffer)
height:CVPixelBufferGetHeight(pixelBuffer) height:CVPixelBufferGetHeight(pixelBuffer)
stride:CVPixelBufferGetBytesPerRow(pixelBuffer) stride:CVPixelBufferGetBytesPerRow(pixelBuffer)
@ -144,7 +144,7 @@
switch (pixelBufferFormat) { switch (pixelBufferFormat) {
case kCVPixelFormatType_32BGRA: { case kCVPixelFormatType_32BGRA: {
pixelData = [MPPCVPixelBufferUtils rgbPixelDatafromCVPixelBuffer:pixelBuffer error:error]; pixelData = [MPPCVPixelBufferUtils rgbPixelDataFromCVPixelBuffer:pixelBuffer error:error];
break; break;
} }
default: { default: {
@ -191,7 +191,7 @@
if (srcData) { if (srcData) {
// We have drawn the image as an RGBA image with 8 bitsPerComponent and hence can safely input // We have drawn the image as an RGBA image with 8 bitsPerComponent and hence can safely input
// a pixel format of type kCVPixelFormatType_32RGBA for conversion by vImage. // a pixel format of type kCVPixelFormatType_32RGBA for conversion by vImage.
pixel_data_to_return = [MPPPixelDataUtils rgbPixelDatafromPixelData:srcData pixel_data_to_return = [MPPPixelDataUtils rgbPixelDataFromPixelData:srcData
withWidth:width withWidth:width
height:height height:height
stride:bytesPerRow stride:bytesPerRow