Logo Search packages:      
Sourcecode: adesklets version File versions

void imlib_image_query_pixel_cmya ( int  x,
int  y,
int *  cyan,
int *  magenta,
int *  yellow,
int *  alpha 
)

Parameters:
x Tthe x coordinate of the pixel.
y The y coordinate of the pixel.
cyan The returned cyan channel.
magenta The returned magenta channel.
yellow The returned yellow channel.
alpha The returned alpha channel.
Gets the CMYA color of the pixel from the current image that is at the (x, y) location specified.

Definition at line 4939 of file imlib2.c.

{
   ImlibImage         *im;
   DATA32             *p;

   if (!ctx)
      ctx = imlib_context_new();
   CHECK_PARAM_POINTER("imlib_image_query_pixel", "image", ctx->image);
   CAST_IMAGE(im, ctx->image);
   if ((!(im->data)) && (im->loader) && (im->loader->load))
      im->loader->load(im, NULL, 0, 1);
   if (!(im->data))
      return;
   if ((x < 0) || (x >= im->w) || (y < 0) || (y >= im->h))
     {
        *cyan = 0;
        *magenta = 0;
        *yellow = 0;
        *alpha = 0;
        return;
     }
   p = im->data + (im->w * y) + x;
   *cyan = 255 - (((*p) >> 16) & 0xff);
   *magenta = 255 - (((*p) >> 8) & 0xff);
   *yellow = 255 - ((*p) & 0xff);
   *alpha = ((*p) >> 24) & 0xff;
}


Generated by  Doxygen 1.6.0   Back to index