Subversion Repositories Kolibri OS

Rev

Rev 6733 | Rev 8341 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6733 Rev 6779
Line 14... Line 14...
14
; into the info struct for writing into the file.  This abstracts the
14
; into the info struct for writing into the file.  This abstracts the
15
; info struct and allows us to change the structure in the future.
15
; info struct and allows us to change the structure in the future.
16
 
16
 
Line 17... Line 17...
17
 
17
 
18
;void (png_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)
18
;void (png_structrp png_ptr, png_inforp info_ptr, png_color_16p background)
19
align 4
19
align 4
20
proc png_set_bKGD, png_ptr:dword, info_ptr:dword, background:dword
20
proc png_set_bKGD uses ecx edi esi, png_ptr:dword, info_ptr:dword, background:dword
Line -... Line 21...
-
 
21
	png_debug1 1, 'in %s storage function', 'bKGD'
-
 
22
 
-
 
23
	cmp dword[png_ptr],0
-
 
24
	je .end_f
-
 
25
	mov edi,[info_ptr]
21
	png_debug1 1, 'in %s storage function', 'bKGD'
26
	cmp edi,0
22
 
27
	je .end_f
-
 
28
	mov esi,[background]
Line -... Line 29...
-
 
29
	cmp esi,0
23
;   if (png_ptr == NULL || info_ptr == NULL || background == NULL)
30
	je .end_f ;if (..==0 || ..==0 || ..==0) return
24
;      return;
31
 
-
 
32
	or dword[edi+png_info_def.valid],PNG_INFO_bKGD
-
 
33
	add edi,png_info_def.background
25
 
34
	mov ecx,sizeof.png_color_16
26
;   info_ptr->background = *background;
35
	rep movsb
Line 27... Line -...
27
;   info_ptr->valid |= PNG_INFO_bKGD;
-
 
28
	ret
36
.end_f:
29
endp
37
	ret
30
 
38
endp
31
;if PNG_cHRM_SUPPORTED
39
 
32
;void (png_structrp png_ptr, png_inforp info_ptr,
40
;void (png_structrp png_ptr, png_inforp info_ptr,
Line 97... Line 105...
97
;   if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace,
105
;   if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace,
98
;       &XYZ, 2) != 0)
106
;       &XYZ, 2) != 0)
99
;      info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
107
;      info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
Line 100... Line 108...
100
 
108
 
101
	stdcall png_colorspace_sync_info, edi, esi;
109
	stdcall png_colorspace_sync_info, edi, esi
102
.end_f:
110
.end_f:
103
	ret
111
	ret
Line 104... Line 112...
104
endp
112
endp
Line 139... Line 147...
139
;       png_fixed(png_ptr, blue_Z, "cHRM Blue Z"));
147
;       png_fixed(png_ptr, blue_Z, "cHRM Blue Z"));
140
	ret
148
	ret
141
endp
149
endp
142
 
150
 
Line 143... Line -...
143
;end if /* cHRM */
-
 
144
 
-
 
145
;void (png_structrp png_ptr, png_inforp info_ptr, png_fixed_point file_gamma)
151
;void (png_structrp png_ptr, png_inforp info_ptr, png_fixed_point file_gamma)
146
align 4
152
align 4
147
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
148
	png_debug1 1, 'in %s storage function', 'gAMA'
154
	png_debug1 1, 'in %s storage function', 'gAMA'
Line 170... Line 176...
170
	stdcall png_set_gAMA_fixed, [png_ptr], [info_ptr], eax
176
	stdcall png_set_gAMA_fixed, [png_ptr], [info_ptr], eax
171
	ret
177
	ret
172
endp
178
endp
173
 
179
 
Line 174... Line 180...
174
;void (png_structrp png_ptr, png_inforp info_ptr,
180
;void (png_structrp png_ptr, png_inforp info_ptr, png_uint_16p hist)
175
;    png_const_uint_16p hist)
-
 
176
align 4
181
align 4
177
proc png_set_hIST uses edi esi, png_ptr:dword, info_ptr:dword, hist:dword
182
proc png_set_hIST uses edi esi, png_ptr:dword, info_ptr:dword, hist:dword
178
;   int i;
183
;   int i;
Line 179... Line 184...
179
 
184
 
Line 350... Line 355...
350
	; Check that the type matches the specification.
355
	; Check that the type matches the specification.
351
	cmp dword[type],0
356
	cmp dword[type],0
352
	jl @f
357
	jl @f
353
	cmp dword[type],3
358
	cmp dword[type],3
354
	jg @f ;if (..<0 || ..>3)
359
	jle .end0 ;if (..<0 || ..>3)
355
		jmp .end0
-
 
356
	@@:
360
	@@:
357
		png_error edi, 'Invalid pCAL equation type'
361
		png_error edi, 'Invalid pCAL equation type'
358
	.end0:
362
	.end0:
Line 359... Line 363...
359
 
363
 
360
	cmp dword[type],0
364
	cmp dword[nparams],0
361
	jl @f
365
	jl @f
362
	cmp dword[type],255
366
	cmp dword[nparams],255
363
	jg @f ;if (..<0 || ..>255)
-
 
364
		jmp .end1
367
	jle .end1 ;if (..<0 || ..>255)
365
	@@:
368
	@@:
366
		png_error edi, 'Invalid pCAL parameter count'
369
		png_error edi, 'Invalid pCAL parameter count'
Line 367... Line 370...
367
	.end1:
370
	.end1:
Line 586... Line 589...
586
;   info_ptr->valid |= PNG_INFO_pHYs;
589
;   info_ptr->valid |= PNG_INFO_pHYs;
587
	ret
590
	ret
588
endp
591
endp
589
 
592
 
Line 590... Line 593...
590
;void (png_structrp png_ptr, png_inforp info_ptr,
593
;void (png_structrp png_ptr, png_inforp info_ptr, png_colorp palette, int num_palette)
591
;    png_const_colorp palette, int num_palette)
-
 
592
align 4
594
align 4
593
proc png_set_PLTE uses eax edi esi, png_ptr:dword, info_ptr:dword, palette:dword, num_palette:dword
595
proc png_set_PLTE uses eax edi esi, png_ptr:dword, info_ptr:dword, palette:dword, num_palette:dword
594
;   uint_32 max_palette_length;
596
;   uint_32 max_palette_length;
Line 595... Line 597...
595
 
597
 
Line 655... Line 657...
655
.end_f:
657
.end_f:
656
	ret
658
	ret
657
endp
659
endp
658
 
660
 
Line 659... Line 661...
659
;void (png_structrp png_ptr, png_inforp info_ptr,
661
;void (png_structrp png_ptr, png_inforp info_ptr, png_color_8p sig_bit)
660
;    png_const_color_8p sig_bit)
-
 
661
align 4
662
align 4
662
proc png_set_sBIT, png_ptr:dword, info_ptr:dword, sig_bit:dword
663
proc png_set_sBIT, png_ptr:dword, info_ptr:dword, sig_bit:dword
663
	png_debug1 1, 'in %s storage function', 'sBIT'
664
	png_debug1 1, 'in %s storage function', 'sBIT'
Line 664... Line 665...
664
 
665
 
Line 781... Line 782...
781
	or dword[esi+png_info_def.valid],PNG_INFO_iCCP
782
	or dword[esi+png_info_def.valid],PNG_INFO_iCCP
782
	ret
783
	ret
783
endp
784
endp
784
 
785
 
Line 785... Line 786...
785
;void (png_structrp png_ptr, png_inforp info_ptr,
786
;void (png_structrp png_ptr, png_inforp info_ptr, png_textp text_ptr, int num_text)
786
;    png_const_textp text_ptr, int num_text)
-
 
787
align 4
787
align 4
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]
Line 796... Line 796...
796
	ret
796
	ret
797
endp
797
endp
798
 
798
 
Line 799... Line 799...
799
;int (png_structrp png_ptr, png_inforp info_ptr,
799
;int (png_structrp png_ptr, png_inforp info_ptr,
800
;    png_const_textp text_ptr, int num_text)
800
;    png_textp text_ptr, int num_text)
801
align 4
801
align 4
802
proc png_set_text_2, png_ptr:dword, info_ptr:dword, text_ptr:dword, num_text:dword
802
proc png_set_text_2, png_ptr:dword, info_ptr:dword, text_ptr:dword, num_text:dword
803
;   int i;
803
;   int i;
Line 804... Line 804...
804
 
804
 
Line 989... Line 989...
989
.end_f:
989
.end_f:
990
	ret
990
	ret
991
endp
991
endp
992
 
992
 
Line 993... Line 993...
993
;void (png_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)
993
;void (png_structrp png_ptr, png_inforp info_ptr, png_timep mod_time)
994
align 4
994
align 4
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'
Line 997... Line 997...
997
 
997
 
Line 1038... Line 1038...
1038
	ret
1038
	ret
1039
endp
1039
endp
1040
 
1040
 
Line 1041... Line 1041...
1041
;void (png_structrp png_ptr, png_inforp info_ptr,
1041
;void (png_structrp png_ptr, png_inforp info_ptr,
1042
;    bytep trans_alpha, int num_trans, png_const_color_16p trans_color)
1042
;    bytep trans_alpha, int num_trans, png_color_16p trans_color)
1043
align 4
1043
align 4
1044
proc png_set_tRNS, png_ptr:dword, info_ptr:dword, trans_alpha:dword, num_trans:dword, trans_color:dword
1044
proc png_set_tRNS, png_ptr:dword, info_ptr:dword, trans_alpha:dword, num_trans:dword, trans_color:dword
1045
	png_debug1 1, 'in %s storage function', 'tRNS'
1045
	png_debug1 1, 'in %s storage function', 'tRNS'
Line 1046... Line 1046...
1046
 
1046
 
Line 1104... Line 1104...
1104
endp
1104
endp
1105
 
1105
 
Line 1106... Line 1106...
1106
;if PNG_sPLT_SUPPORTED
1106
;if PNG_sPLT_SUPPORTED
1107
;void (png_structrp png_ptr,
1107
;void (png_structrp png_ptr,
1108
;    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)
1108
;    png_inforp info_ptr, png_sPLT_tp entries, int nentries)
Line 1109... Line 1109...
1109
 
1109
 
1110
;  entries        - array of png_sPLT_t structures
1110
;  entries        - array of png_sPLT_t structures
1111
;                   to be added to the list of palettes
1111
;                   to be added to the list of palettes
Line 1188... Line 1188...
1188
 
1188
 
Line 1189... Line 1189...
1189
;      memcpy(np->entries, entries->entries,
1189
;      memcpy(np->entries, entries->entries,
1190
;          entries->nentries * sizeof (png_sPLT_entry));
1190
;          entries->nentries * sizeof (png_sPLT_entry));
Line 1191... Line 1191...
1191
 
1191
 
1192
;      /* Note that 'continue' skips the advance of the out pointer and out
1192
	; Note that 'continue' skips the advance of the out pointer and out
Line 1193... Line 1193...
1193
	; count, so an invalid entry is not added.
1193
	; count, so an invalid entry is not added.
1194
 
1194
 
1195
;      info_ptr->valid |= PNG_INFO_sPLT;
1195
;      info_ptr->valid |= PNG_INFO_sPLT;
Line 1209... Line 1209...
1209
align 4
1209
align 4
1210
proc check_location, png_ptr:dword, location:dword
1210
proc check_location, png_ptr:dword, location:dword
1211
;   location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT);
1211
;   location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT);
1212
 
1212
 
Line 1213... Line 1213...
1213
;   /* New in 1.6.0; copy the location and check it.  This is an API
1213
	; New in 1.6.0; copy the location and check it.  This is an API
1214
	; change; previously the app had to use the
1214
	; change; previously the app had to use the
1215
	; png_set_unknown_chunk_location API below for each chunk.
1215
	; png_set_unknown_chunk_location API below for each chunk.
Line 1216... Line 1216...
1216
 
1216
 
1217
;   if (location == 0 && (png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
1217
;   if (location == 0 && (png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
Line 1223... Line 1223...
1223
;      location = (byte)(png_ptr->mode &
1223
;      location = (byte)(png_ptr->mode &
1224
;          (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT));
1224
;          (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT));
1225
;   }
1225
;   }
1226
 
1226
 
Line 1227... Line 1227...
1227
;   /* This need not be an internal error - if the app calls
1227
	; This need not be an internal error - if the app calls
1228
	; png_set_unknown_chunks on a read pointer it must get the location right.
1228
	; png_set_unknown_chunks on a read pointer it must get the location right.
Line 1229... Line 1229...
1229
 
1229
 
1230
;   if (location == 0)
1230
;   if (location == 0)
Line 1231... Line 1231...
1231
;      png_error(png_ptr, "invalid location in png_set_unknown_chunks");
1231
;      png_error(png_ptr, "invalid location in png_set_unknown_chunks");
1232
 
1232
 
Line 1233... Line 1233...
1233
;   /* Now reduce the location to the top-most set bit by removing each least
1233
	; Now reduce the location to the top-most set bit by removing each least
1234
	; significant bit in turn.
1234
	; significant bit in turn.
Line 1243... Line 1243...
1243
	ret
1243
	ret
1244
endp
1244
endp
1245
 
1245
 
Line 1246... Line 1246...
1246
;void (png_structrp png_ptr,
1246
;void (png_structrp png_ptr,
1247
;    png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
1247
;    png_inforp info_ptr, png_unknown_chunkp unknowns, int num_unknowns)
1248
align 4
1248
align 4
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;
Line 1251... Line 1251...
1251
 
1251
 
Line 1655... Line 1655...
1655
;         return;
1655
;         return;
1656
;      }
1656
;      }
Line 1657... Line 1657...
1657
 
1657
 
1658
;#ifndef __COVERITY__
1658
;#ifndef __COVERITY__
1659
;      /* Some compilers complain that this is always false.  However, it
1659
	; Some compilers complain that this is always false.  However, it
Line 1660... Line 1660...
1660
	; can be true when integer overflow happens.
1660
	; can be true when integer overflow happens.
1661
 
1661
 
1662
;      if (size > ZLIB_IO_MAX)
1662
;      if (size > ZLIB_IO_MAX)
Line 1832... Line 1832...
1832
;      if (bad_character == 0)
1832
;      if (bad_character == 0)
1833
;         bad_character = 32;
1833
;         bad_character = 32;
1834
;   }
1834
;   }
1835
 
1835
 
Line 1836... Line 1836...
1836
;   /* Terminate the keyword */
1836
	; Terminate the keyword
1837
;   *new_key = 0;
1837
;   *new_key = 0;
Line 1838... Line 1838...
1838
 
1838
 
1839
;   if (key_len == 0)
1839
;   if (key_len == 0)