Subversion Repositories Kolibri OS

Rev

Rev 8341 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8341 Rev 8463
Line 360... Line 360...
360
	png_debug 1, 'in png_deflate_claim'
360
	png_debug 1, 'in png_deflate_claim'
361
 
361
 
Line 362... Line 362...
362
	cmp dword[edi+png_struct.zowner],0
362
	cmp dword[edi+png_struct.zowner],0
363
	je .end0 ;if (..!=0)
363
	je .end0 ;if (..!=0)
364
		mov ebx,ebp
364
		lea ebx,[ebp-64]
365
		sub ebx,64
-
 
366
if (PNG_WARNINGS_SUPPORTED eq 1) | (PNG_ERROR_TEXT_SUPPORTED eq 1)
365
if (PNG_WARNINGS_SUPPORTED eq 1) | (PNG_ERROR_TEXT_SUPPORTED eq 1)
367
		mov eax,[owner]
366
		mov eax,[owner]
368
		mov [ebx],eax
367
		mov [ebx],eax
369
		mov word[ebx+4],': '
368
		mov word[ebx+4],': '
370
		mov eax,[edi+png_struct.zowner]
369
		mov eax,[edi+png_struct.zowner]
Line 1010... Line 1009...
1010
	mov al,[edi+png_struct.channels]
1009
	mov al,[edi+png_struct.channels]
1011
	mov [edi+png_struct.usr_channels],al
1010
	mov [edi+png_struct.usr_channels],al
1012
 
1011
 
Line 1013... Line 1012...
1013
	; Pack the header information into the buffer
1012
	; Pack the header information into the buffer
1014
	mov ebx,ebp
1013
	lea ebx,[ebp-13]
1015
	sub ebx,13
-
 
1016
	stdcall png_save_uint_32, ebx, [width]
1014
	stdcall png_save_uint_32, ebx, [width]
1017
	add ebx,4
1015
	add ebx,4
1018
	stdcall png_save_uint_32, ebx, [height]
1016
	stdcall png_save_uint_32, ebx, [height]
1019
	add ebx,4
1017
	add ebx,4
1020
	mov al,byte[bit_depth]
1018
	mov al,byte[bit_depth]
Line 1041... Line 1039...
1041
 
1039
 
Line 1042... Line 1040...
1042
	cmp byte[edi+png_struct.color_type],PNG_COLOR_TYPE_PALETTE
1040
	cmp byte[edi+png_struct.color_type],PNG_COLOR_TYPE_PALETTE
1043
	je @f
1041
	je @f
1044
	cmp byte[edi+png_struct.bit_depth],8
1042
	cmp byte[edi+png_struct.bit_depth],8
1045
	jl @f ;if ((..==..)||(..<..))
1043
	jge .els_5 ;if ((..==..)||(..<..))
1046
		jmp .els_5
-
 
1047
	@@:
1044
	@@:
1048
		mov byte[edi+png_struct.do_filter], PNG_FILTER_NONE
1045
		mov byte[edi+png_struct.do_filter], PNG_FILTER_NONE
1049
		jmp .end_5
1046
		jmp .end_5
1050
	.els_5: ;else
1047
	.els_5: ;else
1051
		mov byte[edi+png_struct.do_filter], PNG_ALL_FILTERS
1048
		mov byte[edi+png_struct.do_filter], PNG_ALL_FILTERS
Line 1369... Line 1366...
1369
endl
1366
endl
1370
	png_debug 1, 'in png_write_gAMA'
1367
	png_debug 1, 'in png_write_gAMA'
1371
 
1368
 
Line 1372... Line 1369...
1372
	; file_gamma is saved in 1/100,000ths
1369
	; file_gamma is saved in 1/100,000ths
1373
	mov ebx,ebp
1370
	lea ebx,[ebp-4]
1374
	sub ebx,4
-
 
1375
	stdcall png_save_uint_32 ,ebx, [file_gamma]
1371
	stdcall png_save_uint_32 ,ebx, [file_gamma]
1376
	stdcall png_write_complete_chunk, [png_ptr], png_gAMA, ebx, 4
1372
	stdcall png_write_complete_chunk, [png_ptr], png_gAMA, ebx, 4
1377
	ret
1373
	ret
1378
endp
1374
endp
Line 1439... Line 1435...
1439
;      if (profile_len != embedded_profile_len)
1435
;      if (profile_len != embedded_profile_len)
1440
;         png_error(png_ptr, "Profile length does not match profile");
1436
;         png_error(png_ptr, "Profile length does not match profile");
1441
;   }
1437
;   }
Line 1442... Line -...
1442
 
-
 
1443
	mov ebx,ebp
1438
 
1444
	sub ebx,sizeof.compression_state
1439
	lea ebx,[ebp-sizeof.compression_state]
1445
	mov ecx,ebx ;ecx = &comp
1440
	mov ecx,ebx ;ecx = &comp
1446
	sub ebx,81  ;ebx = &new_name
1441
	sub ebx,81  ;ebx = &new_name
1447
	stdcall png_check_keyword, edi, [name], ebx
1442
	stdcall png_check_keyword, edi, [name], ebx
Line 1630... Line 1625...
1630
	png_debug 1, 'in png_write_cHRM'
1625
	png_debug 1, 'in png_write_cHRM'
1631
 
1626
 
Line 1632... Line 1627...
1632
	; Each value is saved in 1/100,000ths
1627
	; Each value is saved in 1/100,000ths
1633
	mov eax,[xy]
1628
	mov eax,[xy]
1634
	mov ebx,ebp
1629
	lea ebx,[ebp-32]
1635
	sub ebx,32
-
 
1636
;   png_save_int_32(buf,      xy->whitex);
1630
;   png_save_int_32(buf,      xy->whitex);
1637
;   png_save_int_32(buf +  4, xy->whitey);
1631
;   png_save_int_32(buf +  4, xy->whitey);
Line 1638... Line 1632...
1638
 
1632
 
1639
;   png_save_int_32(buf +  8, xy->redx);
1633
;   png_save_int_32(buf +  8, xy->redx);
Line 1689... Line 1683...
1689
			png_app_warning edi, 'Ignoring attempt to write tRNS chunk out-of-range for bit_depth'
1683
			png_app_warning edi, 'Ignoring attempt to write tRNS chunk out-of-range for bit_depth'
1690
			jmp .end_f
1684
			jmp .end_f
1691
		@@:
1685
		@@:
1692
		movzx eax,word[ecx+png_color_16.gray]
1686
		movzx eax,word[ecx+png_color_16.gray]
1693
		mov ebx,ebp
1687
		lea ebx,[ebp-6]
1694
		sub ebx,6
1688
		stdcall png_save_uint_16, ebx, eax
1695
		stdcall png_save_uint_16, ebx, eax
-
 
1696
		stdcall png_write_complete_chunk, edi, png_tRNS, ebx, 2
1689
		stdcall png_write_complete_chunk, edi, png_tRNS, ebx, 2
1697
		jmp .end_f
1690
		jmp .end_f
1698
	.end2:
1691
	.end2:
1699
 
1692
 
Line 1700... Line 1693...
1700
	cmp dword[color_type],PNG_COLOR_TYPE_RGB
1693
	cmp dword[color_type],PNG_COLOR_TYPE_RGB
1701
	jne .end3 ;else if (..== ..)
1694
	jne .end3 ;else if (..== ..)
1702
		; Three 16-bit values
1695
		; Three 16-bit values
1703
		mov ebx,ebp
1696
		lea ebx,[ebp-6]
1704
		sub ebx,6
-
 
1705
		mov ecx,[tran]
1697
		mov ecx,[tran]
1706
		movzx eax,word[ecx+png_color_16.red]
1698
		movzx eax,word[ecx+png_color_16.red]
1707
		stdcall png_save_uint_16, ebx, eax
1699
		stdcall png_save_uint_16, ebx, eax
1708
		add ebx,2
1700
		add ebx,2
1709
		movzx eax,word[ecx+png_color_16.green]
1701
		movzx eax,word[ecx+png_color_16.green]
Line 1718... Line 1710...
1718
end if
1710
end if
1719
		mov al,[ebx]
1711
		mov al,[ebx]
1720
		or al,[ebx+2]
1712
		or al,[ebx+2]
1721
		or al,[ebx+4]
1713
		or al,[ebx+4]
1722
		cmp al,0
1714
		or al,al
1723
		je @f ;if (..|..|..!=0)
1715
		jz @f ;if (..|..|..!=0)
1724
			png_app_warning edi, 'Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8'
1716
			png_app_warning edi, 'Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8'
1725
			jmp .end_f
1717
			jmp .end_f
1726
		@@:
1718
		@@:
1727
		stdcall png_write_complete_chunk, edi, png_tRNS, ebx, 6
1719
		stdcall png_write_complete_chunk, edi, png_tRNS, ebx, 6
1728
		jmp .end_f
1720
		jmp .end_f
1729
	.end3: ;else
1721
	.end3: ;else
Line 1945... Line 1937...
1945
 
1937
 
Line 1946... Line 1938...
1946
	png_debug 1, 'in png_write_iTXt'
1938
	png_debug 1, 'in png_write_iTXt'
1947
pushad
1939
pushad
1948
	mov edi,[png_ptr]
1940
	mov edi,[png_ptr]
1949
	mov ebx,ebp
-
 
1950
	sub ebx,82+sizeof.compression_state
1941
	lea ebx,[ebp-(82+sizeof.compression_state)]
1951
	stdcall png_check_keyword, edi, [key], ebx
1942
	stdcall png_check_keyword, edi, [key], ebx
1952
	mov [key_len],eax
1943
	mov [key_len],eax
Line 1953... Line 1944...
1953
 
1944
 
1954
	test eax,eax
1945
	test eax,eax
Line 2055... Line 2046...
2055
	jl @f ;if (..>=..)
2046
	jl @f ;if (..>=..)
2056
		png_warning edi, 'Unrecognized unit type for oFFs chunk'
2047
		png_warning edi, 'Unrecognized unit type for oFFs chunk'
2057
	@@:
2048
	@@:
2058
 
2049
 
Line 2059... Line 2050...
2059
	mov ebx,ebp
2050
	lea ebx,[ebp-9]
2060
	sub ebx,9
-
 
2061
	stdcall png_save_int_32, ebx, [x_offset]
2051
	stdcall png_save_int_32, ebx, [x_offset]
2062
	add ebx,4
2052
	add ebx,4
2063
	stdcall png_save_int_32, ebx, [y_offset]
2053
	stdcall png_save_int_32, ebx, [y_offset]
2064
	add ebx,4
2054
	add ebx,4
2065
	mov eax,[unit_type]
2055
	mov eax,[unit_type]
Line 2093... Line 2083...
2093
	jl @f ;if (..>=..)
2083
	jl @f ;if (..>=..)
2094
		png_error edi, 'Unrecognized equation type for pCAL chunk'
2084
		png_error edi, 'Unrecognized equation type for pCAL chunk'
2095
	@@:
2085
	@@:
2096
 
2086
 
Line 2097... Line -...
2097
	mov ebx,ebp
-
 
2098
	sub ebx,84 ;ebx = &new_purpose
2087
	lea ebx,[ebp-84] ;ebx = &new_purpose
2099
	stdcall png_check_keyword, edi, [purpose], ebx
2088
	stdcall png_check_keyword, edi, [purpose], ebx
2100
	mov [purpose_len],eax
2089
	mov [purpose_len],eax
Line 2101... Line 2090...
2101
 
2090
 
2102
	test eax,eax
2091
	test eax,eax
Line 2127... Line 2116...
2127
 
2116
 
Line 2128... Line 2117...
2128
	png_debug1 3, 'pCAL total length = %d', [total_len]
2117
	png_debug1 3, 'pCAL total length = %d', [total_len]
2129
	stdcall png_write_chunk_header, edi, png_pCAL, [total_len]
2118
	stdcall png_write_chunk_header, edi, png_pCAL, [total_len]
2130
	stdcall png_write_chunk_data, edi, ebx, [purpose_len]
2119
	stdcall png_write_chunk_data, edi, ebx, [purpose_len]
2131
	mov ebx,ebp
-
 
2132
	sub ebx,94 ;ebx = &buf
2120
	lea ebx,[ebp-94] ;ebx = &buf
2133
	stdcall png_save_int_32, ebx, [X0]
2121
	stdcall png_save_int_32, ebx, [X0]
2134
	add ebx,4
2122
	add ebx,4
2135
	stdcall png_save_int_32, ebx, [X1]
2123
	stdcall png_save_int_32, ebx, [X1]
2136
	add ebx,4
2124
	add ebx,4
2137
	mov eax,[type]
2125
	mov eax,[type]
Line 2179... Line 2167...
2179
		png_warning [png_ptr], eax
2167
		png_warning [png_ptr], eax
2180
		jmp .end_f
2168
		jmp .end_f
2181
	@@:
2169
	@@:
2182
 
2170
 
Line 2183... Line 2171...
2183
	mov ebx,ebp
2171
	lea ebx,[ebp-64]
2184
	sub ebx,64
-
 
2185
	mov eax,[unit]
2172
	mov eax,[unit]
2186
	mov byte[ebx],al
2173
	mov byte[ebx],al
2187
	mov ecx,[wlen]
2174
	mov ecx,[wlen]
2188
	inc ecx
2175
	inc ecx
2189
	mov edi,ebx
2176
	mov edi,ebx
Line 2214... Line 2201...
2214
	jl @f ;if (..>=..)
2201
	jl @f ;if (..>=..)
2215
		png_warning [png_ptr], 'Unrecognized unit type for pHYs chunk'
2202
		png_warning [png_ptr], 'Unrecognized unit type for pHYs chunk'
2216
	@@:
2203
	@@:
2217
 
2204
 
Line 2218... Line 2205...
2218
	mov ebx,ebp
2205
	lea ebx,[ebp-9]
2219
	sub ebx,9
-
 
2220
	stdcall png_save_uint_32, ebx, [x_pixels_per_unit]
2206
	stdcall png_save_uint_32, ebx, [x_pixels_per_unit]
2221
	add ebx,4
2207
	add ebx,4
2222
	stdcall png_save_uint_32, ebx, [y_pixels_per_unit]
2208
	stdcall png_save_uint_32, ebx, [y_pixels_per_unit]
2223
	add ebx,4
2209
	add ebx,4
2224
	mov al,byte[unit_type]
2210
	mov al,byte[unit_type]
Line 2262... Line 2248...
2262
	.end0:
2248
	.end0:
2263
 
2249
 
Line 2264... Line 2250...
2264
	movzx ebx,word[eax+png_time.year]
2250
	movzx ebx,word[eax+png_time.year]
2265
	push ebx
2251
	push ebx
2266
	mov ebx,ebp
2252
	lea ebx,[ebp-7]
2267
	sub ebx,7
-
 
2268
	stdcall png_save_uint_16, ebx ;, year
2253
	stdcall png_save_uint_16, ebx ;, year
2269
	add ebx,2
2254
	add ebx,2
2270
	mov byte[ebx],cl ;month
2255
	mov byte[ebx],cl ;month
2271
	inc ebx
2256
	inc ebx
2272
	mov byte[ebx],ch ;day
2257
	mov byte[ebx],ch ;day