[−][src]Struct gif_dispose::Screen
Combined GIF frames forming a "virtual screen"
Pixel type can be RGB8
or RGBA8
. The size is overall GIF size (grater or equal individual frame sizes).
Fields
pixels: ImgVec<PixelType>
Result of combining all frames so far. It's in RGB/RGBA.
Methods
impl Screen<RGBA8>
[src]
pub fn new_reader<T: Read>(reader: &Reader<T>) -> Self
[src]
Initialize an empty RGBA screen from the GIF Reader.
Make sure Reader is set to use Indexed color.
decoder.set(gif::ColorOutput::Indexed);
impl<PixelType: From<RGB8> + Copy + Default> Screen<PixelType>
[src]
pub fn from_reader<T: Read>(reader: &Reader<T>) -> Self
[src]
Create an new Screen
with any pixel type
You may need type hints or use the screen.pixels
to tell Rust whether you want RGB8
or RGBA8
.
pub fn new(
width: usize,
height: usize,
_bg_color: PixelType,
global_pal: Option<Vec<PixelType>>
) -> Self
[src]
width: usize,
height: usize,
_bg_color: PixelType,
global_pal: Option<Vec<PixelType>>
) -> Self
Manual setup of the canvas. You probably should use from_reader
instead.
bg_color
argument will be ignored. It appears that nobody tries to follow the GIF spec,
and background must always be transparent.
pub fn blit_frame(&mut self, frame: &Frame) -> Result<ImgRef<PixelType>, Error>
[src]
Advance the screen by one frame.
The result will be in screen.pixels.buf
pub fn blit(
&mut self,
local_pal: Option<&[PixelType]>,
method: DisposalMethod,
left: u16,
top: u16,
buffer: ImgRef<u8>,
transparent: Option<u8>
) -> Result<ImgRef<PixelType>, Error>
[src]
&mut self,
local_pal: Option<&[PixelType]>,
method: DisposalMethod,
left: u16,
top: u16,
buffer: ImgRef<u8>,
transparent: Option<u8>
) -> Result<ImgRef<PixelType>, Error>
Low-level version of blit_frame
Auto Trait Implementations
impl<PixelType> RefUnwindSafe for Screen<PixelType> where
PixelType: RefUnwindSafe,
PixelType: RefUnwindSafe,
impl<PixelType> Send for Screen<PixelType> where
PixelType: Send,
PixelType: Send,
impl<PixelType> Sync for Screen<PixelType> where
PixelType: Sync,
PixelType: Sync,
impl<PixelType> Unpin for Screen<PixelType> where
PixelType: Unpin,
PixelType: Unpin,
impl<PixelType> UnwindSafe for Screen<PixelType> where
PixelType: UnwindSafe,
PixelType: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,