Struct gift::block::ImageDesc

source ·
pub struct ImageDesc { /* private fields */ }
Expand description

The image descriptor block contains properties which apply to one frame.

use gift::block::{
    ColorTableConfig, ColorTableExistence, ColorTableOrdering, ImageDesc,
};

let desc = ImageDesc::default()
    .with_width(64)
    .with_height(64)
    .with_color_table_config(ColorTableConfig::new(
        ColorTableExistence::Present,
        ColorTableOrdering::NotSorted,
        16,
    ));

Implementations§

source§

impl ImageDesc

source

pub fn with_left(self, left: u16) -> Self

Set the left position

source

pub fn left(&self) -> u16

Get the left position

source

pub fn with_top(self, top: u16) -> Self

Set the top position

source

pub fn top(&self) -> u16

Get the top position

source

pub fn with_width(self, width: u16) -> Self

Set the width

source

pub fn width(&self) -> u16

Get the width

source

pub fn with_height(self, height: u16) -> Self

Set the height

source

pub fn height(&self) -> u16

Get the height

source

pub fn with_flags(self, flags: u8) -> Self

Set the flags which control the interlace value and the local color table configuration.

It is recommended to use with_interlaced or with_color_table_config instead.

source

pub fn flags(&self) -> u8

Get the flags which control the interlace value and the local color table configuration.

source

pub fn with_interlaced(self, interlaced: bool) -> Self

Set the interlaced flag

source

pub fn interlaced(&self) -> bool

Get the interlaced flag

source

pub fn color_table_config(&self) -> ColorTableConfig

Get the local color table configuration

source

pub fn with_color_table_config(self, tbl: ColorTableConfig) -> Self

Set the local color table configuration

source

pub fn image_sz(&self) -> usize

Get the image size (bytes)

Trait Implementations§

source§

impl Clone for ImageDesc

source§

fn clone(&self) -> ImageDesc

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ImageDesc

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ImageDesc

source§

fn default() -> ImageDesc

Returns the “default value” for a type. Read more
source§

impl From<ImageDesc> for Block

source§

fn from(b: ImageDesc) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ImageDesc

source§

fn eq(&self, other: &ImageDesc) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ImageDesc

source§

impl Eq for ImageDesc

source§

impl StructuralEq for ImageDesc

source§

impl StructuralPartialEq for ImageDesc

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.