libimg: add img.from_file, refactor img.convert.

Add new function, img.from_file: gets file name and returns decoded Image.
Make img.convert code less spaghetti: use jump table, not a chain of jmp's.


git-svn-id: svn://kolibrios.org@7105 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
2017-10-31 21:33:52 +00:00
parent 437e995f11
commit 6cf659fe71
3 changed files with 593 additions and 540 deletions

View File

@@ -30,7 +30,7 @@ LIBIMG_FORMAT_XCF = 9
LIBIMG_FORMAT_TIFF = 10
LIBIMG_FORMAT_PNM = 11
LIBIMG_FORMAT_WBMP = 12
LIBIMG_FORMAT_XBM = 13
LIBIMG_FORMAT_XBM = 13
LIBIMG_FORMAT_Z80 = 14
; scale type ; corresponding img.scale params
@@ -65,10 +65,10 @@ LIBIMG_ERROR_NOT_INPLEMENTED = 9
LIBIMG_ERROR_INVALID_INPUT = 10
; encode flags (byte 0x02 of _common option)
;LIBIMG_ENCODE_STRICT_SPECIFIC = 0x01
LIBIMG_ENCODE_STRICT_BIT_DEPTH = 0x02
;LIBIMG_ENCODE_DELETE_ALPHA = 0x08
;LIBIMG_ENCODE_FLUSH_ALPHA = 0x10
;LIBIMG_ENCODE_STRICT_SPECIFIC = 0x01
LIBIMG_ENCODE_STRICT_BIT_DEPTH = 0x02
;LIBIMG_ENCODE_DELETE_ALPHA = 0x08
;LIBIMG_ENCODE_FLUSH_ALPHA = 0x10
; convert flags
; none so far