diff --git a/programs/develop/libraries/libs-dev/.test/003/in_1bpp.png b/programs/develop/libraries/libs-dev/.test/003/in_1bpp.png deleted file mode 100644 index 967b75b5c2..0000000000 Binary files a/programs/develop/libraries/libs-dev/.test/003/in_1bpp.png and /dev/null differ diff --git a/programs/develop/libraries/libs-dev/.test/003/in_1bpp.wbmp b/programs/develop/libraries/libs-dev/.test/003/in_1bpp.wbmp new file mode 100644 index 0000000000..1a575b79d7 Binary files /dev/null and b/programs/develop/libraries/libs-dev/.test/003/in_1bpp.wbmp differ diff --git a/programs/develop/libraries/libs-dev/.test/003/in_8bpp.png b/programs/develop/libraries/libs-dev/.test/003/in_8bpp.png deleted file mode 100644 index 2d11838add..0000000000 Binary files a/programs/develop/libraries/libs-dev/.test/003/in_8bpp.png and /dev/null differ diff --git a/programs/develop/libraries/libs-dev/.test/003/in_8bpp.tiff b/programs/develop/libraries/libs-dev/.test/003/in_8bpp.tiff new file mode 100644 index 0000000000..1f539cbd1e Binary files /dev/null and b/programs/develop/libraries/libs-dev/.test/003/in_8bpp.tiff differ diff --git a/programs/develop/libraries/libs-dev/.test/003/test003.asm b/programs/develop/libraries/libs-dev/.test/003/test003.asm index 6b6a46dded..84c4de11bb 100644 --- a/programs/develop/libraries/libs-dev/.test/003/test003.asm +++ b/programs/develop/libraries/libs-dev/.test/003/test003.asm @@ -74,6 +74,28 @@ START: 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 @@ endp ;----------------------------------------------------------------------------- -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,23 +221,29 @@ import libio , \ file.size , 'file_size' , \ file.open , 'file_open' , \ file.read , 'file_read' , \ + file.write , 'file_write' , \ file.close , 'file_close' import libimg , \ 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' ;----------------------------------------------------------------------------- I_END: -img_data dd ? -img_data_len dd ? -fh dd ? +img_data dd ? +img_data_len dd ? +fh dd ? -image_initial dd ? -image_to_rgb2 dd ? +image_initial dd ? +image_to_rgb2 dd ? + +encoded_file dd ? +encoded_file_size dd ?