• allegro5.a5_display
  • allegro5.a5_file
  • allegro5.a5_font
  • allegro5.a5_image
  • allegro5.a5_joystick
  • allegro5.a5_main
  • allegro5.a5_misc
  • allegro5.a5_opengl
  • allegro5.a5_shader
  • allegro5.a5_sound
  • allegro5.a5_thread
  • allegro5.a5_triangles
  • animation
  • array
  • atlas
  • buffer
  • color
  • common
  • csg.csg_aabb
  • csg.csg
  • csg.csg_octree
  • csg.csg_shapes
  • csg.csg_test
  • data
  • display
  • exception
  • file
  • font
  • glsl
  • grid
  • hash
  • image
  • image_op
  • index
  • ini
  • isometric
  • joystick
  • keyboard
  • land
  • layer
  • list
  • log
  • main
  • map
  • mem
  • mouse
  • net
  • noise
  • openglutil
  • perlin
  • pixelmask
  • plasma
  • pool
  • protobuf
  • queue
  • random
  • runner
  • shader
  • sound
  • sprite
  • thread
  • tilegrid
  • triangles
  • util2d
  • util3d
  • util
  • view
  • voronoi
  • widget.base
  • widget.board
  • widget.book
  • widget.box
  • widget.button
  • widget.checkbox
  • widget.container
  • widget.edit
  • widget.gul
  • widget.hbox
  • widget.layout
  • widget
  • widget.menu
  • widget.mover
  • widget.panel
  • widget.scrollbar
  • widget.scrolling
  • widget.sizer
  • widget.slider
  • widget.spin
  • widget.text
  • widget.theme
  • widget.vbox
  • widget.widget_list
  • yaml.external
  • yaml.internal
  • yaml
  • yaml.xml

land.image

LandImage

An image is a rectangular area of pixels. The actual representation of the pixel data is completely left to the plaform specific layer. An OpenGL driver most likely will have a memory buffer with the raw RGBA data of the image attached to each LandImage, along with a texture id for displaying it and an FBO id for drawing to it.

LandSubImage

A sub-image is an image sharing all of its pixels with some other image. If the other image is changed, then also the sub-image changes.

land_image_set_callback

Parameters: void(* cb)(char const * path, LandImage * image)

land_image_load

Parameters: char const * filename

Returns: LandImage*

land_image_was_loaded

Parameters: LandImage * self

Returns: bool

land_image_load_memory

Parameters: char const * filename

Returns: LandImage*

land_image_new_deferred

Parameters: char const * filename

Returns: LandImage*

land_image_load_on_demand

Parameters: LandImage * self

Returns: bool

Load an image that was previously declared “on demand”.

land_image_load_async

Parameters: LandImage * self

Returns: bool

land_image_exists

Parameters: LandImage * self

Returns: bool

land_image_memory_new

Parameters: int w, int h

Returns: LandImage*

Creates a new image. If w or h are 0, the image will have no contents at all (this can be useful if the contents are to be added later). The image will always be a simple memory rectangle of pixels, with no driver specific optimizations.

land_image_new_flags

Parameters: int w, int h, int flags

Returns: LandImage*

Creates a new image. If w and h are 0, the image will have no contents at all (this can be useful if the contents are to be added later).

land_image_new

Parameters: int w, int h

Returns: LandImage*

land_image_create

Parameters: int w, int h

Returns: LandImage*

Like land_image_new, but clears the image to all 0 initially.

land_image_del

Parameters: LandImage * self

land_image_destroy

Parameters: LandImage * self

land_image_crop

Parameters: LandImage * self, int x, int y, int w, int h

Crops an image to the specified rectangle. All image contents outside the rectangle will be lost. You can also use this to make an image larger, in which case the additional borders are filled with transparency. The offset need not lie within the image.

land_image_auto_crop

Parameters: LandImage * self

This will optimize an image by cropping away any completely transparent borders it may have.

land_image_resize

Parameters: LandImage * self, int new_w, int new_h, int flags

land_image_new_from

Parameters: LandImage * copy, int x, int y, int w, int h

Returns: LandImage*

Create a new image, copying pixel data from a rectangle in an existing image.

land_image_color_stats

Parameters: LandImage * self, float * red, float * green, float * blue, float * alpha

Returns: int

Returns the number of pixels in the image, and the average red, green, blue and alpha component.

land_image_color_replace

Parameters: LandImage * self, int r255, int g255, int b255, int a255, int **_r255, int _g255, int _b255, int _a255**

Replaces a color with another.

land_image_colorkey

Parameters: LandImage * self, int r255, int g255, int b255

Replaces all pixels in the image matching the given RGB triplet (in 0..255 format) with full transparency.

land_image_colorkey_hack

Parameters: LandImage * self, int allegro_color

Like land_image_colorkey, but even more hackish, you directly specify the color in Allegro’s format. The only use for this is if you load paletted pictures and want to colorkey by index.

land_image_colorize

Parameters: LandImage * self, LandImage * colormask

Colorizes the part of the image specified by the mask with the current color. The mask uses (1, 0, 1) for transparent, and the intensity is otherwise used as intensity of the replacement color.

land_image_colorize_replace

Parameters: LandImage * self, int n, int * rgb

This takes a list of colors and replaces all colors in the image corresponding to one of them with the current color.

The colors use integer 0..255 format, since exact comparison with
the usual floating point colors would be difficult otherwise. The
array ''rgb'' should have 3 * n integers, consisting of consecutive
R, G, B triplets to replace.

The first rgb triplet has a special meaning - it determines the image color
which is mapped to the current color. All matching colors with a larger
rgb sum then are mapped to a color between the first color and pure weight,
depending on their rgb sum. All colors with a smaller rgb sum are mapped
to a range from total black to the first color.

land_image_split_mask_from_colors

Parameters: LandImage * self, int n_rgb, int * rgb

Returns: LandImage*

Takes the same parameters as land_image_colorize_replace - but instead of recoloring the image itself, creates a separate image of the same size, which is transparent except where mask colors have been found in the given image. Here, it is colored in graylevels with the intensity corresponding to the mask colors. In the original image, all mask colors are replaced by transparency. The use of this function is to always draw the mask over the original image, but tint the white mask to other colors.

land_load_images_cb

Parameters: char const * pattern, void(* cb)(LandImage * image, void * data), void * data

Returns: LandArray*

Load all images matching the file name pattern, and create an array referencing them all, in alphabetic filename order. The callback function is called on each image along the way.

land_load_images

Parameters: char const * pattern, int center, int auto_crop

Returns: LandArray*

Load all images matching the file name pattern, and create an array referencing them all.

land_image_sub

Parameters: LandImage * parent, float x, float y, float w, float h

Returns: LandImage*

land_image_load_sheet

Parameters: char const * filename, int offset_x, int offset_y, int grid_w, int grid_h, int x_gap, int y_gap, int x_count, int y_count, int auto_crop

Returns: LandArray*

land_image_load_split_sheet

Parameters: char const * filename, int offset_x, int offset_y, int grid_w, int grid_h, int x_gap, int y_gap, int x_count, int y_count, int auto_crop

Returns: LandArray*

land_image_draw_scaled_rotated_tinted_flipped

Parameters: LandImage * self, float x, float y, float sx, float sy, float angle, float r, float g, float b, float alpha, int flip

land_image_draw_scaled_rotated_tinted

Parameters: LandImage * self, float x, float y, float sx, float sy, float angle, float r, float g, float b, float alpha

land_image_draw_scaled_rotated

Parameters: LandImage * self, float x, float y, float sx, float sy, float angle

land_image_draw_scaled

Parameters: LandImage * self, float x, float y, float sx, float sy

land_image_draw_rotated

Parameters: LandImage * self, float x, float y, float a

land_image_draw_rotated_flipped

Parameters: LandImage * self, float x, float y, float a

land_image_draw_rotated_tinted

Parameters: LandImage * self, float x, float y, float a, float r, float g, float b, float alpha

land_image_draw_scaled_tinted

Parameters: LandImage * self, float x, float y, float sx, float sy, float r, float g, float b, float alpha

land_image_draw

Parameters: LandImage * self, float x, float y

land_image_draw_flipped

Parameters: LandImage * self, float x, float y

land_image_draw_tinted

Parameters: LandImage * self, float x, float y, float r, float g, float b, float alpha

land_image_grab

Parameters: LandImage * self, int x, int y

land_image_grab_into

Parameters: LandImage * self, float x, float y, float tx, float ty, float tw, float th

land_image_offset

Parameters: LandImage * self, int x, int y

land_image_memory_draw

Parameters: LandImage * self, float x, float y

land_image_center

Parameters: LandImage * self

land_image_init

no parameters

land_image_exit

no parameters

land_image_clip

Parameters: LandImage * self, float x, float y, float x_, float y_

land_image_unclip

Parameters: LandImage * self

land_image_draw_partial

Parameters: LandImage * self, float x, float y, float sx, float sy, float sw, float sh

land_image_height

Parameters: LandImage * self

Returns: int

land_image_width

Parameters: LandImage * self

Returns: int

land_image_get_rgba_data

Parameters: LandImage * self, unsigned char * rgba

Copies rgba data into the specified buffer. It has to be large enough (w * h * 4 bytes) to hold all the data.

land_image_set_rgba_data

Parameters: LandImage * self, unsigned char const * rgba

Copies the rgba data, overwriting the image contents. Since data are copied rgba can be safely deleted after returning from the function.

land_image_save

Parameters: LandImage * self, char const * filename

land_image_opengl_texture

Parameters: LandImage * self

Returns: int

land_image_flip

Parameters: LandImage * self

land_image_clone

Parameters: LandImage * self

Returns: LandImage*

land_image_fade_to_color

Parameters: LandImage * self

land_image_from_xpm

Parameters: char const * (* xpm)

Returns: LandImage*

land_image_write_callback

Parameters: LandImage * self, void(* cb)(int x, int y, unsigned char * rgba, void * user), void * user

Run a callback for each pixel of a picture. The pointer passed to the callback must be assigned 4 8-bit values in the range 0..255. It must not be read from.

land_image_read_write_callback

Parameters: LandImage * self, void(* cb)(int x, int y, unsigned char * rgba, void * user), void * user

Run a callback for each pixel of a picture. The rgba pointer passed to the callback will contain the current color as 4 consecutive bytes and may be modified.

land_image_read_backup_write_callback

Parameters: LandImage * self, void(* cb)(int x, int y, int w, int h, unsigned char * rgba_in, unsigned char * rgba_out, void * user), void * user

Same as land_image_read_write_callback but the previous image is kept in a backup buffer and a separate pointer for reading is provided. This is useful if you also want to read from neighboring pixels. As a convenience the width and height of the buffers is also passed to the callback to allow handling border conditions.


Generated: Thu 27 Feb 2020 10:49:37 PM EST