Skip to main content

LogicalScreenDesc

Struct LogicalScreenDesc 

Source
pub struct LogicalScreenDesc { /* private fields */ }
Expand description

The logical screen descriptor contains properties which apply to all frames in the file.

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

let desc = LogicalScreenDesc::default()
    .with_screen_width(64)
    .with_screen_height(64)
    .with_color_table_config(ColorTableConfig::new(
        ColorTableExistence::Present,
        ColorTableOrdering::NotSorted,
        16,
    ))
    .with_background_color_idx(1);

Implementations§

Source§

impl LogicalScreenDesc

Source

pub fn with_screen_width(self, screen_width: u16) -> Self

Set the screen width

Source

pub fn screen_width(self) -> u16

Get the screen width

Source

pub fn with_screen_height(self, screen_height: u16) -> Self

Set the screen height

Source

pub fn screen_height(self) -> u16

Get the screen height

Source

pub fn equal_size(self, rhs: Self) -> bool

Check if screen sizes are equal

Source

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

Set the flags which control the global color table configuration.

It is recommended to use with_color_table_config instead.

Source

pub fn flags(self) -> u8

Get the flags which control the global color table configuration

Source

pub fn color_resolution(self) -> u16

Get the color resolution (obsolete GIF feature)

Source

pub fn color_table_config(self) -> ColorTableConfig

Get the global color table configuration

Source

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

Set the global color table configuration

Source

pub fn with_background_color_idx(self, background_color_idx: u8) -> Self

Set the background color index

Source

pub fn background_color_idx(self) -> u8

Get the background color index

Source

pub fn with_pixel_aspect_ratio(self, pixel_aspect_ratio: u8) -> Self

Set the pixel aspect ratio (obsolete GIF feature)

Source

pub fn pixel_aspect_ratio(self) -> u8

Get the pixel aspect ratio (obsolete GIF feature)

Trait Implementations§

Source§

impl Clone for LogicalScreenDesc

Source§

fn clone(&self) -> LogicalScreenDesc

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for LogicalScreenDesc

Source§

impl Debug for LogicalScreenDesc

Source§

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

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

impl Default for LogicalScreenDesc

Source§

fn default() -> LogicalScreenDesc

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

impl Eq for LogicalScreenDesc

Source§

impl From<LogicalScreenDesc> for Block

Source§

fn from(b: LogicalScreenDesc) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for LogicalScreenDesc

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LogicalScreenDesc

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.