aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2026-01-24 11:40:54 +0100
committerGitHub <noreply@github.com>2026-01-24 11:40:54 +0100
commit8ffc98b4bf791e25e9281ddfe32a1308b5ccbed3 (patch)
treedfd686f084a690cfddb5ff5db775558de309bf02
parent533079fc1ae8e88ae7a5ce10666e56a53791a0d0 (diff)
parent550e57aba977ff766e5ab38a4c13a8dc18d55992 (diff)
Merge pull request #5661 from leecommamichael/core-image-tga
[core:image/tga] implement Option.do_not_expand_grayscale
-rw-r--r--core/image/tga/tga.odin7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/image/tga/tga.odin b/core/image/tga/tga.odin
index 260720bb4..1941b53f9 100644
--- a/core/image/tga/tga.odin
+++ b/core/image/tga/tga.odin
@@ -152,7 +152,7 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
// Intentionally blank
case .Uncompressed_Black_White:
black_white = true
- dest_depth = 24
+ dest_depth = 8 if .do_not_expand_grayscale in options else 24
case .Uncompressed_Color_Mapped:
color_mapped = true
case .Compressed_Color_Mapped:
@@ -161,7 +161,7 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
case .Compressed_Black_White:
black_white = true
rle_encoding = true
- dest_depth = 24
+ dest_depth = 8 if .do_not_expand_grayscale in options else 24
case:
return nil, .Unsupported_Format
@@ -180,6 +180,9 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
}
switch dest_depth {
+ case 8: // R8
+ src_channels = 1
+ dest_channels = 1
case 15: // B5G5R5
src_channels = 2
dest_channels = 3