언어 설정

Menu
Sites
Language
How to get the RGB value for one point in a image

Hi, 

Is there any way to get the RGB value for one point in a image file?  There is a API evas_object_color_get,  but seems this can't get the point value.

Thanks.

Responses

2 댓글
Vikram

Hi,

Maybe, you can decode the image raw data to a buffer in memory (call image_util_decode_jpeg). And get the RGB value for each point. 

such as:

point: x, (0 <= x <= image_width*image_height)

R: buffer[x*3]

G:buffer[x*3+1]

B:buffer[x*3+2]

Jean Yang

Hello, 

Yes, we can got the RBG data in RAW data.  After test, the below API is worked:

unsigned char *img_src = evas_object_image_data_get(img, EINA_TRUE);

In img_src we can get the R,G,B,A data for one pixel.