imlib2.c File Reference

Imlib2 library. More...

Functions

void  imlib_context_set_cliprect (int x, int y, int w, int h)
void  imlib_context_set_display (Display *display)
Display *  imlib_context_get_display (void)
void  imlib_context_set_visual (Visual *visual)
Visual *  imlib_context_get_visual (void)
void  imlib_context_set_colormap (Colormap colormap)
Colormap  imlib_context_get_colormap (void)
void  imlib_context_set_drawable (Drawable drawable)
Drawable  imlib_context_get_drawable (void)
void  imlib_context_set_mask (Pixmap mask)
Pixmap  imlib_context_get_mask (void)
void  imlib_context_set_dither_mask (char dither_mask)
char  imlib_context_get_dither_mask (void)
void  imlib_context_set_anti_alias (char anti_alias)
char  imlib_context_get_anti_alias (void)
void  imlib_context_set_dither (char dither)
char  imlib_context_get_dither (void)
void  imlib_context_set_blend (char blend)
char  imlib_context_get_blend (void)
void  imlib_context_set_color_modifier (Imlib_Color_Modifier color_modifier)
Imlib_Color_Modifier  imlib_context_get_color_modifier (void)
void  imlib_context_set_operation (Imlib_Operation operation)
Imlib_Operation  imlib_context_get_operation (void)
void  imlib_context_set_font (Imlib_Font font)
Imlib_Font  imlib_context_get_font (void)
void  imlib_context_set_direction (Imlib_Text_Direction direction)
void  imlib_context_set_angle (double angle)
double  imlib_context_get_angle (void)
Imlib_Text_Direction  imlib_context_get_direction (void)
void  imlib_context_set_color (int red, int green, int blue, int alpha)
void  imlib_context_get_color (int *red, int *green, int *blue, int *alpha)
Imlib_Color *  imlib_context_get_imlib_color (void)
void  imlib_context_set_color_hsva (float hue, float saturation, float value, int alpha)
void  imlib_context_get_color_hsva (float *hue, float *saturation, float *value, int *alpha)
void  imlib_context_set_color_hlsa (float hue, float lightness, float saturation, int alpha)
void  imlib_context_get_color_hlsa (float *hue, float *lightness, float *saturation, int *alpha)
void  imlib_context_set_color_cmya (int cyan, int magenta, int yellow, int alpha)
void  imlib_context_get_color_cmya (int *cyan, int *magenta, int *yellow, int *alpha)
void  imlib_context_set_color_range (Imlib_Color_Range color_range)
Imlib_Color_Range  imlib_context_get_color_range (void)
void  imlib_context_set_progress_function (Imlib_Progress_Function progress_function)
Imlib_Progress_Function  imlib_context_get_progress_function (void)
void  imlib_context_set_progress_granularity (char progress_granularity)
char  imlib_context_get_progress_granularity (void)
void  imlib_context_set_image (Imlib_Image image)
Imlib_Image  imlib_context_get_image (void)
int  imlib_get_cache_size (void)
void  imlib_set_cache_size (int bytes)
int  imlib_get_color_usage (void)
void  imlib_set_color_usage (int max)
void  imlib_flush_loaders (void)
  If you want Imlib2 to forcibly flush any cached loaders it has and re-load them from disk (this is useful if the program just installed a new loader and does not want to wait till Imlib2 deems it an optimal time to rescan the loaders).
int  imlib_get_visual_depth (Display *display, Visual *visual)
Visual *  imlib_get_best_visual (Display *display, int screen, int *depth_return)
Imlib_Image  imlib_load_image (const char *file)
Imlib_Image  imlib_load_image_immediately (const char *file)
Imlib_Image  imlib_load_image_without_cache (const char *file)
Imlib_Image  imlib_load_image_immediately_without_cache (const char *file)
Imlib_Image  imlib_load_image_with_error_return (const char *file, Imlib_Load_Error *error_return)
void  imlib_free_image (void)
  Frees the image that is set as the current image in Imlib2's context.
void  imlib_free_image_and_decache (void)
  Frees the current image in Imlib2's context AND removes it from the cache.
int  imlib_image_get_width (void)
  Returns the width in pixels of the current image in Imlib2's context.
int  imlib_image_get_height (void)
  Returns the height in pixels of the current image in Imlib2's context.
const char *  imlib_image_get_filename (void)
DATA32 *  imlib_image_get_data (void)
DATA32 *  imlib_image_get_data_for_reading_only (void)
void  imlib_image_put_back_data (DATA32 *data)
char  imlib_image_has_alpha (void)
void  imlib_image_set_changes_on_disk (void)
  By default Imlib2 will not check the timestamp of an image on disk and compare it with the image in its cache - this is to minimize disk activity when using the cache.
void  imlib_image_get_border (Imlib_Border *border)
void  imlib_image_set_border (Imlib_Border *border)
void  imlib_image_set_format (const char *format)
void  imlib_image_set_irrelevant_format (char irrelevant)
void  imlib_image_set_irrelevant_border (char irrelevant)
void  imlib_image_set_irrelevant_alpha (char irrelevant)
char *  imlib_image_format (void)
void  imlib_image_set_has_alpha (char has_alpha)
void  imlib_render_pixmaps_for_whole_image (Pixmap *pixmap_return, Pixmap *mask_return)
void  imlib_render_pixmaps_for_whole_image_at_size (Pixmap *pixmap_return, Pixmap *mask_return, int width, int height)
void  imlib_free_pixmap_and_mask (Pixmap pixmap)
void  imlib_render_image_on_drawable (int x, int y)
void  imlib_render_image_on_drawable_at_size (int x, int y, int width, int height)
void  imlib_render_image_part_on_drawable_at_size (int source_x, int source_y, int source_width, int source_height, int x, int y, int width, int height)
void  imlib_blend_image_onto_image (Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int destination_width, int destination_height)
Imlib_Image  imlib_create_image (int width, int height)
Imlib_Image  imlib_create_image_using_data (int width, int height, DATA32 *data)
Imlib_Image  imlib_create_image_using_copied_data (int width, int height, DATA32 *data)
Imlib_Image  imlib_create_image_from_drawable (Pixmap mask, int x, int y, int width, int height, char need_to_grab_x)
Imlib_Image  imlib_create_image_from_ximage (XImage *image, XImage *mask, int x, int y, int width, int height, char need_to_grab_x)
Imlib_Image  imlib_create_scaled_image_from_drawable (Pixmap mask, int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height, char need_to_grab_x, char get_mask_from_shape)
char  imlib_copy_drawable_to_image (Pixmap mask, int x, int y, int width, int height, int destination_x, int destination_y, char need_to_grab_x)
Imlib_Image  imlib_clone_image (void)
Imlib_Image  imlib_create_cropped_image (int x, int y, int width, int height)
Imlib_Image  imlib_create_cropped_scaled_image (int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height)
Imlib_Updates  imlib_updates_clone (Imlib_Updates updates)
Imlib_Updates  imlib_update_append_rect (Imlib_Updates updates, int x, int y, int w, int h)
Imlib_Updates  imlib_updates_merge (Imlib_Updates updates, int w, int h)
Imlib_Updates  imlib_updates_merge_for_rendering (Imlib_Updates updates, int w, int h)
void  imlib_updates_free (Imlib_Updates updates)
Imlib_Updates  imlib_updates_get_next (Imlib_Updates updates)
void  imlib_updates_get_coordinates (Imlib_Updates updates, int *x_return, int *y_return, int *width_return, int *height_return)
void  imlib_updates_set_coordinates (Imlib_Updates updates, int x, int y, int width, int height)
void  imlib_render_image_updates_on_drawable (Imlib_Updates updates, int x, int y)
Imlib_Updates  imlib_updates_init (void)
Imlib_Updates  imlib_updates_append_updates (Imlib_Updates updates, Imlib_Updates appended_updates)
void  imlib_image_flip_horizontal (void)
  Flips/mirrors the current image horizontally.
void  imlib_image_flip_vertical (void)
  Flips/mirrors the current image vertically.
void  imlib_image_flip_diagonal (void)
  Flips/mirrors the current image diagonally (good for quick and dirty 90 degree rotations if used before to after a horizontal or vertical flip).
void  imlib_image_orientate (int orientation)
void  imlib_image_blur (int radius)
void  imlib_image_sharpen (int radius)
void  imlib_image_tile_horizontal (void)
  Modifies an image so it will tile seamlessly horizontally if used as a tile (i.e.
void  imlib_image_tile_vertical (void)
  Modifies an image so it will tile seamlessly vertically if used as a tile (i.e.
void  imlib_image_tile (void)
  Modifies an image so it will tile seamlessly horizontally and vertically if used as a tile (i.e.
Imlib_Font  imlib_load_font (const char *font_name)
void  imlib_free_font (void)
  Frees the current font.
void  imlib_text_draw (int x, int y, const char *text)
void  imlib_text_draw_with_return_metrics (int x, int y, const char *text, int *width_return, int *height_return, int *horizontal_advance_return, int *vertical_advance_return)
void  imlib_get_text_size (const char *text, int *width_return, int *height_return)
void  imlib_get_text_advance (const char *text, int *horizontal_advance_return, int *vertical_advance_return)
int  imlib_get_text_inset (const char *text)
void  imlib_add_path_to_font_path (const char *path)
void  imlib_remove_path_from_font_path (const char *path)
char **  imlib_list_font_path (int *number_return)
int  imlib_text_get_index_and_location (const char *text, int x, int y, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return)
void  imlib_text_get_location_at_index (const char *text, int index, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return)
char **  imlib_list_fonts (int *number_return)
void  imlib_free_font_list (char **font_list, int number)
int  imlib_get_font_cache_size (void)
void  imlib_set_font_cache_size (int bytes)
void  imlib_flush_font_cache (void)
  Causes a flush of all speculatively cached fonts from the font cache.
int  imlib_get_font_ascent (void)
int  imlib_get_font_descent (void)
int  imlib_get_maximum_font_ascent (void)
int  imlib_get_maximum_font_descent (void)
Imlib_Color_Modifier  imlib_create_color_modifier (void)
void  imlib_free_color_modifier (void)
  Frees the current color modifier.
void  imlib_modify_color_modifier_gamma (double gamma_value)
void  imlib_modify_color_modifier_brightness (double brightness_value)
void  imlib_modify_color_modifier_contrast (double contrast_value)
void  imlib_set_color_modifier_tables (DATA8 *red_table, DATA8 *green_table, DATA8 *blue_table, DATA8 *alpha_table)
void  imlib_get_color_modifier_tables (DATA8 *red_table, DATA8 *green_table, DATA8 *blue_table, DATA8 *alpha_table)
void  imlib_reset_color_modifier (void)
  Resets the current color modifier to have linear mapping tables.
void  imlib_apply_color_modifier (void)
  Uses the current color modifier and modifies the current image using the mapping tables in the current color modifier.
void  imlib_apply_color_modifier_to_rectangle (int x, int y, int width, int height)
Imlib_Updates  imlib_image_draw_line (int x1, int y1, int x2, int y2, char make_updates)
void  imlib_image_draw_rectangle (int x, int y, int width, int height)
void  imlib_image_fill_rectangle (int x, int y, int width, int height)
void  imlib_image_copy_alpha_to_image (Imlib_Image image_source, int x, int y)
void  imlib_image_copy_alpha_rectangle_to_image (Imlib_Image image_source, int x, int y, int width, int height, int destination_x, int destination_y)
void  imlib_image_scroll_rect (int x, int y, int width, int height, int delta_x, int delta_y)
void  imlib_image_copy_rect (int x, int y, int width, int height, int new_x, int new_y)
Imlib_Color_Range  imlib_create_color_range (void)
void  imlib_free_color_range (void)
  Frees the current color range.
void  imlib_add_color_to_color_range (int distance_away)
void  imlib_image_fill_color_range_rectangle (int x, int y, int width, int height, double angle)
void  imlib_image_fill_hsva_color_range_rectangle (int x, int y, int width, int height, double angle)
void  imlib_image_query_pixel (int x, int y, Imlib_Color *color_return)
void  imlib_image_query_pixel_hsva (int x, int y, float *hue, float *saturation, float *value, int *alpha)
void  imlib_image_query_pixel_hlsa (int x, int y, float *hue, float *lightness, float *saturation, int *alpha)
void  imlib_image_query_pixel_cmya (int x, int y, int *cyan, int *magenta, int *yellow, int *alpha)
void  imlib_image_attach_data_value (const char *key, void *data, int value, Imlib_Internal_Data_Destructor_Function destructor_function)
void *  imlib_image_get_attached_data (const char *key)
int  imlib_image_get_attached_value (const char *key)
void  imlib_image_remove_attached_data_value (const char *key)
void  imlib_image_remove_and_free_attached_data_value (const char *key)
void  imlib_save_image (const char *filename)
void  imlib_save_image_with_error_return (const char *filename, Imlib_Load_Error *error_return)
Imlib_Image  imlib_create_rotated_image (double angle)
void  imlib_blend_image_onto_image_at_angle (Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y)
void  imlib_blend_image_onto_image_skewed (Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y)
void  imlib_render_image_on_drawable_skewed (int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y)
void  imlib_render_image_on_drawable_at_angle (int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y)
void  imlib_context_set_filter (Imlib_Filter filter)
Imlib_Filter  imlib_context_get_filter (void)
ImlibPolygon  imlib_polygon_new (void)
  Returns a new polygon object with no points set.
void  imlib_polygon_add_point (ImlibPolygon poly, int x, int y)
void  imlib_polygon_free (ImlibPolygon poly)
void  imlib_image_draw_polygon (ImlibPolygon poly, unsigned char closed)
void  imlib_image_fill_polygon (ImlibPolygon poly)
void  imlib_polygon_get_bounds (ImlibPolygon poly, int *px1, int *py1, int *px2, int *py2)
void  imlib_image_draw_ellipse (int xc, int yc, int a, int b)
void  imlib_image_fill_ellipse (int xc, int yc, int a, int b)
unsigned char  imlib_polygon_contains_point (ImlibPolygon poly, int x, int y)

Detailed Description

Imlib2 library.

Brief of imlib2 library


Function Documentation

void imlib_add_color_to_color_range int  distance_away  ) 
 
Parameters:
distance_away  Distance from the previous color.
Adds the current color to the current color range at a distance_away distance from the previous color in the range (if it's the first color in the range this is irrelevant).
void imlib_add_path_to_font_path const char *  path  ) 
 
Parameters:
path  A directory path.
Adds the directory path to the end of the current list of directories to scan for fonts.
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.
void imlib_blend_image_onto_image Imlib_Image  source_image,
char  merge_alpha,
int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_x,
int  destination_y,
int  destination_width,
int  destination_height
 
Parameters:
source_image  The source image.
merge_alpha  Alpha flag.
source_x  X coordinate of the source image.
source_y  Y coordinate of the source image.
source_width  Width of the source image.
source_height  Height of the source image.
destination_x  X coordinate of the destination image.
destination_y  Y coordinate of the destination image.
destination_width  Width of the destination image.
destination_height  Height of the destination image.
Blends the source rectangle (source_x, source_y, source_width, source_height) from source_image onto the current image at the destination (destination_x, destination_y) location scaled to the width destination_width and height destination_height. If merge_alpha is set to 1 it will also modify the destination image alpha channel, otherwise the destination alpha channel is left untouched.
void imlib_blend_image_onto_image_at_angle Imlib_Image  source_image,
char  merge_alpha,
int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_x,
int  destination_y,
int  angle_x,
int  angle_y
 
Parameters:
source_image  The image source.
merge_alpha  A char.
source_x  The source x coordinate.
source_y  The source y coordinate.
source_width  The source width.
source_height  The source height.
destination_x  The destination x coordinate.
destination_y  The destination y coordinate.
angle_x  An angle.
angle_y  An angle.
Works just like imlib_blend_image_onto_image_skewed() except you cannot skew an image (v_angle_x and v_angle_y are 0).
void imlib_blend_image_onto_image_skewed Imlib_Image  source_image,
char  merge_alpha,
int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_x,
int  destination_y,
int  h_angle_x,
int  h_angle_y,
int  v_angle_x,
int  v_angle_y
 
Parameters:
source_image  The source image.
merge_alpha  A char
source_x  The source x coordinate.
source_y  The source y coordinate.
source_width  The source width.
source_height  The source height.
destination_x  The destination x coordinate.
destination_y  The destination y coordinate.
h_angle_x  An angle.
h_angle_y  An angle.
v_angle_x  An angle.
v_angle_y  An angle.
Blends the source rectangle (source_x, source_y, source_width, source_height) from the source_image onto the current image at the destination (destination_x, destination_y) location. It will be rotated and scaled so that the upper right corner will be positioned h_angle_x pixels to the right (or left, if negative) and h_angle_y pixels down (from (destination_x, destination_y). If v_angle_x and v_angle_y are not 0, the image will also be skewed so that the lower left corner will be positioned v_angle_x pixels to the right and v_angle_y pixels down. The at_angle versions simply have the v_angle_x and v_angle_y set to 0 so the rotation doesn't get skewed, and the render_..._on_drawable ones seem obvious enough; they do the same on a drawable.

Example:

 imlib_blend_image_onto_image_skewed(..., 0, 0, 100, 0, 0, 100);
will simply scale the image to be 100x100.
 imlib_blend_image_onto_image_skewed(..., 0, 0, 0, 100, 100, 0);
will scale the image to be 100x100, and flip it diagonally.
 imlib_blend_image_onto_image_skewed(..., 100, 0, 0, 100, -100, 0);
will scale the image and rotate it 90 degrees clockwise.
 imlib_blend_image_onto_image_skewed(..., 50, 0, 50, 50, -50, 50);
will rotate the image 45 degrees clockwise, and will scale it so its corners are at (50,0)-(100,50)-(50,100)-(0,50) i.e. it fits into the 100x100 square, so it's scaled down to 70.7% (sqrt(2)/2).
 imlib_blend_image_onto_image_skewed(..., 50, 50, 100 * cos(a), 100 * sin(a), 0);
will rotate the image `a' degrees, with its upper left corner at (50,50).
Imlib_Image imlib_clone_image void   ) 
 
Returns:
A valid image, otherwise NULL.
Creates an exact duplicate of the current image and returns a valid image handle on success, or NULL on failure.
double imlib_context_get_angle void   ) 
 
Returns:
The current angle of the text strings.
Returns the current angle used to render text at if the direction is IMLIB_TEXT_TO_ANGLE.
char imlib_context_get_anti_alias void   ) 
 
Returns:
The current anti alias flag.
Returns if Imlib2 currently will smoothly scale images. 1 means it will and 0 means it will not.
char imlib_context_get_blend void   ) 
 
Returns:
The current blending flag.
Returns if Imlib2 will blend images onto a drawable whilst rendering to that drawable. 1 means yes and 0 means no.
void imlib_context_get_color int *  red,
int *  green,
int *  blue,
int *  alpha
 
Parameters:
red  Red channel of the current color.
green  Green channel of the current color.
blue  Blue channel of the current color.
alpha  Alpha channel of the current color.
Returns the current color for rendering text, rectangles and lines.
void imlib_context_get_color_cmya int *  cyan,
int *  magenta,
int *  yellow,
int *  alpha
 
Parameters:
cyan  Cyan channel of the current color.
magenta  Magenta channel of the current color.
yellow  Yellow channel of the current color.
alpha  Alpha channel of the current color.
Returns the current color for rendering text, rectangles and lines in CMYA space.
void imlib_context_get_color_hlsa float *  hue,
float *  lightness,
float *  saturation,
int *  alpha
 
Parameters:
hue  Hue channel of the current color.
lightness  Lightness channel of the current color.
saturation  Saturation channel of the current color.
alpha  Alpha channel of the current color.
Returns the current color for rendering text, rectangles and lines in HLSA space.
void imlib_context_get_color_hsva float *  hue,
float *  saturation,
float *  value,
int *  alpha
 
Parameters:
hue  Hue channel of the current color.
saturation  Saturation channel of the current color.
value  Value channel of the current color.
alpha  Alpha channel of the current color.
Returns the current color for rendering text, rectangles and lines in HSVA space.
Imlib_Color_Modifier imlib_context_get_color_modifier void   ) 
 
Returns:
The current color modifier.
Returns the current color modifier being used.
Imlib_Color_Range imlib_context_get_color_range void   ) 
 
Returns:
The current color range.
Returns the current color range being used for gradients.
Colormap imlib_context_get_colormap void   ) 
 
Returns:
The current colormap.
Returns the current Colormap used for Imlib2's context.
Imlib_Text_Direction imlib_context_get_direction void   ) 
 
Returns:
The current direction of the text.
Returns the current direction to render text in.
Display* imlib_context_get_display void   ) 
 
Returns:
The current display.
Returns the current display used for Imlib2's display context.
char imlib_context_get_dither void   ) 
 
Returns:
The current dithering flag.
Returns if image data is rendered with dithering currently. 1 means yes and 0 means no.
char imlib_context_get_dither_mask void   ) 
 
Returns:
The current dither mask flag.
Returns the current mode for dithering pixmap masks. 1 means dithering is enabled and 0 means it is not.
Drawable imlib_context_get_drawable void   ) 
 
Returns:
The current drawable.
Returns the current Drawable used for Imlib2's context.
Imlib_Filter imlib_context_get_filter void   ) 
 
Returns:
Gets the current context image filter.
Imlib_Font imlib_context_get_font void   ) 
 
Returns:
The current font.
Returns the current font.
Imlib_Image imlib_context_get_image void   ) 
 
Returns:
The current image.
Returns the current context image.
Imlib_Color* imlib_context_get_imlib_color void   ) 
 
Returns:
The current color.
Returns the current color as a color struct. Do NOT free this pointer.
Pixmap imlib_context_get_mask void   ) 
 
Returns:
The current pixmap.
Returns the current pixmap destination to be used to render a mask into.
Imlib_Operation imlib_context_get_operation void   ) 
 
Returns:
The current operation mode.
Returns the current operation mode.
Imlib_Progress_Function imlib_context_get_progress_function void   ) 
 
Returns:
The current progress function.
Returns the current progress function being used.
char imlib_context_get_progress_granularity void   ) 
 
Returns:
The current progress granularity
Returns the current progress granularity being used.
Visual* imlib_context_get_visual void   ) 
 
Returns:
The current visual.
Returns the current visual used for Imlib2's context.
void imlib_context_set_angle double  angle  ) 
 
Parameters:
angle  Angle of the text strings.
Sets the angle at which text strings will be drawn if the text direction has been set to IMLIB_TEXT_TO_ANGLE with imlib_context_set_direction().
void imlib_context_set_anti_alias char  anti_alias  ) 
 
Parameters:
anti_alias  The anti alias flag.
Toggles "anti-aliased" scaling of images. This isn't quite correct since it's actually super and sub pixel sampling that it turns on and off, but anti-aliasing is used for having "smooth" edges to lines and shapes and this means when images are scaled they will keep their smooth appearance. Passing in 1 turns this on and 0 turns it off.
void imlib_context_set_blend char  blend  ) 
 
Parameters:
blend  The blending flag.
When rendering an image to a drawable, Imlib2 is able to blend the image directly onto the drawable during rendering. Setting this to 1 will enable this. If the image has no alpha channel this has no effect. Setting it to 0 will disable this.
void imlib_context_set_cliprect int  x,
int  y,
int  w,
int  h
 
Parameters:
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
w  The width of the rectangle.
h  The height of the rectangle.
Sets the rectangle of the current context.
void imlib_context_set_color int  red,
int  green,
int  blue,
int  alpha
 
Parameters:
red  Red channel of the current color.
green  Green channel of the current color.
blue  Blue channel of the current color.
alpha  Alpha channel of the current color.
Sets the color with which text, lines and rectangles are drawn when being rendered onto an image. Values for red, green, blue and alpha are between 0 and 255 - any other values have undefined results.
void imlib_context_set_color_cmya int  cyan,
int  magenta,
int  yellow,
int  alpha
 
Parameters:
cyan  Cyan channel of the current color.
magenta  Magenta channel of the current color.
yellow  Yellow channel of the current color.
alpha  Alpha channel of the current color.
Sets the color in CMYA space. Values for cyan, magenta, yellow and alpha are between 0 and 255 - any other values have undefined results.
void imlib_context_set_color_hlsa float  hue,
float  lightness,
float  saturation,
int  alpha
 
Parameters:
hue  Hue channel of the current color.
lightness  Lightness channel of the current color.
saturation  Saturation channel of the current color.
alpha  Alpha channel of the current color.
Sets the color in HLSA space. Values for hue are between 0 and 360, values for lightness and saturation between 0 and 1, and values for alpha are between 0 and 255 - any other values have undefined results.
void imlib_context_set_color_hsva float  hue,
float  saturation,
float  value,
int  alpha
 
Parameters:
hue  Hue channel of the current color.
saturation  Saturation channel of the current color.
value  Value channel of the current color.
alpha  Alpha channel of the current color.
Sets the color in HSVA space. Values for hue are between 0 and 360, values for saturation and value between 0 and 1, and values for alpha are between 0 and 255 - any other values have undefined results.
void imlib_context_set_color_modifier Imlib_Color_Modifier  color_modifier  ) 
 
Parameters:
color_modifier  Current color modifier.
Sets the current color modifier used for rendering pixmaps or images to a drawable or images onto other images. Color modifiers are lookup tables that map the values in the red, green, blue and alpha channels to other values in the same channel when rendering, allowing for fades, color correction etc. to be done whilst rendering. pass in NULL as the color_modifier to disable the color modifier for rendering.
void imlib_context_set_color_range Imlib_Color_Range  color_range  ) 
 
Parameters:
color_range  Color range.
Sets the current color range to use for rendering gradients.
void imlib_context_set_colormap Colormap  colormap  ) 
 
Parameters:
colormap  Colormap to use.
Sets the colormap to use when rendering to drawables and allocating colors. You must set this to the colormap you are using to render any images or produce any pixmaps (this can be the default colormap).
void imlib_context_set_direction Imlib_Text_Direction  direction  ) 
 
Parameters:
direction  Text direction.
Sets the direction in which to draw text in terms of simple 90 degree orientations or an arbitrary angle. The direction can be one of IMLIB_TEXT_TO_RIGHT, IMLIB_TEXT_TO_LEFT, IMLIB_TEXT_TO_DOWN, IMLIB_TEXT_TO_UP or IMLIB_TEXT_TO_ANGLE. The default is IMLIB_TEXT_TO_RIGHT. If you use IMLIB_TEXT_TO_ANGLE, you will also have to set the angle with imlib_context_set_angle().
void imlib_context_set_display Display *  display  ) 
 
Parameters:
display  Current display to bu used.
Sets the current X display to be used for rendering of images to drawables. You do not need to set this if you do not intend to render an image to an X drawable. If you do you will need to set this. If you change displays just set this to the new display pointer. Do not use a Display pointer if you have closed that display already - also note that if you close a display connection and continue to render using Imlib2 without setting the display pointer to NULL or something new, crashes may occur.
void imlib_context_set_dither char  dither  ) 
 
Parameters:
dither  The dithering flag.
Sets the dithering flag for rendering to a drawable or when pixmaps are produced. This affects the color image appearance by enabling dithering. Dithering slows down rendering but produces considerably better results. this option has no effect foe rendering in 24 bit and up, but in 16 bit and lower it will dither, producing smooth gradients and much better quality images. setting dither to 1 enables it and 0 disables it.
void imlib_context_set_dither_mask char  dither_mask  ) 
 
Parameters:
dither_mask  The dither mask flag.
Selects if, you are rendering to a mask, or producing pixmap masks from images, if the mask is to be dithered or not. passing in 1 for dither_mask means the mask pixmap will be dithered, 0 means it will not be dithered.
void imlib_context_set_drawable Drawable  drawable  ) 
 
Parameters:
drawable  An X drawable.
Sets the X drawable to which images will be rendered when you call a render call in Imlib2. This may be either a pixmap or a window. You must set this to render anything.
void imlib_context_set_filter Imlib_Filter  filter  ) 
 
Parameters:
filter  Current filter.
Sets the current filter to be used when applying filters to images. Set this to NULL to disable filters.
void imlib_context_set_font Imlib_Font  font  ) 
 
Parameters:
font  Current font.
Sets the current font to use when rendering text. you should load the font first with imlib_load_font().
void imlib_context_set_image Imlib_Image  image  ) 
 
Parameters:
image  Current image.
Sets the current image Imlib2 will be using with its function calls.
void imlib_context_set_mask Pixmap  mask  ) 
 
Parameters:
mask  An 1-bit deep pixmap.
Sets the 1-bit deep pixmap to be drawn to when rendering to generate a mask pixmap. This is only useful if the image you are rendering has alpha. Set this to 0 to not render a pixmap mask.
void imlib_context_set_operation Imlib_Operation  operation  ) 
 
Parameters:
operation 
When Imlib2 draws an image onto another or an image onto a drawable it is able to do more than just blend the result on using the given alpha channel of the image. It is also able to do saturating additive, subtractive and a combination of the both (called reshade) rendering. The default mode is IMLIB_OP_COPY. you can also set it to IMLIB_OP_ADD, IMLIB_OP_SUBTRACT or IMLIB_OP_RESHADE. Use this function to set the rendering operation. IMLIB_OP_COPY performs basic alpha blending: DST = (SRC * A) + (DST * (1 - A)). IMLIB_OP_ADD does DST = DST + (SRC * A). IMLIB_OP_SUBTRACT does DST = DST - (SRC * A) and IMLIB_OP_RESHADE does DST = DST + (((SRC - 0.5) / 2) * A).
void imlib_context_set_progress_function Imlib_Progress_Function  progress_function  ) 
 
Parameters:
progress_function  A progress function.
Sets the progress function to be called back whilst loading images. Set this to the function to be called, or set it to NULL to disable progress callbacks whilst loading.
void imlib_context_set_progress_granularity char  progress_granularity  ) 
 
Parameters:
progress_granularity  A char.
This hints as to how often to call the progress callback. 0 means as often as possible. 1 means whenever 15 more of the image has been decoded, 10 means every 10% of the image decoding, 50 means every 50% and 100 means only call at the end. Values outside of the range 0-100 are undefined.
void imlib_context_set_visual Visual *  visual  ) 
 
Parameters:
visual  Current visual to use.
Sets the current visual to use when rendering images to drawables or producing pixmaps. You need to set this for anything to render to a drawable or produce any pixmaps (this can be the default visual).
char imlib_copy_drawable_to_image Pixmap  mask,
int  x,
int  y,
int  width,
int  height,
int  destination_x,
int  destination_y,
char  need_to_grab_x
 
Parameters:
mask  A mask.
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
destination_x  The x coordinate of the new location.
destination_y  The x coordinate of the new location.
need_to_grab_x  Grab flag.
Returns:
A char.
Grabs a section of the current drawable (optionally using the pixmap mask provided as a corresponding mask for that drawable - if mask is 0 this is not used). It grabs the (x, y, width, height) rectangle and places it at the destination (destination_x, destination_y) location in the current image. If need_to_grab_x is 1 it will grab and ungrab the server whilst doing this - you need to do this if you have not already grabbed the server.
Imlib_Color_Modifier imlib_create_color_modifier void   ) 
 
Returns:
Valid handle.
Creates a new empty color modifier and returns a valid handle on success. NULL is returned on failure.
Imlib_Color_Range imlib_create_color_range void   ) 
 
Returns:
valid handle.
Creates a new empty color range and returns a valid handle to that color range.
Imlib_Image imlib_create_cropped_image int  x,
int  y,
int  width,
int  height
 
Parameters:
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
Returns:
A valid image, otherwise NULL.
Creates a duplicate of a (x, y, width, height) rectangle in the current image and returns a valid image handle on success, or NULL on failure.
Imlib_Image imlib_create_cropped_scaled_image int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_width,
int  destination_height
 
Parameters:
source_x  The top left x coordinate of the source rectangle.
source_y  The top left y coordinate of the source rectangle.
source_width  The width of the source rectangle.
source_height  The height of the source rectangle.
destination_width  The width of the destination image.
destination_height  The height of the destination image.
Returns:
A valid image, otherwise NULL.
Works the same as imlib_create_cropped_image() but will scale the new image to the new destination destination_width and destination_height whilst cropping.
Imlib_Image imlib_create_image int  width,
int  height
 
Parameters:
width  The width of the image.
height  The height of the image.
Returns:
A new blank image.
Creates a new blank image of size width and height. The contents of this image at creation time are undefined (they could be garbage memory). You are free to do whatever you like with this image. It is not cached. On success an image handle is returned - on failure NULL is returned.
Imlib_Image imlib_create_image_from_drawable Pixmap  mask,
int  x,
int  y,
int  width,
int  height,
char  need_to_grab_x
 
Parameters:
mask  A mask.
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
need_to_grab_x  Grab flag.
Returns:
a valid image, otherwise NULL.
Return an image (using the mask mask to determine the alpha channel) from the current drawable. If the mask is 0 it will not create a useful alpha channel in the image. It will create an image from the (x, y, width , height) rectangle in the drawable. If need_to_grab_x is 1 it will also grab the X Server to avoid possible race conditions in grabbing. If you have not already grabbed the server you MUST set this to 1. Imlib2 returns a valid image handle on success or NULL on failure.
Imlib_Image imlib_create_image_from_ximage XImage *  image,
XImage *  mask,
int  x,
int  y,
int  width,
int  height,
char  need_to_grab_x
 
Parameters:
image  An image.
mask  A mask.
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
need_to_grab_x  Grab flag.
Returns:
a valid image, otherwise NULL.
Imlib_Image imlib_create_image_using_copied_data int  width,
int  height,
DATA32 *  data
 
Parameters:
width  The width of the image.
height  The height of the image.
data  The data.
Returns:
A valid image, otherwise NULL.
Works the same way as imlib_create_image_using_data() but Imlib2 copies the image data to the image structure. You may now do whatever you wish with the original data as it will not be needed anymore. Imlib2 returns a valid image handle on success or NULL on failure.
Imlib_Image imlib_create_image_using_data int  width,
int  height,
DATA32 *  data
 
Parameters:
width  The width of the image.
height  The height of the image.
data  The data.
Returns:
A valid image, otherwise NULL.
Creates an image from the image data specified with the width width and the height height specified. The image data data must be in the same format as imlib_image_get_data() would return. You are responsible for freeing this image data once the image is freed - Imlib2 will not do that for you. This is useful for when you already have static buffers of the same format Imlib2 uses (many video grabbing devices use such a format) and wish to use Imlib2 to render the results onto another image, or X drawable. You should free the image when you are done with it. Imlib2 returns a valid image handle on success or NULL on failure
Imlib_Image imlib_create_rotated_image double  angle  ) 
 
Parameters:
angle  An angle in radians.
Returns:
A new image, or NULL.
Creates an new copy of the current image, but rotated by angle radians. On success it returns a valid image handle, otherwise NULL.
Imlib_Image imlib_create_scaled_image_from_drawable Pixmap  mask,
int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_width,
int  destination_height,
char  need_to_grab_x,
char  get_mask_from_shape
 
Parameters:
mask  A mask.
source_x  The top left x coordinate of the rectangle.
source_y  The top left y coordinate of the rectangle.
source_width  The width of the rectangle.
source_height  The height of the rectangle.
destination_width  The width of the returned image.
destination_height  The height of the returned image.
need_to_grab_x  Grab flag.
get_mask_from_shape  A char.
Returns:
A valid image, otherwise NULL.
Creates an image from the current drawable (optionally using the mask pixmap specified to determine alpha transparency) and scale the grabbed data first before converting to an actual image (to minimize reads from the frame buffer which can be slow). The source (source_x, source_y, source_width, source_height) rectangle will be grabbed, scaled to the destination destination_width and destination_height, then converted to an image. If need_to_grab_x is set to 1, X is grabbed (set this to 1 unless you have already grabbed the server) and if get_mask_from_shape and the current drawable is a window its shape is used for determining the alpha channel. If successful this function will return a valid image handle, otherwise NULL is returned.
void imlib_free_font_list char **  font_list,
int  number
 
Parameters:
font_list  The font list.
number  Number of fonts in the list.
Frees the font list returned by imlib_list_fonts().
void imlib_free_pixmap_and_mask Pixmap  pixmap  ) 
 
Parameters:
pixmap  The pixmap.
Frees pixmap (and any mask generated in association with that pixmap). The pixmap will remain cached until the image the pixmap was generated from is dirtied or decached, or the cache is flushed.
Visual* imlib_get_best_visual Display *  display,
int  screen,
int *  depth_return
 
Parameters:
display  The current display
screen  The screen
depth_return  The depth of the returned visual.
Returns:
The best visual.
Returns the visual for the display display and the screen screen that Imlib2 thinks will give you the best quality output. depth_return should point to an int that will be filled with the depth of that visual too.
int imlib_get_cache_size void   ) 
 
Returns:
The current image size.
Returns the current size of the image cache in bytes. The cache is a unified cache used for image data AND pixmaps.
void imlib_get_color_modifier_tables DATA8 *  red_table,
DATA8 *  green_table,
DATA8 *  blue_table,
DATA8 *  alpha_table
 
Parameters:
red_table,:  an array of DATA8.
green_table,:  an array of DATA8.
blue_table,:  an array of DATA8.
alpha_table,:  an array of DATA8.
Copies the table values from the current color modifier into the pointers to mapping tables specified. They must have 256 entries and be DATA8 format.
int imlib_get_color_usage void   ) 
 
Returns:
The current number of colors.
Gets the number of colors Imlib2 currently at a maximum is allowed to allocate for rendering. The default is 256.
int imlib_get_font_ascent void   ) 
 
Returns:
The font's ascent.
Returns the current font's ascent value in pixels.
int imlib_get_font_cache_size void   ) 
 
Returns:
The font cache size.
Returns the font cache size in bytes.
int imlib_get_font_descent void   ) 
 
Returns:
The font's descent.
Returns the current font's descent value in pixels.
int imlib_get_maximum_font_ascent void   ) 
 
Returns:
The font's maximum ascent.
Returns the current font's maximum ascent extent.
int imlib_get_maximum_font_descent void   ) 
 
Returns:
The font's maximum descent.
Returns the current font's maximum descent extent.
void imlib_get_text_advance const char *  text,
int *  horizontal_advance_return,
int *  vertical_advance_return
 
Parameters:
text  A string.
horizontal_advance_return  Horizontal offset.
vertical_advance_return  Vertical offset.
Gets the advance horizontally and vertically in pixels the next text string would need to be placed at for the current font. The advances are not adjusted for rotation so you will have to translate the advances (which are calculated as if the text was drawn horizontally from left to right) depending on the text orientation.
int imlib_get_text_inset const char *  text  ) 
 
Parameters:
text  A string.
Returns:
The inset value of .
Returns the inset of the first character of text in using the current font and returns that value in pixels.
void imlib_get_text_size const char *  text,
int *  width_return,
int *  height_return
 
Parameters:
text  A string.
width_return  The width of the text.
height_return  The height of the text.
Gets the width and height in pixels the text string would use up if drawn with the current font.
int imlib_get_visual_depth Display *  display,
Visual *  visual
 
Parameters:
display  The current display
visual  The current visual
Returns:
Convenience function that returns the depth of a visual for that display.
void imlib_image_attach_data_value const char *  key,
void *  data,
int  value,
Imlib_Internal_Data_Destructor_Function  destructor_function
 
Parameters:
key  A string.
data  A pointer.
value  A value.
destructor_function  An Imlib internal function.
Attaches data to the current image with the string key of key, and the data of data and an integer of value. The destructor_function function, if not NULL is called when this image is freed so the destructor can free data, if this is needed.
void imlib_image_blur int  radius  ) 
 
Parameters:
radius  The radius.
Blurs the current image. A radius value of 0 has no effect, 1 and above determine the blur matrix radius that determine how much to blur the image.
void imlib_image_copy_alpha_rectangle_to_image Imlib_Image  image_source,
int  x,
int  y,
int  width,
int  height,
int  destination_x,
int  destination_y
 
Parameters:
image_source  An image.
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
destination_x  The top left x coordinate of the destination rectangle.
destination_y  The top left x coordinate of the destination rectangle.
Copies the source (x, y, width, height) rectangle alpha channel from the source image image_source and replaces the alpha channel on the destination image at the (destination_x, destination_y) coordinates.
void imlib_image_copy_alpha_to_image Imlib_Image  image_source,
int  x,
int  y
 
Parameters:
image_source  An image.
x  The x coordinate.
y  The y coordinate.
Copies the alpha channel of the source image image_source to the (x, y) coordinates of the current image, replacing the alpha channel there.
void imlib_image_copy_rect int  x,
int  y,
int  width,
int  height,
int  new_x,
int  new_y
 
Parameters:
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
new_x  The top left x coordinate of the new location.
new_y  The top left y coordinate of the new location.
Copies a rectangle of size width, height at the (x, y) location specified in the current image to a new location (new_x, new_y) in the same image.
void imlib_image_draw_ellipse int  xc,
int  yc,
int  a,
int  b
 
Parameters:
xc  X coordinate of the center of the ellipse.
yc  Y coordinate of the center of the ellipse.
a  The horizontal amplitude of the ellipse.
b  The vertical amplitude of the ellipse.
Draws an ellipse on the current context image. The ellipse is defined as (x-xc)^2/a^2 + (y-yc)^2/b^2 = 1. This means that the point (xc, yc) marks the center of the ellipse, a defines the horizontal amplitude of the ellipse, and b defines the vertical amplitude.
Imlib_Updates imlib_image_draw_line int  x1,
int  y1,
int  x2,
int  y2,
char  make_updates
 
Parameters:
x1  The x coordinate of the first point.
y1  The y coordinate of the first point.
x2  The x coordinate of the second point.
y2  The y coordinate of the second point.
make_updates,:  a char.
Returns:
An updates list.
Draws a line using the current color on the current image from coordinates (x1, y1) to (x2, y2). If make_updates is 1 it will also return an update you can use for an updates list, otherwise it returns NULL.
void imlib_image_draw_polygon ImlibPolygon  poly,
unsigned char  closed
 
Parameters:
poly  A polygon.
closed  Closed polygon flag.
Draws the polygon poly onto the current context image. Points which have been added to the polygon are drawn in sequence, first to last. The final point will be joined with the first point if closed is non-zero.
void imlib_image_draw_rectangle int  x,
int  y,
int  width,
int  height
 
Parameters:
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
Draws the outline of a rectangle on the current image at the (x, y) coordinates with a size of width and height pixels, using the current color.
void imlib_image_fill_color_range_rectangle int  x,
int  y,
int  width,
int  height,
double  angle
 
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.
angle  Angle of gradient.
Fills a rectangle of width width and height height at the (x, y) location specified in the current image with a linear gradient of the current color range at an angle of angle degrees with 0 degrees being vertical from top to bottom going clockwise from there.
void imlib_image_fill_ellipse int  xc,
int  yc,
int  a,
int  b
 
Parameters:
xc  X coordinate of the center of the ellipse.
yc  Y coordinate of the center of the ellipse.
a  The horizontal amplitude of the ellipse.
b  The vertical amplitude of the ellipse.
Fills an ellipse on the current context image using the current context color. The ellipse is defined as (x-xc)^2/a^2 + (y-yc)^2/b^2 = 1. This means that the point (xc, yc) marks the center of the ellipse, a defines the horizontal amplitude of the ellipse, and b defines the vertical amplitude.
void imlib_image_fill_hsva_color_range_rectangle int  x,
int  y,
int  width,
int  height,
double  angle
 
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.
angle  Angle of gradient.
Fills a rectangle of width width and height height at the (x, y) location specified in the current image with a linear gradient in HSVA color space of the current color range at an angle of angle degrees with 0 degrees being vertical from top to bottom going clockwise from there.
void imlib_image_fill_polygon ImlibPolygon  poly  ) 
 
Parameters:
poly  A polygon.
Fills the area defined by the polygon polyon the current context image with the current context color.
void imlib_image_fill_rectangle int  x,
int  y,
int  width,
int  height
 
Parameters:
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
Draws a filled rectangle on the current image at the (x, y) coordinates with a size of width and height pixels, using the current color.
char* imlib_image_format void   ) 
 
Returns:
Current image format.
Returns the current image's format. Do not free this string. Duplicate it if you need it for later use.
void* imlib_image_get_attached_data const char *  key  ) 
 
Parameters:
key  A string.
Returns:
The attached data as a pointer, or NULL if none.
Gets the data attached to the current image with the key key specified. NULL is returned if no data could be found with that key on the current image.
int imlib_image_get_attached_value const char *  key  ) 
 
Parameters:
key  A string.
Returns:
The attached value as an integer, or 0 if none.
Returns the value attached to the current image with the specified key key. If none could be found 0 is returned.
void imlib_image_get_border Imlib_Border *  border  ) 
 
Parameters:
border  The border of the image.
Fills the Imlib_Border structure to which border points to with the values of the border of the current context image. The border is the area at the edge of the image that does not scale with the rest of the image when resized - the borders remain constant in size. This is useful for scaling bevels at the edge of images differently to the image center.
DATA32* imlib_image_get_data void   ) 
 
Returns:
A pointer to the image data.
Returns a pointer to the image data in the image set as the image for the current context. When you get this pointer it is assumed you are planning on writing to the data, thus once you do this the image can no longer be used for caching - in fact all images cached from this one will also be affected when you put the data back. If this matters it is suggested you clone the image first before playing with the image data. The image data is returned in the format of a DATA32 (32 bits) per pixel in a linear array ordered from the top left of the image to the bottom right going from left to right each line. Each pixel has the upper 8 bits as the alpha channel and the lower 8 bits are the blue channel - so a pixel's bits are ARGB (from most to least significant, 8 bits per channel). You must put the data back at some point.
DATA32* imlib_image_get_data_for_reading_only void   ) 
 
Returns:
A pointer to the image data.
Functions the same way as imlib_image_get_data(), but returns a pointer expecting the program to NOT write to the data returned (it is for inspection purposes only). Writing to this data has undefined results. The data does not need to be put back.
const char* imlib_image_get_filename void   ) 
 
Returns:
The current filename.
Returns the filename for the file that is set as the current context. The pointer returned is only valid as long as no operations cause the filename of the image to change. Saving the file with a different name would cause this. It is suggested you duplicate the string if you wish to continue to use the string for later processing. Do not free the string pointer returned by this function.
char imlib_image_has_alpha void   ) 
 
Returns:
Current alpha channel flag.
Returns 1 if the current context image has an alpha channel, or 0 if it does not (the alpha data space is still there and available - just "unused").
void imlib_image_orientate int  orientation  ) 
 
Parameters:
orientation  The orientation.
Performs 90 degree rotations on the current image. Passing in orientation does not rotate, 1 rotates clockwise by 90 degree, 2, rotates clockwise by 180 degrees, 3 rotates clockwise by 270 degrees.
void imlib_image_put_back_data DATA32 *  data  ) 
 
Parameters:
data  The pointer to the image data.
Puts back data when it was obtained by imlib_image_get_data(). data must be the same pointer returned by imlib_image_get_data(). This operated on the current context image.
void imlib_image_query_pixel int  x,
int  y,
Imlib_Color *  color_return
 
Parameters:
x  The x coordinate of the pixel.
y  The y coordinate of the pixel.
color_return  The returned color.
Fills the color_return color structure with the color of the pixel in the current image that is at the (x, y) location specified.
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.
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.
void imlib_image_query_pixel_hsva int  x,
int  y,
float *  hue,
float *  saturation,
float *  value,
int *  alpha
 
Parameters:
x  The x coordinate of the pixel.
y  The y coordinate of the pixel.
hue  The returned hue channel.
saturation  The returned saturation channel.
value  The returned value channel.
alpha  The returned alpha channel.
Gets the HSVA color of the pixel from the current image that is at the (x, y) location specified.
void imlib_image_remove_and_free_attached_data_value const char *  key  ) 
 
Parameters:
key  A string.
Removes the data and value attached to the current image with the specified key key and also calls the destructor function that was supplied when attaching it (see imlib_image_attach_data_value()).
void imlib_image_remove_attached_data_value const char *  key  ) 
 
Parameters:
key  A string.
Detaches the data & value attached with the specified key key from the current image.
void imlib_image_scroll_rect int  x,
int  y,
int  width,
int  height,
int  delta_x,
int  delta_y
 
Parameters:
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
width  The width of the rectangle.
height  The height of the rectangle.
delta_x  Distance along the x coordinates.
delta_y  Distance along the y coordinates.
Scrolls a rectangle of size width, height at the (x, y) location within the current image by the delta_x, delta_y distance (in pixels).
void imlib_image_set_border Imlib_Border *  border  ) 
 
Parameters:
border  The border of the image.
Sets the border of the current context image to the values contained in the Imlib_Border structure border points to.
void imlib_image_set_changes_on_disk void   ) 
 

By default Imlib2 will not check the timestamp of an image on disk and compare it with the image in its cache - this is to minimize disk activity when using the cache.

Call this function and it will flag the current context image as being liable to change on disk and Imlib2 will check the timestamp of the image file on disk and compare it with the cached image when it next needs to use this image in the cache.

void imlib_image_set_format const char *  format  ) 
 
Parameters:
format  Format of the image.
Sets the format of the current image. This is used for when you wish to save an image in a different format that it was loaded in, or if the image currently has no file format associated with it.
void imlib_image_set_has_alpha char  has_alpha  ) 
 
Parameters:
has_alpha  Alpha flag.
Sets the alpha flag for the current image. Set has_alpha to 1 to enable the alpha channel in the current image, or 0 to disable it.
void imlib_image_set_irrelevant_alpha char  irrelevant  ) 
 
Parameters:
irrelevant  Irrelevant alpha flag.
Sets if the alpha channel status of the current image (i.e. if there is or is not one) is important for caching purposes. By default it is not. Set irrelevant to 1 to make it irrelevant and 0 to make it relevant.
void imlib_image_set_irrelevant_border char  irrelevant  ) 
 
Parameters:
irrelevant  Irrelevant border flag.
Sets if the border of the current image is irrelevant for caching purposes. By default it is. Set irrelevant to 1 to make it irrelevant, and 0 to make it relevant.
void imlib_image_set_irrelevant_format char  irrelevant  ) 
 
Parameters:
irrelevant  Irrelevant format flag.
Sets if the format value of the current image is irrelevant for caching purposes - by default it is. pass irrelevant as 1 to make it irrelevant and 0 to make it relevant for caching.
void imlib_image_sharpen int  radius  ) 
 
Parameters:
radius  The radius.
Sharpens the current image. The radius value affects how much to sharpen by.
void imlib_image_tile void   ) 
 

Modifies an image so it will tile seamlessly horizontally and vertically if used as a tile (i.e.

drawn multiple times horizontally and vertically).

void imlib_image_tile_horizontal void   ) 
 

Modifies an image so it will tile seamlessly horizontally if used as a tile (i.e.

drawn multiple times horizontally).

void imlib_image_tile_vertical void   ) 
 

Modifies an image so it will tile seamlessly vertically if used as a tile (i.e.

drawn multiple times vertically).

char** imlib_list_font_path int *  number_return  ) 
 
Parameters:
number_return  Number of paths in the list.
Returns:
A list of strings.
Returns a list of strings that are the directories in the font path. Do not free this list or change it in any way. If you add or delete members of the font path this list will be invalid. If you intend to use this list later duplicate it for your own use. The number of elements in the array of strings is put into number_return.
char** imlib_list_fonts int *  number_return  ) 
 
Parameters:
number_return  Number of fonts in the list.
Returns:
A list of fonts.
Returns a list of fonts imlib2 can find in its font path.
Imlib_Font imlib_load_font const char *  font_name  ) 
 
Parameters:
font_name  The font name with the size.
Returns:
NULL if no font found.
Loads a truetype font from the first directory in the font path that contains that font. The font name font_name format is "font_name/size". For example. If there is a font file called blum.ttf somewhere in the font path you might use "blum/20" to load a 20 pixel sized font of blum. If the font cannot be found NULL is returned.
Imlib_Image imlib_load_image const char *  file  ) 
 
Parameters:
file  Image file.
Returns:
An image handle.
Loads an image from disk located at the path specified by file. Please see the section How Image Loading Works for more detail. Returns an image handle on success or NULL on failure.
Imlib_Image imlib_load_image_immediately const char *  file  ) 
 
Parameters:
file  Image file.
Returns:
An image handle.
Loads an image from disk located at the path specified by file. This forces the image data to be decoded at load time too, instead of decoding being deferred until it is needed. Returns an image handle on success or NULL on failure.
Imlib_Image imlib_load_image_immediately_without_cache const char *  file  ) 
 
Parameters:
file  Image file.
Returns:
An image handle.
Loads the image without deferred image data decoding (i.e. it is decoded straight away) and without looking in the cache. Returns an image handle on success or NULL on failure.
Imlib_Image imlib_load_image_with_error_return const char *  file,
Imlib_Load_Error *  error_return
 
Parameters:
file  Image file.
error_return  The returned error.
Returns:
An image handle.
Loads an image at the path file on disk. If it succeeds it returns a valid image handle, if not NULL is returned and error_return is set to the detail of the error.
Imlib_Image imlib_load_image_without_cache const char *  file  ) 
 
Parameters:
file  Image file.
Returns:
An image handle.
Loads the image without looking in the cache first. Returns an image handle on success or NULL on failure.
void imlib_modify_color_modifier_brightness double  brightness_value  ) 
 
Parameters:
brightness_value  Value of brightness.
Modifies the current color modifier by adjusting the brightness by the value brightness_value. The color modifier is modified not set, so calling this repeatedly has cumulative effects. brightness values of 0 do not affect anything. -1.0 will make things completely black and 1.0 will make things all white. Values in-between vary brightness linearly.
void imlib_modify_color_modifier_contrast double  contrast_value  ) 
 
Parameters:
contrast_value  Value of contrast.
Modifies the current color modifier by adjusting the contrast by the value contrast_value. The color modifier is modified not set, so calling this repeatedly has cumulative effects. Contrast of 1.0 does nothing. 0.0 will merge to gray, 2.0 will double contrast etc.
void imlib_modify_color_modifier_gamma double  gamma_value  ) 
 
Parameters:
gamma_value  Value of gamma.
Modifies the current color modifier by adjusting the gamma by the value specified gamma_value. The color modifier is modified not set, so calling this repeatedly has cumulative effects. A gamma of 1.0 is normal linear, 2.0 brightens and 0.5 darkens etc. Negative values are not allowed.
void imlib_polygon_add_point ImlibPolygon  poly,
int  x,
int  y
 
Parameters:
poly  A polygon
x  The X coordinate.
y  The Y coordinate.
Adds the point (x, y) to the polygon poly. The point will be added to the end of the polygon's internal point list. The points are drawn in order, from the first to the last.
unsigned char imlib_polygon_contains_point ImlibPolygon  poly,
int  x,
int  y
 
Parameters:
poly  A polygon
x  The X coordinate.
y  The Y coordinate.
Returns non-zero if the point (x, y) is within the area defined by the polygon poly.
void imlib_polygon_free ImlibPolygon  poly  ) 
 
Parameters:
poly  A polygon.
Frees a polygon object.
void imlib_polygon_get_bounds ImlibPolygon  poly,
int *  px1,
int *  py1,
int *  px2,
int *  py2
 
Parameters:
poly  A polygon.
px1  X coordinate of the upper left corner.
py1  Y coordinate of the upper left corner.
px2  X coordinate of the lower right corner.
py2  Y coordinate of the lower right corner.
Calculates the bounding area of the polygon poly. (px1, py1) defines the upper left corner of the bounding box and (px2, py2) defines it's lower right corner.
void imlib_remove_path_from_font_path const char *  path  ) 
 
Parameters:
path  A directory path.
Removes all directories in the font path that match path.
void imlib_render_image_on_drawable int  x,
int  y
 
Parameters:
x  X coordinate of the pixel.
y  Y coordinate of the pixel.
Renders the current image onto the current drawable at the (x, y) pixel location specified without scaling.
void imlib_render_image_on_drawable_at_angle int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_x,
int  destination_y,
int  angle_x,
int  angle_y
 
Parameters:
source_x  The source x coordinate.
source_y  The source y coordinate.
source_width  The source width.
source_height  The source height.
destination_x  The destination x coordinate.
destination_y  The destination y coordinate.
angle_x  An angle.
angle_y  An angle.
Works just like imlib_render_image_on_drawable_skewed() except you cannot skew an image (v_angle_x and v_angle_y are 0).
void imlib_render_image_on_drawable_at_size int  x,
int  y,
int  width,
int  height
 
Parameters:
x  X coordinate of the pixel.
y  Y coordinate of the pixel.
width  Width of the rendered image.
height  Height of the rendered image.
Renders the current image onto the current drawable at the (x, y) location specified AND scale the image to the width width and height height.
void imlib_render_image_on_drawable_skewed int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  destination_x,
int  destination_y,
int  h_angle_x,
int  h_angle_y,
int  v_angle_x,
int  v_angle_y
 
Parameters:
source_x  The source x coordinate.
source_y  The source y coordinate.
source_width  The source width.
source_height  The source height.
destination_x  The destination x coordinate.
destination_y  The destination y coordinate.
h_angle_x  An angle.
h_angle_y  An angle.
v_angle_x  An angle.
v_angle_y  An angle.
Works just like imlib_blend_image_onto_image_skewed(), except it blends the image onto the current drawable instead of the current image.
void imlib_render_image_part_on_drawable_at_size int  source_x,
int  source_y,
int  source_width,
int  source_height,
int  x,
int  y,
int  width,
int  height
 
Parameters:
source_x  X coordinate of the source image.
source_y  Y coordinate of the source image.
source_width  Width of the source image.
source_height  Height of the source image.
x  X coordinate of the destination image.
y  Y coordinate of the destination image.
width  Width of the destination image.
height  Height of the destination image.
Renders the source (source_x, source_y, source_width, source_height) pixel rectangle from the current image onto the current drawable at the (x, y) location scaled to the width width and height height.
void imlib_render_image_updates_on_drawable Imlib_Updates  updates,
int  x,
int  y
 
Parameters:
updates  An updates list.
x  The top left x coordinate of the update.
y  The top left y coordinate of the update.
Given an updates list (preferable already merged for rendering) this will render the corresponding parts of the image to the current drawable at an offset of x, y in the drawable.
void imlib_render_pixmaps_for_whole_image Pixmap *  pixmap_return,
Pixmap *  mask_return
 
Parameters:
pixmap_return  The returned pixmap.
mask_return  The returned mask.
Creates a pixmap of the current image (and a mask if the image has an alpha value) and return the id's of the pixmap and mask to pixmap_return and mask_return pixmap id's. You must free these pixmaps using Imlib2's free function imlib_free_pixmap_and_mask();.
void imlib_render_pixmaps_for_whole_image_at_size Pixmap *  pixmap_return,
Pixmap *  mask_return,
int  width,
int  height
 
Parameters:
pixmap_return  The returned pixmap.
mask_return  The returned mask.
width  Width of the pixmap.
height  Height of the pixmap.
Works just like imlib_render_pixmaps_for_whole_image(), but will scale the output result to the width width and height height specified. Scaling is done before depth conversion so pixels used for dithering don't grow large.
void imlib_save_image const char *  filename  ) 
 
Parameters:
filename  The file name.
Saves the current image in the format specified by the current image's format settings to the filename filename.
void imlib_save_image_with_error_return const char *  filename,
Imlib_Load_Error *  error_return
 
Parameters:
filename  The file name.
error_return  The returned error.
Works the same way imlib_save_image() works, but will set the error_return to an error value if the save fails.
void imlib_set_cache_size int  bytes  ) 
 
Parameters:
bytes  Cache size.
Sets the cache size. The size is in bytes. Setting the cache size to 0 effectively flushes the cache and keeps the cache size at 0 until set to another value. Whenever you set the cache size Imlib2 will flush as many old images and pixmap from the cache as needed until the current cache usage is less than or equal to the cache size.
void imlib_set_color_modifier_tables DATA8 *  red_table,
DATA8 *  green_table,
DATA8 *  blue_table,
DATA8 *  alpha_table
 
Parameters:
red_table  An array of DATA8.
green_table  An array of DATA8.
blue_table  An array of DATA8.
alpha_table  An array of DATA8.
Explicitly copies the mapping tables from the table pointers passed into this function into those of the current color modifier. Tables are 256 entry arrays of DATA8 which are a mapping of that channel value to a new channel value. A normal mapping would be linear (v[0] = 0, v[10] = 10, v[50] = 50, v[200] = 200, v[255] = 255).
void imlib_set_color_usage int  max  ) 
 
Parameters:
max  Maximum number of colors.
Sets the maximum number of colors you would like Imlib2 to allocate for you when rendering. The default is 256. This has no effect in depths greater than 8 bit.
void imlib_set_font_cache_size int  bytes  ) 
 
Parameters:
bytes  The font cache size.
Sets the font cache in bytes. Whenever you set the font cache size Imlib2 will flush fonts from the cache until the memory used by fonts is less than or equal to the font cache size. Setting the size to 0 effectively frees all speculatively cached fonts.
void imlib_text_draw int  x,
int  y,
const char *  text
 
Parameters:
x  The x coordinate of the top left corner.
y  The y coordinate of the top left corner.
text  A null-byte terminated string.
Draws the null-byte terminated string text using the current font on the current image at the (x, y) location (x, y denoting the top left corner of the font string)
void imlib_text_draw_with_return_metrics int  x,
int  y,
const char *  text,
int *  width_return,
int *  height_return,
int *  horizontal_advance_return,
int *  vertical_advance_return
 
Parameters:
x  The x coordinate of the top left corner.
y  The y coordinate of the top left corner.
text  A null-byte terminated string.
width_return  The width of the string.
height_return  The height of the string.
horizontal_advance_return  Horizontal offset.
vertical_advance_return  Vertical offset.
Works just like imlib_text_draw() but also returns the width and height of the string drawn, and horizontal_advance_return returns the number of pixels you should advance horizontally to draw another string (useful if you are drawing a line of text word by word) and vertical_advance_return does the same for the vertical direction (i.e. drawing text line by line).
int imlib_text_get_index_and_location const char *  text,
int  x,
int  y,
int *  char_x_return,
int *  char_y_return,
int *  char_width_return,
int *  char_height_return
 
Parameters:
text  A string.
x  The x offset.
y  The y offset.
char_x_return  The x coordinate of the character.
char_y_return  The x coordinate of the character.
char_width_return  The width of the character.
char_height_return  The height of the character.
Returns:
-1 if no character found.
Returns the character number in the string text using the current font at the (x, y) pixel location which is an offset relative to the top left of that string. -1 is returned if there is no character there. If there is a character, char_x_return, char_y_return, char_width_return and char_height_return (respectively the character x, y, width and height) are also filled in.
void imlib_text_get_location_at_index const char *  text,
int  index,
int *  char_x_return,
int *  char_y_return,
int *  char_width_return,
int *  char_height_return
 
Parameters:
text  A string.
index  The index of .
char_x_return  The x coordinate of the character.
char_y_return  The y coordinate of the character.
char_width_return  The width of the character.
char_height_return  The height of the character.
Gets the geometry of the character at index index in the text string using the current font.
Imlib_Updates imlib_update_append_rect Imlib_Updates  updates,
int  x,
int  y,
int  w,
int  h
 
Parameters:
updates  An updates list.
x  The top left x coordinate of the rectangle.
y  The top left y coordinate of the rectangle.
w  The width of the rectangle.
h  The height of the rectangle.
Returns:
The updates handle.
Appends an update rectangle to the updates list passed in (if the updates is NULL it will create a new updates list) and returns a handle to the modified updates list (the handle may be modified so only use the new updates handle returned).
Imlib_Updates imlib_updates_append_updates Imlib_Updates  updates,
Imlib_Updates  appended_updates
 
Parameters:
updates  An updates list.
appended_updates  The updates list to append.
Returns:
The new updates list.
Appends appended_updates to the updates list updates and returns the new list.
Imlib_Updates imlib_updates_clone Imlib_Updates  updates  ) 
 
Parameters:
updates  An updates list.
Returns:
Duplicate of updates.
Creates a duplicate of the updates list passed into the function.
void imlib_updates_free Imlib_Updates  updates  ) 
 
Parameters:
updates  An updates list.
Frees an updates list.
void imlib_updates_get_coordinates Imlib_Updates  updates,
int *  x_return,
int *  y_return,
int *  width_return,
int *  height_return
 
Parameters:
updates  An updates list.
x_return  The top left x coordinate of the update.
y_return  The top left y coordinate of the update.
width_return  The width of the update.
height_return  The height of the update.
Returns the coordinates of an update.
Imlib_Updates imlib_updates_get_next Imlib_Updates  updates  ) 
 
Parameters:
updates  An updates list.
Returns:
The next updates.
Gets the next update in the updates list relative to the one passed in.
Imlib_Updates imlib_updates_init void   ) 
 
Returns:
The initialized updates list.
Initializes an updates list before you add any updates to it or merge it for rendering etc.
Imlib_Updates imlib_updates_merge Imlib_Updates  updates,
int  w,
int  h
 
Parameters:
updates  An updates list.
w  The width of the rectangle.
h  The height of the rectangle.
Returns:
The updates handle.
Takes an updates list, and modifies it by merging overlapped rectangles and lots of tiny rectangles into larger rectangles to minimize the number of rectangles in the list for optimized redrawing. The new updates handle is now valid and the old one passed in is not.
Imlib_Updates imlib_updates_merge_for_rendering Imlib_Updates  updates,
int  w,
int  h
 
Parameters:
updates  An updates list.
w  The width of the rectangle.
h  The height of the rectangle.
Returns:
The updates handle.
Works almost exactly as imlib_updates_merge() but is more lenient on the spacing between update rectangles - if they are very close it amalgamates 2 smaller rectangles into 1 larger one.
void imlib_updates_set_coordinates Imlib_Updates  updates,
int  x,
int  y,
int  width,
int  height
 
Parameters:
updates  An updates list.
x  The top left x coordinate of the update.
y  The top left y coordinate of the update.
width  The width of the update.
height  The height of the update.
Modifies the coordinates of an update in update.