aboutsummaryrefslogtreecommitdiff
path: root/core/image/common.odin
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-04-18 23:28:34 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2022-04-18 23:28:34 +0200
commitfdd24f787fd6df5c1f3339d6317c76a1bafe60f5 (patch)
tree08644f9a4b25fde2240535d24a5aa2ef228d7034 /core/image/common.odin
parentdf4a0c62add28af74ac8c926b3a6e0612296ccd1 (diff)
[image/tga] Writer for RGB(A) 8-bit images.
Diffstat (limited to 'core/image/common.odin')
-rw-r--r--core/image/common.odin14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/image/common.odin b/core/image/common.odin
index 2e7bca17e..8c77ec48a 100644
--- a/core/image/common.odin
+++ b/core/image/common.odin
@@ -320,6 +320,20 @@ QOI_Info :: struct {
header: QOI_Header,
}
+TGA_Header :: struct #packed {
+ id_length: u8,
+ color_map_type: u8,
+ data_type_code: u8,
+ color_map_origin: u16le,
+ color_map_length: u16le,
+ color_map_depth: u8,
+ origin: [2]u16le,
+ dimensions: [2]u16le,
+ bits_per_pixel: u8,
+ image_descriptor: u8,
+}
+#assert(size_of(TGA_Header) == 18)
+
// 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