![]() |
Imlib2 1.11.1
|
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_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) |
Imlib2 library API
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).
distance_away | Distance from the previous color |
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.
path | A directory path |
EAPI void imlib_apply_color_modifier | ( | void | ) |
Apply color modifier to image
Uses the current color modifier mapping tables to modify the current image.
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.
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 |
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.
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 |
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).
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 |
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:
will simply scale the image to be 100x100.
will scale the image to be 100x100, and flip it diagonally.
will scale the image and rotate it 90 degrees clockwise.
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).
will rotate the image ‘a’ degrees, with its upper left corner at (50,50).
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 |
EAPI Imlib_Image imlib_clone_image | ( | void | ) |
Clone image
Creates an exact duplicate of the current image.
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.
EAPI void imlib_context_free | ( | Imlib_Context | context | ) |
Free context
EAPI Imlib_Context imlib_context_get | ( | void | ) |
Get context handle
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.
EAPI char imlib_context_get_anti_alias | ( | void | ) |
Return the current "anti-aliasing" mode
EAPI char imlib_context_get_blend | ( | void | ) |
Return current blending mode
EAPI void imlib_context_get_cliprect | ( | int * | x, |
int * | y, | ||
int * | w, | ||
int * | h | ||
) |
Return the current clip rectangle
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 |
EAPI void imlib_context_get_color | ( | int * | red, |
int * | green, | ||
int * | blue, | ||
int * | alpha | ||
) |
Return the current drawing color in RGBA space
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 |
EAPI void imlib_context_get_color_cmya | ( | int * | cyan, |
int * | magenta, | ||
int * | yellow, | ||
int * | alpha | ||
) |
Return the current drawing color in CMYA space
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 |
EAPI void imlib_context_get_color_hlsa | ( | float * | hue, |
float * | lightness, | ||
float * | saturation, | ||
int * | alpha | ||
) |
Return the current drawing color in HLSA space
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 |
EAPI void imlib_context_get_color_hsva | ( | float * | hue, |
float * | saturation, | ||
float * | value, | ||
int * | alpha | ||
) |
Return the current drawing color in HSVA space
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 |
EAPI Imlib_Color_Modifier imlib_context_get_color_modifier | ( | void | ) |
Return the current color modifier
EAPI Imlib_Color_Range imlib_context_get_color_range | ( | void | ) |
Return the current color range being used for gradients
EAPI Colormap imlib_context_get_colormap | ( | void | ) |
Return the current Colormap
EAPI Imlib_Text_Direction imlib_context_get_direction | ( | void | ) |
Return the current direction to render text in
EAPI Display * imlib_context_get_display | ( | void | ) |
Return the current display used for Imlib2's display context
EAPI char imlib_context_get_dither | ( | void | ) |
Return the current dithering mode
EAPI char imlib_context_get_dither_mask | ( | void | ) |
Return the current mask dithering mode
EAPI Drawable imlib_context_get_drawable | ( | void | ) |
Return the current Drawable
EAPI Imlib_Filter imlib_context_get_filter | ( | void | ) |
Get the current image filter
EAPI Imlib_Font imlib_context_get_font | ( | void | ) |
Return the current font
EAPI Imlib_Image imlib_context_get_image | ( | void | ) |
Return the current context image
EAPI Imlib_Image_Data_Memory_Function imlib_context_get_image_data_memory_function | ( | void | ) |
Return the current image data memeory management function
EAPI Imlib_Color * imlib_context_get_imlib_color | ( | void | ) |
Return the current drawing color as a color struct
Do NOT free this pointer.
EAPI Pixmap imlib_context_get_mask | ( | void | ) |
Return the current mask pixmap
EAPI int imlib_context_get_mask_alpha_threshold | ( | void | ) |
Return the current mask alpha threshold
EAPI Imlib_Operation imlib_context_get_operation | ( | void | ) |
Return the current operation mode
EAPI Imlib_Progress_Function imlib_context_get_progress_function | ( | void | ) |
Return the current progress function
EAPI char imlib_context_get_progress_granularity | ( | void | ) |
Return the current progress granularity
IMLIB2_DEPRECATED EAPI Imlib_TTF_Encoding imlib_context_get_TTF_encoding | ( | void | ) |
Deprecated function - hasn't done anything useful in ~20 years
EAPI Visual * imlib_context_get_visual | ( | void | ) |
Return the current visual
EAPI Imlib_Context imlib_context_new | ( | void | ) |
Create new context
EAPI void imlib_context_pop | ( | void | ) |
Pop context
EAPI void imlib_context_push | ( | Imlib_Context | context | ) |
Push context
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().
angle | Angle of the text strings |
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.
anti_alias | The anti-alias flag |
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.
blend | The blending flag |
EAPI void imlib_context_set_cliprect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Set the clip rectangle
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 |
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
red | Red channel of the color |
green | Green channel of the color |
blue | Blue channel of the color |
alpha | Alpha channel of the color |
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
cyan | Cyan channel of the color |
magenta | Magenta channel of the color |
yellow | Yellow channel of the color |
alpha | Alpha channel of the color |
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
hue | Hue channel of the color |
lightness | Lightness channel of the color |
saturation | Saturation channel of the color |
alpha | Alpha channel of the color |
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
hue | Hue channel of the color |
saturation | Saturation channel of the color |
value | Value channel of the color |
alpha | Alpha channel of the color |
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.
color_modifier | The color modifier |
EAPI void imlib_context_set_color_range | ( | Imlib_Color_Range | color_range | ) |
Set the color range to use for rendering gradients
color_range | Color range |
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).
colormap | The Colormap to use |
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().
direction | The text direction |
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.
display | The Display to use |
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.
dither | The dithering flag |
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.
dither_mask | The dither mask flag |
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.
drawable | An X Drawable |
EAPI void imlib_context_set_filter | ( | Imlib_Filter | filter | ) |
Set the current image filter
Set this to NULL to disable filters.
filter | The filter |
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().
font | The font |
EAPI void imlib_context_set_image | ( | Imlib_Image | image | ) |
Set the image Imlib2 will be using with its function calls
image | The image |
EAPI void imlib_context_set_image_data_memory_function | ( | Imlib_Image_Data_Memory_Function | memory_function | ) |
Set the image data memory management function
memory_function | The image data memory management function |
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.
mask | A pixmap with depth 1 |
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.
mask_alpha_threshold | The mask alpha threshold |
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).
operation | The drawing operation |
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.
progress_function | The progress function |
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.
progress_granularity | The progress granularity |
IMLIB2_DEPRECATED EAPI void imlib_context_set_TTF_encoding | ( | Imlib_TTF_Encoding | encoding | ) |
Deprecated function - hasn't done anything useful in ~20 years
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).
visual | The Visual to use |
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.
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 |
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.
EAPI Imlib_Color_Range imlib_create_color_range | ( | void | ) |
Create empty color range
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.
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 |
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.
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 |
EAPI Imlib_Filter imlib_create_filter | ( | int | initsize | ) |
Create image filter object
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.
width | The width of the image |
height | The height of the image |
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.
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 |
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
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 |
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.
width | The width of the image |
height | The height of the image |
data | The 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.
width | The width of the image |
height | The height of the image |
data | The 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 | ||
) |
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.
width | The width of the image |
height | The height of the image |
data | The data |
func | The memory management function |
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.
angle | An angle in radians |
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.
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 |
EAPI void imlib_flush_font_cache | ( | void | ) |
Flush all speculatively cached fonts from the font cache
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)
EAPI void imlib_free_color_modifier | ( | void | ) |
Free the current color modifier
EAPI void imlib_free_color_range | ( | void | ) |
Free the current color range
EAPI void imlib_free_filter | ( | void | ) |
Free the current image filter
EAPI void imlib_free_font | ( | void | ) |
Unload current font
EAPI void imlib_free_font_list | ( | char ** | font_list, |
int | number | ||
) |
Free the font list returned by imlib_list_fonts()
font_list | The font list |
number | Number of fonts in the list |
EAPI void imlib_free_image | ( | void | ) |
Free the current image
EAPI void imlib_free_image_and_decache | ( | void | ) |
Free the current image AND remove it from the cache
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.
pixmap | The pixmap |
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.
display | The display |
screen | The screen |
depth_return | The depth of the returned visual |
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.
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.
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.
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 |
EAPI int imlib_get_color_usage | ( | void | ) |
Get the maximum number of colors Imlib2 is allowed to allocate
The default is 256.
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.
EAPI int imlib_get_font_ascent | ( | void | ) |
Return the current font's ascent
EAPI int imlib_get_font_cache_size | ( | void | ) |
Return the font cache size
EAPI int imlib_get_font_descent | ( | void | ) |
Return the current font's descent
EAPI int imlib_get_maximum_font_ascent | ( | void | ) |
Return the current font's maximum ascent
EAPI int imlib_get_maximum_font_descent | ( | void | ) |
Return the current font's maximum descent
EAPI Imlib_Font imlib_get_next_font_in_fallback_chain | ( | Imlib_Font | fn | ) |
Return next font in font fallback chain
EAPI Imlib_Font imlib_get_prev_font_in_fallback_chain | ( | Imlib_Font | fn | ) |
Return previous font in font fallback chain
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.
text | A string |
horizontal_advance_return | Horizontal offset |
vertical_advance_return | Vertical offset |
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.
text | A string |
text
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.
text | A string |
width_return | The width of the text |
height_return | The height of the text |
EAPI int imlib_get_visual_depth | ( | Display * | display, |
Visual * | visual | ||
) |
Convenience function that returns the depth of a visual
display | The display |
visual | The visual |
EAPI int imlib_get_ximage_cache_count_max | ( | void | ) |
Return the maximum number of XImages to cache
EAPI int imlib_get_ximage_cache_count_used | ( | void | ) |
Return the current number of cached XImages
EAPI int imlib_get_ximage_cache_size_max | ( | void | ) |
Return the XImage cache maximum size
EAPI int imlib_get_ximage_cache_size_used | ( | void | ) |
Return the current XImage cache memory usage
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.
key | The key |
data | A pointer |
value | A value |
destructor_function | An Imlib internal function |
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.
radius | The radius |
EAPI void imlib_image_clear | ( | void | ) |
Clear current image
Set all pixels values to 0.
EAPI void imlib_image_clear_color | ( | int | r, |
int | g, | ||
int | b, | ||
int | a | ||
) |
Set all current image pixels to given color
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.
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 |
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.
image_source | An image |
x | The x coordinate |
y | The y coordinate |
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.
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 |
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-
1. This means that the point (yc
)^2/b^2
=xc
, yc
) marks the center of the ellipse, a
defines the horizontal amplitude of the ellipse, and b
defines the vertical amplitude.
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 |
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.
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 |
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.
x | The x coordinate of the first point |
y | The y coordinate of the first point |
make_updates | Make updates flag |
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.
poly | A polygon |
closed | Closed polygon flag |
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.
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 |
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.
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 |
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-
1. This means that the point (yc
)^2/b^2
=xc
, yc
) marks the center of the ellipse, a
defines the horizontal amplitude of the ellipse, and b
defines the vertical amplitude.
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 |
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.
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 |
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.
poly | A polygon |
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.
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 |
EAPI void imlib_image_filter | ( | void | ) |
Filter current image with current filter
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.
EAPI void imlib_image_flip_horizontal | ( | void | ) |
Flip/mirror the current image horizontally
EAPI void imlib_image_flip_vertical | ( | void | ) |
Flip/mirror the current image vertically
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.
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.
key | The key |
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.
key | The key |
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.
border | Returns the image border |
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.
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.
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.
EAPI void imlib_image_get_frame_info | ( | Imlib_Frame_Info * | info | ) |
Get information about current image frame
info | Imlib_Frame_Info struct returning the information |
EAPI int imlib_image_get_height | ( | void | ) |
Get the height in pixels of the current image
EAPI int imlib_image_get_width | ( | void | ) |
Get the width in pixels of the current image
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.
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.
orientation | The orientation |
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().
data | The pointer to the image data |
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.
x | The x coordinate of the pixel |
y | The y coordinate of the pixel |
color_return | The returned color |
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
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 |
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
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 |
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
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 |
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()).
key | The key |
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.
key | The key |
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.
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 |
EAPI void imlib_image_set_border | ( | Imlib_Border * | border | ) |
Set image border
border | Image border |
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.
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.
format | Image format |
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.
has_alpha | Alpha flag |
IMLIB2_DEPRECATED EAPI void imlib_image_set_irrelevant_alpha | ( | char | irrelevant | ) |
Deprecated function - hasn't done anything useful ever
IMLIB2_DEPRECATED EAPI void imlib_image_set_irrelevant_border | ( | char | irrelevant | ) |
Deprecated function - hasn't done anything useful ever
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.
irrelevant | Irrelevant format flag |
EAPI void imlib_image_sharpen | ( | int | radius | ) |
Sharpen the current image
The radius
value affects how much to sharpen by.
radius | The radius |
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).
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).
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).
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.
font | A previously loaded font |
fallback_font | A previously loaded font to be chained to the given font |
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
.
number_return | Number of paths in the list |
EAPI char ** imlib_list_fonts | ( | int * | number_return | ) |
Return a list of fonts imlib2 can find in its font path
number_return | Number of fonts in the list |
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.
font_name | The font name with the size |
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.
file | File name |
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.
fd | Image file descriptor |
file | File name |
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.
file | Image file |
frame | Frame number |
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.
file | File name |
frame | Frame number |
data | Image data |
size | Image data size |
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.
file | File name |
EAPI Imlib_Image imlib_load_image_immediately_without_cache | ( | const char * | file | ) |
Load an image "immediately" without looking in the cache first
file | File name |
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.
file | File name |
data | Image data |
size | Image data size |
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
file | File name |
error_return | The returned error |
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.
file | File name |
error_return | The returned error |
EAPI Imlib_Image imlib_load_image_without_cache | ( | const char * | file | ) |
Load an image without looking in the cache first
file | File name |
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.
brightness_value | Value of brightness |
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.
contrast_value | Value of contrast |
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.
gamma_value | Value of gamma |
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.
poly | A polygon |
x | The X coordinate |
y | The Y coordinate |
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
.
poly | A polygon |
x | The X coordinate |
y | The Y coordinate |
EAPI void imlib_polygon_free | ( | ImlibPolygon | poly | ) |
Free a polygon object.
poly | A polygon |
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.
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 |
EAPI ImlibPolygon imlib_polygon_new | ( | void | ) |
Create empty polygon object
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.
fallback_font | A font previously added to a fallback chain |
EAPI void imlib_remove_path_from_font_path | ( | const char * | path | ) |
Remove font path
Removes a font path from the font path list
path | A directory path |
EAPI uint32_t imlib_render_get_pixel_color | ( | void | ) |
Return X11 pixel value of current color
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.
x | X coordinate of the pixel |
y | Y coordinate of the pixel |
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).
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 |
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
.
x | X coordinate of the pixel |
y | Y coordinate of the pixel |
width | Width of the rendered image |
height | Height of the rendered image |
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.
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 |
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
.
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 |
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().
pixmap_return | The returned pixmap |
mask_return | The returned mask |
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.
pixmap_return | The returned pixmap |
mask_return | The returned mask |
width | Width of the pixmap |
height | Height of the pixmap |
EAPI void imlib_reset_color_modifier | ( | void | ) |
Reset current color modifier tables
Resets the current color modifier to have linear mapping tables
EAPI void imlib_rotate_image_from_buffer | ( | double | angle, |
Imlib_Image | src_image | ||
) |
Rotate image onto image
Rotate @ src_image onto current image.
src_image | The source image |
angle | An angle in radians |
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
.
file | The file name |
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.
fd | Image file descriptor |
file | The file name |
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
file | The file name |
error_return | The returned error |
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.
file | The file name |
error_return | The returned error |
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.
bytes | Image cache max size |
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).
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 |
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.
max | Maximum number of colors |
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.
bytes | The font cache size in bytes |
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.
count | XImage cache max count |
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.
bytes | XImage cache max size in bytes |
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.
err | The error code |
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)
x | The x coordinate of the top left corner |
y | The y coordinate of the top left corner |
text | A null-byte terminated string |
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).
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 |
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.
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 |
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.
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 |
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).
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 |
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.
updates | An updates list |
appended_updates | The updates list to append |
EAPI Imlib_Updates imlib_updates_clone | ( | Imlib_Updates | updates | ) |
Duplicate update list
Creates a duplicate of an updates list.
updates | An updates list |
updates
EAPI void imlib_updates_free | ( | Imlib_Updates | updates | ) |
Free updates list
updates | An updates list |
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
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 |
EAPI Imlib_Updates imlib_updates_get_next | ( | Imlib_Updates | updates | ) |
Get the next update in an updates list
updates | An updates list |
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.
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.
updates | An updates list |
w | The width of the rectangle |
h | The height of the rectangle |
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.
updates | An updates list |
w | The width of the rectangle |
h | The height of the rectangle |
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
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 |
EAPI int imlib_version | ( | void | ) |
Return Imlib2 version