Logo Search packages:      
Sourcecode: adesklets version File versions

void imlib_apply_color_modifier_to_rectangle ( int  x,
int  y,
int  width,
int  height 
)

Parameters:
x The x coordinate of the left edge of the rectangle.
y The y coordinate of the top edge of the rectangle.
width The width of the rectangle.
height The height of the rectangle.
Works the same way as imlib_apply_color_modifier() but only modifies a selected rectangle in the current image.

Definition at line 4336 of file imlib2.c.

{
   ImlibImage         *im;

   if (!ctx)
      ctx = imlib_context_new();
   CHECK_PARAM_POINTER("imlib_apply_color_modifier_to_rectangle", "image",
                       ctx->image);
   CHECK_PARAM_POINTER("imlib_apply_color_modifier_to_rectangle",
                       "color_modifier", ctx->color_modifier);
   CAST_IMAGE(im, ctx->image);
   if (x < 0)
     {
        width += x;
        x = 0;
     }
   if (width <= 0)
      return;
   if ((x + width) > im->w)
      width = (im->w - x);
   if (width <= 0)
      return;
   if (y < 0)
     {
        height += y;
        y = 0;
     }
   if (height <= 0)
      return;
   if ((y + height) > im->h)
      height = (im->h - y);
   if (height <= 0)
      return;
   if ((!(im->data)) && (im->loader) && (im->loader->load))
      im->loader->load(im, NULL, 0, 1);
   if (!(im->data))
      return;
   __imlib_DirtyImage(im);
   __imlib_DataCmodApply(im->data + (y * im->w) + x, width, height,
                         im->w - width, &(im->flags),
                         (ImlibColorModifier *) ctx->color_modifier);
}


Generated by  Doxygen 1.6.0   Back to index