Imlib2: Imlib2.h File Reference

| Imlib2 1.12.6

Functions
Imlib2.h File Reference

Go to the source code of this file.

## Functions
EAPI int | imlib_version (void)
EAPI Imlib_Context | imlib_context_new (void)
EAPI void | imlib_context_free (Imlib_Context context)
EAPI void | imlib_context_push (Imlib_Context context)
EAPI void | imlib_context_pop (void)
EAPI Imlib_Context | imlib_context_get (void)
EAPI void | imlib_context_set_display (Display *display)
EAPI Display * | imlib_context_get_display (void)
EAPI void | imlib_context_disconnect_display (void)
EAPI void | imlib_context_set_visual (Visual *visual)
EAPI Visual * | imlib_context_get_visual (void)
EAPI void | imlib_context_set_colormap (Colormap colormap)
EAPI Colormap | imlib_context_get_colormap (void)
EAPI void | imlib_context_set_drawable (Drawable drawable)
EAPI Drawable | imlib_context_get_drawable (void)
EAPI void | imlib_context_set_mask (Pixmap mask)
EAPI Pixmap | imlib_context_get_mask (void)
EAPI void | imlib_context_set_dither_mask (char dither_mask)
EAPI char | imlib_context_get_dither_mask (void)
EAPI void | imlib_context_set_mask_alpha_threshold (int mask_alpha_threshold)
EAPI int | imlib_context_get_mask_alpha_threshold (void)
EAPI void | imlib_context_set_anti_alias (char anti_alias)
EAPI char | imlib_context_get_anti_alias (void)
EAPI void | imlib_context_set_dither (char dither)
EAPI char | imlib_context_get_dither (void)
EAPI void | imlib_context_set_blend (char blend)
EAPI char | imlib_context_get_blend (void)
EAPI void | imlib_context_set_color_modifier (Imlib_Color_Modifier color_modifier)
EAPI Imlib_Color_Modifier | imlib_context_get_color_modifier (void)
EAPI void | imlib_context_set_operation (Imlib_Operation operation)
EAPI Imlib_Operation | imlib_context_get_operation (void)
EAPI void | imlib_context_set_font (Imlib_Font font)
EAPI Imlib_Font | imlib_context_get_font (void)
EAPI void | imlib_context_set_direction (Imlib_Text_Direction direction)
EAPI Imlib_Text_Direction | imlib_context_get_direction (void)
EAPI void | imlib_context_set_angle (double angle)
EAPI double | imlib_context_get_angle (void)
EAPI void | imlib_context_set_color (int red, int green, int blue, int alpha)
EAPI void | imlib_context_get_color (int *red, int *green, int *blue, int *alpha)
EAPI void | imlib_context_set_color_hsva (float hue, float saturation, float value, int alpha)
EAPI void | imlib_context_get_color_hsva (float *hue, float *saturation, float *value, int *alpha)
EAPI void | imlib_context_set_color_hlsa (float hue, float lightness, float saturation, int alpha)
EAPI void | imlib_context_get_color_hlsa (float *hue, float *lightness, float *saturation, int *alpha)
EAPI void | imlib_context_set_color_cmya (int cyan, int magenta, int yellow, int alpha)
EAPI void | imlib_context_get_color_cmya (int *cyan, int *magenta, int *yellow, int *alpha)
EAPI Imlib_Color * | imlib_context_get_imlib_color (void)
EAPI void | imlib_context_set_color_range (Imlib_Color_Range color_range)
EAPI Imlib_Color_Range | imlib_context_get_color_range (void)
EAPI void | imlib_context_set_image_data_memory_function (Imlib_Image_Data_Memory_Function memory_function)
EAPI Imlib_Image_Data_Memory_Function | imlib_context_get_image_data_memory_function (void)
EAPI void | imlib_context_set_progress_function (Imlib_Progress_Function progress_function)
EAPI Imlib_Progress_Function | imlib_context_get_progress_function (void)
EAPI void | imlib_context_set_progress_granularity (char progress_granularity)
EAPI char | imlib_context_get_progress_granularity (void)
EAPI void | imlib_context_set_image (Imlib_Image image)
EAPI Imlib_Image | imlib_context_get_image (void)
EAPI void | imlib_context_set_cliprect (int x, int y, int w, int h)
EAPI void | imlib_context_get_cliprect (int *x, int *y, int *w, int *h)
EAPI int | imlib_get_cache_used (void)
EAPI int | imlib_get_cache_size (void)
EAPI void | imlib_set_cache_size (int bytes)
EAPI int | imlib_get_color_usage (void)
EAPI void | imlib_set_color_usage (int max)
EAPI int | imlib_get_visual_depth (Display *display, Visual *visual)
EAPI Visual * | imlib_get_best_visual (Display *display, int screen, int *depth_return)
EAPI void | imlib_flush_loaders (void)
EAPI int | imlib_get_error (void)
EAPI Imlib_Image | imlib_load_image (const char *file)
EAPI Imlib_Image | imlib_load_image_immediately (const char *file)
EAPI Imlib_Image | imlib_load_image_without_cache (const char *file)
EAPI Imlib_Image | imlib_load_image_immediately_without_cache (const char *file)
EAPI Imlib_Image | imlib_load_image_with_errno_return (const char *file, int *error_return)
EAPI Imlib_Image | imlib_load_image_fd (int fd, const char *file)
EAPI Imlib_Image | imlib_load_image_mem (const char *file, const void *data, size_t size)
EAPI void | imlib_free_image (void)
EAPI void | imlib_free_image_and_decache (void)
EAPI int | imlib_image_decache_file (const char *file)
EAPI int | imlib_image_get_width (void)
EAPI int | imlib_image_get_height (void)
EAPI const char * | imlib_image_get_filename (void)
EAPI uint32_t * | imlib_image_get_data (void)
EAPI uint32_t * | imlib_image_get_data_for_reading_only (void)
EAPI void | imlib_image_put_back_data (uint32_t *data)
EAPI char | imlib_image_has_alpha (void)
EAPI void | imlib_image_set_changes_on_disk (void)
EAPI void | imlib_image_get_border (Imlib_Border *border)
EAPI void | imlib_image_set_border (Imlib_Border *border)
EAPI void | imlib_image_set_format (const char *format)
EAPI void | imlib_image_set_irrelevant_format (char irrelevant)
EAPI char * | imlib_image_format (void)
EAPI void | imlib_image_set_has_alpha (char has_alpha)
EAPI void | imlib_image_query_pixel (int x, int y, Imlib_Color *color_return)
EAPI void | imlib_image_query_pixel_hsva (int x, int y, float *hue, float *saturation, float *value, int *alpha)
EAPI void | imlib_image_query_pixel_hlsa (int x, int y, float *hue, float *lightness, float *saturation, int *alpha)
EAPI void | imlib_image_query_pixel_cmya (int x, int y, int *cyan, int *magenta, int *yellow, int *alpha)
EAPI void | imlib_render_pixmaps_for_whole_image (Pixmap *pixmap_return, Pixmap *mask_return)
EAPI void | imlib_render_pixmaps_for_whole_image_at_size (Pixmap *pixmap_return, Pixmap *mask_return, int width, int height)
EAPI void | imlib_free_pixmap_and_mask (Pixmap pixmap)
EAPI void | imlib_render_image_on_drawable (int x, int y)
EAPI void | imlib_render_image_on_drawable_at_size (int x, int y, int width, int height)
EAPI void | imlib_render_image_part_on_drawable_at_size (int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int dst_width, int dst_height)
EAPI uint32_t | imlib_render_get_pixel_color (void)
EAPI void | imlib_blend_image_onto_image (Imlib_Image src_image, char merge_alpha, int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int dst_width, int dst_height)
EAPI Imlib_Image | imlib_create_image (int width, int height)
EAPI Imlib_Image | imlib_clone_image (void)
EAPI Imlib_Image | imlib_create_cropped_image (int x, int y, int width, int height)
EAPI Imlib_Image | imlib_create_cropped_scaled_image (int src_x, int src_y, int src_width, int src_height, int dst_width, int dst_height)
EAPI Imlib_Image | imlib_create_image_using_data (int width, int height, uint32_t *data)
EAPI Imlib_Image | imlib_create_image_using_data_and_memory_function (int width, int height, uint32_t *data, Imlib_Image_Data_Memory_Function func)
EAPI Imlib_Image | imlib_create_image_using_copied_data (int width, int height, uint32_t *data)
EAPI Imlib_Image | imlib_create_image_from_drawable (Pixmap mask, int x, int y, int width, int height, char need_to_grab_x)
EAPI Imlib_Image | imlib_create_image_from_ximage (XImage *image, XImage *mask, int x, int y, int width, int height, char need_to_grab_x)
EAPI Imlib_Image | imlib_create_scaled_image_from_drawable (Pixmap mask, int src_x, int src_y, int src_width, int src_height, int dst_width, int dst_height, char need_to_grab_x, char get_mask_from_shape)
EAPI char | imlib_copy_drawable_to_image (Pixmap mask, int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, char need_to_grab_x)
EAPI int | imlib_get_ximage_cache_count_used (void)
EAPI int | imlib_get_ximage_cache_count_max (void)
EAPI void | imlib_set_ximage_cache_count_max (int count)
EAPI int | imlib_get_ximage_cache_size_used (void)
EAPI int | imlib_get_ximage_cache_size_max (void)
EAPI void | imlib_set_ximage_cache_size_max (int bytes)
EAPI Imlib_Updates | imlib_updates_clone (Imlib_Updates updates)
EAPI Imlib_Updates | imlib_update_append_rect (Imlib_Updates updates, int x, int y, int w, int h)
EAPI Imlib_Updates | imlib_updates_merge (Imlib_Updates updates, int w, int h)
EAPI Imlib_Updates | imlib_updates_merge_for_rendering (Imlib_Updates updates, int w, int h)
EAPI void | imlib_updates_free (Imlib_Updates updates)
EAPI Imlib_Updates | imlib_updates_get_next (Imlib_Updates updates)
EAPI void | imlib_updates_get_coordinates (Imlib_Updates updates, int *x_return, int *y_return, int *width_return, int *height_return)
EAPI void | imlib_updates_set_coordinates (Imlib_Updates updates, int x, int y, int width, int height)
EAPI Imlib_Updates | imlib_updates_init (void)
EAPI Imlib_Updates | imlib_updates_append_updates (Imlib_Updates updates, Imlib_Updates appended_updates)
EAPI void | imlib_image_flip_horizontal (void)
EAPI void | imlib_image_flip_vertical (void)
EAPI void | imlib_image_flip_diagonal (void)
EAPI void | imlib_image_orientate (int orientation)
EAPI void | imlib_image_blur (int radius)
EAPI void | imlib_image_sharpen (int radius)
EAPI void | imlib_image_tile_horizontal (void)
EAPI void | imlib_image_tile_vertical (void)
EAPI void | imlib_image_tile (void)
EAPI void | imlib_image_copy_alpha_to_image (Imlib_Image image_source, int x, int y)
EAPI void | imlib_image_copy_alpha_rectangle_to_image (Imlib_Image image_source, int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y)
EAPI void | imlib_image_scroll_rect (int x, int y, int width, int height, int delta_x, int delta_y)
EAPI void | imlib_image_copy_rect (int x, int y, int width, int height, int new_x, int new_y)
EAPI Imlib_Font | imlib_load_font (const char *font_name)
EAPI void | imlib_free_font (void)
EAPI int | imlib_insert_font_into_fallback_chain (Imlib_Font font, Imlib_Font fallback_font)
EAPI void | imlib_remove_font_from_fallback_chain (Imlib_Font fallback_font)
EAPI Imlib_Font | imlib_get_prev_font_in_fallback_chain (Imlib_Font fn)
EAPI Imlib_Font | imlib_get_next_font_in_fallback_chain (Imlib_Font fn)
EAPI void | imlib_text_draw (int x, int y, const char *text)
EAPI 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)
EAPI void | imlib_get_text_size (const char *text, int *width_return, int *height_return)
EAPI void | imlib_get_text_advance (const char *text, int *horizontal_advance_return, int *vertical_advance_return)
EAPI int | imlib_get_text_inset (const char *text)
EAPI void | imlib_add_path_to_font_path (const char *path)
EAPI void | imlib_remove_path_from_font_path (const char *path)
EAPI char ** | imlib_list_font_path (int *number_return)
EAPI 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)
EAPI 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)
EAPI char ** | imlib_list_fonts (int *number_return)
EAPI void | imlib_free_font_list (char **font_list, int number)
EAPI int | imlib_get_font_cache_size (void)
EAPI void | imlib_set_font_cache_size (int bytes)
EAPI void | imlib_flush_font_cache (void)
EAPI int | imlib_get_font_ascent (void)
EAPI int | imlib_get_font_descent (void)
EAPI int | imlib_get_maximum_font_ascent (void)
EAPI int | imlib_get_maximum_font_descent (void)
EAPI Imlib_Color_Modifier | imlib_create_color_modifier (void)
EAPI void | imlib_free_color_modifier (void)
EAPI void | imlib_modify_color_modifier_gamma (double gamma_value)
EAPI void | imlib_modify_color_modifier_brightness (double brightness_value)
EAPI void | imlib_modify_color_modifier_contrast (double contrast_value)
EAPI void | imlib_set_color_modifier_tables (uint8_t *red_table, uint8_t *green_table, uint8_t *blue_table, uint8_t *alpha_table)
EAPI void | imlib_get_color_modifier_tables (uint8_t *red_table, uint8_t *green_table, uint8_t *blue_table, uint8_t *alpha_table)
EAPI void | imlib_reset_color_modifier (void)
EAPI void | imlib_apply_color_modifier (void)
EAPI void | imlib_apply_color_modifier_to_rectangle (int x, int y, int width, int height)
EAPI Imlib_Updates | imlib_image_draw_pixel (int x, int y, char make_updates)
EAPI Imlib_Updates | imlib_image_draw_line (int x1, int y1, int x2, int y2, char make_updates)
EAPI void | imlib_image_draw_rectangle (int x, int y, int width, int height)
EAPI void | imlib_image_fill_rectangle (int x, int y, int width, int height)
EAPI ImlibPolygon | imlib_polygon_new (void)
EAPI void | imlib_polygon_free (ImlibPolygon poly)
EAPI void | imlib_polygon_add_point (ImlibPolygon poly, int x, int y)
EAPI void | imlib_image_draw_polygon (ImlibPolygon poly, unsigned char closed)
EAPI void | imlib_image_fill_polygon (ImlibPolygon poly)
EAPI void | imlib_polygon_get_bounds (ImlibPolygon poly, int *px1, int *py1, int *px2, int *py2)
EAPI unsigned char | imlib_polygon_contains_point (ImlibPolygon poly, int x, int y)
EAPI void | imlib_image_draw_ellipse (int xc, int yc, int a, int b)
EAPI void | imlib_image_fill_ellipse (int xc, int yc, int a, int b)
EAPI Imlib_Color_Range | imlib_create_color_range (void)
EAPI void | imlib_free_color_range (void)
EAPI void | imlib_add_color_to_color_range (int distance_away)
EAPI void | imlib_image_fill_color_range_rectangle (int x, int y, int width, int height, double angle)
EAPI void | imlib_image_fill_hsva_color_range_rectangle (int x, int y, int width, int height, double angle)
EAPI void | imlib_image_attach_data_value (const char *key, void *data, int value, Imlib_Data_Destructor_Function destructor_function)
EAPI void * | imlib_image_get_attached_data (const char *key)
EAPI int | imlib_image_get_attached_value (const char *key)
EAPI void | imlib_image_remove_attached_data_value (const char *key)
EAPI void | imlib_image_remove_and_free_attached_data_value (const char *key)
EAPI void | imlib_save_image (const char *file)
EAPI void | imlib_save_image_with_errno_return (const char *file, int *error_return)
EAPI void | imlib_save_image_fd (int fd, const char *file)
EAPI Imlib_Image | imlib_create_rotated_image (double angle)
EAPI void | imlib_rotate_image_from_buffer (double angle, Imlib_Image src_image)
EAPI void | imlib_blend_image_onto_image_at_angle (Imlib_Image src_image, char merge_alpha, int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int angle_x, int angle_y)
EAPI void | imlib_blend_image_onto_image_skewed (Imlib_Image src_image, char merge_alpha, int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y)
EAPI void | imlib_render_image_on_drawable_skewed (int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y)
EAPI void | imlib_render_image_on_drawable_at_angle (int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int angle_x, int angle_y)
EAPI void | imlib_image_filter (void)
EAPI Imlib_Filter | imlib_create_filter (int initsize)
EAPI void | imlib_context_set_filter (Imlib_Filter filter)
EAPI Imlib_Filter | imlib_context_get_filter (void)
EAPI void | imlib_free_filter (void)
EAPI void | imlib_image_clear (void)
EAPI void | imlib_image_clear_color (int r, int g, int b, int a)
EAPI Imlib_Image | imlib_load_image_frame (const char *file, int frame)
EAPI Imlib_Image | imlib_load_image_frame_mem (const char *file, int frame, const void *data, size_t size)
EAPI void | imlib_image_get_frame_info (Imlib_Frame_Info *info)
EAPI const char * | imlib_strerror (int err)
EAPI Imlib_Image | imlib_load_image_with_error_return (const char *file, Imlib_Load_Error *error_return)
EAPI void | imlib_save_image_with_error_return (const char *file, Imlib_Load_Error *error_return)
IMLIB2_DEPRECATED EAPI void | imlib_image_set_irrelevant_border (char irrelevant)
IMLIB2_DEPRECATED EAPI void | imlib_image_set_irrelevant_alpha (char irrelevant)
IMLIB2_DEPRECATED EAPI void | imlib_context_set_TTF_encoding (Imlib_TTF_Encoding encoding)
IMLIB2_DEPRECATED EAPI Imlib_TTF_Encoding | imlib_context_get_TTF_encoding (void)

## Detailed Description

Imlib2 library API

## Function Documentation

## ◆ imlib_add_color_to_color_range()

EAPI void imlib_add_color_to_color_range | ( | int | distance_away | ) |

Add color to color range

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).

Parameters

  distance_away | Distance from the previous color

## ◆ imlib_add_path_to_font_path()

EAPI void imlib_add_path_to_font_path | ( | const char * | path | ) |

Add font path

Adds the directory `path` to the end of the current list of directories to scan for fonts.

Parameters

  path | A directory path

## ◆ imlib_apply_color_modifier()

EAPI void imlib_apply_color_modifier | ( | void |  | ) |

Apply color modifier to image

Uses the current color modifier mapping tables to modify the current image.

## ◆ imlib_apply_color_modifier_to_rectangle()

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

Apply color modifier to image part

Works the same way as imlib_apply_color_modifier() but only modifies a selected rectangle in the current image.

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

## ◆ imlib_blend_image_onto_image()

EAPI void imlib_blend_image_onto_image | ( | Imlib_Image | src_image,
|  | char | merge_alpha,
|  | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | int | dst_width,
|  | int | dst_height )

Blend part of image onto image

Blends the source rectangle (`src_x`, `src_y`, `src_width`, `src_height`) from `src_image` onto the current image at the destination (`dst_x`, `dst_y`) location scaled to the width `dst_width` and height `*` dst_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.

Parameters

  src_image | The source image
  merge_alpha | Alpha flag
  src_x | X coordinate of the source image
  src_y | Y coordinate of the source image
  src_width | Width of the source image
  src_height | Height of the source image
  dst_x | X coordinate of the destination image
  dst_y | Y coordinate of the destination image
  dst_width | Width of the destination image
  dst_height | Height of the destination image

## ◆ imlib_blend_image_onto_image_at_angle()

EAPI void imlib_blend_image_onto_image_at_angle | ( | Imlib_Image | src_image,
|  | char | merge_alpha,
|  | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | int | angle_x,
|  | int | angle_y )

Blend image onto image at 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).

Parameters

  src_image | The image source
  merge_alpha | A char
  src_x | The source x coordinate
  src_y | The source y coordinate
  src_width | The source width
  src_height | The source height
  dst_x | The destination x coordinate
  dst_y | The destination y coordinate
  angle_x | An angle
  angle_y | An angle

## ◆ imlib_blend_image_onto_image_skewed()

EAPI void imlib_blend_image_onto_image_skewed | ( | Imlib_Image | src_image,
|  | char | merge_alpha,
|  | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | int | h_angle_x,
|  | int | h_angle_y,
|  | int | v_angle_x,
|  | int | v_angle_y )

Blend image onto image at angle, skewed

Blends the source rectangle (`src_x`, `src_y`, `src_width`, * `src_height`) from the `src_image` onto the current image at the destination (`dst_x`, `dst_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 (`dst_x`, `dst_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);
imlib_blend_image_onto_image_skewed
EAPI void imlib_blend_image_onto_image_skewed(Imlib_Image src_image, char merge_alpha, int src_x, int src_y, int src_width, int src_height, int dst_x, int dst_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y)

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).

Parameters

  src_image | The source image
  merge_alpha | A char
  src_x | The source x coordinate
  src_y | The source y coordinate
  src_width | The source width
  src_height | The source height
  dst_x | The destination x coordinate
  dst_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

## ◆ imlib_clone_image()

EAPI Imlib_Image imlib_clone_image | ( | void |  | ) |

Clone image

Creates an exact duplicate of the current image.

Returns
  Image handle (NULL on failure)

## ◆ imlib_context_disconnect_display()

EAPI void imlib_context_disconnect_display | ( | void |  | ) |

Tell Imlib2 that the current display connection has been closed

Call when (and only when) you close a display connection but continue using Imlib2 on a different connection.

## ◆ imlib_context_free()

EAPI void imlib_context_free | ( | Imlib_Context | context | ) |

Free context

## ◆ imlib_context_get()

EAPI Imlib_Context imlib_context_get | ( | void |  | ) |

Get context handle

## ◆ imlib_context_get_angle()

EAPI double imlib_context_get_angle | ( | void |  | ) |

Return the current angle used to render text in

Used if the direction is IMLIB_TEXT_TO_ANGLE.

Returns
  The current text rendering angle

## ◆ imlib_context_get_anti_alias()

EAPI char imlib_context_get_anti_alias | ( | void |  | ) |

Return the current "anti-aliasing" mode

Returns
  The current anti alias flag

## ◆ imlib_context_get_blend()

EAPI char imlib_context_get_blend | ( | void |  | ) |

Return current blending mode

Returns
  The current blending flag

## ◆ imlib_context_get_cliprect()

EAPI void imlib_context_get_cliprect | ( | int * | x,
|  | int * | y,
|  | int * | w,
|  | int * | h )

Return the current clip rectangle

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

## ◆ imlib_context_get_color()

EAPI void imlib_context_get_color | ( | int * | red,
|  | int * | green,
|  | int * | blue,
|  | int * | alpha )

Return the current drawing color in RGBA space

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

## ◆ imlib_context_get_color_cmya()

EAPI void imlib_context_get_color_cmya | ( | int * | cyan,
|  | int * | magenta,
|  | int * | yellow,
|  | int * | alpha )

Return the current drawing color in CMYA space

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

## ◆ imlib_context_get_color_hlsa()

EAPI void imlib_context_get_color_hlsa | ( | float * | hue,
|  | float * | lightness,
|  | float * | saturation,
|  | int * | alpha )

Return the current drawing color in HLSA space

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

## ◆ imlib_context_get_color_hsva()

EAPI void imlib_context_get_color_hsva | ( | float * | hue,
|  | float * | saturation,
|  | float * | value,
|  | int * | alpha )

Return the current drawing color in HSVA space

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

## ◆ imlib_context_get_color_modifier()

EAPI Imlib_Color_Modifier imlib_context_get_color_modifier | ( | void |  | ) |

Return the current color modifier

Returns
  The current color modifier

## ◆ imlib_context_get_color_range()

EAPI Imlib_Color_Range imlib_context_get_color_range | ( | void |  | ) |

Return the current color range being used for gradients

Returns
  The current color range

## ◆ imlib_context_get_colormap()

EAPI Colormap imlib_context_get_colormap | ( | void |  | ) |

Return the current Colormap

Returns
  The current colormap

## ◆ imlib_context_get_direction()

EAPI Imlib_Text_Direction imlib_context_get_direction | ( | void |  | ) |

Return the current direction to render text in

Returns
  The current text rendering direction

## ◆ imlib_context_get_display()

EAPI Display * imlib_context_get_display | ( | void |  | ) |

Return the current display used for Imlib2's display context

Returns
  The current display

## ◆ imlib_context_get_dither()

EAPI char imlib_context_get_dither | ( | void |  | ) |

Return the current dithering mode

Returns
  The current dithering flag

## ◆ imlib_context_get_dither_mask()

EAPI char imlib_context_get_dither_mask | ( | void |  | ) |

Return the current mask dithering mode

Returns
  The current dither mask flag

## ◆ imlib_context_get_drawable()

EAPI Drawable imlib_context_get_drawable | ( | void |  | ) |

Return the current Drawable

Returns
  The current drawable

## ◆ imlib_context_get_filter()

EAPI Imlib_Filter imlib_context_get_filter | ( | void |  | ) |

Get the current image filter

Returns
  Current filter

## ◆ imlib_context_get_font()

EAPI Imlib_Font imlib_context_get_font | ( | void |  | ) |

Return the current font

Returns
  The current font

## ◆ imlib_context_get_image()

EAPI Imlib_Image imlib_context_get_image | ( | void |  | ) |

Return the current context image

Returns
  The current image

## ◆ imlib_context_get_image_data_memory_function()

EAPI Imlib_Image_Data_Memory_Function imlib_context_get_image_data_memory_function | ( | void |  | ) |

Return the current image data memeory management function

Returns
  The image data memory management function

## ◆ imlib_context_get_imlib_color()

EAPI Imlib_Color * imlib_context_get_imlib_color | ( | void |  | ) |

Return the current drawing color as a color struct

Do NOT free this pointer.

Returns
  The current color

## ◆ imlib_context_get_mask()

EAPI Pixmap imlib_context_get_mask | ( | void |  | ) |

Return the current mask pixmap

Returns
  The current pixmap

## ◆ imlib_context_get_mask_alpha_threshold()

EAPI int imlib_context_get_mask_alpha_threshold | ( | void |  | ) |

Return the current mask alpha threshold

Returns
  The current mask mask alpha threshold

## ◆ imlib_context_get_operation()

EAPI Imlib_Operation imlib_context_get_operation | ( | void |  | ) |

Return the current operation mode

Returns
  The current operation mode

## ◆ imlib_context_get_progress_function()

EAPI Imlib_Progress_Function imlib_context_get_progress_function | ( | void |  | ) |

Return the current progress function

Returns
  The current progress function

## ◆ imlib_context_get_progress_granularity()

EAPI char imlib_context_get_progress_granularity | ( | void |  | ) |

Return the current progress granularity

Returns
  The current progress granularity

## ◆ imlib_context_get_TTF_encoding()

IMLIB2_DEPRECATED EAPI Imlib_TTF_Encoding imlib_context_get_TTF_encoding | ( | void |  | ) |

Deprecated function - hasn't done anything useful in ~20 years

Deprecated
  Useless - don't use

## ◆ imlib_context_get_visual()

EAPI Visual * imlib_context_get_visual | ( | void |  | ) |

Return the current visual

Returns
  The current visual

## ◆ imlib_context_new()

EAPI Imlib_Context imlib_context_new | ( | void |  | ) |

Create new context

## ◆ imlib_context_pop()

EAPI void imlib_context_pop | ( | void |  | ) |

Pop context

## ◆ imlib_context_push()

EAPI void imlib_context_push | ( | Imlib_Context | context | ) |

Push context

## ◆ imlib_context_set_angle()

EAPI void imlib_context_set_angle | ( | double | angle | ) |

Set the text drawing angle

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().

Parameters

  angle | Angle of the text strings

## ◆ imlib_context_set_anti_alias()

EAPI void imlib_context_set_anti_alias | ( | char | anti_alias | ) |

Set "anti-aliasing" mode when scaling 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.

Parameters

  anti_alias | The anti-alias flag

## ◆ imlib_context_set_blend()

EAPI void imlib_context_set_blend | ( | char | blend | ) |

Set blending mode

Select whether to blend or not during rendering operations. Setting blend to 1 enables blending and 0 disables blending.

Parameters

  blend | The blending flag

## ◆ imlib_context_set_cliprect()

EAPI void imlib_context_set_cliprect | ( | int | x,
|  | int | y,
|  | int | w,
|  | int | h )

Set the clip rectangle

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

## ◆ imlib_context_set_color()

EAPI void imlib_context_set_color | ( | int | red,
|  | int | green,
|  | int | blue,
|  | int | alpha )

Set the drawing color in RGBA space

Sets the color with which text and lines 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.

Parameters

  red | Red channel of the color
  green | Green channel of the color
  blue | Blue channel of the color
  alpha | Alpha channel of the color

## ◆ imlib_context_set_color_cmya()

EAPI void imlib_context_set_color_cmya | ( | int | cyan,
|  | int | magenta,
|  | int | yellow,
|  | int | alpha )

Set the drawing color in CMYA space

Values for `cyan`, `magenta`, `yellow` and `alpha` are between 0 and 255

- any other values have undefined results.

Parameters

  cyan | Cyan channel of the color
  magenta | Magenta channel of the color
  yellow | Yellow channel of the color
  alpha | Alpha channel of the color

## ◆ imlib_context_set_color_hlsa()

EAPI void imlib_context_set_color_hlsa | ( | float | hue,
|  | float | lightness,
|  | float | saturation,
|  | int | alpha )

Set the drawing 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.

Parameters

  hue | Hue channel of the color
  lightness | Lightness channel of the color
  saturation | Saturation channel of the color
  alpha | Alpha channel of the color

## ◆ imlib_context_set_color_hsva()

EAPI void imlib_context_set_color_hsva | ( | float | hue,
|  | float | saturation,
|  | float | value,
|  | int | alpha )

Set the drawing 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.

Parameters

  hue | Hue channel of the color
  saturation | Saturation channel of the color
  value | Value channel of the color
  alpha | Alpha channel of the color

## ◆ imlib_context_set_color_modifier()

EAPI void imlib_context_set_color_modifier | ( | Imlib_Color_Modifier | color_modifier | ) |

Set the color modifier

The color modifier is used when 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.

Parameters

  color_modifier | The color modifier

## ◆ imlib_context_set_color_range()

EAPI void imlib_context_set_color_range | ( | Imlib_Color_Range | color_range | ) |

Set the color range to use for rendering gradients

Parameters

  color_range | Color range

## ◆ imlib_context_set_colormap()

EAPI void imlib_context_set_colormap | ( | Colormap | colormap | ) |

Set the colormap to use when rendering to drawables and allocating colors

You must set this to render any images or produce pixmaps (this can be the default colormap).

Parameters

  colormap | The Colormap to use

## ◆ imlib_context_set_direction()

EAPI void imlib_context_set_direction | ( | Imlib_Text_Direction | direction | ) |

Set the text drawing 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().

Parameters

  direction | The text direction

## ◆ imlib_context_set_display()

EAPI void imlib_context_set_display | ( | Display * | display | ) |

Set the X display to use 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.

Parameters

  display | The Display to use

## ◆ imlib_context_set_dither()

EAPI void imlib_context_set_dither | ( | char | dither | ) |

Set dithering mode

Sets the dithering flag for rendering to a drawable or when pixmaps are produced. This affects the color image appearance. Dithering slows down rendering but produces considerably better results. This option has no effect for 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 dithering and 0 disables dithering.

Parameters

  dither | The dithering flag

## ◆ imlib_context_set_dither_mask()

EAPI void imlib_context_set_dither_mask | ( | char | dither_mask | ) |

Set mask dithering mode

When rendering to a mask or producing pixmap masks from images dither_mask selects 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.

Parameters

  dither_mask | The dither mask flag

## ◆ imlib_context_set_drawable()

EAPI void imlib_context_set_drawable | ( | Drawable | drawable | ) |

Set the X drawable to which images will be rendered

This may be either a pixmap or a window. You must set this to render anything.

Parameters

  drawable | An X Drawable

## ◆ imlib_context_set_filter()

EAPI void imlib_context_set_filter | ( | Imlib_Filter | filter | ) |

Set the current image filter

Set this to NULL to disable filters.

Parameters

  filter | The filter

## ◆ imlib_context_set_font()

EAPI void imlib_context_set_font | ( | Imlib_Font | font | ) |

Set the font to use when rendering text

The font should be loaded first with imlib_load_font().

Parameters

  font | The font

## ◆ imlib_context_set_image()

EAPI void imlib_context_set_image | ( | Imlib_Image | image | ) |

Set the image Imlib2 will be using with its function calls

Parameters

  image | The image

## ◆ imlib_context_set_image_data_memory_function()

EAPI void imlib_context_set_image_data_memory_function | ( | Imlib_Image_Data_Memory_Function | memory_function | ) |

Set the image data memory management function

Parameters

  memory_function | The image data memory management function

## ◆ imlib_context_set_mask()

EAPI void imlib_context_set_mask | ( | Pixmap | mask | ) |

Set the 1-bit deep pixmap to be drawn to when generating 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.

Parameters

  mask | A pixmap with depth 1

## ◆ imlib_context_set_mask_alpha_threshold()

EAPI void imlib_context_set_mask_alpha_threshold | ( | int | mask_alpha_threshold | ) |

Set mask alpha threshold

When rendering to a mask or producing pixmap masks from images mask_alpha_threshold selects the alpha threshold above which mask bits are set. The default mask alpha threshold is 128, meaning that a mask bit will be set if the pixel alpha is >= 128.

Parameters

  mask_alpha_threshold | The mask alpha threshold

## ◆ imlib_context_set_operation()

EAPI void imlib_context_set_operation | ( | Imlib_Operation | operation | ) |

Set drawing 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. 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) IMLIB_OP_RESHADE does DST = DST + (((SRC - * 0.5) / 2) * A).

Parameters

  operation | The drawing operation

## ◆ imlib_context_set_progress_function()

EAPI void imlib_context_set_progress_function | ( | Imlib_Progress_Function | progress_function | ) |

Set 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.

Parameters

  progress_function | The progress function

## ◆ imlib_context_set_progress_granularity()

EAPI void imlib_context_set_progress_granularity | ( | char | progress_granularity | ) |

Set progress callback granularity

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.

Parameters

  progress_granularity | The progress granularity

## ◆ imlib_context_set_TTF_encoding()

IMLIB2_DEPRECATED EAPI void imlib_context_set_TTF_encoding | ( | Imlib_TTF_Encoding | encoding | ) |

Deprecated function - hasn't done anything useful in ~20 years

Deprecated
  Useless - don't use

## ◆ imlib_context_set_visual()

EAPI void imlib_context_set_visual | ( | Visual * | visual | ) |

Set the visual to use when rendering images to drawables

You need to set this for anything to render to a drawable or produce pixmaps (this can be the default visual).

Parameters

  visual | The Visual to use

## ◆ imlib_copy_drawable_to_image()

EAPI char imlib_copy_drawable_to_image | ( | Pixmap | mask,
|  | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | char | need_to_grab_x )

Copy part of drawable to image

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). If `mask` is 1 the mask will be set to the shape mask of the drawable. It grabs the (`src_x`, `src_y`, `src_width`, `src_height`) rectangle and places it at the destination (`dst_x`, `dst_y`) location in the current image. If `need_to_grab_x` is 1 the X Server s grabbed to avoid possible race conditions. Set to 1 unless the server is already grabbed.

Parameters

  mask | A mask
  src_x | The top left x coordinate of the rectangle
  src_y | The top left y coordinate of the rectangle
  src_width | The width of the rectangle
  src_height | The height of the rectangle
  dst_x | The x coordinate of the new location
  dst_y | The x coordinate of the new location
  need_to_grab_x | Grab flag

Returns
  1 on success, 0 otherwise

## ◆ imlib_create_color_modifier()

EAPI Imlib_Color_Modifier imlib_create_color_modifier | ( | void |  | ) |

Create empty color modifier

Creates a new empty color modifier and returns a valid handle on success. NULL is returned on failure.

Returns
  Color modifier handle (NULL on failure)

## ◆ imlib_create_color_range()

EAPI Imlib_Color_Range imlib_create_color_range | ( | void |  | ) |

Create empty color range

Returns
  Color range handle (NULL on error)

## ◆ imlib_create_cropped_image()

EAPI Imlib_Image imlib_create_cropped_image | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height )

Create cropped image

Creates a duplicate of a (`x`, `y`, `width`, `height`) rectangle in the current image.

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
  Image handle (NULL on failure)

## ◆ imlib_create_cropped_scaled_image()

EAPI Imlib_Image imlib_create_cropped_scaled_image | ( | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_width,
|  | int | dst_height )

Create cropped and scaled image

Works the same as imlib_create_cropped_image() but will scale the new image to the new destination `dst_width` and `dst_height` whilst cropping.

Parameters

  src_x | The top left x coordinate of the source rectangle
  src_y | The top left y coordinate of the source rectangle
  src_width | The width of the source rectangle
  src_height | The height of the source rectangle
  dst_width | The width of the destination image
  dst_height | The height of the destination image

Returns
  Image handle (NULL on failure)

## ◆ imlib_create_filter()

EAPI Imlib_Filter imlib_create_filter | ( | int | initsize | ) |

Create image filter object

## ◆ imlib_create_image()

EAPI Imlib_Image imlib_create_image | ( | int | width,
|  | int | height )

Create 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.

Parameters

  width | The width of the image
  height | The height of the image

Returns
  A new blank image on success or NULL on failure

## ◆ imlib_create_image_from_drawable()

EAPI Imlib_Image imlib_create_image_from_drawable | ( | Pixmap | mask,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | char | need_to_grab_x )

Create image from drawable

Return an image (using the mask `mask` to determine the alpha channel) from the current drawable. If `mask` is 0 it will not create a useful alpha channel in the image. If `mask` is 1 the mask will be set to the shape mask of the drawable. It will create an image from the (`x`, `y`, `width` , `height`) rectangle in the drawable. If `need_to_grab_x` is 1 the X Server s grabbed to avoid possible race conditions. Set to 1 unless the server is already grabbed. If you have not already grabbed the server you MUST set this to 1.

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
  Image handle (NULL on failure)

## ◆ imlib_create_image_from_ximage()

EAPI Imlib_Image imlib_create_image_from_ximage | ( | XImage * | image,
|  | XImage * | mask,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | char | need_to_grab_x )

Create image from XImage

Parameters

  image | An XImage
  mask | An XImage 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
  Image handle (NULL on failure)

## ◆ imlib_create_image_using_copied_data()

EAPI Imlib_Image imlib_create_image_using_copied_data | ( | int | width,
|  | int | height,
|  | uint32_t * | data )

Create a new image using given pixel data

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.

Parameters

  width | The width of the image
  height | The height of the image
  data | The data

Returns
  Image handle (NULL on failure)

## ◆ imlib_create_image_using_data()

EAPI Imlib_Image imlib_create_image_using_data | ( | int | width,
|  | int | height,
|  | uint32_t * | data )

Create a new image using given pixel data

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. 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. On success an image handle is returned - otherwise NULL is returned.

Parameters

  width | The width of the image
  height | The height of the image
  data | The data

Returns
  Image handle (NULL on failure)

## ◆ imlib_create_image_using_data_and_memory_function()

EAPI Imlib_Image imlib_create_image_using_data_and_memory_function | ( | int | width,
|  | int | height,
|  | uint32_t * | data,
|  | Imlib_Image_Data_Memory_Function | func )

Create a new image using given pixel data and memory management function

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. The memory management function `func` is responsible for freeing this image data once the image is freed.

Parameters

  width | The width of the image
  height | The height of the image
  data | The data
  func | The memory management function

Returns
  Image handle (NULL on failure)

## ◆ imlib_create_rotated_image()

EAPI Imlib_Image imlib_create_rotated_image | ( | double | angle | ) |

Create rotated image

Creates a new copy of the current image, but rotated by `angle` radians.

Parameters

  angle | An angle in radians

Returns
  Image handle (NULL on failure)

## ◆ imlib_create_scaled_image_from_drawable()

EAPI Imlib_Image imlib_create_scaled_image_from_drawable | ( | Pixmap | mask,
|  | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_width,
|  | int | dst_height,
|  | char | need_to_grab_x,
|  | char | get_mask_from_shape )

Create image from drawable, scaled

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 (`src_x`, `src_y`, `src_width`, `src_height`) rectangle will be grabbed, scaled to the destination `dst_width` and `dst_height`, then converted to an image. If `need_to_grab_x` is 1 the X Server s grabbed to avoid possible race conditions. Set to 1 unless the server is already grabbed. If `get_mask_from_shape` and the current drawable is a window its shape is used for determining the alpha channel.

Parameters

  mask | A mask
  src_x | The top left x coordinate of the rectangle
  src_y | The top left y coordinate of the rectangle
  src_width | The width of the rectangle
  src_height | The height of the rectangle
  dst_width | The width of the returned image
  dst_height | The height of the returned image
  need_to_grab_x | Grab flag
  get_mask_from_shape | A char

Returns
  Image handle (NULL on failure)

## ◆ imlib_flush_font_cache()

EAPI void imlib_flush_font_cache | ( | void |  | ) |

Flush all speculatively cached fonts from the font cache

## ◆ imlib_flush_loaders()

EAPI void imlib_flush_loaders | ( | void |  | ) |

Flush loader cache

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)

## ◆ imlib_free_color_modifier()

EAPI void imlib_free_color_modifier | ( | void |  | ) |

Free the current color modifier

## ◆ imlib_free_color_range()

EAPI void imlib_free_color_range | ( | void |  | ) |

Free the current color range

## ◆ imlib_free_filter()

EAPI void imlib_free_filter | ( | void |  | ) |

Free the current image filter

## ◆ imlib_free_font()

EAPI void imlib_free_font | ( | void |  | ) |

Unload current font

## ◆ imlib_free_font_list()

EAPI void imlib_free_font_list | ( | char ** | font_list,
|  | int | number )

Free the font list returned by imlib_list_fonts()

Parameters

  font_list | The font list
  number | Number of fonts in the list

## ◆ imlib_free_image()

EAPI void imlib_free_image | ( | void |  | ) |

Free the current image

## ◆ imlib_free_image_and_decache()

EAPI void imlib_free_image_and_decache | ( | void |  | ) |

Free the current image AND remove it from the cache

## ◆ imlib_free_pixmap_and_mask()

EAPI void imlib_free_pixmap_and_mask | ( | Pixmap | pixmap | ) |

Free `pixmap` and any associated mask

The pixmap will remain cached until the image the pixmap was generated from is dirtied or decached, or the cache is flushed.

Parameters

  pixmap | The pixmap

## ◆ imlib_get_best_visual()

EAPI Visual * imlib_get_best_visual | ( | Display * | display,
|  | int | screen,
|  | int * | depth_return )

Return the visual that Imlib2 thinks will give you the best quality output

If not NULL `depth_return` will return the depth of the visual.

Parameters

  display | The display
  screen | The screen
  depth_return | The depth of the returned visual

Returns
  The best visual

## ◆ imlib_get_cache_size()

EAPI int imlib_get_cache_size | ( | void |  | ) |

Return the current maximum size of the image cache in bytes

The cache is a unified cache used for image data AND pixmaps.

Returns
  The current image cache max size

## ◆ imlib_get_cache_used()

EAPI int imlib_get_cache_used | ( | void |  | ) |

Return the current size of the image cache in bytes

The cache is a unified cache used for image data AND pixmaps.

Returns
  The current image cache memory usage

## ◆ imlib_get_color_modifier_tables()

EAPI void imlib_get_color_modifier_tables | ( | uint8_t * | red_table,
|  | uint8_t * | green_table,
|  | uint8_t * | blue_table,
|  | uint8_t * | alpha_table )

Get current color modifier tables

Copies the table values from the current color modifier into the pointers to mapping tables specified. They must have 256 entries and be uint8_t format.

Parameters

  red_table | A 256 element uint8_t array
  green_table | A 256 element uint8_t array
  blue_table | A 256 element uint8_t array
  alpha_table | A 256 element uint8_t array

## ◆ imlib_get_color_usage()

EAPI int imlib_get_color_usage | ( | void |  | ) |

Get the maximum number of colors Imlib2 is allowed to allocate

The default is 256.

Returns
  The current maximum number of colors

## ◆ imlib_get_error()

EAPI int imlib_get_error | ( | void |  | ) |

Get error code from previous imlib function call

The error code is set in function calls that involve direct or indirect image loading or saving.

Returns
  error code 0: Success, positive: Regular errnos, negative: IMLIB_ERR_... values, see above

## ◆ imlib_get_font_ascent()

EAPI int imlib_get_font_ascent | ( | void |  | ) |

Return the current font's ascent

Returns
  The font's ascent value in pixels

## ◆ imlib_get_font_cache_size()

EAPI int imlib_get_font_cache_size | ( | void |  | ) |

Return the font cache size

Returns
  The font cache size in bytes

## ◆ imlib_get_font_descent()

EAPI int imlib_get_font_descent | ( | void |  | ) |

Return the current font's descent

Returns
  The font's descent value in pixels

## ◆ imlib_get_maximum_font_ascent()

EAPI int imlib_get_maximum_font_ascent | ( | void |  | ) |

Return the current font's maximum ascent

Returns
  The font's maximum ascent

## ◆ imlib_get_maximum_font_descent()

EAPI int imlib_get_maximum_font_descent | ( | void |  | ) |

Return the current font's maximum descent

Returns
  The font's maximum descent

## ◆ imlib_get_next_font_in_fallback_chain()

EAPI Imlib_Font imlib_get_next_font_in_fallback_chain | ( | Imlib_Font | fn | ) |

Return next font in font fallback chain

## ◆ imlib_get_prev_font_in_fallback_chain()

EAPI Imlib_Font imlib_get_prev_font_in_fallback_chain | ( | Imlib_Font | fn | ) |

Return previous font in font fallback chain

## ◆ imlib_get_text_advance()

EAPI void imlib_get_text_advance | ( | const char * | text,
|  | int * | horizontal_advance_return,
|  | int * | vertical_advance_return )

Get text advances

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.

Parameters

  text | A string
  horizontal_advance_return | Horizontal offset
  vertical_advance_return | Vertical offset

## ◆ imlib_get_text_inset()

EAPI int imlib_get_text_inset | ( | const char * | text | ) |

Get text inset

Returns the inset of the first character of `text` in using the current font and returns that value in pixels.

Parameters

  text | A string

Returns
  The inset value of `text`

## ◆ imlib_get_text_size()

EAPI void imlib_get_text_size | ( | const char * | text,
|  | int * | width_return,
|  | int * | height_return )

Get text size

Gets the width and height in pixels the `text` string would use up if drawn with the current font.

Parameters

  text | A string
  width_return | The width of the text
  height_return | The height of the text

## ◆ imlib_get_visual_depth()

EAPI int imlib_get_visual_depth | ( | Display * | display,
|  | Visual * | visual )

Convenience function that returns the depth of a visual

Parameters

  display | The display
  visual | The visual

## ◆ imlib_get_ximage_cache_count_max()

EAPI int imlib_get_ximage_cache_count_max | ( | void |  | ) |

Return the maximum number of XImages to cache

Returns
  The current XImage cache max count

## ◆ imlib_get_ximage_cache_count_used()

EAPI int imlib_get_ximage_cache_count_used | ( | void |  | ) |

Return the current number of cached XImages

Returns
  The current number of cached XImages

## ◆ imlib_get_ximage_cache_size_max()

EAPI int imlib_get_ximage_cache_size_max | ( | void |  | ) |

Return the XImage cache maximum size

Returns
  The current XImage cache max size

## ◆ imlib_get_ximage_cache_size_used()

EAPI int imlib_get_ximage_cache_size_used | ( | void |  | ) |

Return the current XImage cache memory usage

Returns
  The current XImage cache memory usage

## ◆ imlib_image_attach_data_value()

EAPI void imlib_image_attach_data_value | ( | const char * | key,
|  | void * | data,
|  | int | value,
|  | Imlib_Data_Destructor_Function | destructor_function )

Attach data to image

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.

Parameters

  key | The key
  data | A pointer
  value | A value
  destructor_function | An Imlib internal function

## ◆ imlib_image_blur()

EAPI void imlib_image_blur | ( | int | radius | ) |

Blur 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.

Parameters

  radius | The radius

## ◆ imlib_image_clear()

EAPI void imlib_image_clear | ( | void |  | ) |

Clear current image

Set all pixels values to 0.

## ◆ imlib_image_clear_color()

EAPI void imlib_image_clear_color | ( | int | r,
|  | int | g,
|  | int | b,
|  | int | a )

Set all current image pixels to given color

## ◆ imlib_image_copy_alpha_rectangle_to_image()

EAPI void imlib_image_copy_alpha_rectangle_to_image | ( | Imlib_Image | image_source,
|  | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y )

Copy partial image alpha

Copies the source (`src_x`, `src_y`, `src_width`, `src_height`) rectangle alpha channel from the source image `image_source` and replaces the alpha channel on the destination image at the (`dst_x`, `dst_y`) coordinates.

Parameters

  image_source | An image
  src_x | The top left x coordinate of the rectangle
  src_y | The top left y coordinate of the rectangle
  src_width | The width of the rectangle
  src_height | The height of the rectangle
  dst_x | The top left x coordinate of the destination rectangle
  dst_y | The top left x coordinate of the destination rectangle

## ◆ imlib_image_copy_alpha_to_image()

EAPI void imlib_image_copy_alpha_to_image | ( | Imlib_Image | image_source,
|  | int | x,
|  | int | y )

Copy image alpha

Copies the alpha channel of the source image `image_source` to the (`x`, `y`) coordinates of the current image, replacing the alpha channel there.

Parameters

  image_source | An image
  x | The x coordinate
  y | The y coordinate

## ◆ imlib_image_copy_rect()

EAPI void imlib_image_copy_rect | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | int | new_x,
|  | int | new_y )

Copy image part within image

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.

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

## ◆ imlib_image_decache_file()

EAPI int imlib_image_decache_file | ( | const char * | file | ) |

Invalidate all cached images associated with file

Parameters

  file | filename to decache

Returns
  The number of images decached

## ◆ imlib_image_draw_ellipse()

EAPI void imlib_image_draw_ellipse | ( | int | xc,
|  | int | yc,
|  | int | a,
|  | int | b )

Draw an ellipse (no fill)

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.

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

## ◆ imlib_image_draw_line()

EAPI Imlib_Updates imlib_image_draw_line | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2,
|  | char | make_updates )

Draw a line

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.

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

## ◆ imlib_image_draw_pixel()

EAPI Imlib_Updates imlib_image_draw_pixel | ( | int | x,
|  | int | y,
|  | char | make_updates )

Draw a pixel

Draws a pixel using the urrent color on the current image at coordinate (`x1`, `y1`). If `make_updates` is 1 it will also return an update you can use for an updates list, otherwise it returns NULL.

Parameters

  x | The x coordinate of the first point
  y | The y coordinate of the first point
  make_updates | Make updates flag

Returns
  An updates list

## ◆ imlib_image_draw_polygon()

EAPI void imlib_image_draw_polygon | ( | ImlibPolygon | poly,
|  | unsigned char | closed )

Draw a polygon (no fill)

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.

Parameters

  poly | A polygon
  closed | Closed polygon flag

## ◆ imlib_image_draw_rectangle()

EAPI void imlib_image_draw_rectangle | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height )

Draw a rectangle (no fill)

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.

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

## ◆ imlib_image_fill_color_range_rectangle()

EAPI void imlib_image_fill_color_range_rectangle | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | double | angle )

Fill image rectangle with color range

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.

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

## ◆ imlib_image_fill_ellipse()

EAPI void imlib_image_fill_ellipse | ( | int | xc,
|  | int | yc,
|  | int | a,
|  | int | b )

Draw an ellipse (filled)

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.

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

## ◆ imlib_image_fill_hsva_color_range_rectangle()

EAPI void imlib_image_fill_hsva_color_range_rectangle | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | double | angle )

Fill image rectangle with HSVA color range

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.

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

## ◆ imlib_image_fill_polygon()

EAPI void imlib_image_fill_polygon | ( | ImlibPolygon | poly | ) |

Draw a polygon (filled)

Fills the area defined by the polygon `polyon` the current context image with the current context color.

Parameters

  poly | A polygon

## ◆ imlib_image_fill_rectangle()

EAPI void imlib_image_fill_rectangle | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height )

Draw rectangle (filled)

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.

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

## ◆ imlib_image_filter()

EAPI void imlib_image_filter | ( | void |  | ) |

Filter current image with current filter

## ◆ imlib_image_flip_diagonal()

EAPI void imlib_image_flip_diagonal | ( | void |  | ) |

Flip/mirror the current image diagonally

Good for quick and dirty 90 degree rotations if used before or after a horizontal or vertical flip.

## ◆ imlib_image_flip_horizontal()

EAPI void imlib_image_flip_horizontal | ( | void |  | ) |

Flip/mirror the current image horizontally

## ◆ imlib_image_flip_vertical()

EAPI void imlib_image_flip_vertical | ( | void |  | ) |

Flip/mirror the current image vertically

## ◆ imlib_image_format()

EAPI char * imlib_image_format | ( | void |  | ) |

Return the current image's format

Do not free this string. Duplicate it if you need it for later use.

Returns
  Current image format

## ◆ imlib_image_get_attached_data()

EAPI void * imlib_image_get_attached_data | ( | const char * | key | ) |

Get attached image data

Gets the data attached to the current image with the key `key` specified.

Parameters

  key | The key

Returns
  The attached data as a pointer, or NULL if none

## ◆ imlib_image_get_attached_value()

EAPI int imlib_image_get_attached_value | ( | const char * | key | ) |

Get attached image data value

Returns the value attached to the current image with the specified key `key`. If none could be found 0 is returned.

Parameters

  key | The key

Returns
  The attached value as an integer, or 0 if none

## ◆ imlib_image_get_border()

EAPI void imlib_image_get_border | ( | Imlib_Border * | border | ) |

Get image border

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.

Parameters

  border | Returns the image border

## ◆ imlib_image_get_data()

EAPI uint32_t * imlib_image_get_data | ( | void |  | ) |

Get a pointer to the image data for the current image

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 uint32_t (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.

Returns
  A pointer to the image data

## ◆ imlib_image_get_data_for_reading_only()

EAPI uint32_t * imlib_image_get_data_for_reading_only | ( | void |  | ) |

Get a pointer to the image data for the current image (read-only)

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.

Returns
  A pointer to the image data

## ◆ imlib_image_get_filename()

EAPI const char * imlib_image_get_filename | ( | void |  | ) |

Get the filename for the current image

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.

Returns
  The current image filename

## ◆ imlib_image_get_frame_info()

EAPI void imlib_image_get_frame_info | ( | Imlib_Frame_Info * | info | ) |

Get information about current image frame

Parameters

  info | Imlib_Frame_Info struct returning the information

## ◆ imlib_image_get_height()

EAPI int imlib_image_get_height | ( | void |  | ) |

Get the height in pixels of the current image

## ◆ imlib_image_get_width()

EAPI int imlib_image_get_width | ( | void |  | ) |

Get the width in pixels of the current image

## ◆ imlib_image_has_alpha()

EAPI char imlib_image_has_alpha | ( | void |  | ) |

Return whether or not the current image has an alpa channel

Returns 1 if the current context image has an alpha channel, or 0 if it does not.

Returns
  Current alpha channel flag

## ◆ imlib_image_orientate()

EAPI void imlib_image_orientate | ( | int | orientation | ) |

Rotate the current image

Performs 90 degree rotations on the current image. 0 does not rotate, 1 rotates clockwise by 90 degree, 2, rotates clockwise by 180 degrees, 3 rotates clockwise by 270 degrees.

Parameters

  orientation | The orientation

## ◆ imlib_image_put_back_data()

EAPI void imlib_image_put_back_data | ( | uint32_t * | data | ) |

Put back `data` obtained by imlib_image_get_data().

`data` must be returned by imlib_image_get_data().

Parameters

  data | The pointer to the image data

## ◆ imlib_image_query_pixel()

EAPI void imlib_image_query_pixel | ( | int | x,
|  | int | y,
|  | Imlib_Color * | color_return )

Get image pixel value at given location

Fills the `color_return` color structure with the color of the pixel in the current image that is at the (`x`, `y`) location.

Parameters

  x | The x coordinate of the pixel
  y | The y coordinate of the pixel
  color_return | The returned color

## ◆ imlib_image_query_pixel_cmya()

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

Get image pixel value at given location - CMYA space

Parameters

  x | The 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

## ◆ imlib_image_query_pixel_hlsa()

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

Get image pixel value at given location - HLSA space

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

## ◆ imlib_image_query_pixel_hsva()

EAPI void imlib_image_query_pixel_hsva | ( | int | x,
|  | int | y,
|  | float * | hue,
|  | float * | saturation,
|  | float * | value,
|  | int * | alpha )

Get image pixel value at given location - HSVA space

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

## ◆ imlib_image_remove_and_free_attached_data_value()

EAPI void imlib_image_remove_and_free_attached_data_value | ( | const char * | key | ) |

Detach image data

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()).

Parameters

  key | The key

## ◆ imlib_image_remove_attached_data_value()

EAPI void imlib_image_remove_attached_data_value | ( | const char * | key | ) |

Detach image data

Detaches the data & value attached with the specified key `key` from the current image.

Parameters

  key | The key

## ◆ imlib_image_scroll_rect()

EAPI void imlib_image_scroll_rect | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | int | delta_x,
|  | int | delta_y )

Scroll image

Scrolls a rectangle of size `width`, `height` at the (`x`, `y`) location within the current image by the `delta_x`, `delta_y` distance.

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

## ◆ imlib_image_set_border()

EAPI void imlib_image_set_border | ( | Imlib_Border * | border | ) |

Set image border

Parameters

  border | Image border

## ◆ imlib_image_set_changes_on_disk()

EAPI void imlib_image_set_changes_on_disk | ( | void |  | ) |

Force timestamp check on next load

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.

## ◆ imlib_image_set_format()

EAPI void imlib_image_set_format | ( | const char * | format | ) |

Set image format

This formt is used 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.

Parameters

  format | Image format

## ◆ imlib_image_set_has_alpha()

EAPI void imlib_image_set_has_alpha | ( | char | has_alpha | ) |

Set the alpha flag for the current image

Set `has_alpha` to 1 to enable the alpha channel or 0 to disable it.

Parameters

  has_alpha | Alpha flag

## ◆ imlib_image_set_irrelevant_alpha()

IMLIB2_DEPRECATED EAPI void imlib_image_set_irrelevant_alpha | ( | char | irrelevant | ) |

Deprecated function - hasn't done anything useful ever

Deprecated
  Useless - don't use

## ◆ imlib_image_set_irrelevant_border()

IMLIB2_DEPRECATED EAPI void imlib_image_set_irrelevant_border | ( | char | irrelevant | ) |

Deprecated function - hasn't done anything useful ever

Deprecated
  Useless - don't use

## ◆ imlib_image_set_irrelevant_format()

EAPI void imlib_image_set_irrelevant_format | ( | char | irrelevant | ) |

Set 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.

Parameters

  irrelevant | Irrelevant format flag

## ◆ imlib_image_sharpen()

EAPI void imlib_image_sharpen | ( | int | radius | ) |

Sharpen the current image

The `radius` value affects how much to sharpen by.

Parameters

  radius | The radius

## ◆ imlib_image_tile()

EAPI void imlib_image_tile | ( | void |  | ) |

Modify current image for horizontal and vertical tiling

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

## ◆ imlib_image_tile_horizontal()

EAPI void imlib_image_tile_horizontal | ( | void |  | ) |

Modify current image for horizontal tiling

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

## ◆ imlib_image_tile_vertical()

EAPI void imlib_image_tile_vertical | ( | void |  | ) |

Modify current image for vertical tiling

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

## ◆ imlib_insert_font_into_fallback_chain()

EAPI int imlib_insert_font_into_fallback_chain | ( | Imlib_Font | font,
|  | Imlib_Font | fallback_font )

Add font to fallback chain

This arranges for the given fallback font to be used if a glyph does not exist in the given font when text is being rendered. Fonts can be arranged in an aribitrarily long chain and attempts will be made in order on the chain. Cycles in the chain are not possible since the given fallback font is removed from any chain it's already in. A fallback font may be a member of only one chain. Adding it as the fallback font to another font will remove it from it's first fallback chain.

Parameters

  font | A previously loaded font
  fallback_font | A previously loaded font to be chained to the given font

Returns
  0 on success

## ◆ imlib_list_font_path()

EAPI char ** imlib_list_font_path | ( | int * | number_return | ) |

Return font path list

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`.

Parameters

  number_return | Number of paths in the list

Returns
  A list of strings

## ◆ imlib_list_fonts()

EAPI char ** imlib_list_fonts | ( | int * | number_return | ) |

Return a list of fonts imlib2 can find in its font path

Parameters

  number_return | Number of fonts in the list

Returns
  A list of fonts

## ◆ imlib_load_font()

EAPI Imlib_Font imlib_load_font | ( | const char * | font_name | ) |

Load a truetype font

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.

Parameters

  font_name | The font name with the size

Returns
  NULL if no font found

## ◆ imlib_load_image()

EAPI Imlib_Image imlib_load_image | ( | const char * | file | ) |

Load an image from file (header only)

Please see the section How Image Loading Works for more detail.

Parameters

  file | File name

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_fd()

EAPI Imlib_Image imlib_load_image_fd | ( | int | fd,
|  | const char * | file )

Read an image from file descriptor

The file name `file` is only used to guess the file format. The image is loaded without deferred image data decoding and without looking in the cache.

`fd` must be mmap'able (so it cannot be a pipe). `fd` will be closed after calling this function.

Parameters

  fd | Image file descriptor
  file | File name

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_frame()

EAPI Imlib_Image imlib_load_image_frame | ( | const char * | file,
|  | int | frame )

Load image frame

Loads the specified frame within the image. On success an image handle is returned, otherwise NULL is returned (e.g. if the requested frame does not exist). The image is loaded immediately.

Parameters

  file | Image file
  frame | Frame number

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_frame_mem()

EAPI Imlib_Image imlib_load_image_frame_mem | ( | const char * | file,
|  | int | frame,
|  | const void * | data,
|  | size_t | size )

Load image frame form memory

Loads the specified frame within the image from memory. The file name `file` is only used to guess the file format. On success an image handle is returned, otherwise NULL is returned (e.g. if the requested frame does not exist). The image is loaded immediately.

Parameters

  file | File name
  frame | Frame number
  data | Image data
  size | Image data size

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_immediately()

EAPI Imlib_Image imlib_load_image_immediately | ( | const char * | file | ) |

Load an image from file "immediately" (header and data)

This forces the image data to be decoded at load time instead of decoding being deferred until it is needed.

Parameters

  file | File name

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_immediately_without_cache()

EAPI Imlib_Image imlib_load_image_immediately_without_cache | ( | const char * | file | ) |

Load an image "immediately" without looking in the cache first

Parameters

  file | File name

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_mem()

EAPI Imlib_Image imlib_load_image_mem | ( | const char * | file,
|  | const void * | data,
|  | size_t | size )

Read an image from memory

The file name `file` is only used to guess the file format. The image is loaded without deferred image data decoding and without looking in the cache.

Parameters

  file | File name
  data | Image data
  size | Image data size

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_with_errno_return()

EAPI Imlib_Image imlib_load_image_with_errno_return | ( | const char * | file,
|  | int * | error_return )

Load an image from file with error return

The image is loaded without deferred image data decoding.

On error `error_return` is set to the detail of the error. error values: 0: Success, positive: Regular errnos, negative: IMLIB_ERR_... values, see above

Parameters

  file | File name
  error_return | The returned error

Returns
  Image handle (NULL on failure)

## ◆ imlib_load_image_with_error_return()

EAPI Imlib_Image imlib_load_image_with_error_return | ( | const char * | file,
|  | Imlib_Load_Error * | error_return )

Load an image from file with error return

The image is loaded without deferred image data decoding.

On error `error_return` is set to the detail of the error.

Parameters

  file | File name
  error_return | The returned error

Returns
  Image handle (NULL on failure)

Deprecated
  Use imlib_load_image_with_errno_return()

## ◆ imlib_load_image_without_cache()

EAPI Imlib_Image imlib_load_image_without_cache | ( | const char * | file | ) |

Load an image without looking in the cache first

Parameters

  file | File name

Returns
  Image handle (NULL on failure)

## ◆ imlib_modify_color_modifier_brightness()

EAPI void imlib_modify_color_modifier_brightness | ( | double | brightness_value | ) |

Modify current color modifier 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.

Parameters

  brightness_value | Value of brightness

## ◆ imlib_modify_color_modifier_contrast()

EAPI void imlib_modify_color_modifier_contrast | ( | double | contrast_value | ) |

Modify current color modifier 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.

Parameters

  contrast_value | Value of contrast

## ◆ imlib_modify_color_modifier_gamma()

EAPI void imlib_modify_color_modifier_gamma | ( | double | gamma_value | ) |

Modify current color modifier 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.

Parameters

  gamma_value | Value of gamma

## ◆ imlib_polygon_add_point()

EAPI void imlib_polygon_add_point | ( | ImlibPolygon | poly,
|  | int | x,
|  | int | y )

Add point to polygon

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.

Parameters

  poly | A polygon
  x | The X coordinate
  y | The Y coordinate

## ◆ imlib_polygon_contains_point()

EAPI unsigned char imlib_polygon_contains_point | ( | ImlibPolygon | poly,
|  | int | x,
|  | int | y )

Check if polygon contains point

Returns non-zero if the point (`x`, `y`) is within the area defined by the polygon `poly`.

Parameters

  poly | A polygon
  x | The X coordinate
  y | The Y coordinate

Returns
  non-zero if point is inside polygon

## ◆ imlib_polygon_free()

EAPI void imlib_polygon_free | ( | ImlibPolygon | poly | ) |

Free a polygon object.

Parameters

  poly | A polygon

## ◆ imlib_polygon_get_bounds()

EAPI void imlib_polygon_get_bounds | ( | ImlibPolygon | poly,
|  | int * | px1,
|  | int * | py1,
|  | int * | px2,
|  | int * | py2 )

Get polygon bounds

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.

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

## ◆ imlib_polygon_new()

EAPI ImlibPolygon imlib_polygon_new | ( | void |  | ) |

Create empty polygon object

Returns
  a new polygon object with no points set

## ◆ imlib_remove_font_from_fallback_chain()

EAPI void imlib_remove_font_from_fallback_chain | ( | Imlib_Font | fallback_font | ) |

Remove font from fallback chain

This removes the given font from any fallback chain it may be in.

Parameters

  fallback_font | A font previously added to a fallback chain

## ◆ imlib_remove_path_from_font_path()

EAPI void imlib_remove_path_from_font_path | ( | const char * | path | ) |

Remove font path

Removes a font path from the font path list

Parameters

  path | A directory path

## ◆ imlib_render_get_pixel_color()

EAPI uint32_t imlib_render_get_pixel_color | ( | void |  | ) |

Return X11 pixel value of current color

## ◆ imlib_render_image_on_drawable()

EAPI void imlib_render_image_on_drawable | ( | int | x,
|  | int | y )

Render image onto drawable

Renders the current image onto the current drawable at the (`x`, `y`) pixel location specified without scaling.

Parameters

  x | X coordinate of the pixel
  y | Y coordinate of the pixel

## ◆ imlib_render_image_on_drawable_at_angle()

EAPI void imlib_render_image_on_drawable_at_angle | ( | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | int | angle_x,
|  | int | angle_y )

Blend image onto drawable at 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).

Parameters

  src_x | The source x coordinate
  src_y | The source y coordinate
  src_width | The source width
  src_height | The source height
  dst_x | The destination x coordinate
  dst_y | The destination y coordinate
  angle_x | An angle
  angle_y | An angle

## ◆ imlib_render_image_on_drawable_at_size()

EAPI void imlib_render_image_on_drawable_at_size | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height )

Render image onto drawable at given size

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`.

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

## ◆ imlib_render_image_on_drawable_skewed()

EAPI void imlib_render_image_on_drawable_skewed | ( | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | int | h_angle_x,
|  | int | h_angle_y,
|  | int | v_angle_x,
|  | int | v_angle_y )

Blend image onto drawable at angle, skewed

Works just like imlib_blend_image_onto_image_skewed(), except it blends the image onto the current drawable instead of the current image.

Parameters

  src_x | The source x coordinate
  src_y | The source y coordinate
  src_width | The source width
  src_height | The source height
  dst_x | The destination x coordinate
  dst_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

## ◆ imlib_render_image_part_on_drawable_at_size()

EAPI void imlib_render_image_part_on_drawable_at_size | ( | int | src_x,
|  | int | src_y,
|  | int | src_width,
|  | int | src_height,
|  | int | dst_x,
|  | int | dst_y,
|  | int | dst_width,
|  | int | dst_height )

Render part of image onto drawable at given size

Renders the source (`src_x`, `src_y`, `src_width`, `src_height`) pixel rectangle from the current image onto the current drawable at the (`dst_x`, `dst_y`) location scaled to the width `dst_width` and height `dst_height`.

Parameters

  src_x | X coordinate of the source image
  src_y | Y coordinate of the source image
  src_width | Width of the source image
  src_height | Height of the source image
  dst_x | X coordinate of the destination image
  dst_y | Y coordinate of the destination image
  dst_width | Width of the destination image
  dst_height | Height of the destination image

## ◆ imlib_render_pixmaps_for_whole_image()

EAPI void imlib_render_pixmaps_for_whole_image | ( | Pixmap * | pixmap_return,
|  | Pixmap * | mask_return )

Create pixmap/mask of the current image

The mask is generated if the image has an alpha value.

The pixmaps must be freed using imlib_free_pixmap_and_mask().

Parameters

  pixmap_return | The returned pixmap
  mask_return | The returned mask

## ◆ imlib_render_pixmaps_for_whole_image_at_size()

EAPI void imlib_render_pixmaps_for_whole_image_at_size | ( | Pixmap * | pixmap_return,
|  | Pixmap * | mask_return,
|  | int | width,
|  | int | height )

Create pixmap/mask of the current image at given size

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.

Parameters

  pixmap_return | The returned pixmap
  mask_return | The returned mask
  width | Width of the pixmap
  height | Height of the pixmap

## ◆ imlib_reset_color_modifier()

EAPI void imlib_reset_color_modifier | ( | void |  | ) |

Reset current color modifier tables

Resets the current color modifier to have linear mapping tables

## ◆ imlib_rotate_image_from_buffer()

EAPI void imlib_rotate_image_from_buffer | ( | double | angle,
|  | Imlib_Image | src_image )

Rotate image onto image

Rotate @ src_image onto current image.

Parameters

  src_image | The source image
  angle | An angle in radians

## ◆ imlib_save_image()

EAPI void imlib_save_image | ( | const char * | file | ) |

Save image to file

Saves the current image in the format specified by the current image's format setting to the filename `file`. If the image's format is not set, the format is derived from `file`.

Parameters

  file | The file name

## ◆ imlib_save_image_fd()

EAPI void imlib_save_image_fd | ( | int | fd,
|  | const char * | file )

Save image to file descriptor

Saves the current image in the format specified by the current image's format setting to the file given by `fd`. The file name `file` is used only to derive the file format if the image's format is not set.

`fd` will be closed after calling this function.

Parameters

  fd | Image file descriptor
  file | The file name

## ◆ imlib_save_image_with_errno_return()

EAPI void imlib_save_image_with_errno_return | ( | const char * | file,
|  | int * | error_return )

Save image to file with error return

Works the same way imlib_save_image() works, but will set the `error_return` to an error value if the save fails. error values: 0: Success, positive: Regular errnos, negative: IMLIB_ERR_... values, see above

Parameters

  file | The file name
  error_return | The returned error

## ◆ imlib_save_image_with_error_return()

EAPI void imlib_save_image_with_error_return | ( | const char * | file,
|  | Imlib_Load_Error * | error_return )

Save image to file with error return

Works the same way imlib_save_image() works, but will set the `error_return` to an error value if the save fails.

Parameters

  file | The file name
  error_return | The returned error

Deprecated
  Use imlib_save_image_with_errno_return()

## ◆ imlib_set_cache_size()

EAPI void imlib_set_cache_size | ( | int | bytes | ) |

Set 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.

Parameters

  bytes | Image cache max size

## ◆ imlib_set_color_modifier_tables()

EAPI void imlib_set_color_modifier_tables | ( | uint8_t * | red_table,
|  | uint8_t * | green_table,
|  | uint8_t * | blue_table,
|  | uint8_t * | alpha_table )

Set current color modifier tables

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 uint8_t 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).

Parameters

  red_table | A 256 element uint8_t array
  green_table | A 256 element uint8_t array
  blue_table | A 256 element uint8_t array
  alpha_table | A 256 element uint8_t array

## ◆ imlib_set_color_usage()

EAPI void imlib_set_color_usage | ( | int | max | ) |

Set the maximum number of colors Imlib2 is allowed to allocate

The default is 256. This has no effect in depths greater than 8 bit.

Parameters

  max | Maximum number of colors

## ◆ imlib_set_font_cache_size()

EAPI void imlib_set_font_cache_size | ( | int | bytes | ) |

Set the font cache size

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.

Parameters

  bytes | The font cache size in bytes

## ◆ imlib_set_ximage_cache_count_max()

EAPI void imlib_set_ximage_cache_count_max | ( | int | count | ) |

Set the maximum number of XImages to cache

Setting the cache size to 0 effectively flushes the cache and keeps the cached XImage count at 0 until set to another value. Whenever you set the max count Imlib2 will flush as many old XImages from the cache as possible until the current cached XImage count is less than or equal to the cache max count.

Parameters

  count | XImage cache max count

## ◆ imlib_set_ximage_cache_size_max()

EAPI void imlib_set_ximage_cache_size_max | ( | int | bytes | ) |

Set the XImage cache maximum size

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 max size Imlib2 will flush as many old XImages from the cache as possible until the current XImage cache usage is less than or equal to the cache max size.

Parameters

  bytes | XImage cache max size in bytes

## ◆ imlib_strerror()

EAPI const char * imlib_strerror | ( | int | err | ) |

Return string describing error code

`err` must be a value returned by imlib_load/save_image_with_errno_return(). The returned string must not be modified or freed.

Parameters

  err | The error code

Returns
  String describing the error code

## ◆ imlib_text_draw()

EAPI void imlib_text_draw | ( | int | x,
|  | int | y,
|  | const char * | text )

Draw text

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)

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

## ◆ imlib_text_draw_with_return_metrics()

EAPI 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 )

Draw text and return metrics

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).

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

## ◆ imlib_text_get_index_and_location()

EAPI 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 )

Return character number in text

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.

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
  Character number, -1 if no character found

## ◆ imlib_text_get_location_at_index()

EAPI 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 )

Get geometry of character in text

Gets the geometry of the character at index `index` in the `text` string using the current font.

Parameters

  text | A string
  index | The character index
  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

## ◆ imlib_update_append_rect()

EAPI Imlib_Updates imlib_update_append_rect | ( | Imlib_Updates | updates,
|  | int | x,
|  | int | y,
|  | int | w,
|  | int | h )

Append rectangle to updates list

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).

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

## ◆ imlib_updates_append_updates()

EAPI Imlib_Updates imlib_updates_append_updates | ( | Imlib_Updates | updates,
|  | Imlib_Updates | appended_updates )

Append update list to update list

Appends `appended_updates` to the updates list `updates` and returns the new list.

Parameters

  updates | An updates list
  appended_updates | The updates list to append

Returns
  The new updates list

## ◆ imlib_updates_clone()

EAPI Imlib_Updates imlib_updates_clone | ( | Imlib_Updates | updates | ) |

Duplicate update list

Creates a duplicate of an updates list.

Parameters

  updates | An updates list

Returns
  Duplicate of `updates`

## ◆ imlib_updates_free()

EAPI void imlib_updates_free | ( | Imlib_Updates | updates | ) |

Free updates list

Parameters

  updates | An updates list

## ◆ imlib_updates_get_coordinates()

EAPI void imlib_updates_get_coordinates | ( | Imlib_Updates | updates,
|  | int * | x_return,
|  | int * | y_return,
|  | int * | width_return,
|  | int * | height_return )

Return the coordinates of first update in update list

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

## ◆ imlib_updates_get_next()

EAPI Imlib_Updates imlib_updates_get_next | ( | Imlib_Updates | updates | ) |

Get the next update in an updates list

Parameters

  updates | An updates list

Returns
  The next updates

## ◆ imlib_updates_init()

EAPI Imlib_Updates imlib_updates_init | ( | void |  | ) |

Return empty updates list

Initializes an updates list before you add any updates to it or merge it for rendering etc.

Returns
  The initialized updates list

## ◆ imlib_updates_merge()

EAPI Imlib_Updates imlib_updates_merge | ( | Imlib_Updates | updates,
|  | int | w,
|  | int | h )

Merge updates list

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.

Parameters

  updates | An updates list
  w | The width of the rectangle
  h | The height of the rectangle

Returns
  The updates handle

## ◆ imlib_updates_merge_for_rendering()

EAPI Imlib_Updates imlib_updates_merge_for_rendering | ( | Imlib_Updates | updates,
|  | int | w,
|  | int | h )

Merge updates list

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.

Parameters

  updates | An updates list
  w | The width of the rectangle
  h | The height of the rectangle

Returns
  The updates handle

## ◆ imlib_updates_set_coordinates()

EAPI void imlib_updates_set_coordinates | ( | Imlib_Updates | updates,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height )

Modify the coordinates of the first update in update list

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

## ◆ imlib_version()

EAPI int imlib_version | ( | void |  | ) |

Return Imlib2 version