libimg: to_rgb2() proc; version bump
git-svn-id: svn://kolibrios.org@1001 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
9c55afa3c4
commit
76bc83bd66
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
@ -137,6 +137,27 @@ proc img.from_rgb _rgb_data ;///////////////////////////////////////////////////
|
|||||||
ret
|
ret
|
||||||
endp
|
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 ;////////////////////////////////////////////////////////////////////////////;;
|
proc img.to_rgb _img ;////////////////////////////////////////////////////////////////////////////;;
|
||||||
;;------------------------------------------------------------------------------------------------;;
|
;;------------------------------------------------------------------------------------------------;;
|
||||||
@ -147,7 +168,8 @@ proc img.to_rgb _img ;//////////////////////////////////////////////////////////
|
|||||||
;< eax = 0 / pointer to rgb_data (array of [rgb] triplets) ;;
|
;< eax = 0 / pointer to rgb_data (array of [rgb] triplets) ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
push esi edi
|
push esi edi
|
||||||
stdcall img._.validate, [_img]
|
mov esi, [_img]
|
||||||
|
stdcall img._.validate, esi
|
||||||
or eax, eax
|
or eax, eax
|
||||||
jnz .error
|
jnz .error
|
||||||
|
|
||||||
@ -165,13 +187,33 @@ proc img.to_rgb _img ;//////////////////////////////////////////////////////////
|
|||||||
stosd
|
stosd
|
||||||
mov eax, [esi + Image.Height]
|
mov eax, [esi + Image.Height]
|
||||||
stosd
|
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]
|
mov eax, [esi + Image.Type]
|
||||||
dec eax
|
dec eax
|
||||||
jz .bpp8
|
jz .bpp8
|
||||||
dec eax
|
dec eax
|
||||||
jz .bpp24
|
jz .bpp24
|
||||||
dec eax
|
|
||||||
jnz .error_pop
|
|
||||||
; 32 BPP -> 24 BPP
|
; 32 BPP -> 24 BPP
|
||||||
mov esi, [esi + Image.Data]
|
mov esi, [esi + Image.Data]
|
||||||
|
|
||||||
@ -181,8 +223,7 @@ proc img.to_rgb _img ;//////////////////////////////////////////////////////////
|
|||||||
dec edi
|
dec edi
|
||||||
jmp @b
|
jmp @b
|
||||||
|
|
||||||
@@: pop eax
|
@@:
|
||||||
pop edi esi
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.bpp24:
|
.bpp24:
|
||||||
@ -191,8 +232,6 @@ proc img.to_rgb _img ;//////////////////////////////////////////////////////////
|
|||||||
mov esi, [esi + Image.Data]
|
mov esi, [esi + Image.Data]
|
||||||
shr ecx, 2
|
shr ecx, 2
|
||||||
rep movsd
|
rep movsd
|
||||||
pop eax
|
|
||||||
pop edi esi
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.bpp8:
|
.bpp8:
|
||||||
@ -209,16 +248,6 @@ proc img.to_rgb _img ;//////////////////////////////////////////////////////////
|
|||||||
sub ecx, 1
|
sub ecx, 1
|
||||||
jnz @b
|
jnz @b
|
||||||
pop ebx
|
pop ebx
|
||||||
pop eax
|
|
||||||
pop edi esi
|
|
||||||
ret
|
|
||||||
|
|
||||||
.error_pop:
|
|
||||||
pop eax
|
|
||||||
|
|
||||||
.error:
|
|
||||||
xor eax, eax
|
|
||||||
pop edi esi
|
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
@ -1124,13 +1153,14 @@ align 4
|
|||||||
|
|
||||||
export \
|
export \
|
||||||
lib_init , 'lib_init' , \
|
lib_init , 'lib_init' , \
|
||||||
0x00010001 , 'version' , \
|
0x00010002 , 'version' , \
|
||||||
img.is_img , 'img.is_img' , \
|
img.is_img , 'img.is_img' , \
|
||||||
img.info , 'img.info' , \
|
img.info , 'img.info' , \
|
||||||
img.from_file , 'img.from_file' , \
|
img.from_file , 'img.from_file' , \
|
||||||
img.to_file , 'img.to_file' , \
|
img.to_file , 'img.to_file' , \
|
||||||
img.from_rgb , 'img.from_rgb' , \
|
img.from_rgb , 'img.from_rgb' , \
|
||||||
img.to_rgb , 'img.to_rgb' , \
|
img.to_rgb , 'img.to_rgb' , \
|
||||||
|
img.to_rgb2 , 'img.to_rgb2' , \
|
||||||
img.decode , 'img.decode' , \
|
img.decode , 'img.decode' , \
|
||||||
img.encode , 'img.encode' , \
|
img.encode , 'img.encode' , \
|
||||||
img.create , 'img.create' , \
|
img.create , 'img.create' , \
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
;; ;;
|
;; ;;
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
;; ;;
|
;; ;;
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
;; This file is part of Common development libraries (Libs-Dev). ;;
|
;; This file is part of Common development libraries (Libs-Dev). ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||||
;; General Public License as published by the Free Software Foundation, either version 3 of the ;;
|
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
|
||||||
;; License, or (at your option) any later version. ;;
|
;; of the License, or (at your option) any later version. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||||
;; General Public License for more details. ;;
|
;; Lesser General Public License for more details. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; You should have received a copy of the GNU General Public License along with Libs-Dev. If not, ;;
|
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;;
|
||||||
;; see <http://www.gnu.org/licenses/>. ;;
|
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;================================================================================================;;
|
;;================================================================================================;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user