Accessing an Image Buffer

This example shows the how to handle image buffers.

The program can be found in the %TOPLEVEL%\Samples\VC71\Pixelformat directory. A VC6 version can be found in the directory %TOPLEVEL%\Samples\VC6. In order to run the program, open the solution file Pixelformat.sln in this directory and select Build -> Build Pixelformat in the menu. You can then execute the program by clicking Debug -> Start.

Available Data Formats

Y800

The Y800 color format is an 8 bit monochrome format. Every pixel is represented by one byte. The organization of the pixels in the image buffer is from left to right and top down. In other words: The first byte of the image buffer corresponds to the first pixel of the first line of the image.

RGB8

The RGB8 color format is an 8 bit monochrome format. Every pixel is represented by one byte. The organization of the pixels in the image buffer is from left to right and bottom up. In other words: The first byte of the image buffer corresponds to the first pixel of the last line of the image.

RGB24

RGB24 is a 24 bit color format. Every pixel is represented by 3 bytes, while every byte of this triple corresponds to one color value. The letters 'RGB' mean Red, Green and Blue, so one byte represents the red value, one byte represents the green value and the last byte represents the blue value.

RGB32

RGB32 is a 32 bit color format. It is like RGB24, except that every pixel has an additional byte to store an alpha value. An alpha value describes the transparency of the pixel. Therefore, every pixel consists of 4 bytes. RGB32 is also referred to as RGBA, where the A stands for Alpha. The A value is not used in IC Imaging Control and is therefore always 0. As for the RGB24 pixel format, IC Imaging Control uses the BGRA byte order for the RGB32 pixel format. The organization of the pixels in the image buffer is from left to right and bottom up.

RGB555

RGB555 is a 16 bit color format. Every pixel is represented by two bytes. The characters 555 stand for the number of bits used for every color value. In this case, 5 bits are used for every color value, so only 15 bits are needed. The last bit (most significant bit) is unused. The organization of the pixels in the image buffer is from left to right and bottom up.

RGB565

The RGB565 color format is the same as the RGB555 color format, except that 6 bits are used for the green value instead of 5. Therefore, all 16 bits are in use. The organization of the pixels in the image buffer is from left to right and bottom up.

UYVY

The UYVY color format is basically a 16 bit color format. In contrast to the RGB formats, it contains no values for red, green or blue. It uses values for luminance and chrominance instead. Y stands for the luminance. U (or Cb) and V (or Cr) describe the chrominance. For further details refer to the following link:

YGB0

YGB0 is a 10 bit grayscale format. Every pixel is stored in two bytes. Only 10 of the 16 bits of these two bytes contain relevant image data, the other bits are unused. The organization of the pixels in the image buffer is from left to right and top down.

YGB1

YGB1 is a 10 bit grayscale format. Every pixel is stored in two bytes. Only 10 of the 16 bits of these two bytes contain relevant image data, the other bits are unused. The organization of the pixels in the image buffer is from left to right and top down.

<< Programmer's Guide

This site is part of The Imaging Source Network. Other sites include Company Portal, Image Processing, Astronomy Cameras, Astronomy Cameras Blog, Blog caméras d'astronomie, Astronomy Cameras Competition, TX Text Control, LiveDocx, phpLiveDocx and Forums.