138,27 → 138,6 |
endp |
|
;;================================================================================================;; |
proc img.to_rgb2 _img, _out ;/////////////////////////////////////////////////////////////////////;; |
;;------------------------------------------------------------------------------------------------;; |
;? --- TBD --- ;; |
;;------------------------------------------------------------------------------------------------;; |
;> --- TBD --- ;; |
;;------------------------------------------------------------------------------------------------;; |
;< --- TBD --- ;; |
;;================================================================================================;; |
push esi edi |
mov esi, [_img] |
stdcall img._.validate, esi |
or eax, eax |
jnz .ret |
mov edi, [_out] |
call img._.do_rgb |
.ret: |
pop edi esi |
ret |
endp |
|
;;================================================================================================;; |
proc img.to_rgb _img ;////////////////////////////////////////////////////////////////////////////;; |
;;------------------------------------------------------------------------------------------------;; |
;? --- TBD --- ;; |
168,8 → 147,7 |
;< eax = 0 / pointer to rgb_data (array of [rgb] triplets) ;; |
;;================================================================================================;; |
push esi edi |
mov esi, [_img] |
stdcall img._.validate, esi |
stdcall img._.validate, [_img] |
or eax, eax |
jnz .error |
|
187,33 → 165,13 |
stosd |
mov eax, [esi + Image.Height] |
stosd |
call img._.do_rgb |
pop eax |
pop edi esi |
ret |
|
.error: |
xor eax, eax |
pop edi esi |
ret |
endp |
|
;;================================================================================================;; |
proc img._.do_rgb ;///////////////////////////////////////////////////////////////////////////////;; |
;;------------------------------------------------------------------------------------------------;; |
;? --- TBD --- ;; |
;;------------------------------------------------------------------------------------------------;; |
;> --- TBD --- ;; |
;;------------------------------------------------------------------------------------------------;; |
;< --- TBD --- ;; |
;;================================================================================================;; |
mov ecx, [esi + Image.Width] |
imul ecx, [esi + Image.Height] |
mov eax, [esi + Image.Type] |
dec eax |
jz .bpp8 |
dec eax |
jz .bpp24 |
dec eax |
jnz .error_pop |
; 32 BPP -> 24 BPP |
mov esi, [esi + Image.Data] |
|
223,7 → 181,8 |
dec edi |
jmp @b |
|
@@: |
@@: pop eax |
pop edi esi |
ret |
|
.bpp24: |
232,6 → 191,8 |
mov esi, [esi + Image.Data] |
shr ecx, 2 |
rep movsd |
pop eax |
pop edi esi |
ret |
|
.bpp8: |
248,7 → 209,17 |
sub ecx, 1 |
jnz @b |
pop ebx |
pop eax |
pop edi esi |
ret |
|
.error_pop: |
pop eax |
|
.error: |
xor eax, eax |
pop edi esi |
ret |
endp |
|
;;================================================================================================;; |
1153,7 → 1124,7 |
|
export \ |
lib_init , 'lib_init' , \ |
0x00010002 , 'version' , \ |
0x00010001 , 'version' , \ |
img.is_img , 'img.is_img' , \ |
img.info , 'img.info' , \ |
img.from_file , 'img.from_file' , \ |
1160,7 → 1131,6 |
img.to_file , 'img.to_file' , \ |
img.from_rgb , 'img.from_rgb' , \ |
img.to_rgb , 'img.to_rgb' , \ |
img.to_rgb2 , 'img.to_rgb2' , \ |
img.decode , 'img.decode' , \ |
img.encode , 'img.encode' , \ |
img.create , 'img.create' , \ |