| wind&oil | |||||
|
Syndicate:
Projects:
Others Bogs: |
home :: imaging :: pixel_naming_2007.11.13.html Tue, 13 Nov 2007
Pixel naming in Cairo
colour bit/channel bit/pixel cairo_format_t sheme --------------------------------------------------------------- RGB 8 24 CAIRO_FORMAT_RGB24 RGBA 8 32 CAIRO_FORMAT_ARGB32 Gray 8 8 GrayA 8 16 Alpha 8 8 CAIRO_FORMAT_A8 CMYKA 8 40 RGB 16 48 CAIRO_FORMAT_RGB48 RGBA 16 64 CAIRO_FORMAT_ARGB64 Gray 16 16 GrayA 16 32 CMYKA 16 80 RGB[A]... 16-bit float/channel use the same pixel size as the 16-bit per channel integers. RGB IEEE Half 16 48 CAIRO_FORMAT_RGB48F RGBA IEEE Half 16 64 CAIRO_FORMAT_ARGB64F ... IEEE floats and 32-bit integers: RGB FLOAT 32 96 CAIRO_FORMAT_RGB96F RGBA FLOAT 32 128 CAIRO_FORMAT_ARGB128F ... IEEE doubles: RGB DOUBLE 64 192 CAIRO_FORMAT_RGB192F RGBA DOUBLE 64 256 CAIRO_FORMAT_ARGB256FThe later can easily be confused with a 256 shades of Gray per channel naming. Do you really expect a user to always divide the pixel values by the channels count to get an idea about the colour resolution? To remember the marketing inflation of having 16 million colours and so on is long gone away. Today it is in, to say a software supports 16-bit, which is much more meaningful. As a side step, manufacturers suggesting theire consumer camera to deliver the full range of 16-bit is still a joke. Such anouncements are demystified regularily. Windows and osX have long inherited pixel naming conventions. Cairo as a young project does not. Cairo could express pixels much closer to our current language in cairo_format_t. Lets end here and come to a suggestion for a new sheme: CAIRO_FORMAT_ARGB32 -> CAIRO_FORMAT_ARGB_8 CAIRO_FORMAT_RGB24 -> CAIRO_FORMAT_RGB_8 CAIRO_FORMAT_A8 -> CAIRO_FORMAT_A_8 CAIRO_FORMAT_A1 -> CAIRO_FORMAT_A_1 #define CAIRO_FORMAT_ARGB32 CAIRO_FORMAT_ARGB_8could ashure compatibility. Later Cairo could add CAIRO_FORMAT_ARGB_16 CAIRO_FORMAT_RGB_16 CAIRO_FORMAT_RGB_HALF CAIRO_FORMAT_RGB_FLOAT... and so on. /imaging | 21 comments | permanent link | |
||||