forked from KolibriOS/kolibrios
add new function 'buf2d_filter_dither' from Heavyiron and diamond
git-svn-id: svn://kolibrios.org@3105 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -63,6 +63,7 @@ table { font-size: 15px; }
|
|||||||
<li><a href="#f_b_wdiv2">buf2d_img_wdiv2</a></li>
|
<li><a href="#f_b_wdiv2">buf2d_img_wdiv2</a></li>
|
||||||
<li><a href="#f_c_color">buf2d_crop_color</a></li>
|
<li><a href="#f_c_color">buf2d_crop_color</a></li>
|
||||||
<li><a href="#f_flip_v">buf2d_flip_v</a></li>
|
<li><a href="#f_flip_v">buf2d_flip_v</a></li>
|
||||||
|
<li><a href="#f_filter_d">buf2d_filter_dither</a></li>
|
||||||
|
|
||||||
<li><a href="#f_v_brush_c">buf2d_vox_brush_create</a></li>
|
<li><a href="#f_v_brush_c">buf2d_vox_brush_create</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -260,6 +261,12 @@ stdcall [buf2d_convert_text_matrix], buf_1</pre>
|
|||||||
<pre>stdcall buf2d_flip_v, buf_0</pre>
|
<pre>stdcall buf2d_flip_v, buf_0</pre>
|
||||||
<p><EFBFBD><EFBFBD><EFBFBD> buf_0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 24-<2D> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p>
|
<p><EFBFBD><EFBFBD><EFBFBD> buf_0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 24-<2D> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p>
|
||||||
|
|
||||||
|
<h4><a name="f_filter_d">buf2d_filter_dither</a></h4>
|
||||||
|
<p><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 24 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 8-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:</p>
|
||||||
|
<pre>stdcall [buf2d_filter_dither], buf_0, 0</pre>
|
||||||
|
<p><EFBFBD><EFBFBD><EFBFBD> buf_0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 24-<2D> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p>
|
||||||
|
<p>0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: 0 - Sierra Lite, 1 - Floyd-Steinberg, 2 - Burkers).</p>
|
||||||
|
|
||||||
<h4><a name="f_v_brush_c">buf2d_vox_brush_create</a></h4>
|
<h4><a name="f_v_brush_c">buf2d_vox_brush_create</a></h4>
|
||||||
<p><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:</p>
|
<p><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:</p>
|
||||||
<pre>stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
|
<pre>stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
|
||||||
@@ -353,6 +360,7 @@ import_buf2d_lib:
|
|||||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||||
buf2d_get_pixel dd sz_buf2d_get_pixel
|
buf2d_get_pixel dd sz_buf2d_get_pixel
|
||||||
buf2d_flip_v dd sz_buf2d_flip_v
|
buf2d_flip_v dd sz_buf2d_flip_v
|
||||||
|
buf2d_filter_dither dd sz_buf2d_filter_dither
|
||||||
|
|
||||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||||
buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
|
buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
|
||||||
@@ -396,6 +404,7 @@ import_buf2d_lib:
|
|||||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||||
sz_buf2d_get_pixel db 'buf2d_get_pixel',0
|
sz_buf2d_get_pixel db 'buf2d_get_pixel',0
|
||||||
sz_buf2d_flip_v db 'buf2d_flip_v',0
|
sz_buf2d_flip_v db 'buf2d_flip_v',0
|
||||||
|
sz_buf2d_filter_dither db 'buf2d_filter_dither',0
|
||||||
|
|
||||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||||
sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
|
sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
|
||||||
@@ -434,5 +443,6 @@ import_buf2d_lib:
|
|||||||
<p>11.08.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_img_hdiv2 <20> buf2d_img_wdiv2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 32 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p>
|
<p>11.08.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_img_hdiv2 <20> buf2d_img_wdiv2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 32 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p>
|
||||||
<p>01.10.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 90 <20> 180 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_rotate.</p>
|
<p>01.10.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 90 <20> 180 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_rotate.</p>
|
||||||
<p>15.11.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 24 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf_flip_v, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_img_hdiv2.</p>
|
<p>15.11.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 24 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf_flip_v, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_img_hdiv2.</p>
|
||||||
|
<p>14.12.12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> buf2d_filter_dither.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -3451,6 +3451,296 @@ proc buf_curve_bezier, buffer:dword, coord_p0:dword,coord_p1:dword,coord_p2:dwor
|
|||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
;䨫<><E4A8AB><EFBFBD><EFBFBD>
|
||||||
|
align 4
|
||||||
|
proc buf_filter_dither, buffer:dword, algor:dword
|
||||||
|
pushad
|
||||||
|
mov edi,[buffer]
|
||||||
|
cmp buf2d_bits,24
|
||||||
|
jne .error
|
||||||
|
mov edx,buf2d_w
|
||||||
|
mov esi,buf2d_h
|
||||||
|
mov edi,buf2d_data
|
||||||
|
;edi - pointer to 24bit bitmap
|
||||||
|
;edx - x size
|
||||||
|
;esi - y size
|
||||||
|
lea edx,[edx*3]
|
||||||
|
imul esi,edx
|
||||||
|
|
||||||
|
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD>
|
||||||
|
cmp dword[algor],0
|
||||||
|
jne @f
|
||||||
|
call dither_0
|
||||||
|
jmp .dither_end
|
||||||
|
@@:
|
||||||
|
cmp dword[algor],1
|
||||||
|
jne @f
|
||||||
|
call dither_1
|
||||||
|
jmp .dither_end
|
||||||
|
@@:
|
||||||
|
call dither_2
|
||||||
|
jmp .dither_end
|
||||||
|
.error:
|
||||||
|
stdcall print_err,sz_buf2d_filter_dither,txt_err_n24b
|
||||||
|
.dither_end:
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
endp
|
||||||
|
|
||||||
|
align 16
|
||||||
|
dither_0: ; Sierra Filter Lite algoritm
|
||||||
|
newp_0: ; Dithering cycle
|
||||||
|
xor ebx,ebx ; At first threshold
|
||||||
|
movzx ecx,byte[edi]
|
||||||
|
cmp cl,255
|
||||||
|
je newp_0.next
|
||||||
|
test cl,cl
|
||||||
|
jz newp_0.next
|
||||||
|
jns @f
|
||||||
|
dec ebx
|
||||||
|
sub ecx,255
|
||||||
|
@@:
|
||||||
|
mov [edi],bl ; putpixel
|
||||||
|
|
||||||
|
sar ecx,1 ; error/2
|
||||||
|
;adc ecx,0 ; round to integer
|
||||||
|
|
||||||
|
movzx eax,byte[edi+3] ; pixel (x+1;y)
|
||||||
|
add eax,ecx ; add error/2 to (x+1;y)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok
|
||||||
|
or al,255
|
||||||
|
.ok:
|
||||||
|
mov [edi+3],al ; putpixel
|
||||||
|
|
||||||
|
sar ecx,1 ; error/4
|
||||||
|
adc ecx,0 ; round to integer
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx-3] ; pixel (x-1;y+1)
|
||||||
|
add eax,ecx ; add error/4 to (x-1;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok1
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok1
|
||||||
|
or al,255
|
||||||
|
.ok1:
|
||||||
|
mov [edi+edx-3],al ; putpixel
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx] ; pixel (x;y+1)
|
||||||
|
add eax,ecx ; add error/4 to (x;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok2
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok2
|
||||||
|
or al,255
|
||||||
|
.ok2:
|
||||||
|
mov [edi+edx],al ; putpixel
|
||||||
|
|
||||||
|
.next:
|
||||||
|
inc edi
|
||||||
|
dec esi
|
||||||
|
jnz newp_0
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 16
|
||||||
|
dither_1: ; Floyd-Steinberg algoritm
|
||||||
|
newp_1: ; Dithering cycle
|
||||||
|
xor ebx,ebx ; At first threshold
|
||||||
|
movzx ecx,byte[edi]
|
||||||
|
cmp cl,255
|
||||||
|
je newp_1.next
|
||||||
|
test cl,cl
|
||||||
|
jz newp_1.next
|
||||||
|
jns @f
|
||||||
|
dec ebx
|
||||||
|
sub ecx,255
|
||||||
|
@@:
|
||||||
|
mov [edi],bl ; putpixel
|
||||||
|
|
||||||
|
sar ecx,4 ; error/16
|
||||||
|
adc ecx,0 ; round to integer
|
||||||
|
mov ebx,ecx
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx+3] ; pixel (x+1;y+1)
|
||||||
|
add eax,ecx ; add error/16 to (x+1;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok
|
||||||
|
or al,255
|
||||||
|
.ok:
|
||||||
|
mov [edi+edx+3],al ;putpixel
|
||||||
|
|
||||||
|
imul ecx,3
|
||||||
|
movzx eax,byte[edi+edx-3] ; pixel (x-1;y+1)
|
||||||
|
add eax,ecx ; add 3*error/16 to (x-1;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok1
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok1
|
||||||
|
or al,255
|
||||||
|
.ok1:
|
||||||
|
mov [edi+edx-3],al ;putpixel
|
||||||
|
|
||||||
|
mov ecx,ebx
|
||||||
|
imul ecx,5
|
||||||
|
movzx eax,byte[edi+edx] ; pixel (x;y+1)
|
||||||
|
add eax,ecx ; add 5*error/16 to (x;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok2
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok2
|
||||||
|
or al,255
|
||||||
|
.ok2:
|
||||||
|
mov [edi+edx],al ;putpixel
|
||||||
|
|
||||||
|
mov ecx,ebx
|
||||||
|
imul ecx,7
|
||||||
|
movzx eax,byte[edi+3] ; pixel (x+1;y)
|
||||||
|
add eax,ecx ; add 7*error/16 to (x+1;y)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok3
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok3
|
||||||
|
or al,255
|
||||||
|
.ok3:
|
||||||
|
mov [edi+3],al ;putpixel
|
||||||
|
|
||||||
|
.next:
|
||||||
|
inc edi
|
||||||
|
dec esi
|
||||||
|
jnz newp_1
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 16
|
||||||
|
dither_2: ; Burkers algoritm
|
||||||
|
newp_2: ; Dithering cycle
|
||||||
|
xor ebx,ebx ; At first threshold
|
||||||
|
movsx ecx,byte[edi]
|
||||||
|
cmp cl,255
|
||||||
|
je newp_2.next
|
||||||
|
test cl,cl
|
||||||
|
jz newp_2.next
|
||||||
|
jns @f
|
||||||
|
dec ebx
|
||||||
|
@@:
|
||||||
|
mov [edi],bl ; putpixel
|
||||||
|
|
||||||
|
sar ecx,2 ; error/4
|
||||||
|
adc ecx,0 ; round to integer
|
||||||
|
|
||||||
|
movzx eax,byte[edi+3] ; pixel (x+1;y)
|
||||||
|
add eax,ecx ; add error/4 to (x+1;y)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok
|
||||||
|
or al,255
|
||||||
|
.ok:
|
||||||
|
mov [edi+3],al ; putpixel
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx] ; pixel (x;y+1)
|
||||||
|
add eax,ecx ; add error/4 to (x;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok1
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok1
|
||||||
|
or al,255
|
||||||
|
.ok1:
|
||||||
|
mov [edi+edx],al ; putpixel
|
||||||
|
|
||||||
|
sar ecx,1 ; error/8
|
||||||
|
adc ecx,0 ; round to integer
|
||||||
|
|
||||||
|
movzx eax,byte[edi+6] ; pixel (x+2;y)
|
||||||
|
add eax,ecx ; add error/8 to (x+2;y)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok2
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok2
|
||||||
|
or al,255
|
||||||
|
.ok2:
|
||||||
|
mov [edi+6],al ; putpixel
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx-3] ; pixel (x-1;y+1)
|
||||||
|
add eax,ecx ; add error/8 to (x-1;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok3
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok3
|
||||||
|
or al,255
|
||||||
|
.ok3:
|
||||||
|
mov [edi+edx-3],al ; putpixel
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx+3] ; pixel (x+1;y+1)
|
||||||
|
add eax,ecx ; add error/8 to (x+1;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok4
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok4
|
||||||
|
or al,255
|
||||||
|
.ok4:
|
||||||
|
mov [edi+edx+3],al ; putpixel
|
||||||
|
|
||||||
|
sar ecx,1 ; error/16
|
||||||
|
;adc ecx,0 ; round to integer
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx-6] ; pixel (x-2;y+1)
|
||||||
|
add eax,ecx ; add error/16 to (x-2;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok5
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok5
|
||||||
|
or al,255
|
||||||
|
.ok5:
|
||||||
|
mov [edi+edx-6],al ; putpixel
|
||||||
|
|
||||||
|
movzx eax,byte[edi+edx+6] ; pixel (x+2;y+1)
|
||||||
|
add eax,ecx ; add error/16 to (x+2;y+1)
|
||||||
|
jge @f ; check_overflow
|
||||||
|
xor eax,eax
|
||||||
|
jmp .ok6
|
||||||
|
@@:
|
||||||
|
cmp eax,255
|
||||||
|
jle .ok6
|
||||||
|
or al,255
|
||||||
|
.ok6:
|
||||||
|
mov [edi+edx+6],al ; putpixel
|
||||||
|
|
||||||
|
.next:
|
||||||
|
inc edi
|
||||||
|
dec esi
|
||||||
|
jnz newp_2
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;*** <20>㭪樨 <20><><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> <20><><EFBFBD>ᥫ쭮<E1A5AB> <20><><EFBFBD>䨪<EFBFBD><E4A8AA> ***
|
;*** <20>㭪樨 <20><><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> <20><><EFBFBD>ᥫ쭮<E1A5AB> <20><><EFBFBD>䨪<EFBFBD><E4A8AA> ***
|
||||||
@@ -4816,6 +5106,7 @@ EXPORTS:
|
|||||||
dd sz_buf2d_set_pixel, buf_set_pixel
|
dd sz_buf2d_set_pixel, buf_set_pixel
|
||||||
dd sz_buf2d_get_pixel, buf_get_pixel
|
dd sz_buf2d_get_pixel, buf_get_pixel
|
||||||
dd sz_buf2d_flip_v, buf_flip_v
|
dd sz_buf2d_flip_v, buf_flip_v
|
||||||
|
dd sz_buf2d_filter_dither, buf_filter_dither
|
||||||
dd sz_buf2d_vox_brush_create, vox_brush_create
|
dd sz_buf2d_vox_brush_create, vox_brush_create
|
||||||
dd sz_buf2d_vox_brush_delete, vox_brush_delete
|
dd sz_buf2d_vox_brush_delete, vox_brush_delete
|
||||||
dd sz_buf2d_vox_obj_get_img_w_3g, buf_vox_obj_get_img_w_3g
|
dd sz_buf2d_vox_obj_get_img_w_3g, buf_vox_obj_get_img_w_3g
|
||||||
@@ -4856,6 +5147,7 @@ EXPORTS:
|
|||||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||||
sz_buf2d_get_pixel db 'buf2d_get_pixel',0
|
sz_buf2d_get_pixel db 'buf2d_get_pixel',0
|
||||||
sz_buf2d_flip_v db 'buf2d_flip_v',0
|
sz_buf2d_flip_v db 'buf2d_flip_v',0
|
||||||
|
sz_buf2d_filter_dither db 'buf2d_filter_dither',0
|
||||||
sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
|
sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
|
||||||
sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
|
sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
|
||||||
sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
|
sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
|
||||||
|
@@ -16,6 +16,7 @@ if not exist bin\vaz2106.vox @copy ..\..\..\..\..\media\voxel_editor\trunk\vaz21
|
|||||||
@fasm.exe -m 16384 e5_lines_sm.asm bin\e5_lines_sm.kex
|
@fasm.exe -m 16384 e5_lines_sm.asm bin\e5_lines_sm.kex
|
||||||
@fasm.exe -m 16384 e6_vox_1g.asm bin\e6_vox_1g.kex
|
@fasm.exe -m 16384 e6_vox_1g.asm bin\e6_vox_1g.kex
|
||||||
@fasm.exe -m 16384 e7_vox_3g.asm bin\e7_vox_3g.kex
|
@fasm.exe -m 16384 e7_vox_3g.asm bin\e7_vox_3g.kex
|
||||||
|
@fasm.exe -m 16384 e8_filters.asm bin\e8_filters.kex
|
||||||
|
|
||||||
@kpack bin\e0_dr_lines.kex
|
@kpack bin\e0_dr_lines.kex
|
||||||
@kpack bin\e1_scaling.kex
|
@kpack bin\e1_scaling.kex
|
||||||
@@ -25,4 +26,5 @@ if not exist bin\vaz2106.vox @copy ..\..\..\..\..\media\voxel_editor\trunk\vaz21
|
|||||||
@kpack bin\e5_lines_sm.kex
|
@kpack bin\e5_lines_sm.kex
|
||||||
@kpack bin\e6_vox_1g.kex
|
@kpack bin\e6_vox_1g.kex
|
||||||
@kpack bin\e7_vox_3g.kex
|
@kpack bin\e7_vox_3g.kex
|
||||||
|
@kpack bin\e8_filters.kex
|
||||||
pause
|
pause
|
@@ -10,7 +10,7 @@ use32
|
|||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../../../../proc32.inc'
|
include '../../../../../proc32.inc'
|
||||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include 'mem.inc'
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ use32
|
|||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../../../../proc32.inc'
|
include '../../../../../proc32.inc'
|
||||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include 'mem.inc'
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ use32
|
|||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../../../../proc32.inc'
|
include '../../../../../proc32.inc'
|
||||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include 'mem.inc'
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ use32
|
|||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../../../../proc32.inc'
|
include '../../../../../proc32.inc'
|
||||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include 'mem.inc'
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ use32
|
|||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../../../../proc32.inc'
|
include '../../../../../proc32.inc'
|
||||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include 'mem.inc'
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ use32
|
|||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../../../../proc32.inc'
|
include '../../../../../proc32.inc'
|
||||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
include 'mem.inc'
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
|
||||||
|
|
||||||
|
296
programs/develop/libraries/buf2d/trunk/examples/e8_filters.asm
Normal file
296
programs/develop/libraries/buf2d/trunk/examples/e8_filters.asm
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
use32
|
||||||
|
org 0x0
|
||||||
|
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||||
|
dd 0x1
|
||||||
|
dd start
|
||||||
|
dd i_end ;ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
dd mem,stacktop
|
||||||
|
dd 0,sys_path
|
||||||
|
|
||||||
|
include '../../../../../macros.inc'
|
||||||
|
include '../../../../../proc32.inc'
|
||||||
|
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
|
include '../../../../../dll.inc'
|
||||||
|
|
||||||
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||||
|
|
||||||
|
struct FileInfoBlock
|
||||||
|
Function dd ?
|
||||||
|
Position dd ?
|
||||||
|
Flags dd ?
|
||||||
|
Count dd ?
|
||||||
|
Buffer dd ?
|
||||||
|
db ?
|
||||||
|
FileName dd ?
|
||||||
|
ends
|
||||||
|
|
||||||
|
IMAGE_FILE1_SIZE equ 200*186*3 ;ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD><EFBFBD> 200 x 100
|
||||||
|
|
||||||
|
BUF_STRUCT_SIZE equ 21
|
||||||
|
buf2d_data equ dword[edi] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
buf2d_w equ dword[edi+8] ;<3B><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
buf2d_h equ dword[edi+12] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
buf2d_l equ word[edi+4]
|
||||||
|
buf2d_t equ word[edi+6] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||||
|
buf2d_size_lt equ dword[edi+4] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5> <20> <20><>ࠢ<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
buf2d_color equ dword[edi+16] ;梥<> 䮭<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
buf2d_bits equ byte[edi+20] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD> <20> 1-<2D> <20><>窥 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
vox_offs_tree_table equ 4
|
||||||
|
|
||||||
|
macro load_image_file path,buf,size { ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
;path - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ப<EFBFBD><E0AEAA><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC>
|
||||||
|
if path eqtype '' ;<3B><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ப<EFBFBD><E0AEAA> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD> path
|
||||||
|
jmp @f
|
||||||
|
local .path_str
|
||||||
|
.path_str db path ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
db 0
|
||||||
|
@@:
|
||||||
|
;32 - <20>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><>⥬
|
||||||
|
copy_path .path_str,[32],file_name,0x0
|
||||||
|
else
|
||||||
|
copy_path path,[32],file_name,0x0 ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>, <20><><EFBFBD>ࠧ㬥<E0A0A7><E3ACA5><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD>
|
||||||
|
end if
|
||||||
|
|
||||||
|
stdcall mem.Alloc, dword size ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
mov [buf],eax
|
||||||
|
|
||||||
|
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||||
|
mov [run_file_70.Function], 0
|
||||||
|
mov [run_file_70.Position], 0
|
||||||
|
mov [run_file_70.Flags], 0
|
||||||
|
mov [run_file_70.Count], dword size
|
||||||
|
m2m [run_file_70.Buffer], [buf]
|
||||||
|
mov byte[run_file_70+20], 0
|
||||||
|
mov [run_file_70.FileName], file_name
|
||||||
|
mov ebx,run_file_70
|
||||||
|
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
cmp ebx,0xffffffff
|
||||||
|
je @f
|
||||||
|
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||||
|
stdcall dword[img_decode], dword[buf],ebx,0
|
||||||
|
mov dword[image_data],eax
|
||||||
|
;<3B>८<EFBFBD>ࠧ㥬 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> rgb
|
||||||
|
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
|
||||||
|
;㤠<>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||||
|
stdcall dword[img_destroy], dword[image_data]
|
||||||
|
@@:
|
||||||
|
}
|
||||||
|
|
||||||
|
align 4
|
||||||
|
start:
|
||||||
|
load_libraries l_libs_start,load_lib_end
|
||||||
|
|
||||||
|
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
mov ebp,lib0
|
||||||
|
cmp dword [ebp+ll_struc_size-4],0
|
||||||
|
jz @f
|
||||||
|
mcall -1 ;exit not correct
|
||||||
|
@@:
|
||||||
|
mov ebp,lib1
|
||||||
|
cmp dword [ebp+ll_struc_size-4],0
|
||||||
|
jz @f
|
||||||
|
mcall -1 ;exit not correct
|
||||||
|
@@:
|
||||||
|
|
||||||
|
mcall 40,0x27
|
||||||
|
mcall 48,3,sc,sizeof.system_colors ;<3B><><EFBFBD><EFBFBD>砥<EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> 梥<><E6A2A5>
|
||||||
|
|
||||||
|
load_image_file 'img1.png',image_data_rgb, IMAGE_FILE1_SIZE
|
||||||
|
stdcall [buf2d_create_f_img], buf_0,[image_data_rgb] ;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall [buf2d_create_f_img], buf_1,[image_data_rgb] ;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall [buf2d_create_f_img], buf_2,[image_data_rgb] ;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall mem.Free,[image_data_rgb] ;<3B><EFBFBD><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
stdcall [buf2d_filter_dither], buf_1,0
|
||||||
|
stdcall [buf2d_filter_dither], buf_2,2
|
||||||
|
|
||||||
|
align 4
|
||||||
|
red_win:
|
||||||
|
call draw_window
|
||||||
|
|
||||||
|
align 4
|
||||||
|
still: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 横<>
|
||||||
|
mcall 10
|
||||||
|
|
||||||
|
cmp al,0x1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
jz red_win
|
||||||
|
cmp al,0x2
|
||||||
|
jz key
|
||||||
|
cmp al,0x3
|
||||||
|
jz button
|
||||||
|
|
||||||
|
jmp still
|
||||||
|
|
||||||
|
align 4
|
||||||
|
key:
|
||||||
|
push eax ebx
|
||||||
|
mcall 2
|
||||||
|
;...
|
||||||
|
pop ebx eax
|
||||||
|
jmp still
|
||||||
|
|
||||||
|
|
||||||
|
align 4
|
||||||
|
draw_window:
|
||||||
|
pushad
|
||||||
|
mcall 12,1
|
||||||
|
|
||||||
|
mov edx,[sc.work]
|
||||||
|
or edx,0x33000000
|
||||||
|
mcall 0,(20 shl 16)+670,(20 shl 16)+520,,,caption ;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
stdcall [buf2d_draw], buf_0
|
||||||
|
stdcall [buf2d_draw], buf_1
|
||||||
|
stdcall [buf2d_draw], buf_2
|
||||||
|
|
||||||
|
mcall 12,2
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
|
||||||
|
head_f_i:
|
||||||
|
head_f_l db '<27><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20>訡<EFBFBD><E8A8A1>',0
|
||||||
|
|
||||||
|
system_dir0 db '/sys/lib/'
|
||||||
|
name_buf2d db 'buf2d.obj',0
|
||||||
|
err_message_found_lib0 db '<27><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> buf2d.obj',0
|
||||||
|
err_message_import0 db '<27>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> buf2d.obj',0
|
||||||
|
|
||||||
|
system_dir1 db '/sys/lib/'
|
||||||
|
name_libimg db 'libimg.obj',0
|
||||||
|
err_message_found_lib1 db '<27><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> libimg.obj',0
|
||||||
|
err_message_import1 db '<27>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> libimg.obj',0
|
||||||
|
|
||||||
|
;library structures
|
||||||
|
l_libs_start:
|
||||||
|
lib0 l_libs name_buf2d, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, import_buf2d_lib, err_message_import0, head_f_i
|
||||||
|
lib1 l_libs name_libimg, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, import_libimg, err_message_import1, head_f_i
|
||||||
|
load_lib_end:
|
||||||
|
|
||||||
|
align 4
|
||||||
|
button:
|
||||||
|
mcall 17 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
cmp ah,1
|
||||||
|
jne still
|
||||||
|
.exit:
|
||||||
|
stdcall [buf2d_delete],buf_0 ;㤠<>塞 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall [buf2d_delete],buf_1 ;㤠<>塞 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
stdcall [buf2d_delete],buf_2 ;㤠<>塞 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
mcall -1 ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||||
|
|
||||||
|
image_data dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⨭<EFBFBD><E2A8AD> <20>㭪<EFBFBD><E3ADAA>ﬨ libimg
|
||||||
|
image_data_gray dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> 8-bit
|
||||||
|
image_data_rgb dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> rgb
|
||||||
|
image_data_foto dd 0
|
||||||
|
|
||||||
|
run_file_70 FileInfoBlock
|
||||||
|
caption db 'Draw images 13.09.11',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
sc system_colors ;<3B><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> 梥<><E6A2A5>
|
||||||
|
|
||||||
|
align 4
|
||||||
|
buf_0:
|
||||||
|
dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
dw 5 ;+4 left
|
||||||
|
dw 5 ;+6 top
|
||||||
|
dd 200 ;+8 w
|
||||||
|
dd 186 ;+12 h
|
||||||
|
dd 0xffffff ;+16 color
|
||||||
|
db 24 ;+20 bit in pixel
|
||||||
|
|
||||||
|
align 4
|
||||||
|
buf_1:
|
||||||
|
dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
dw 5 ;+4 left
|
||||||
|
dw 200 ;+6 top
|
||||||
|
dd 200 ;+8 w
|
||||||
|
dd 186 ;+12 h
|
||||||
|
dd 0 ;+16 color
|
||||||
|
db 24 ;+20 bit in pixel
|
||||||
|
|
||||||
|
align 4
|
||||||
|
buf_2:
|
||||||
|
dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
dw 210 ;+4 left
|
||||||
|
dw 200 ;+6 top
|
||||||
|
dd 200 ;+8 w
|
||||||
|
dd 186 ;+12 h
|
||||||
|
dd 0 ;+16 color
|
||||||
|
db 24 ;+20 bit in pixel
|
||||||
|
|
||||||
|
align 4
|
||||||
|
import_libimg:
|
||||||
|
dd alib_init1
|
||||||
|
img_is_img dd aimg_is_img
|
||||||
|
img_info dd aimg_info
|
||||||
|
img_from_file dd aimg_from_file
|
||||||
|
img_to_file dd aimg_to_file
|
||||||
|
img_from_rgb dd aimg_from_rgb
|
||||||
|
img_to_rgb dd aimg_to_rgb
|
||||||
|
img_to_rgb2 dd aimg_to_rgb2
|
||||||
|
img_decode dd aimg_decode
|
||||||
|
img_encode dd aimg_encode
|
||||||
|
img_create dd aimg_create
|
||||||
|
img_destroy dd aimg_destroy
|
||||||
|
img_destroy_layer dd aimg_destroy_layer
|
||||||
|
img_count dd aimg_count
|
||||||
|
img_lock_bits dd aimg_lock_bits
|
||||||
|
img_unlock_bits dd aimg_unlock_bits
|
||||||
|
img_flip dd aimg_flip
|
||||||
|
img_flip_layer dd aimg_flip_layer
|
||||||
|
img_rotate dd aimg_rotate
|
||||||
|
img_rotate_layer dd aimg_rotate_layer
|
||||||
|
img_draw dd aimg_draw
|
||||||
|
|
||||||
|
dd 0,0
|
||||||
|
alib_init1 db 'lib_init',0
|
||||||
|
aimg_is_img db 'img_is_img',0 ;<3B><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||||
|
aimg_info db 'img_info',0
|
||||||
|
aimg_from_file db 'img_from_file',0
|
||||||
|
aimg_to_file db 'img_to_file',0
|
||||||
|
aimg_from_rgb db 'img_from_rgb',0
|
||||||
|
aimg_to_rgb db 'img_to_rgb',0 ;<3B>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
|
||||||
|
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||||
|
aimg_decode db 'img_decode',0 ;<3B><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨ <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
aimg_encode db 'img_encode',0
|
||||||
|
aimg_create db 'img_create',0
|
||||||
|
aimg_destroy db 'img_destroy',0
|
||||||
|
aimg_destroy_layer db 'img_destroy_layer',0
|
||||||
|
aimg_count db 'img_count',0
|
||||||
|
aimg_lock_bits db 'img_lock_bits',0
|
||||||
|
aimg_unlock_bits db 'img_unlock_bits',0
|
||||||
|
aimg_flip db 'img_flip',0
|
||||||
|
aimg_flip_layer db 'img_flip_layer',0
|
||||||
|
aimg_rotate db 'img_rotate',0
|
||||||
|
aimg_rotate_layer db 'img_rotate_layer',0
|
||||||
|
aimg_draw db 'img_draw',0
|
||||||
|
|
||||||
|
align 4
|
||||||
|
import_buf2d_lib:
|
||||||
|
dd sz_lib_init
|
||||||
|
buf2d_create dd sz_buf2d_create
|
||||||
|
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||||
|
buf2d_clear dd sz_buf2d_clear
|
||||||
|
buf2d_draw dd sz_buf2d_draw
|
||||||
|
buf2d_delete dd sz_buf2d_delete
|
||||||
|
buf2d_filter_dither dd sz_buf2d_filter_dither
|
||||||
|
dd 0,0
|
||||||
|
sz_lib_init db 'lib_init',0
|
||||||
|
sz_buf2d_create db 'buf2d_create',0
|
||||||
|
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||||
|
sz_buf2d_clear db 'buf2d_clear',0
|
||||||
|
sz_buf2d_draw db 'buf2d_draw',0
|
||||||
|
sz_buf2d_delete db 'buf2d_delete',0
|
||||||
|
sz_buf2d_filter_dither db 'buf2d_filter_dither',0
|
||||||
|
|
||||||
|
i_end:
|
||||||
|
rb 1024
|
||||||
|
stacktop:
|
||||||
|
sys_path rb 4096
|
||||||
|
file_name:
|
||||||
|
rb 4096
|
||||||
|
plugin_path:
|
||||||
|
rb 4096
|
||||||
|
openfile_path:
|
||||||
|
rb 4096
|
||||||
|
filename_area:
|
||||||
|
rb 256
|
||||||
|
mem:
|
Reference in New Issue
Block a user