[][src]Struct astcenc_rs::Context

pub struct Context { /* fields omitted */ }

The core context. All configuration should be done through this.

Implementations

impl Context[src]

pub fn new(config: Config) -> Result<Self, Error>[src]

Create a new context from the given config (see ConfigBuilder for more information on this config). Returns an error in the case that the config is invalid or the context could not be allocated.

pub fn compress<D, T>(
    &mut self,
    image: &Image<T>,
    swizzle: Swizzle
) -> Result<Vec<u8>, Error> where
    D: DataType,
    T: Deref<Target = [D]>, 
[src]

Compress the given image, returning a byte vector that can be sent to the GPU.

pub fn decompress_into<D, T>(
    &mut self,
    data: &[u8],
    out: &mut Image<T>,
    swizzle: Swizzle
) -> Result<(), Error> where
    D: DataType,
    T: DerefMut<Target = [D]>, 
[src]

Decompress an image into a pre-existing buffer. The metadata (size and border padding) must already be set and enough space must be reserved in out.data for the output pixels (RGBA).

pub fn decompress<D>(
    &mut self,
    data: &[u8],
    extents: Extents,
    border_padding: u32,
    swizzle: Swizzle
) -> Result<Image<Vec<D>>, Error> where
    D: DataType
[src]

Decompress an image. The metadata is not stored in the compressed data itself, and should be stored as a separate header.

Trait Implementations

impl Default for Context[src]

impl Send for Context[src]

impl Sync for Context[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.