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 (30)
- ADAM7_X_SPACING
- CIE_1931_Raw
- MAX_CHUNK_SIZE
- Options
- Options
- append_chunk
- chrm
- chunk_type_to_name
- copy_chunk
- defilter
- defilter_8
- defilter_less_than_8
- exif
- filter_paeth
- gamma
- hIST
- hist
- iccp
- iccp_destroy
- load_from_bytes
- load_from_context
- load_from_file
- phys_to_dpi
- plte
- read_header
- splt
- splt_destroy
- srgb
- text_destroy
- time
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 ¶
Related Procedures With Returns
Row_Filter ¶
Row_Filter :: enum u8 { None = 0, Sub = 1, Up = 2, Average = 3, Paeth = 4, }
Signature ¶
Signature :: enum u64be { // 0x89504e470d0a1a0a PNG = 9894494448401390090, }
cHRM ¶
Related Procedures With Returns
cHRM_Raw ¶
cHRM_Raw :: struct #packed { w: CIE_1931_Raw, r: CIE_1931_Raw, g: CIE_1931_Raw, b: CIE_1931_Raw, }
hIST ¶
Related Procedures With Returns
load_from_file ¶
load_from_file :: PLTE_Entry
pHYs_Unit ¶
pHYs_Unit :: enum u8 { Unknown = 0, Meter = 1, }
sRGB_Rendering_Intent ¶
sRGB_Rendering_Intent :: enum u8 { Perceptual = 0, Relative_colorimetric = 1, Saturation = 2, Absolute_colorimetric = 3, }
Constants
INCHES_PER_METER ¶
INCHES_PER_METER :: 1000.0 / 25.4
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}
load ¶
load :: MAX_CHUNK_SIZE
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.
Variables
ADAM7_X_ORIG ¶
ADAM7_X_ORIG: []int = …
ADAM7_X_SPACING ¶
ADAM7_X_SPACING: []int = …
ADAM7_Y_SPACING ¶
ADAM7_Y_SPACING: []int = …
hIST ¶
hIST :: ADAM7_Y_ORIG
Procedures
ADAM7_X_SPACING ¶
ADAM7_X_SPACING :: text
CIE_1931_Raw ¶
CIE_1931_Raw :: defilter_16
MAX_CHUNK_SIZE ¶
MAX_CHUNK_SIZE :: core_time
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 {…}
copy_chunk ¶
copy_chunk :: proc(src: image.PNG_Chunk, allocator := context.allocator) -> (dest: image.PNG_Chunk, err: image.Error) {…}
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) {…}
Related Procedure Groups
load_from_context ¶
load_from_context :: proc(ctx: ^$C, options: image.Options = Options{}, allocator := context.allocator) -> (img: ^image.Image, err: image.Error) {…}
Related Procedure Groups
load_from_file ¶
load_from_file :: proc(filename: string, options: image.Options = Options{}, allocator := context.allocator) -> (img: ^image.Image, err: image.Error) {…}
Related Procedure Groups
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-03 (vendor "odin") Windows_amd64 @ 2026-03-16 21:30:53.982959300 +0000 UTC