[−][src]Struct astcenc_rs::Context
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]
&mut self,
image: &Image<T>,
swizzle: Swizzle
) -> Result<Vec<u8>, Error> where
D: DataType,
T: Deref<Target = [D]>,
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]
&mut self,
data: &[u8],
out: &mut Image<T>,
swizzle: Swizzle
) -> Result<(), Error> where
D: DataType,
T: DerefMut<Target = [D]>,
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]
&mut self,
data: &[u8],
extents: Extents,
border_padding: u32,
swizzle: Swizzle
) -> Result<Image<Vec<D>>, Error> where
D: DataType,
Decompress an image. The metadata is not stored in the compressed data itself, and should be stored as a separate header.
Trait Implementations
Auto Trait Implementations
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, 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>,