Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions basis-universal/examples/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use basis_universal::{
BasisTextureFormat, Compressor, CompressorParams, TranscodeParameters, Transcoder,
TranscoderTextureFormat, UserData,
};
use image::GenericImageView;

// This example:
// - Loads a PNG file
Expand All @@ -26,20 +25,7 @@ pub fn main() {
);

// We need to know how many color channels are in the image
use image::ColorType;
let channel_count = match &image_data.color() {
ColorType::L8 => 1,
ColorType::La8 => 2,
ColorType::Rgb8 => 3,
ColorType::Rgba8 => 4,
ColorType::L16 => 1,
ColorType::La16 => 2,
ColorType::Rgb16 => 3,
ColorType::Rgba16 => 4,
ColorType::Bgr8 => 3,
ColorType::Bgra8 => 4,
_ => unimplemented!(),
};
let channel_count = image_data.color().channel_count();

println!(
"Going to encode {}x{} image with {} channels ({} uncompressed bytes)",
Expand Down