mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-18 20:40:28 +00:00
Image: Fix implicit enum error
This commit is contained in:
@@ -167,6 +167,7 @@ Error :: union #shared_nil {
|
||||
General_Image_Error :: enum {
|
||||
None = 0,
|
||||
Invalid_Image_Dimensions,
|
||||
Invalid_Number_Of_Channels,
|
||||
Image_Dimensions_Too_Large,
|
||||
Image_Does_Not_Adhere_to_Spec,
|
||||
Invalid_Input_Image,
|
||||
@@ -213,7 +214,6 @@ Netpbm_Error :: enum {
|
||||
// writing
|
||||
File_Not_Writable,
|
||||
Invalid_Format,
|
||||
Invalid_Number_Of_Channels,
|
||||
Invalid_Image_Depth,
|
||||
}
|
||||
|
||||
@@ -339,7 +339,6 @@ PNG_Interlace_Method :: enum u8 {
|
||||
QOI_Error :: enum {
|
||||
None = 0,
|
||||
Invalid_QOI_Signature,
|
||||
Invalid_Number_Of_Channels, // QOI allows 3 or 4 channel data.
|
||||
Invalid_Bit_Depth, // QOI supports only 8-bit images, error only returned from writer.
|
||||
Invalid_Color_Space, // QOI allows 0 = sRGB or 1 = linear.
|
||||
Corrupt, // More data than pixels to decode into, for example.
|
||||
|
||||
@@ -104,7 +104,7 @@ write_to_buffer :: proc(img: Image, allocator := context.allocator) -> (buffer:
|
||||
//? validation
|
||||
if header.format in (PBM + PGM + Formats{.Pf}) && img.channels != 1 \
|
||||
|| header.format in (PPM + Formats{.PF}) && img.channels != 3 {
|
||||
err = Format_Error.Invalid_Number_Of_Channels
|
||||
err = .Invalid_Number_Of_Channels
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user