SDL_PIXELFORMAT_INDEX4LSB pixel format in SDL 1.3

Hello, All!

Pixel formats SDL_PIXELFORMAT_INDEX4LSB and SDL_PIXELFORMAT_INDEX4MSB are
defined in SDL_pixels.h as:

SDL_PIXELFORMAT_INDEX4LSB =
    SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 

0,
2, 0),
SDL_PIXELFORMAT_INDEX4MSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321,
0,
2, 0),

I have question about value β€œ2”, it means 2 bits per pixel, but these
formats (according to logic :slight_smile: must have 4 bits per pixel, is it a typo ?

I’m afraid to change this without Sam or Ryan review because DirectFB and
X11 drivers are using this pixel format and changing of this definition,
possibly, will broke the code.

With best regards, Mike Gorchak. E-mail: mike at malva.ua

Yep, that’s a typo. Thanks for catching it!On Mon, Jun 8, 2009 at 2:09 PM, Mike Gorchak wrote:

Hello, All!

Pixel formats SDL_PIXELFORMAT_INDEX4LSB and SDL_PIXELFORMAT_INDEX4MSB are
defined in SDL_pixels.h as:

SDL_PIXELFORMAT_INDEX4LSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234,
0,
2, 0),
SDL_PIXELFORMAT_INDEX4MSB =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321,
0,
2, 0),

I have question about value β€œ2”, it means 2 bits per pixel, but these
formats (according to logic :slight_smile: must have 4 bits per pixel, is it a typo ?

I’m afraid to change this without Sam or Ryan review because DirectFB and
X11 drivers are using this pixel format and changing of this definition,
possibly, will broke the code.

With best regards, Mike Gorchak. E-mail: mike at malva.ua


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org