74,6 → 74,28 |
stosb |
dec ecx |
jnz @b |
|
stdcall [img.encode], [image_to_rgb2], (LIBIMG_FORMAT_ID_PNM), 0 |
; stdcall [img.encode], [image_initial], (LIBIMG_FORMAT_ID_PNM), 0 |
test eax, eax |
jz exit |
mov [encoded_file], eax |
mov [encoded_file_size], ecx |
|
invoke file.open, output_file, O_WRITE OR O_CREATE |
or eax, eax |
jz exit |
mov [fh], eax |
|
invoke file.write, [fh], [encoded_file], [encoded_file_size] |
cmp eax, [encoded_file_size] |
jne exit |
|
invoke file.close, [fh] |
inc eax |
jz exit |
|
stdcall mem.Free, [encoded_file] |
;----------------------------------------------------------------------------- |
|
redraw: |
176,9 → 198,15 |
|
;----------------------------------------------------------------------------- |
|
window_title db 'img.to_rgb2 test app',0 |
window_title db 'libimg to_rgb2 & encode demo',0 |
|
;input_file db '/hd0/1/in_1bpp.wbmp',0 |
;input_file db '/hd0/1/in_8bpp.tiff',0 |
input_file db '/hd0/1/in_32bpp.png',0 |
|
;output_file db '/hd0/1/out_1bpp.pnm',0 |
;output_file db '/hd0/1/out_8bpp.pnm',0 |
output_file db '/hd0/1/out_24bpp.pnm',0 |
;----------------------------------------------------------------------------- |
|
align 16 |
193,6 → 221,7 |
file.size , 'file_size' , \ |
file.open , 'file_open' , \ |
file.read , 'file_read' , \ |
file.write , 'file_write' , \ |
file.close , 'file_close' |
|
import libimg , \ |
199,9 → 228,11 |
libimg.init , 'lib_init' , \ |
img.draw , 'img_draw' , \ |
img.decode , 'img_decode' , \ |
img.encode , 'img_encode' , \ |
img.create , 'img_create' , \ |
img.destroy , 'img_destroy', \ |
img.to_rgb2 , 'img_to_rgb2' |
img.to_rgb2 , 'img_to_rgb2', \ |
img.formats_table, 'img_formats_table' |
|
;----------------------------------------------------------------------------- |
|
213,3 → 244,6 |
|
image_initial dd ? |
image_to_rgb2 dd ? |
|
encoded_file dd ? |
encoded_file_size dd ? |