Enum squish::Format [−][src]
pub enum Format { Bc1, Bc2, Bc3, }
Defines a compression format
Variants
Bc1
Bc2
Bc3
Methods
impl Format
[src]
impl Format
pub fn decompress(
self,
data: &[u8],
width: usize,
height: usize,
output: &mut [u8]
)
[src]
pub fn decompress(
self,
data: &[u8],
width: usize,
height: usize,
output: &mut [u8]
)
Decompresses an image in memory
data
- The compressed image datawidth
- The width of the source imageheight
- The height of the source imageoutput
- Space to store the decompressed image
pub fn compressed_size(self, width: usize, height: usize) -> usize
[src]
pub fn compressed_size(self, width: usize, height: usize) -> usize
Computes the amount of space in bytes needed for an image of given size, accounting for padding to a multiple of 4x4 pixels
width
- Width of the uncompressed imageheight
- Height of the uncompressed image
pub fn compress(
self,
rgba: &[u8],
width: usize,
height: usize,
params: Params,
output: &mut [u8]
)
[src]
pub fn compress(
self,
rgba: &[u8],
width: usize,
height: usize,
params: Params,
output: &mut [u8]
)
Compresses an image in memory
rgba
- The uncompressed pixel datawidth
- The width of the source imageheight
- The height of the source imageparams
- Additional compressor parametersoutput
- Output buffer for the compressed image. Ensure that this has at least as much space available ascompute_compressed_size
suggests.
Trait Implementations
impl Clone for Format
[src]
impl Clone for Format
fn clone(&self) -> Format
[src]
fn clone(&self) -> Format
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Format
[src]
impl Copy for Format
impl Debug for Format
[src]
impl Debug for Format
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for Format
[src]
impl Eq for Format
impl PartialEq for Format
[src]
impl PartialEq for Format
fn eq(&self, other: &Format) -> bool
[src]
fn eq(&self, other: &Format) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl FromStr for Format
[src]
impl FromStr for Format
type Err = ParseFormatError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Format, ParseFormatError>
[src]
fn from_str(s: &str) -> Result<Format, ParseFormatError>
Parses a string s
to return a value of this type. Read more