View Full Version : ROI example in color
November 18, 2004, 16:37:55
Hi everyone, I have been working with Advanced Image processing example and it works fine, now I would like to know wath considerations should I take for doing same example using, for example, ICImagingControl1.MemoryCurrentGrabberColorformat = ICRGB555 instead of ICImagingControl1.MemoryCurrentGrabberColorformat = ICY8 Because when I paint the rectangle in ICRGB555 instead of being white, the rectangle is made of different colors and it's not set in the positions it's supposed to be. Thanks a lot for your help
November 19, 2004, 07:37:27
The Advanced Image Processing sample does not use the graphic overlay to draw the rectangle. The lines are drawn directly into the memory of the image. This means that the color format must be considered, when a pixel should be changed. With Y8 video format this is very simple. Just set it to 255, you will get a white pixel. Color formats, that use more than one byte per pixel must be handled differently: all bytes of the pixel must be set to 255 to get a white pixel. If you use RGB555 or RGB565, you have two bytes per pixel, so both of them must be set to 255. If you want to have a red pixel, you must code red color in this format. This means 0 for the first byte and 31 (binary 00011111) for the second byte. Remember: color is save blue green red.
If you have an RGB 24 format, you must set three bytes to 255 to get a white pixel. To get a red line, set the first to bytes to 0 and the last one to red. This is similar to RGB32. The RGB32 codes color as ABGR.
Powered by vBulletin® Version 4.2.3 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.