[英]With FreeImage is it possible to have ConvertToRawBits output in ARGB32 or RGBA32 rather than BGRA32?
I'm loading in a PNG to use as a texture in Unity. 我正在加载一个PNG以用作Unity中的纹理。 When I use ConvertToRawBits() it outputs to BGRA32.
当我使用ConvertToRawBits()时,它输出到BGRA32。 Is it possible to output to ARGB32 or RGBA32 instead?
是否可以改为输出到ARGB32或RGBA32?
https://gist.github.com/ciwolsey/24635ea523b4a6b758783688be53bf86 https://gist.github.com/ciwolsey/24635ea523b4a6b758783688be53bf86
You have two options for this, you can: 为此,您有两种选择:
Recompile Freeimage
with FREEIMAGE_COLORORDER
set to FREEIMAGE_COLORORDER_RGB
value (1). 将
FREEIMAGE_COLORORDER
设置为FREEIMAGE_COLORORDER_RGB
值(1) FREEIMAGE_COLORORDER_RGB
编译Freeimage
。 Then your loaded images will be always in RGBA32
format. 这样,您加载的图像将始终为
RGBA32
格式。 If this FREEIMAGE_COLORORDER
is not specified at compile time, the actual color order setting is determined from the target system's endianess. 如果在编译时未指定此
FREEIMAGE_COLORORDER
,则根据目标系统的字节序确定实际的颜色顺序设置。
Use Freeimage
SwapRedBlue32
function to convert loaded image from BGRA32
to RGBA32
format. 使用
Freeimage
SwapRedBlue32
函数将加载的图像从BGRA32
转换为RGBA32
格式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.