forked from rebol/rebol
-
Notifications
You must be signed in to change notification settings - Fork 2
Decode
angerangel edited this page Mar 15, 2013
·
1 revision
DECODE type data
Decodes a series of bytes into the related datatype (e.g. image!).
DECODE is a function value.
- type -- Media type (jpeg, png, etc.) (word!)
- data -- The data to decode (binary!)
#SOURCE
decode: make function! [ [
{Decodes a series of bytes into the related datatype (e.g. image!).}
type [word!] "Media type (jpeg, png, etc.)"
data [binary!] "The data to decode"
/local cod
][
unless all [
cod: select system/codecs type
data: do-codec cod/entry 'decode data
] [
cause-error 'access 'no-codec type
]
data
] ]