我使用带有此代码的CIContext将UIImage直接绘制到CVImageBuffer中
UIImage *img = [self imageFromText:txt];
CIImage *filteredImage = [[CIImage alloc] initWithCGImage:img.CGImage];
[self.ciContext render:filteredImage toCVPixelBuffer:imageBuffer bounds:[filteredImage extent] colorSpace:CGColorSpaceCreateDeviceRGB()];
[filteredImage extent]
返回CGRect,其中0,0开始坐标工作正常,但是当我想要成像到另一个角落并将代码更改为此
UIImage *img = [self imageFromText:txt];
CIImage *filteredImage = [[CIImage alloc] initWithCGImage:img.CGImage];
[self.ciContext render:filteredImage toCVPixelBuffer:imageBuffer bounds:CGRectMake(-500,100,500,200) colorSpace:CGColorSpaceCreateDeviceRGB()];
没有被绘制。请帮忙。