Added initial Netpbm image format support
This commit is contained in:
1 parent
df4a0c62ad
commit
8d370fabdd
4 files changed
+785
No files matched your search
@@ -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 = ""
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user