darrenecm
07-08-2006, 09:44 AM
In my work getting OpenGL rendering to C gauges I've always been mystified as to why the IMAGE_FORMAT enumeration that is used in the IMAGE structure in gauges.h lists so many formats as shown below:
IMG_8_BIT_MONOCHROME = 0,
IMG_8_BIT_INDEXED,
IMG_15_BIT, // 1555
IMG_16_BIT, // 565
IMG_16A_BIT, // 4444
IMG_24_BIT, // 888
IMG_32_BIT, // 888
IMG_32A_BIT, // 8888
IMG_DXT1, // DirectX Texture Compression DXT1
IMG_DXT3, // DirectX Texture Compression DXT3
IMG_DUDV, // Pertubation data
IMG_MAX // keep this last
Whenever I create a 24-bit image in Photoshop and use this in a MAKE_STATIC, the image is *always* sampled down to a 16-bit color depth by the panel system.
With this fact in mind I'm wondering why nearly all add-on developers create their panel and gauge artwork bitmaps as 24-bit when they are ultimately degraded to 16-bit? Wouldn't reducing them to 16-bit save on the users' disk space and avoid any possible time spent by the panel system in detecting that the bitmaps are 24-bit and then sampling them down?
To make things even more confusing, in Dai Griffith's tutorial documents, he says the following:
"According to the SDK you can create both 24-bit and 8-bit images in the same gauge and have them separated by &H500 (i.e. 500 hex) in the #define listing. This is completely wrong. The numerical separation of the 8-bit and 24-bit bitmaps is 500 decimal, not 500 hex."
I tried ensuring my 24-bit bitmaps in the resource file were seperated appropriately but they are still sampled down to 16-bit by the panel system.
As confirmation, when I'm initialisaing OpenGL I always use the following case statement to ensure pfd.cColorBits in my Pixel Format Descriptor structure matches that of the gauge:
switch(pScreen->image_data.final->format)
{
case IMG_15_BIT: pfd.cColorBits = 16; break;
case IMG_16_BIT: pfd.cColorBits = 16; break;
case IMG_24_BIT: pfd.cColorBits = 24; break;
case IMG_32_BIT: pfd.cColorBits = 32; break;
break;
} // END switch(pelement->image_data.final->format)
In all my debugging sessions I've never noticed the result *ever* being anything other than IMG_15_BIT.
In short, does anyone know whether bitmaps with greater than 16-bit color depth bitmaps are supported at all in gauges? If not, what's the point of all those other enumerated formats?
IMG_8_BIT_MONOCHROME = 0,
IMG_8_BIT_INDEXED,
IMG_15_BIT, // 1555
IMG_16_BIT, // 565
IMG_16A_BIT, // 4444
IMG_24_BIT, // 888
IMG_32_BIT, // 888
IMG_32A_BIT, // 8888
IMG_DXT1, // DirectX Texture Compression DXT1
IMG_DXT3, // DirectX Texture Compression DXT3
IMG_DUDV, // Pertubation data
IMG_MAX // keep this last
Whenever I create a 24-bit image in Photoshop and use this in a MAKE_STATIC, the image is *always* sampled down to a 16-bit color depth by the panel system.
With this fact in mind I'm wondering why nearly all add-on developers create their panel and gauge artwork bitmaps as 24-bit when they are ultimately degraded to 16-bit? Wouldn't reducing them to 16-bit save on the users' disk space and avoid any possible time spent by the panel system in detecting that the bitmaps are 24-bit and then sampling them down?
To make things even more confusing, in Dai Griffith's tutorial documents, he says the following:
"According to the SDK you can create both 24-bit and 8-bit images in the same gauge and have them separated by &H500 (i.e. 500 hex) in the #define listing. This is completely wrong. The numerical separation of the 8-bit and 24-bit bitmaps is 500 decimal, not 500 hex."
I tried ensuring my 24-bit bitmaps in the resource file were seperated appropriately but they are still sampled down to 16-bit by the panel system.
As confirmation, when I'm initialisaing OpenGL I always use the following case statement to ensure pfd.cColorBits in my Pixel Format Descriptor structure matches that of the gauge:
switch(pScreen->image_data.final->format)
{
case IMG_15_BIT: pfd.cColorBits = 16; break;
case IMG_16_BIT: pfd.cColorBits = 16; break;
case IMG_24_BIT: pfd.cColorBits = 24; break;
case IMG_32_BIT: pfd.cColorBits = 32; break;
break;
} // END switch(pelement->image_data.final->format)
In all my debugging sessions I've never noticed the result *ever* being anything other than IMG_15_BIT.
In short, does anyone know whether bitmaps with greater than 16-bit color depth bitmaps are supported at all in gauges? If not, what's the point of all those other enumerated formats?