Added initial Netpbm image format support

This commit is contained in:
WalterPlinge
2022-04-18 20:29:37 +01:00
parent df4a0c62ad
commit 8d370fabdd
4 changed files with 785 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package netpbm
import "core:bytes"
import "core:image"
destroy :: proc(img: ^image.Image) -> bool {
if img == nil do return false
//! TEMP CAST
info, ok := img.metadata.(^image.Netpbm_Info)
if !ok do return false
bytes.buffer_destroy(&img.pixels)
header_destroy(&info.header)
free(info)
img.metadata = nil
return true
}
header_destroy :: proc(using header: ^Header) {
if format == .P7 && tupltype != "" {
delete(tupltype)
tupltype = ""
}
}