diff options
| author | Benoit Jacquier <benoit.jacquier@gmail.com> | 2022-08-27 16:07:21 +0200 |
|---|---|---|
| committer | Benoit Jacquier <benoit.jacquier@gmail.com> | 2022-08-27 16:07:21 +0200 |
| commit | 00f2e911a73e99b1283306272ff433984d90486c (patch) | |
| tree | b988e610ff5127dcf15999a2416b59164927b3b8 /core/image/common.odin | |
| parent | ecd81e8a5368321f28babd8d18e53401451b8667 (diff) | |
Add support for basic TGA loading
Diffstat (limited to 'core/image/common.odin')
| -rw-r--r-- | core/image/common.odin | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/image/common.odin b/core/image/common.odin index baacd64d9..beb3f93ee 100644 --- a/core/image/common.odin +++ b/core/image/common.odin @@ -61,6 +61,7 @@ Image_Metadata :: union #shared_nil { ^Netpbm_Info, ^PNG_Info, ^QOI_Info, + ^TGA_Info, } @@ -168,6 +169,7 @@ Error :: union #shared_nil { General_Image_Error :: enum { None = 0, + Unsupported_Option, // File I/O Unable_To_Read_File, Unable_To_Write_File, @@ -390,6 +392,10 @@ TGA_Header :: struct #packed { } #assert(size_of(TGA_Header) == 18) +TGA_Info :: struct { + header: TGA_Header, +} + // Function to help with image buffer calculations compute_buffer_size :: proc(width, height, channels, depth: int, extra_row_bytes := int(0)) -> (size: int) { size = ((((channels * width * depth) + 7) >> 3) + extra_row_bytes) * height |