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 22... Line 22...
22
 
22
 
Line 23... Line 23...
23
	cmp dword[png_ptr],0
23
	cmp dword[png_ptr],0
24
	je .end_f
24
	je .end_f
25
	mov edi,[info_ptr]
25
	mov edi,[info_ptr]
26
	cmp edi,0
26
	or edi,edi
27
	je .end_f
27
	jz .end_f
28
	mov esi,[background]
28
	mov esi,[background]
29
	cmp esi,0
29
	or esi,esi
30
	je .end_f ;if (..==0 || ..==0 || ..==0) return
30
	jz .end_f ;if (..==0 || ..==0 || ..==0) return
Line 31... Line 31...
31
 
31
 
32
	or dword[edi+png_info_def.valid],PNG_INFO_bKGD
32
	or dword[edi+png_info_def.valid],PNG_INFO_bKGD
33
	add edi,png_info_def.background
33
	add edi,png_info_def.background
34
	mov ecx,sizeof.png_color_16
34
	mov ecx,sizeof.png_color_16
Line 85... Line 85...
85
 
85
 
Line 86... Line 86...
86
	png_debug1 1, 'in %s storage function', 'cHRM XYZ fixed'
86
	png_debug1 1, 'in %s storage function', 'cHRM XYZ fixed'
Line 87... Line 87...
87
 
87
 
88
	mov edi,[png_ptr]
88
	mov edi,[png_ptr]
89
	cmp edi,0
89
	or edi,edi
90
	je .end_f
90
	jz .end_f
91
	mov esi,[info_ptr]
91
	mov esi,[info_ptr]
92
	cmp esi,0
92
	or esi,esi
Line 93... Line 93...
93
	je .end_f ;if (..==0 || ..==0) return
93
	jz .end_f ;if (..==0 || ..==0) return
94
 
94
 
95
;   XYZ.red_X = int_red_X;
95
;   XYZ.red_X = int_red_X;
96
;   XYZ.red_Y = int_red_Y;
96
;   XYZ.red_Y = int_red_Y;
Line 153... Line 153...
153
proc png_set_gAMA_fixed uses eax edi esi, png_ptr:dword, info_ptr:dword, file_gamma:dword
153
proc png_set_gAMA_fixed uses eax edi esi, png_ptr:dword, info_ptr:dword, file_gamma:dword
154
	png_debug1 1, 'in %s storage function', 'gAMA'
154
	png_debug1 1, 'in %s storage function', 'gAMA'
155
 
155
 
Line 156... Line 156...
156
	mov edi,[png_ptr]
156
	mov edi,[png_ptr]
157
	cmp edi,0
157
	or edi,edi
158
	je .end_f
158
	jz .end_f
159
	mov esi,[info_ptr]
159
	mov esi,[info_ptr]
160
	cmp esi,0
160
	or esi,esi
161
	je .end_f ;if (..== 0 || ..== 0) return
161
	jz .end_f ;if (..== 0 || ..== 0) return
Line 162... Line 162...
162
 
162
 
163
	mov eax,esi
163
	mov eax,esi
164
	add eax,png_info_def.colorspace
164
	add eax,png_info_def.colorspace
165
	stdcall png_colorspace_set_gamma, edi, eax, [file_gamma]
165
	stdcall png_colorspace_set_gamma, edi, eax, [file_gamma]
Line 184... Line 184...
184
 
184
 
Line 185... Line 185...
185
	png_debug1 1, 'in %s storage function', 'hIST'
185
	png_debug1 1, 'in %s storage function', 'hIST'
Line 186... Line 186...
186
 
186
 
187
	mov edi,[png_ptr]
187
	mov edi,[png_ptr]
188
	cmp edi,0
188
	or edi,edi
189
	je .end_f
189
	jz .end_f
190
	mov esi,[info_ptr]
190
	mov esi,[info_ptr]
191
	cmp esi,0
191
	or esi,esi
Line 192... Line 192...
192
	je .end_f ;if (..== 0 || ..== 0) return
192
	jz .end_f ;if (..== 0 || ..== 0) return
193
 
193
 
194
;   if (info_ptr->num_palette == 0 || info_ptr->num_palette
194
;   if (info_ptr->num_palette == 0 || info_ptr->num_palette
195
;       > PNG_MAX_PALETTE_LENGTH)
195
;       > PNG_MAX_PALETTE_LENGTH)
Line 234... Line 234...
234
	interlace_type:dword, compression_type:dword, filter_type:dword
234
	interlace_type:dword, compression_type:dword, filter_type:dword
235
	png_debug1 1, 'in %s storage function', 'IHDR'
235
	png_debug1 1, 'in %s storage function', 'IHDR'
236
pushad
236
pushad
237
	mov edi,[png_ptr]
237
	mov edi,[png_ptr]
238
	cmp edi,0
238
	or edi,edi
239
	je .end_f
239
	jz .end_f
240
	mov esi,[info_ptr]
240
	mov esi,[info_ptr]
241
	cmp esi,0
241
	or esi,esi
242
	je .end_f ;if (..== 0 || ..== 0) return
242
	jz .end_f ;if (..== 0 || ..== 0) return
243
 
243
 
Line 244... Line 244...
244
	mov eax,[width]
244
	mov eax,[width]
245
	mov [esi+png_info_def.width],eax
245
	mov [esi+png_info_def.width],eax
246
	mov eax,[height]
246
	mov eax,[height]
247
	mov [esi+png_info_def.height],eax
247
	mov [esi+png_info_def.height],eax
Line 269... Line 269...
269
		jmp .end0
269
		jmp .end0
270
	@@:
270
	@@:
271
	mov eax,ebx
271
	mov eax,ebx
272
	and eax,PNG_COLOR_MASK_COLOR
272
	and eax,PNG_COLOR_MASK_COLOR
273
	cmp eax,0
273
	or eax,eax
274
	je @f ;else if (..!=0)
274
	jz @f ;else if (..!=0)
275
		mov byte[esi+png_info_def.channels], 3
275
		mov byte[esi+png_info_def.channels], 3
276
		jmp .end0
276
		jmp .end0
277
	@@: ;else
277
	@@: ;else
278
		mov byte[esi+png_info_def.channels], 1
278
		mov byte[esi+png_info_def.channels], 1
279
	.end0:
279
	.end0:
280
 
280
 
Line 281... Line 281...
281
	mov eax,ebx
281
	mov eax,ebx
282
	and eax,PNG_COLOR_MASK_ALPHA
282
	and eax,PNG_COLOR_MASK_ALPHA
283
	cmp eax,0
283
	or eax,eax
284
	je @f ;else if (..!=0)
284
	jz @f ;else if (..!=0)
285
		inc byte[esi+png_info_def.channels]
285
		inc byte[esi+png_info_def.channels]
286
	@@:
286
	@@:
Line 287... Line 287...
287
 
287
 
288
	movzx eax,byte[esi+png_info_def.channels]
288
	movzx eax,byte[esi+png_info_def.channels]
Line 305... Line 305...
305
 
305
 
Line 306... Line 306...
306
	cmp dword[png_ptr],0
306
	cmp dword[png_ptr],0
307
	je @f
307
	je @f
308
	mov esi,[info_ptr]
308
	mov esi,[info_ptr]
309
	cmp esi,0
309
	or esi,esi
310
	je @f ;if (..==0 || ..==0) return
310
	jz @f ;if (..==0 || ..==0) return
Line 311... Line 311...
311
 
311
 
312
	mov eax,[offset_x]
312
	mov eax,[offset_x]
313
	mov [esi+png_info_def.x_offset],eax
313
	mov [esi+png_info_def.x_offset],eax
314
	mov eax,[offset_y]
314
	mov eax,[offset_y]
Line 330... Line 330...
330
 
330
 
Line 331... Line 331...
331
	png_debug1 1, 'in %s storage function', 'pCAL'
331
	png_debug1 1, 'in %s storage function', 'pCAL'
Line 332... Line 332...
332
 
332
 
333
	mov edi,[png_ptr]
333
	mov edi,[png_ptr]
334
	cmp edi,0
334
	or edi,edi
335
	je .end_f
335
	jz .end_f
336
	mov esi,[info_ptr]
336
	mov esi,[info_ptr]
337
	cmp esi,0
337
	or esi,esi
338
	je .end_f
338
	jz .end_f
339
	cmp dword[purpose],0
339
	cmp dword[purpose],0
340
	je .end_f
340
	je .end_f
341
	cmp dword[units],0
341
	cmp dword[units],0
342
	je .end_f
342
	je .end_f
Line 597... Line 597...
597
 
597
 
Line 598... Line 598...
598
	png_debug1 1, 'in %s storage function', 'PLTE'
598
	png_debug1 1, 'in %s storage function', 'PLTE'
Line 599... Line 599...
599
 
599
 
600
	mov edi,[png_ptr]
600
	mov edi,[png_ptr]
601
	cmp edi,0
601
	or edi,edi
602
	je .end_f
602
	jz .end_f
603
	mov esi,[info_ptr]
603
	mov esi,[info_ptr]
604
	cmp esi,0
604
	or esi,esi
Line 605... Line 605...
605
	je .end_f ;if (..==0 || ..==0) return
605
	jz .end_f ;if (..==0 || ..==0) return
606
 
606
 
Line 607... Line 607...
607
;   max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
607
;   max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
Line 677... Line 677...
677
proc png_set_sRGB uses eax edi esi, png_ptr:dword, info_ptr:dword, srgb_intent:dword
677
proc png_set_sRGB uses eax edi esi, png_ptr:dword, info_ptr:dword, srgb_intent:dword
678
	png_debug1 1, 'in %s storage function', 'sRGB'
678
	png_debug1 1, 'in %s storage function', 'sRGB'
679
 
679
 
Line 680... Line 680...
680
	mov edi,[png_ptr]
680
	mov edi,[png_ptr]
681
	cmp edi,0
681
	or edi,edi
682
	je .end_f
682
	jz .end_f
683
	mov esi,[info_ptr]
683
	mov esi,[info_ptr]
684
	cmp esi,0
684
	or esi,esi
685
	je .end_f ;if (..==0 || ..==0)
685
	jz .end_f ;if (..==0 || ..==0)
Line 686... Line 686...
686
 
686
 
687
	mov eax,esi
687
	mov eax,esi
688
	add eax,png_info_def.colorspace
688
	add eax,png_info_def.colorspace
689
	stdcall png_colorspace_set_sRGB, edi, eax, [srgb_intent]
689
	stdcall png_colorspace_set_sRGB, edi, eax, [srgb_intent]
Line 788... Line 788...
788
proc png_set_text uses eax edi, png_ptr:dword, info_ptr:dword, text_ptr:dword, num_text:dword
788
proc png_set_text uses eax edi, png_ptr:dword, info_ptr:dword, text_ptr:dword, num_text:dword
789
	mov edi,[png_ptr]
789
	mov edi,[png_ptr]
790
	stdcall png_set_text_2, edi, [info_ptr], [text_ptr], [num_text]
790
	stdcall png_set_text_2, edi, [info_ptr], [text_ptr], [num_text]
791
 
791
 
Line 792... Line 792...
792
	cmp eax,0
792
	or eax,eax
793
	je @f ;if (..!=0)
793
	jz @f ;if (..!=0)
794
		png_error edi, 'Insufficient memory to store text'
794
		png_error edi, 'Insufficient memory to store text'
795
	@@:
795
	@@:
796
	ret
796
	ret
797
endp
797
endp
Line 995... Line 995...
995
proc png_set_tIME uses eax ebx ecx edi esi, png_ptr:dword, info_ptr:dword, mod_time:dword
995
proc png_set_tIME uses eax ebx ecx edi esi, png_ptr:dword, info_ptr:dword, mod_time:dword
996
	png_debug1 1, 'in %s storage function', 'tIME'
996
	png_debug1 1, 'in %s storage function', 'tIME'
997
 
997
 
Line 998... Line 998...
998
	mov ebx,[png_ptr]
998
	mov ebx,[png_ptr]
999
	cmp ebx,0
999
	or ebx,ebx
1000
	je .end_f
1000
	jz .end_f
1001
	mov edi,[info_ptr]
1001
	mov edi,[info_ptr]
1002
	cmp edi,0
1002
	or edi,edi
1003
	je .end_f
1003
	jz .end_f
1004
	mov esi,[mod_time]
1004
	mov esi,[mod_time]
1005
	cmp esi,0
1005
	or esi,esi
1006
	je .end_f
1006
	jz .end_f
1007
	mov eax,[ebx+png_struct.mode]
1007
	mov eax,[ebx+png_struct.mode]
1008
	and eax,PNG_WROTE_tIME
1008
	and eax,PNG_WROTE_tIME
1009
	cmp eax,0
1009
	or eax,eax
1010
	jne .end_f ;if (..==0 || ..==0 || ..==0 || ..!=0) return
1010
	jnz .end_f ;if (..==0 || ..==0 || ..==0 || ..!=0) return
Line 1011... Line 1011...
1011
 
1011
 
1012
	cmp byte[esi+png_time.month],0
1012
	cmp byte[esi+png_time.month],0
1013
	je @f
1013
	je @f
1014
	cmp byte[esi+png_time.month],12
1014
	cmp byte[esi+png_time.month],12
Line 1249... Line 1249...
1249
proc png_set_unknown_chunks uses edi esi, png_ptr:dword, info_ptr:dword, unknowns:dword, num_unknowns:dword
1249
proc png_set_unknown_chunks uses edi esi, png_ptr:dword, info_ptr:dword, unknowns:dword, num_unknowns:dword
1250
;   png_unknown_chunkp np;
1250
;   png_unknown_chunkp np;
1251
 
1251
 
Line 1252... Line 1252...
1252
	mov edi,[png_ptr]
1252
	mov edi,[png_ptr]
1253
	cmp edi,0
1253
	or edi,edi
1254
	je .end_f
1254
	jz .end_f
1255
	mov esi,[info_ptr]
1255
	mov esi,[info_ptr]
1256
	cmp esi,0
1256
	or esi,esi
1257
	je .end_f
1257
	jz .end_f
1258
	cmp dword[num_unknowns],0
1258
	cmp dword[num_unknowns],0
1259
	jle .end_f
1259
	jle .end_f
1260
	cmp dword[unknowns],0
1260
	cmp dword[unknowns],0
1261
	je .end_f ;if (..== 0 || ..== 0 || ..<=0 || ..==0) return
1261
	je .end_f ;if (..== 0 || ..== 0 || ..<=0 || ..==0) return
Line 1429... Line 1429...
1429
;   bytep new_list;
1429
;   bytep new_list;
1430
;   uint num_chunks, old_num_chunks;
1430
;   uint num_chunks, old_num_chunks;
1431
 
1431
 
Line 1432... Line 1432...
1432
	mov edi,[png_ptr]
1432
	mov edi,[png_ptr]
1433
	cmp edi,0
1433
	or edi,edi
1434
	je .end_f ;if (..== 0) return
1434
	jz .end_f ;if (..== 0) return
Line 1435... Line 1435...
1435
 
1435
 
1436
;   if (keep < 0 || keep >= PNG_HANDLE_CHUNK_LAST)
1436
;   if (keep < 0 || keep >= PNG_HANDLE_CHUNK_LAST)
1437
;   {
1437
;   {
Line 1586... Line 1586...
1586
proc png_set_read_user_chunk_fn uses eax edi, png_ptr:dword, user_chunk_ptr:dword, read_user_chunk_fn:dword
1586
proc png_set_read_user_chunk_fn uses eax edi, png_ptr:dword, user_chunk_ptr:dword, read_user_chunk_fn:dword
1587
	png_debug 1, 'in png_set_read_user_chunk_fn'
1587
	png_debug 1, 'in png_set_read_user_chunk_fn'
1588
 
1588
 
Line 1589... Line 1589...
1589
	mov edi,[png_ptr]
1589
	mov edi,[png_ptr]
1590
	cmp edi,0
1590
	or edi,edi
1591
	je .end_f
1591
	jz .end_f
Line 1592... Line 1592...
1592
 
1592
 
1593
	mov eax,[read_user_chunk_fn]
1593
	mov eax,[read_user_chunk_fn]
1594
	mov [edi+png_struct.read_user_chunk_fn],eax
1594
	mov [edi+png_struct.read_user_chunk_fn],eax
1595
	mov eax,[user_chunk_ptr]
1595
	mov eax,[user_chunk_ptr]
Line 1603... Line 1603...
1603
proc png_set_rows uses eax edi esi, png_ptr:dword, info_ptr:dword, row_pointers:dword
1603
proc png_set_rows uses eax edi esi, png_ptr:dword, info_ptr:dword, row_pointers:dword
1604
	png_debug1 1, 'in %s storage function', 'rows'
1604
	png_debug1 1, 'in %s storage function', 'rows'
1605
 
1605
 
Line 1606... Line 1606...
1606
	mov edi,[png_ptr]
1606
	mov edi,[png_ptr]
1607
	cmp edi,0
1607
	or edi,edi
1608
	je .end_f
1608
	jz .end_f
1609
	mov esi,[info_ptr]
1609
	mov esi,[info_ptr]
1610
	cmp esi,0
1610
	or esi,esi
1611
	je .end_f ;if (..==0 || ..==0) return
1611
	jz .end_f ;if (..==0 || ..==0) return
Line 1612... Line 1612...
1612
 
1612
 
1613
	mov eax,[row_pointers]
1613
	mov eax,[row_pointers]
1614
	cmp dword[esi+png_info_def.row_pointers],0
1614
	cmp dword[esi+png_info_def.row_pointers],0
1615
	je @f
1615
	je @f
1616
	cmp [esi+png_info_def.row_pointers],eax
1616
	cmp [esi+png_info_def.row_pointers],eax
1617
	je @f ;if (..!=0 && ..!=..)
1617
	je @f ;if (..!=0 && ..!=..)
1618
		stdcall png_free_data, edi, esi, PNG_FREE_ROWS, 0
1618
		stdcall png_free_data, edi, esi, PNG_FREE_ROWS, 0
1619
	@@:
1619
	@@:
Line 1620... Line 1620...
1620
	mov [esi+png_info_def.row_pointers],eax
1620
	mov [esi+png_info_def.row_pointers],eax
1621
 
1621
 
1622
	cmp eax,0
1622
	or eax,eax
1623
	je .end_f ;if (..!=0)
1623
	jz .end_f ;if (..!=0)
1624
		or dword[esi+png_info_def.valid],PNG_INFO_IDAT
1624
		or dword[esi+png_info_def.valid],PNG_INFO_IDAT
1625
.end_f:
1625
.end_f:
Line 1626... Line 1626...
1626
	ret
1626
	ret
1627
endp
1627
endp
1628
 
1628
 
1629
;void (png_structrp png_ptr, png_size_t size)
1629
;void (png_structrp png_ptr, png_size_t size)
1630
align 4
1630
align 4
1631
proc png_set_compression_buffer_size uses edi, png_ptr:dword, size:dword
1631
proc png_set_compression_buffer_size uses edi, png_ptr:dword, size:dword
Line 1632... Line 1632...
1632
	mov edi,[png_ptr]
1632
	mov edi,[png_ptr]
1633
	cmp edi,0
1633
	or edi,edi
Line 1634... Line 1634...
1634
	je .end_f ;if (..==0) return
1634
	jz .end_f ;if (..==0) return
Line 1705... Line 1705...
1705
	; rejected by png_set_IHDR().  To accept any PNG datastream
1705
	; rejected by png_set_IHDR().  To accept any PNG datastream
1706
	; regardless of dimensions, set both limits to 0x7fffffff.
1706
	; regardless of dimensions, set both limits to 0x7fffffff.
1707
 
1707
 
Line 1708... Line 1708...
1708
	mov edi,[png_ptr]
1708
	mov edi,[png_ptr]
1709
	cmp edi,0
1709
	or edi,edi
1710
	je @f
1710
	jz @f
1711
		mov eax,[user_width_max]
1711
		mov eax,[user_width_max]
1712
		mov [edi+png_struct.user_width_max],eax
1712
		mov [edi+png_struct.user_width_max],eax
1713
		mov eax,[user_height_max]
1713
		mov eax,[user_height_max]
1714
		mov [edi+png_struct.user_height_max],eax
1714
		mov [edi+png_struct.user_height_max],eax
1715
	@@:
1715
	@@: