From 11e69b40217a18f9a8610026be3fda31879dd581 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Sun, 13 Dec 2020 18:07:49 +0000 Subject: [PATCH] libimg: export img.resize_data git-svn-id: svn://kolibrios.org@8395 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../develop/libraries/libs-dev/libimg/gif/gif.asm | 8 ++++---- .../develop/libraries/libs-dev/libimg/libimg.asm | 15 ++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/programs/develop/libraries/libs-dev/libimg/gif/gif.asm b/programs/develop/libraries/libs-dev/libimg/gif/gif.asm index 341270e16..37dc6407d 100644 --- a/programs/develop/libraries/libs-dev/libimg/gif/gif.asm +++ b/programs/develop/libraries/libs-dev/libimg/gif/gif.asm @@ -238,7 +238,7 @@ img.decode.gif.cur_color_table_size_child equ ebp + 4 + 4 + 4*3 + 4 movzx eax, [ebx + gif.ImageDescriptor.Width] movzx ecx, [ebx + gif.ImageDescriptor.Height] push edx - stdcall img._.resize_data, [img], eax, ecx + stdcall img.resize_data, [img], eax, ecx pop edx or eax, eax jz .error @@ -875,7 +875,7 @@ proc img.decode.gif._.superimpose ;///////////////////////////////////////////// movzx eax, [ebx + sizeof.gif.Image + gif.LogicalScreenDescriptor.ScreenHeight] push eax movzx eax, [ebx + sizeof.gif.Image + gif.LogicalScreenDescriptor.ScreenWidth] - stdcall img._.resize_data, edx, eax + stdcall img.resize_data, edx, eax pop edx test eax, eax jz .palette_nomem @@ -989,7 +989,7 @@ proc img.decode.gif._.superimpose ;///////////////////////////////////////////// movzx eax, [ebx + gif.Header.lsd.ScreenHeight] push eax movzx eax, [ebx + gif.Header.lsd.ScreenWidth] - stdcall img._.resize_data, edx, eax + stdcall img.resize_data, edx, eax pop edx test eax, eax jz .convrgb_nomem @@ -1092,7 +1092,7 @@ proc img.decode.gif._.superimpose ;///////////////////////////////////////////// movzx eax, [ebx + gif.Header.lsd.ScreenHeight] push eax movzx eax, [ebx + gif.Header.lsd.ScreenWidth] - stdcall img._.resize_data, edx, eax + stdcall img.resize_data, edx, eax pop edx test eax, eax jz .rgb_nomem diff --git a/programs/develop/libraries/libs-dev/libimg/libimg.asm b/programs/develop/libraries/libs-dev/libimg/libimg.asm index baac0e375..7806b9a18 100644 --- a/programs/develop/libraries/libs-dev/libimg/libimg.asm +++ b/programs/develop/libraries/libs-dev/libimg/libimg.asm @@ -852,7 +852,7 @@ proc img.create _width, _height, _type ;//////////////////////////////////////// push eax - stdcall img._.resize_data, eax, [_width], [_height] + stdcall img.resize_data, eax, [_width], [_height] or eax, eax jz .error.2 @@ -2557,13 +2557,17 @@ proc img._.delete _img ;//////////////////////////////////////////////////////// endp ;;================================================================================================;; -proc img._.resize_data _img, _width, _height ;////////////////////////////////////////////////////;; +proc img.resize_data _img, _width, _height ;//////////////////////////////////////////////////////;; ;;------------------------------------------------------------------------------------------------;; -;? --- TBD --- ;; +;? Resize data block of image. New size is calculated from _width and _height params and internal ;; +;? Image.Type value. All the internal fields are updated iff succeeded. ;; +;? This function does not scale images, use img.scale if you need to. ;; ;;------------------------------------------------------------------------------------------------;; -;> --- TBD --- ;; +;> _img = pointer to image ;; +;> _width = new width ;; +;> _height = new height ;; ;;------------------------------------------------------------------------------------------------;; -;< --- TBD --- ;; +;< eax = 0 (fail) / pointer to the new pixels data ;; ;;================================================================================================;; push ebx esi mov ebx, [_img] @@ -2819,6 +2823,7 @@ export \ img.get_scaled_size, 'img_get_scaled_size', \ img.convert , 'img_convert' , \ img.blend , 'img_blend' , \ + img.resize_data , 'img_resize_data' , \ img.formats_table , 'img_formats_table' ; import from deflate unpacker