gpt4 book ai didi

Xcode 使用苹果 native 框架将原始数据从 8 位/ channel 转换为 16 位/ channel

转载 作者:行者123 更新时间:2023-12-03 17:23:52 24 4
gpt4 key购买 nike

我有 RGB 原始数据,8 位/ channel ,我需要将其转换为 16 位/ channel ,任何 native 框架都可以这样做,谢谢。

所以输入是图像宽度、高度、原始数据,有什么建议吗?

最佳答案

如果您只想将 8bpc 原始图像转换为 16bpc 原始图像(无需任何特殊的颜色处理和过滤) - 您不需要任何特殊的框架。您可以通过逐像素转换来自己完成...如果是无符号短 16 位原始转换,则如下所示:

size_t ent_cnt = width*height*channel_count;
unsigned short *dst = new unsigned short[ent_cnt];
unsigned short *dst_ptr = dst;
unsigned char *src_ptr = src;
while (ent_cnt --)
*dst_ptr++ = (unsigned short)(*src_ptr++) << 8;
return dst;

关于Xcode 使用苹果 native 框架将原始数据从 8 位/ channel 转换为 16 位/ channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12361336/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com