Struct vtflib::VtfFile [−][src]
#[must_use]pub struct VtfFile<'a> { /* fields omitted */ }
Expand description
A VTF file. Must be bound before it can be worked on.
Implementations
impl<'a> VtfFile<'a>
[src]
impl<'a> VtfFile<'a>
[src]pub fn bind(self, _guard: &mut VtfGuard) -> BoundVtfFile<'a, '_>
[src]
pub fn bind(self, _guard: &mut VtfGuard) -> BoundVtfFile<'a, '_>
[src]#[must_use]pub fn compute_image_size(
width: u32,
height: u32,
depth: u32,
mipmaps: u32,
format: ImageFormat
) -> u32
[src]
#[must_use]pub fn compute_image_size(
width: u32,
height: u32,
depth: u32,
mipmaps: u32,
format: ImageFormat
) -> u32
[src]Compute how much memory a specified image needs in bytes.
#[must_use]pub fn compute_mipmap_count(width: u32, height: u32, depth: u32) -> u32
[src]
#[must_use]pub fn compute_mipmap_count(width: u32, height: u32, depth: u32) -> u32
[src]Compute the number of mip levels needed for an image of given dimensions. The number includes the original image, and counts mipmaps down to 1x1 pixels.
#[must_use]pub fn compute_mipmap_dimensions(
width: u32,
height: u32,
depth: u32,
mipmap_level: u32
) -> (u32, u32, u32)
[src]
#[must_use]pub fn compute_mipmap_dimensions(
width: u32,
height: u32,
depth: u32,
mipmap_level: u32
) -> (u32, u32, u32)
[src]Compute the dimensions of a given mip level for an image of given dimensions.
#[must_use]pub fn compute_mipmap_size(
width: u32,
height: u32,
depth: u32,
mipmap_level: u32,
format: ImageFormat
) -> u32
[src]
#[must_use]pub fn compute_mipmap_size(
width: u32,
height: u32,
depth: u32,
mipmap_level: u32,
format: ImageFormat
) -> u32
[src]Compute how much memory a given mipmap level needs in bytes.
pub fn convert_image_to_rgba8888(
source: &[u8],
width: u32,
height: u32,
source_format: ImageFormat
) -> Result<Vec<u8>>
[src]
pub fn convert_image_to_rgba8888(
source: &[u8],
width: u32,
height: u32,
source_format: ImageFormat
) -> Result<Vec<u8>>
[src]Convert an image stored in a given format to ImageFormat::Rgba8888
.
Errors
Returns Err
if source
has invalid length or if the conversion fails.
pub fn convert_image_from_rgba8888(
source: &[u8],
width: u32,
height: u32,
dest_format: ImageFormat
) -> Result<Vec<u8>>
[src]
pub fn convert_image_from_rgba8888(
source: &[u8],
width: u32,
height: u32,
dest_format: ImageFormat
) -> Result<Vec<u8>>
[src]Convert an image stored in ImageFormat::Rgba8888
to a given format.
Errors
Returns Err
if source
has invalid length or if the conversion fails.
pub fn convert_image(
source: &[u8],
width: u32,
height: u32,
source_format: ImageFormat,
dest_format: ImageFormat
) -> Result<Vec<u8>>
[src]
pub fn convert_image(
source: &[u8],
width: u32,
height: u32,
source_format: ImageFormat,
dest_format: ImageFormat
) -> Result<Vec<u8>>
[src]Convert between supported image formats.
Errors
Returns Err
if source
has invalid length or if the conversion fails.
pub fn convert_image_to_normal_map(
source: &[u8],
width: u32,
height: u32,
settings: &NormalMapConversionSettings
) -> Result<Vec<u8>>
[src]
pub fn convert_image_to_normal_map(
source: &[u8],
width: u32,
height: u32,
settings: &NormalMapConversionSettings
) -> Result<Vec<u8>>
[src]Convert an image stored in ImageFormat::Rgba8888
to a normal map.
Errors
Returns Err
if source
has invalid length or if the conversion fails.
pub fn resize_image(
source: &[u8],
source_width: u32,
source_height: u32,
target_width: u32,
target_height: u32,
resize_filter: MipmapFilter,
sharpen_filter: SharpenFilter
) -> Result<Vec<u8>>
[src]
pub fn resize_image(
source: &[u8],
source_width: u32,
source_height: u32,
target_width: u32,
target_height: u32,
resize_filter: MipmapFilter,
sharpen_filter: SharpenFilter
) -> Result<Vec<u8>>
[src]Resize an image stored in ImageFormat::Rgba8888
to the given dimensions.
Errors
Returns Err
if source
has invalid length or if the resize fails.
pub fn correct_image_gamma(
data: &mut [u8],
width: u32,
height: u32,
gamma_correction: f32
) -> Result<()>
[src]
pub fn correct_image_gamma(
data: &mut [u8],
width: u32,
height: u32,
gamma_correction: f32
) -> Result<()>
[src]Apply gamma correction to an image stored in ImageFormat::Rgba8888
.
Errors
Returns Err
if data
has invalid length.
pub fn compute_image_reflectivity(
data: &[u8],
width: u32,
height: u32
) -> Result<(f32, f32, f32)>
[src]
pub fn compute_image_reflectivity(
data: &[u8],
width: u32,
height: u32
) -> Result<(f32, f32, f32)>
[src]Compute the reflectivity of an image stored in ImageFormat::Rgba8888
.
Errors
Returns Err
if data
has invalid length.