mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-03 03:24:41 +00:00
image/jpeg: better pack APP0 structs
This commit is contained in:
committed by
Jeroen van Rijn
parent
a6f18c3367
commit
8644f3beba
@@ -610,19 +610,19 @@ JFIF_Unit :: enum byte {
|
||||
|
||||
JFIF_APP0 :: struct {
|
||||
version: u16be,
|
||||
units: JFIF_Unit,
|
||||
x_density: u16be,
|
||||
y_density: u16be,
|
||||
x_thumbnail: byte,
|
||||
y_thumbnail: byte,
|
||||
thumbnail: []RGB_Pixel `fmt:"-"`,
|
||||
units: JFIF_Unit,
|
||||
x_thumbnail: u8,
|
||||
y_thumbnail: u8,
|
||||
greyscale_thumbnail: bool,
|
||||
thumbnail: []RGB_Pixel `fmt:"-"`,
|
||||
}
|
||||
|
||||
JFXX_APP0 :: struct {
|
||||
extension_code: JFXX_Extension_Code,
|
||||
x_thumbnail: int,
|
||||
y_thumbnail: int,
|
||||
x_thumbnail: u8,
|
||||
y_thumbnail: u8,
|
||||
thumbnail: []byte `fmt:"-"`,
|
||||
}
|
||||
|
||||
|
||||
@@ -270,13 +270,13 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
|
||||
}
|
||||
info.jfif_app0 = image.JFIF_APP0{
|
||||
version,
|
||||
units,
|
||||
x_density,
|
||||
y_density,
|
||||
units,
|
||||
cast(u8)x_thumbnail,
|
||||
cast(u8)y_thumbnail,
|
||||
thumbnail,
|
||||
greyscale_thumbnail,
|
||||
thumbnail,
|
||||
}
|
||||
img.metadata = info
|
||||
}
|
||||
@@ -330,8 +330,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
|
||||
}
|
||||
info.jfxx_app0 = image.JFXX_APP0{
|
||||
extension_code,
|
||||
x_thumbnail,
|
||||
y_thumbnail,
|
||||
cast(u8)x_thumbnail,
|
||||
cast(u8)y_thumbnail,
|
||||
thumbnail,
|
||||
}
|
||||
img.metadata = info
|
||||
@@ -359,8 +359,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
|
||||
}
|
||||
info.jfxx_app0 = image.JFXX_APP0{
|
||||
extension_code,
|
||||
x_thumbnail,
|
||||
y_thumbnail,
|
||||
cast(u8)x_thumbnail,
|
||||
cast(u8)y_thumbnail,
|
||||
pixels,
|
||||
}
|
||||
img.metadata = info
|
||||
|
||||
Reference in New Issue
Block a user