logo
pub struct Bitmap { /* private fields */ }

Implementations

Creates a bitmap using some existing data. The data is not copied so the application must keep the buffer alive for the lifetime of the Bitmap. This can be used for example with Framebuffer::read_pixels_into_bitmap to read data directly into an application buffer with the specified rowstride.

context

A Context

width

The width of the bitmap.

height

The height of the bitmap.

format

The format of the pixel data.

rowstride

The rowstride of the bitmap (the number of bytes from the start of one row of the bitmap to the next).

data

A pointer to the data. The bitmap will take ownership of this data.

Returns

A new Bitmap.

Returns

the PixelBuffer that this buffer uses for storage. Note that if the bitmap was created with Bitmap::new_from_file then it will not actually be using a pixel buffer and this fn will return None.

Returns

the PixelFormat that the data for the bitmap is in.

Returns

the height of the bitmap

Returns

the rowstride of the bitmap. This is the number of bytes between the address of start of one row to the address of the next row in the image.

Returns

the width of the bitmap

Parses an image file enough to extract the width and height of the bitmap.

filename

the file to check

width

return location for the bitmap width, or None

height

return location for the bitmap height, or None

Returns

true if the image was successfully parsed

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. 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

Returns the argument unchanged.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. 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.