Struct raylib::core::texture::Image[][src]

#[repr(transparent)]
pub struct Image(_);

Implementations

Take the raw ffi type. Must manually free memory by calling the proper unload function

returns the unwrapped raylib-sys object

converts raylib-sys object to a “safe” version. Make sure to call this function from the thread the resource was created.

Exports image as a PNG file.

Exports image as a PNG file.

Get pixel data size in bytes (image or texture)

Gets pixel data from image as a Vec of Color structs.

Extract color palette from image to maximum size

Converts image to POT (power-of-two).

Converts image data to desired pixel format.

Applies alpha mask to image. Alpha mask must be same size as the image. If alpha mask is not greyscale Ensure the colors are white (255, 255, 255, 255) or black (0, 0, 0, 0)

Clears alpha channel on image to desired color.

Crops image depending on alpha value.

Premultiplies alpha channel on image.

Crops image to a defined rectangle.

Resizes image (bilinear filtering).

Resizes image (nearest-neighbor scaling).

Resizes image canvas and fills with color.

Generates all mipmap levels for a provided image.

Dithers image data to 16bpp or lower (Floyd-Steinberg dithering).

Get image alpha border rectangle

Clear image background with given color

Draws a source image within a destination image.

Draw pixel within an image

Draw pixel within an image (Vector version)

Draw line within an image

Draw line within an image (Vector version)

Draw circle within an image

Draw circle within an image (Vector version)

Draws a rectangle within an image.

Draws a rectangle within an image.

Draws text (default font) within an image (destination).

Draws text (default font) within an image (destination).

Flips image vertically.

Flips image horizontally.

Rotates image clockwise by 90 degrees (PI/2 radians).

Rotates image counterclockwise by 90 degrees (PI/2 radians).

Tints colors in image using specified color.

Inverts the colors in image.

Converts `image color to grayscale.

Adjusts the contrast of image.

Adjusts the brightness of image.

Searches image for all occurences of color and replaces them with replace color.

Generates a plain color Image.

Generates an Image containing a vertical gradient.

Generates an Image containing a horizonal gradient.

Generates an Image containing a radial gradient.

Generates an Image containing a checkerboard pattern.

Generates an Image containing white noise.

Generates an Image containing perlin noise.

Generates an Image using a cellular algorithm. Bigger tile_size means bigger cells.

Loads image from file into CPU memory (RAM).

Loads image from a given memory buffer as a vector of arrays

Loads image from RAW file data.

Creates an image from text (custom font).

Creates an image from text (custom font).

Trait Implementations

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.