【问题标题】:Can I use CGDataProviderCreateSequential() to read in the data of a CGImageRef sequentially?我可以使用 CGDataProviderCreateSequential() 顺序读取 CGImageRef 的数据吗?
【发布时间】:2011-12-01 18:43:57
【问题描述】:

是否可以使用 CGDataProviderCreateSequential() 和 CGDataProviderSequentialCallbacks 从 CGImageRef 顺序读取数据?

目前我使用 CGDataProviderCopyData 来获取数据,但是一次读取所有数据并占用太多内存:

CFDataRef dataref = CGDataProviderCopyData(CGImageGetDataProvider(imgRef));

或者有没有其他方法可以顺序读取 cgimageref 的字节?

【问题讨论】:

    标签: objective-c ios memory-management core-graphics cgimage


    【解决方案1】:

    您可以在答案中找到一个非常简洁的 CGImageRef 直接字节访问示例: Getting the average RGB color of a CGImageRef in iOS

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-17
      • 1970-01-01
      相关资源
      最近更新 更多