OC
xlchange
视频编码/菜鸟
展开
-
OC和C++常用数据类型转换
1.OC类型(int, NSString*, NSView*, id)和void*相互转换://NSArray* -- void*NSArray* array;void* p = (__bridge void*)array;NSArray* array2 = (__bridge id) p;//NSView* -- void*NSView* view;void* pView = (__bridge void*)view;NSView* view2 = (__bridge id)pVie原创 2020-09-24 14:57:42 · 1058 阅读 · 0 评论 -
OC 常用图像格式之间转换
1.CGImageRef to NSImageCGImageRef cgImage;NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];// Create an NSImage and add the bitmap rep to it...NSImage *image = [[...原创 2020-04-13 20:13:03 · 2399 阅读 · 0 评论 -
OC CVPixelBuffer不同图像格式间转换
1.YUV转RGB,调用libYUV- (BOOL)NV12ToRgbaPixelBuffer:(CVPixelBufferRef)pixelBufferNV12 pixelBufferRGBA:(CVPixelBufferRef)pixelBufferRGBA{ CVPixelBufferLockBaseAddress(pixelBufferNV12, 0); unsig...原创 2020-04-24 11:45:07 · 5526 阅读 · 0 评论