Functions |
|
void | imlib_context_set_cliprect (int x, int y, int w, int h) |
void | imlib_context_set_dither_mask (char dither_mask) |
char | imlib_context_get_dither_mask (void) |
void | imlib_context_set_anti_alias (char anti_alias) |
char | imlib_context_get_anti_alias (void) |
void | imlib_context_set_dither (char dither) |
char | imlib_context_get_dither (void) |
void | imlib_context_set_blend (char blend) |
char | imlib_context_get_blend (void) |
void | imlib_context_set_color_modifier (Imlib_Color_Modifier color_modifier) |
Imlib_Color_Modifier | imlib_context_get_color_modifier (void) |
void | imlib_context_set_operation (Imlib_Operation operation) |
Imlib_Operation | imlib_context_get_operation (void) |
void | imlib_context_set_font (Imlib_Font font) |
Imlib_Font | imlib_context_get_font (void) |
void | imlib_context_set_direction (Imlib_Text_Direction direction) |
void | imlib_context_set_angle (double angle) |
double | imlib_context_get_angle (void) |
Imlib_Text_Direction | imlib_context_get_direction (void) |
void | imlib_context_set_color (int red, int green, int blue, int alpha) |
void | imlib_context_get_color (int *red, int *green, int *blue, int *alpha) |
Imlib_Color * | imlib_context_get_imlib_color (void) |
void | imlib_context_set_color_hsva (float hue, float saturation, float value, int alpha) |
void | imlib_context_get_color_hsva (float *hue, float *saturation, float *value, int *alpha) |
void | imlib_context_set_color_hlsa (float hue, float lightness, float saturation, int alpha) |
void | imlib_context_get_color_hlsa (float *hue, float *lightness, float *saturation, int *alpha) |
void | imlib_context_set_color_cmya (int cyan, int magenta, int yellow, int alpha) |
void | imlib_context_get_color_cmya (int *cyan, int *magenta, int *yellow, int *alpha) |
void | imlib_context_set_color_range (Imlib_Color_Range color_range) |
Imlib_Color_Range | imlib_context_get_color_range (void) |
void | imlib_context_set_progress_function (Imlib_Progress_Function progress_function) |
Imlib_Progress_Function | imlib_context_get_progress_function (void) |
void | imlib_context_set_progress_granularity (char progress_granularity) |
char | imlib_context_get_progress_granularity (void) |
void | imlib_context_set_image (Imlib_Image image) |
Imlib_Image | imlib_context_get_image (void) |
int | imlib_get_cache_size (void) |
void | imlib_set_cache_size (int bytes) |
int | imlib_get_color_usage (void) |
void | imlib_set_color_usage (int max) |
void | imlib_flush_loaders (void) |
If you want Imlib2 to forcibly flush
any cached loaders it has and re-load them from disk (this
is useful if the program just installed a new loader and
does not want to wait till Imlib2 deems it an optimal time
to rescan the loaders). |
|
Imlib_Image | imlib_load_image (const char *file) |
Imlib_Image | imlib_load_image_immediately (const char *file) |
Imlib_Image | imlib_load_image_without_cache (const char *file) |
Imlib_Image | imlib_load_image_immediately_without_cache (const char *file) |
Imlib_Image | imlib_load_image_with_error_return (const char *file, Imlib_Load_Error *error_return) |
void | imlib_free_image (void) |
Frees the image that is set as the
current image in Imlib2's context. |
|
void | imlib_free_image_and_decache (void) |
Frees the current image in Imlib2's
context AND removes it from the cache. |
|
int | imlib_image_get_width (void) |
Returns the width in pixels of the
current image in Imlib2's context. |
|
int | imlib_image_get_height (void) |
Returns the height in pixels of the
current image in Imlib2's context. |
|
const char * | imlib_image_get_filename (void) |
DATA32 * | imlib_image_get_data (void) |
DATA32 * | imlib_image_get_data_for_reading_only (void) |
void | imlib_image_put_back_data (DATA32 *data) |
char | imlib_image_has_alpha (void) |
void | imlib_image_set_changes_on_disk (void) |
By default Imlib2 will not check the
timestamp of an image on disk and compare it with the image
in its cache - this is to minimize disk activity when using
the cache. |
|
void | imlib_image_get_border (Imlib_Border *border) |
void | imlib_image_set_border (Imlib_Border *border) |
void | imlib_image_set_format (const char *format) |
void | imlib_image_set_irrelevant_format (char irrelevant) |
void | imlib_image_set_irrelevant_border (char irrelevant) |
void | imlib_image_set_irrelevant_alpha (char irrelevant) |
char * | imlib_image_format (void) |
void | imlib_image_set_has_alpha (char has_alpha) |
void | imlib_blend_image_onto_image (Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int destination_width, int destination_height) |
Imlib_Image | imlib_create_image (int width, int height) |
Imlib_Image | imlib_create_image_using_data (int width, int height, DATA32 *data) |
Imlib_Image | imlib_create_image_using_copied_data (int width, int height, DATA32 *data) |
Imlib_Image | imlib_clone_image (void) |
Imlib_Image | imlib_create_cropped_image (int x, int y, int width, int height) |
Imlib_Image | imlib_create_cropped_scaled_image (int source_x, int source_y, int source_width, int source_height, int destination_width, int destination_height) |
Imlib_Updates | imlib_updates_clone (Imlib_Updates updates) |
Imlib_Updates | imlib_update_append_rect (Imlib_Updates updates, int x, int y, int w, int h) |
Imlib_Updates | imlib_updates_merge (Imlib_Updates updates, int w, int h) |
Imlib_Updates | imlib_updates_merge_for_rendering (Imlib_Updates updates, int w, int h) |
void | imlib_updates_free (Imlib_Updates updates) |
Imlib_Updates | imlib_updates_get_next (Imlib_Updates updates) |
void | imlib_updates_get_coordinates (Imlib_Updates updates, int *x_return, int *y_return, int *width_return, int *height_return) |
void | imlib_updates_set_coordinates (Imlib_Updates updates, int x, int y, int width, int height) |
Imlib_Updates | imlib_updates_init (void) |
Imlib_Updates | imlib_updates_append_updates (Imlib_Updates updates, Imlib_Updates appended_updates) |
void | imlib_image_flip_horizontal (void) |
Flips/mirrors the current image
horizontally. |
|
void | imlib_image_flip_vertical (void) |
Flips/mirrors the current image
vertically. |
|
void | imlib_image_flip_diagonal (void) |
Flips/mirrors the current image
diagonally (good for quick and dirty 90 degree rotations if
used before to after a horizontal or vertical
flip). |
|
void | imlib_image_orientate (int orientation) |
void | imlib_image_blur (int radius) |
void | imlib_image_sharpen (int radius) |
void | imlib_image_tile_horizontal (void) |
Modifies an image so it will tile
seamlessly horizontally if used as a tile (i.e. |
|
void | imlib_image_tile_vertical (void) |
Modifies an image so it will tile
seamlessly vertically if used as a tile (i.e. |
|
void | imlib_image_tile (void) |
Modifies an image so it will tile
seamlessly horizontally and vertically if used as a tile
(i.e. |
|
Imlib_Font | imlib_load_font (const char *font_name) |
void | imlib_free_font (void) |
Frees the current font. |
|
void | imlib_text_draw (int x, int y, const char *text) |
void | imlib_text_draw_with_return_metrics (int x, int y, const char *text, int *width_return, int *height_return, int *horizontal_advance_return, int *vertical_advance_return) |
void | imlib_get_text_size (const char *text, int *width_return, int *height_return) |
void | imlib_get_text_advance (const char *text, int *horizontal_advance_return, int *vertical_advance_return) |
int | imlib_get_text_inset (const char *text) |
void | imlib_add_path_to_font_path (const char *path) |
void | imlib_remove_path_from_font_path (const char *path) |
char ** | imlib_list_font_path (int *number_return) |
int | imlib_text_get_index_and_location (const char *text, int x, int y, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return) |
void | imlib_text_get_location_at_index (const char *text, int index, int *char_x_return, int *char_y_return, int *char_width_return, int *char_height_return) |
char ** | imlib_list_fonts (int *number_return) |
void | imlib_free_font_list (char **font_list, int number) |
int | imlib_get_font_cache_size (void) |
void | imlib_set_font_cache_size (int bytes) |
void | imlib_flush_font_cache (void) |
Causes a flush of all speculatively
cached fonts from the font cache. |
|
int | imlib_get_font_ascent (void) |
int | imlib_get_font_descent (void) |
int | imlib_get_maximum_font_ascent (void) |
int | imlib_get_maximum_font_descent (void) |
Imlib_Color_Modifier | imlib_create_color_modifier (void) |
void | imlib_free_color_modifier (void) |
Frees the current color
modifier. |
|
void | imlib_modify_color_modifier_gamma (double gamma_value) |
void | imlib_modify_color_modifier_brightness (double brightness_value) |
void | imlib_modify_color_modifier_contrast (double contrast_value) |
void | imlib_set_color_modifier_tables (DATA8 *red_table, DATA8 *green_table, DATA8 *blue_table, DATA8 *alpha_table) |
void | imlib_get_color_modifier_tables (DATA8 *red_table, DATA8 *green_table, DATA8 *blue_table, DATA8 *alpha_table) |
void | imlib_reset_color_modifier (void) |
Resets the current color modifier to
have linear mapping tables. |
|
void | imlib_apply_color_modifier (void) |
Uses the current color modifier and
modifies the current image using the mapping tables in the
current color modifier. |
|
void | imlib_apply_color_modifier_to_rectangle (int x, int y, int width, int height) |
Imlib_Updates | imlib_image_draw_line (int x1, int y1, int x2, int y2, char make_updates) |
void | imlib_image_draw_rectangle (int x, int y, int width, int height) |
void | imlib_image_fill_rectangle (int x, int y, int width, int height) |
void | imlib_image_copy_alpha_to_image (Imlib_Image image_source, int x, int y) |
void | imlib_image_copy_alpha_rectangle_to_image (Imlib_Image image_source, int x, int y, int width, int height, int destination_x, int destination_y) |
void | imlib_image_scroll_rect (int x, int y, int width, int height, int delta_x, int delta_y) |
void | imlib_image_copy_rect (int x, int y, int width, int height, int new_x, int new_y) |
Imlib_Color_Range | imlib_create_color_range (void) |
void | imlib_free_color_range (void) |
Frees the current color
range. |
|
void | imlib_add_color_to_color_range (int distance_away) |
void | imlib_image_fill_color_range_rectangle (int x, int y, int width, int height, double angle) |
void | imlib_image_fill_hsva_color_range_rectangle (int x, int y, int width, int height, double angle) |
void | imlib_image_query_pixel (int x, int y, Imlib_Color *color_return) |
void | imlib_image_query_pixel_hsva (int x, int y, float *hue, float *saturation, float *value, int *alpha) |
void | imlib_image_query_pixel_hlsa (int x, int y, float *hue, float *lightness, float *saturation, int *alpha) |
void | imlib_image_query_pixel_cmya (int x, int y, int *cyan, int *magenta, int *yellow, int *alpha) |
void | imlib_image_attach_data_value (const char *key, void *data, int value, Imlib_Internal_Data_Destructor_Function destructor_function) |
void * | imlib_image_get_attached_data (const char *key) |
int | imlib_image_get_attached_value (const char *key) |
void | imlib_image_remove_attached_data_value (const char *key) |
void | imlib_image_remove_and_free_attached_data_value (const char *key) |
void | imlib_save_image (const char *filename) |
void | imlib_save_image_with_error_return (const char *filename, Imlib_Load_Error *error_return) |
Imlib_Image | imlib_create_rotated_image (double angle) |
void | imlib_blend_image_onto_image_at_angle (Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int angle_x, int angle_y) |
void | imlib_blend_image_onto_image_skewed (Imlib_Image source_image, char merge_alpha, int source_x, int source_y, int source_width, int source_height, int destination_x, int destination_y, int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y) |
void | imlib_context_set_filter (Imlib_Filter filter) |
Imlib_Filter | imlib_context_get_filter (void) |
ImlibPolygon | imlib_polygon_new (void) |
Returns a new polygon object with no
points set. |
|
void | imlib_polygon_add_point (ImlibPolygon poly, int x, int y) |
void | imlib_polygon_free (ImlibPolygon poly) |
void | imlib_image_draw_polygon (ImlibPolygon poly, unsigned char closed) |
void | imlib_image_fill_polygon (ImlibPolygon poly) |
void | imlib_polygon_get_bounds (ImlibPolygon poly, int *px1, int *py1, int *px2, int *py2) |
void | imlib_image_draw_ellipse (int xc, int yc, int a, int b) |
void | imlib_image_fill_ellipse (int xc, int yc, int a, int b) |
unsigned char | imlib_polygon_contains_point (ImlibPolygon poly, int x, int y) |
Brief of imlib2 library
|
distance_away distance from the previous
color in the range (if it's the first color in the range
this is irrelevant).
|
|
path to the end of
the current list of directories to scan for fonts.
|
|
|
|
source_x ,
source_y , source_width ,
source_height ) from
source_image onto the current image at the
destination (destination_x ,
destination_y ) location scaled to the width
destination_width and height
destination_height . If
merge_alpha is set to 1 it will also modify
the destination image alpha channel, otherwise the
destination alpha channel is left untouched.
|
|
v_angle_x
and v_angle_y are 0).
|
|
source_x ,
source_y , source_width ,
source_height ) from the
source_image onto the current image at the
destination (destination_x ,
destination_y ) location. It will be rotated
and scaled so that the upper right corner will be
positioned h_angle_x pixels to the right (or
left, if negative) and h_angle_y pixels down
(from (destination_x ,
destination_y ). If v_angle_x
and v_angle_y are not 0, the image will also
be skewed so that the lower left corner will be
positioned v_angle_x pixels to the right and
v_angle_y pixels down. The at_angle versions
simply have the v_angle_x and
v_angle_y set to 0 so the rotation doesn't
get skewed, and the render_..._on_drawable ones seem
obvious enough; they do the same on a drawable.
Example: imlib_blend_image_onto_image_skewed(..., 0, 0, 100, 0, 0, 100); imlib_blend_image_onto_image_skewed(..., 0, 0, 0, 100, 100, 0); imlib_blend_image_onto_image_skewed(..., 100, 0, 0, 100, -100, 0); imlib_blend_image_onto_image_skewed(..., 50, 0, 50, 50, -50, 50); imlib_blend_image_onto_image_skewed(..., 50, 50, 100 * cos(a), 100 * sin(a), 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
red , green , blue
and alpha are between 0 and 255 - any other
values have undefined results.
|
|
cyan , magenta ,
yellow and alpha are between 0
and 255 - any other values have undefined results.
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x ,
y , width , height )
rectangle in the current image and returns a valid image
handle on success, or NULL on failure.
|
|
destination_width and
destination_height whilst cropping.
|
|
width
and height . The contents of this image at
creation time are undefined (they could be garbage
memory). You are free to do whatever you like with this
image. It is not cached. On success an image handle is
returned - on failure NULL is returned.
|
|
|
|
width and the height
height specified. The image data
data must be in the same format as imlib_image_get_data()
would return. You are responsible for freeing this image
data once the image is freed - Imlib2 will not do that
for you. This is useful for when you already have static
buffers of the same format Imlib2 uses (many video
grabbing devices use such a format) and wish to use
Imlib2 to render the results onto another image, or X
drawable. You should free the image when you are done
with it. Imlib2 returns a valid image handle on success
or NULL on failure
|
|
angle radians. On success it
returns a valid image handle, otherwise NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text in using the current font and returns
that value in pixels.
|
|
text string would use up if drawn with the
current font.
|
|
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.
|
|
radius value
of 0 has no effect, 1 and above determine the blur matrix
radius that determine how much to blur the image.
|
|
x , y ,
width , height ) rectangle alpha
channel from the source image image_source
and replaces the alpha channel on the destination image
at the (destination_x ,
destination_y ) coordinates.
|
|
image_source to the (x ,
y ) coordinates of the current image,
replacing the alpha channel there.
|
|
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- 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.
|
|
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.
|
|
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.
|
|
x , y ) coordinates
with a size of width and height
pixels, using the current color.
|
|
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- 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.
|
|
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.
|
|
polyon the current context image with the
current context color.
|
|
x , y ) coordinates with a size
of width and height pixels,
using the current color.
|
|
|
|
key specified. NULL is returned if no
data could be found with that key on the current image.
|
|
key . If none could be
found 0 is returned.
|
|
border points to with the values of the
border of the current context image. The border is the
area at the edge of the image that does not scale with
the rest of the image when resized - the borders remain
constant in size. This is useful for scaling bevels at
the edge of images differently to the image center.
|
|
|
|
|
|
|
|
|
|
orientation does not rotate, 1
rotates clockwise by 90 degree, 2, rotates clockwise by
180 degrees, 3 rotates clockwise by 270 degrees.
|
|
data when it was obtained by
imlib_image_get_data().
data must be the same pointer returned by
imlib_image_get_data(). This
operated on the current context image.
|
|
color_return color structure
with the color of the pixel in the current image that is
at the (x , y ) location
specified.
|
|
x , y )
location specified.
|
|
x , y )
location specified.
|
|
x , y )
location specified.
|
|
key and also
calls the destructor function that was supplied when
attaching it (see imlib_image_attach_data_value()).
|
|
key from the current image.
|
|
width ,
height at the (x ,
y ) location within the current image by the
delta_x , delta_y distance (in
pixels).
|
|
border points to.
|
|
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. |
|
|
|
has_alpha to 1 to enable the alpha channel
in the current image, or 0 to disable it.
|
|
|
|
|
|
|
|
radius
value affects how much to sharpen by.
|
|
Modifies an image so it will tile seamlessly horizontally and vertically if used as a tile (i.e. drawn multiple times horizontally and vertically). |
|
Modifies an image so it will tile seamlessly horizontally if used as a tile (i.e. drawn multiple times horizontally). |
|
Modifies an image so it will tile seamlessly vertically if used as a tile (i.e. drawn multiple times vertically). |
|
number_return .
|
|
|
|
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.
|
|
file . Please see the section
How Image Loading
Works for more detail. Returns an image handle on
success or NULL on failure.
|
|
file . This forces the image
data to be decoded at load time too, instead of decoding
being deferred until it is needed. Returns an image
handle on success or NULL on failure.
|
|
|
|
file on
disk. If it succeeds it returns a valid image handle, if
not NULL is returned and error_return is set
to the detail of the error.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
x ,
y ) is within the area defined by the polygon
poly .
|
|
|
|
poly . (px1 , py1 )
defines the upper left corner of the bounding box and
(px2 , py2 ) defines it's lower
right corner.
|
|
path .
|
|
filename .
|
|
error_return to an error value
if the save fails.
|
|
|
|
|
|
|
|
|
|
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)
|
|
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).
|
|
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.
|
|
index in the text string using
the current font.
|
|
|
|
appended_updates to the updates
list updates and returns the new list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
update .
|