Bonjour,
Simple, but not easy question -I think- for you, guys.
On the video game I'm making my first remake of, I've encountered textures of the format 16 bbp RGB655 ( no, NOT 565, 655! ). I figured out this was the format by try and errors with the raw data in IrfanView. So IrfanView can read it alright, BUT CAN'T SAVE IT IN THAT FORMAT. >:( <-(WTF)
So I've been trying lately to find anything that could save/export image files in that format;
GIMP nor Photoshop are even close to interpret the raw data alright and the exportation options are just as miserable.
On the Google side, all I seem to get is some random BS vaguely in the same topic of my question ( and a cool multicolor laser device ).
So the least I need is something that can save/export in that format ( RGB 655 )?
Or... if it exists, something that may... manipulate bits MASSIVELY in one operation like, for example:
from [R5 R4 R3 R2 R1 R0 G4 G3 G2 G1 G0 B4 B3 B2 B1 B0] to [R5 R4 R3 R2 R1 R0 0 0] [G4 G3 G2 G1 G0 0 0 0] [B4 B3 B2 B1 B0 0 0 0]
Where in this case, the entry format is the odd RGB655 format and the output is a very standard 24bpp RGB format. But of course, the actual operation I need the most to do is something like the opposite. It would just be much more polyvalent to have this "bit manipulator". There is certainly going to be many other problems in the futur that might be solved with such a software. ( BTW, the hex editors I have don't do anything remotely like that. )
Thanks in advance.
Why not convert the data yourself? You can convert RGB655 to 8-bit per channel RGB by doing this:
uint16_t* nextPixel = dataPtr; // dataPtr is a pointer to the first 655 pixel
for (y = 0; y < imageHeight; y++)
{
for (x = 0; x < imageWidth; x++)
{
uint16_t inPixel = *nextPixel;
nextPixel++;
uint8_t red = ((inPixel & 0xFC00) >> 10) & 0x003F;
uint8_t green = ((inPixel & 0x03E0) >> 5) & 0x001F;
uint8_t blue = (inPixel & 0x001F);
//... do whatever you need to to store the new pixel...
}
}