KSYGPUPicInput Class Reference

Inherits from GPUImageOutput
Declared in KSYGPUPicInput.h

Overview

GPU图像输输入

  • 将采集到的YUV/RGB数据上传到GPU, 传递给其他filter进行处理
  • 支持的颜色格式包括:
    • kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: (NV12)
    • kCVPixelFormatType_420YpCbCr8BiPlanarFullRange:(NV12)
    • kCVPixelFormatType_420YpCbCr8Planar:(I420)
    • kCVPixelFormatType_420YpCbCr8PlanarFullRange:(I420)
    • kCVPixelFormatType_32BGRA:(BGRA)

– init

Initialization and teardown

- (id)init

Declared In

KSYGPUPicInput.h

– initWithFmt:

设置输入图像的像素格式

- (id)initWithFmt:(OSType)fmt

Parameters

fmt

像素格式

Declared In

KSYGPUPicInput.h

  cropRegion

裁剪区域 将输入的图像按照区域裁剪出中间的一块

@property (readwrite, nonatomic) CGRect cropRegion

Discussion

cropRegion 标记了左上角的位置和宽高, 范围都是0.0 到1.0, 非法值无法设置成功

Declared In

KSYGPUPicInput.h

– processSampleBuffer:

输入图像数据

- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer

Parameters

sampleBuffer

图像数据和时间信息

Declared In

KSYGPUPicInput.h

– processPixelBuffer:time:

输入图像数据

- (void)processPixelBuffer:(CVPixelBufferRef)pixelBuffer time:(CMTime)timeInfo

Parameters

pixelBuffer

图像数据

timeInfo

时间信息

Declared In

KSYGPUPicInput.h

– processPixelData:format:width:height:stride:time:

输入图像数据

- (void)processPixelData:(void **)pData format:(OSType)pixelFmt width:(size_t)width height:(size_t)height stride:(size_t *)strides time:(CMTime)timeInfo

Parameters

pData

图像数据每个分量的指针, 比如pData[0]为Y分量的指针

pixelFmt

图像数据类型, 必须与init时指定的格式一致

width

图像宽度

height

图像高度

strides

图像数据每个分量的行偏移, 比如 stride[0] 为Y分量的行偏移

timeInfo

时间信息

Declared In

KSYGPUPicInput.h