Struct cpclib::image::Sprite

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

A Sprite corresponds to a set of bytes encoded to the right CPC pixel format for a given palette. TODO Check why mode nad palette are optionnals. Force them if it is not mandatory to have htem optionnal

Implementations

TODO Use TryFrom once in standard rust The conversion can only work if a palette and a mode is provided

Produce a linearized version of the sprite.

Get the palette of the sprite

Get hte sprite Mode Cannot manage multimode sprites of course

Get the height (in pixels) of the image TODO Use a trait for that

Get the width (in bytes) of the image TODO Use a trait for that

Get the width in pixels of the image. The mode must be specified

Returns the byte at the right position and crash if it does not exists

Returns the byte at the right position if exists

Returns the line of interest

Convert an RGB image to a sprite that code the pixels XXX Since 2018-06-16, most of code is delagated to ColorMatrix => maybe some bugs has been added

Apply a transformation function on each line It can change there size

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.

Calls U::from(self).

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

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