[haiku-development] RFC: Colorspace header cleanup

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 12 Jan 2012 13:40:39 -0600

I'm working on cleaning up the GraphicDefs.h public header in the
interface kit.

Does anyone see issues with the following color space comments?


// color spaces
typedef enum {
    B_NO_COLOR_SPACE    = 0x0000,

    // linear color space (little endian)
    B_RGB32             = 0x0008,   // BGRx     xRGB 8:8:8:8
    B_RGBA32            = 0x2008,   // BGRA     ARGB 8:8:8:8
    B_RGB24             = 0x0003,   // BGR       RGB 8:8:8
    B_RGB16             = 0x0005,   // BGR       RGB 5:6:5
    B_RGB15             = 0x0010,   // BGRx     xRGB 1:5:5:5
    B_RGBA15            = 0x2010,   // BGRA     ARGB 1:5:5:5
    B_CMAP8             = 0x0004,   // 256 color index table
    B_GRAY8             = 0x0002,   // 256 greyscale table
    B_GRAY1             = 0x0001,   // Each bit represents a single pixel

    // big endian version
    B_RGB32_BIG         = 0x1008,   // xRGB     BGRx 8:8:8:8
    B_RGBA32_BIG        = 0x3008,   // ARGB     BGRA 8:8:8:8
    B_RGB24_BIG         = 0x1003,   //  RGB     BGR  8:8:8
    B_RGB16_BIG         = 0x1005,   //  RGB     BGR  5:6:5
    B_RGB15_BIG         = 0x1010,   // xRGB     BGRx 5:5:5:1
    B_RGBA15_BIG        = 0x3010,   // ARGB     BGRA 5:5:5:1


The BeBook goes a little crazy not documenting RGB24 and documenting
RGB16 as xRGB 5:6:5 which makes *no* sense.

For reference: http://haiku-os.org/legacy-docs/bebook/TheInterfaceKit_GeneralConstants.html#color_space


 -- Alex

Other related posts: