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
18 changes: 17 additions & 1 deletion src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ pub enum ExtendedColorType {
/// Pixel is 8-bit BGR with an alpha channel
Bgra8,

// TODO f16 types?
/// Pixel is 32-bit float luminance
L32F,
/// Pixel is 32-bit float luminance with an alpha channel
Expand All @@ -171,6 +170,15 @@ pub enum ExtendedColorType {
/// Pixel is 8-bit YCbCr
YCbCr8,

/// Pixel is 16-bit float luminance
L16F,
/// Pixel is 16-bit float luminance with an alpha channel
La16F,
/// Pixel is 16-bit float RGB
Rgb16F,
/// Pixel is 16-bit float RGBA
Rgba16F,

/// Pixel is of unknown color type with the specified bits per pixel. This can apply to pixels
/// which are associated with an external palette. In that case, the pixel value is an index
/// into the palette.
Expand All @@ -191,20 +199,23 @@ impl ExtendedColorType {
| ExtendedColorType::L4
| ExtendedColorType::L8
| ExtendedColorType::L16
| ExtendedColorType::L16F
| ExtendedColorType::L32F
| ExtendedColorType::Unknown(_) => 1,
ExtendedColorType::La1
| ExtendedColorType::La2
| ExtendedColorType::La4
| ExtendedColorType::La8
| ExtendedColorType::La16
| ExtendedColorType::La16F
| ExtendedColorType::La32F => 2,
ExtendedColorType::Rgb1
| ExtendedColorType::Rgb2
| ExtendedColorType::Rgb4
| ExtendedColorType::Rgb5x1
| ExtendedColorType::Rgb8
| ExtendedColorType::Rgb16
| ExtendedColorType::Rgb16F
| ExtendedColorType::Rgb32F
| ExtendedColorType::YCbCr8
| ExtendedColorType::Bgr8 => 3,
Expand All @@ -213,6 +224,7 @@ impl ExtendedColorType {
| ExtendedColorType::Rgba4
| ExtendedColorType::Rgba8
| ExtendedColorType::Rgba16
| ExtendedColorType::Rgba16F
| ExtendedColorType::Rgba32F
| ExtendedColorType::Bgra8
| ExtendedColorType::Cmyk8
Expand Down Expand Up @@ -246,6 +258,10 @@ impl ExtendedColorType {
ExtendedColorType::La16 => 32,
ExtendedColorType::Rgb16 => 48,
ExtendedColorType::Rgba16 => 64,
ExtendedColorType::L16F => 16,
ExtendedColorType::La16F => 32,
ExtendedColorType::Rgb16F => 48,
ExtendedColorType::Rgba16F => 64,
ExtendedColorType::L32F => 32,
ExtendedColorType::La32F => 64,
ExtendedColorType::Rgb32F => 96,
Expand Down
Loading