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