Logo Search packages:      
Sourcecode: adesklets version File versions

void imlib_image_query_pixel_hlsa ( int  x,
int  y,
float *  hue,
float *  lightness,
float *  saturation,
int *  alpha 
)

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
hue The returned hue channel.
lightness The returned lightness channel.
saturation The returned saturation channel.
alpha The returned alpha channel.
Gets the HLSA color of the pixel from the current image that is at the (x, y) location specified.

Definition at line 4894 of file imlib2.c.

{
   ImlibImage         *im;
   DATA32             *p;
   int                 r, g, b;

   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))
     {
        *hue = 0;
        *lightness = 0;
        *saturation = 0;
        *alpha = 0;
        return;
     }
   p = im->data + (im->w * y) + x;
   r = ((*p) >> 16) & 0xff;
   g = ((*p) >> 8) & 0xff;
   b = (*p) & 0xff;
   *alpha = ((*p) >> 24) & 0xff;

   __imlib_rgb_to_hls(r, g, b, hue, lightness, saturation);
}


Generated by  Doxygen 1.6.0   Back to index