package core:image/png
⌘K
Ctrl+K
or
/
Overview
Reader for PNG images.
The PNG specification is at https://www.w3.org/TR/PNG/.
Index
Constants (4)
Variables (4)
Procedures (32)
Procedure Groups (1)
Types
Error ¶
Error :: image.Error
Related Procedures With Returns
- append_chunk
- copy_chunk
- defilter
- load_from_bytes
- load_from_context
- load_from_file
- read_chunk
- read_header
- load (procedure groups)
Filter_Params ¶
Filter_Params :: struct #packed { src: []u8, dest: []u8, width: int, height: int, depth: int, channels: int, rescale: bool, }
Related Procedures With Parameters
Image ¶
Image :: image.Image
Related Procedures With Returns
- load_from_bytes
- load_from_context
- load_from_file
- load (procedure groups)
Options ¶
Options :: image.Options
Related Procedures With Parameters
- defilter
- load_from_bytes
- load_from_context
- load_from_file
- load (procedure groups)
PLTE_Entry ¶
PLTE_Entry :: [3]u8
Row_Filter ¶
Row_Filter :: enum u8 { None = 0, Sub = 1, Up = 2, Average = 3, Paeth = 4, }
Signature ¶
Signature :: enum u64be { // 0x89504e470d0a1a0a PNG = 0x89 << 56 | 'P' << 48 | 'N' << 40 | 'G' << 32 | '\r' << 24 | '\n' << 16 | 0x1a << 8 | '\n', }
cHRM_Raw ¶
cHRM_Raw :: struct #packed { w: CIE_1931_Raw, r: CIE_1931_Raw, g: CIE_1931_Raw, b: CIE_1931_Raw, }
pHYs_Unit ¶
pHYs_Unit :: enum u8 { Unknown = 0, Meter = 1, }
sRGB ¶
sRGB :: struct #packed { intent: sRGB_Rendering_Intent, }
sRGB_Rendering_Intent ¶
sRGB_Rendering_Intent :: enum u8 { Perceptual = 0, Relative_colorimetric = 1, Saturation = 2, Absolute_colorimetric = 3, }
tIME ¶
Other chunks
Constants
INCHES_PER_METER ¶
INCHES_PER_METER :: 1000.0 / 25.4
MAX_CHUNK_SIZE ¶
MAX_CHUNK_SIZE :: min(#config(PNG_MAX_CHUNK_SIZE, 16_777_216), 268_435_456)
For chunks other than IDAT with a variable size like zTXT and eXIf,
limit their size to 16 MiB each by default. Max of 256 MiB each.
MAX_IDAT_SIZE ¶
MAX_IDAT_SIZE :: min(#config(PNG_MAX_IDAT_SIZE, _MAX_IDAT_DEFAULT), _MAX_IDAT)
depth_scale_table ¶
depth_scale_table: []u8 : []u8{0, 0xff, 0x55, 0, 0x11, 0, 0, 0, 0x01}
Variables
ADAM7_X_ORIG ¶
ADAM7_X_ORIG: []int = …
ADAM7_X_SPACING ¶
ADAM7_X_SPACING: []int = …
ADAM7_Y_ORIG ¶
ADAM7_Y_ORIG: []int = …
ADAM7_Y_SPACING ¶
ADAM7_Y_SPACING: []int = …
Procedures
append_chunk ¶
append_chunk :: proc( list: ^[dynamic]image.PNG_Chunk, src: image.PNG_Chunk, allocator := context.allocator, ) -> (err: image.Error) {…}
chunk_type_to_name ¶
chunk_type_to_name :: proc(type: ^image.PNG_Chunk_Type) -> string {…}
compute_buffer_size ¶
compute_buffer_size :: image.compute_buffer_size
Function to help with image buffer calculations
copy_chunk ¶
copy_chunk :: proc( src: image.PNG_Chunk, allocator := context.allocator, ) -> (dest: image.PNG_Chunk, err: image.Error) {…}
defilter_16 ¶
defilter_16 :: proc(params: ^Filter_Params) -> bool {…}
defilter_8 ¶
defilter_8 :: proc(params: ^Filter_Params) -> (ok: bool) {…}
defilter_less_than_8 ¶
defilter_less_than_8 :: proc(params: ^Filter_Params) -> bool {…}
iccp_destroy ¶
iccp_destroy :: proc(i: iCCP) {…}
load_from_bytes ¶
load_from_bytes :: proc( data: []u8, options: image.Options = Options{}, allocator := context.allocator, ) -> (img: ^image.Image, err: image.Error) {…}
load_from_context ¶
load_from_context :: proc( ctx: ^$C, options: image.Options = Options{}, allocator := context.allocator, ) -> (img: ^image.Image, err: image.Error) {…}
load_from_file ¶
load_from_file :: proc( filename: string, options: image.Options = Options{}, allocator := context.allocator, ) -> (img: ^image.Image, err: image.Error) {…}
splt_destroy ¶
splt_destroy :: proc(s: sPLT) {…}
text_destroy ¶
text_destroy :: proc(text: Text) {…}
Procedure Groups
load ¶
load :: proc{ load_from_file, load_from_bytes, load_from_context, }
Source Files
Generation Information
Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-10 00:25:51.511820200 +0000 UTC