diff --git a/src/color.rs b/src/color.rs index 80c0955b11..92d5665f42 100644 --- a/src/color.rs +++ b/src/color.rs @@ -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 @@ -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. @@ -191,6 +199,7 @@ impl ExtendedColorType { | ExtendedColorType::L4 | ExtendedColorType::L8 | ExtendedColorType::L16 + | ExtendedColorType::L16F | ExtendedColorType::L32F | ExtendedColorType::Unknown(_) => 1, ExtendedColorType::La1 @@ -198,6 +207,7 @@ impl ExtendedColorType { | ExtendedColorType::La4 | ExtendedColorType::La8 | ExtendedColorType::La16 + | ExtendedColorType::La16F | ExtendedColorType::La32F => 2, ExtendedColorType::Rgb1 | ExtendedColorType::Rgb2 @@ -205,6 +215,7 @@ impl ExtendedColorType { | ExtendedColorType::Rgb5x1 | ExtendedColorType::Rgb8 | ExtendedColorType::Rgb16 + | ExtendedColorType::Rgb16F | ExtendedColorType::Rgb32F | ExtendedColorType::YCbCr8 | ExtendedColorType::Bgr8 => 3, @@ -213,6 +224,7 @@ impl ExtendedColorType { | ExtendedColorType::Rgba4 | ExtendedColorType::Rgba8 | ExtendedColorType::Rgba16 + | ExtendedColorType::Rgba16F | ExtendedColorType::Rgba32F | ExtendedColorType::Bgra8 | ExtendedColorType::Cmyk8 @@ -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,