rustic_bitmap

Trait Get

Source
pub trait Get {
Show 14 methods // Required methods fn get_pixel_array_offset(&self) -> usize; fn get_height(&self) -> u32; fn get_width(&self) -> u32; fn get_bits_per_pixel(&self) -> u8; fn get_file_size(&self) -> u32; fn get_size_of_info_header(&self) -> u32; fn get_planes(&self) -> u16; fn get_compression(&self) -> u32; fn get_image_size(&self) -> u32; fn get_colors_used(&self) -> u32; fn get_important_colors(&self) -> u32; fn get_padding_size(&self) -> u32; fn get_padding_per_line(&self) -> u8; fn get_pixel(&self, point: &Point) -> Result<Rgb, String>;
}
Expand description

A trait for accessing metadata and pixel-level data from a bitmap.

Required Methods§

Source

fn get_pixel_array_offset(&self) -> usize

Returns the byte offset where the pixel array starts in the image file.

Source

fn get_height(&self) -> u32

Returns the height of the image in pixels.

Source

fn get_width(&self) -> u32

Returns the width of the image in pixels.

Source

fn get_bits_per_pixel(&self) -> u8

Returns the number of bits per pixel (e.g., 24 for RGB, 32 for RGBA).

Source

fn get_file_size(&self) -> u32

Returns the total size of the image file in bytes.

Source

fn get_size_of_info_header(&self) -> u32

Returns the size of the info header (40 bytes for BITMAPINFOHEADER).

Source

fn get_planes(&self) -> u16

Returns the number of color planes (usually 1).

Source

fn get_compression(&self) -> u32

Returns the compression method used 0 = BI_RGB no compression
1 = BI_RLE8 8bit RLE encoding
2 = BI_RLE4 4bit RLE encoding

Source

fn get_image_size(&self) -> u32

Returns the compressed image size. It is valid to set this =0 if Compression = 0

Source

fn get_colors_used(&self) -> u32

Returns the number of colors used in the bitmap (0 = default).

Source

fn get_important_colors(&self) -> u32

Returns the number of important colors (0 = all colors are important).

Source

fn get_padding_size(&self) -> u32

Returns the total size of padding bytes added to the image data.

Source

fn get_padding_per_line(&self) -> u8

Returns the number of padding bytes per scan line.

Source

fn get_pixel(&self, point: &Point) -> Result<Rgb, String>

Returns the RGB value of the pixel at the specified point.

§Arguments
  • point - A reference to a Point representing the x and y position.
§Returns
  • Ok(Rgb) containing the pixel color at the specified point.
  • Err(String) if the point is out of bounds or invalid.

Implementations on Foreign Types§

Source§

impl Get for Vec<u8>

Implementors§