Subversion Repositories Kolibri OS

Rev

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

Rev 6779 Rev 6797
Line 79... Line 79...
79
	@@:
79
	@@:
80
	ret
80
	ret
81
endp
81
endp
82
 
82
 
Line 83... Line 83...
83
;void (png_structrp png_ptr, png_const_color_8p true_bits)
83
;void (png_structrp png_ptr, png_color_8p true_bits)
84
align 4
84
align 4
85
proc png_set_shift uses ecx edi, png_ptr:dword, true_bits:dword
85
proc png_set_shift uses ecx edi, png_ptr:dword, true_bits:dword
86
	png_debug 1, 'in png_set_shift'
86
	png_debug 1, 'in png_set_shift'
Line 87... Line 87...
87
 
87
 
Line 137... Line 137...
137
	; operation and therefore to do more checking here for a valid call.
137
	; operation and therefore to do more checking here for a valid call.
138
 
138
 
Line 139... Line 139...
139
	mov eax,[edi+png_struct.mode]
139
	mov eax,[edi+png_struct.mode]
140
	and eax,PNG_IS_READ_STRUCT
140
	and eax,PNG_IS_READ_STRUCT
141
	cmp eax,0
-
 
142
	je @f ;if (..!=0)
141
	jz @f ;if (..!=0)
143
if PNG_READ_FILLER_SUPPORTED eq 1
142
if PNG_READ_FILLER_SUPPORTED eq 1
144
		; On read png_set_filler is always valid, regardless of the base PNG
143
		; On read png_set_filler is always valid, regardless of the base PNG
145
		; format, because other transformations can give a format where the
144
		; format, because other transformations can give a format where the
146
		; filler code can execute (basically an 8 or 16-bit component RGB or G
145
		; filler code can execute (basically an 8 or 16-bit component RGB or G
147
		; format.)
146
		; format.)
Line 227... Line 226...
227
	stdcall png_set_filler, edi, [filler], [filler_loc]
226
	stdcall png_set_filler, edi, [filler], [filler_loc]
228
	; The above may fail to do anything.
227
	; The above may fail to do anything.
229
	mov eax,[edi+png_struct.transformations]
228
	mov eax,[edi+png_struct.transformations]
230
	and eax,PNG_FILLER
229
	and eax,PNG_FILLER
231
	cmp eax,0
-
 
232
	je .end_f ;if (..!=0)
230
	jz .end_f ;if (..!=0)
233
		or dword[edi+png_struct.transformations],PNG_ADD_ALPHA
231
		or dword[edi+png_struct.transformations],PNG_ADD_ALPHA
234
.end_f:
232
.end_f:
235
	ret
233
	ret
236
endp
234
endp
Line 242... Line 240...
242
 
240
 
Line 243... Line 241...
243
	mov edi,[png_ptr]
241
	mov edi,[png_ptr]
244
	cmp edi,0
242
	cmp edi,0
245
	je .end_f ;if (..==0) return
243
	je .end_f ;if (..==0) return
246
 
-
 
247
;   png_ptr->transformations |= PNG_SWAP_ALPHA;
244
		or dword[edi+png_struct.transformations], PNG_SWAP_ALPHA
248
.end_f:
245
.end_f:
249
	ret
246
	ret
250
endp
247
endp
Line 257... Line 254...
257
 
254
 
Line 258... Line 255...
258
	mov edi,[png_ptr]
255
	mov edi,[png_ptr]
259
	cmp edi,0
256
	cmp edi,0
260
	je .end_f ;if (..==0) return
257
	je .end_f ;if (..==0) return
261
 
-
 
262
;   png_ptr->transformations |= PNG_INVERT_ALPHA;
258
		or dword[edi+png_struct.transformations], PNG_INVERT_ALPHA
263
.end_f:
259
.end_f:
264
	ret
260
	ret
265
endp
261
endp
Line 266... Line 262...
266
 
262
 
Line 271... Line 267...
271
 
267
 
Line 272... Line 268...
272
	mov edi,[png_ptr]
268
	mov edi,[png_ptr]
273
	cmp edi,0
269
	cmp edi,0
274
	je .end_f ;if (..==0) return
270
	je .end_f ;if (..==0) return
275
 
-
 
276
;   png_ptr->transformations |= PNG_INVERT_MONO;
271
		or dword[edi+png_struct.transformations], PNG_INVERT_MONO
277
.end_f:
272
.end_f:
278
	ret
273
	ret
279
endp
274
endp
Line 280... Line 275...
280
 
275
 
Line 813... Line 808...
813
 
808
 
Line 814... Line 809...
814
if PNG_READ_USER_TRANSFORM_SUPPORTED eq 1
809
if PNG_READ_USER_TRANSFORM_SUPPORTED eq 1
815
	mov eax,[edi+png_struct.mode]
810
	mov eax,[edi+png_struct.mode]
816
	and eax,PNG_IS_READ_STRUCT
811
	and eax,PNG_IS_READ_STRUCT
817
	cmp eax,0
-
 
818
	je @f
812
	jz @f
819
	mov eax,[edi+png_struct.flags]
813
	mov eax,[edi+png_struct.flags]
820
	and eax,PNG_FLAG_ROW_INIT
814
	and eax,PNG_FLAG_ROW_INIT
821
	cmp eax,0
-
 
822
	je @f ;if (..!=0 && ..!=0)
815
	jz @f ;if (..!=0 && ..!=0)
823
		cStr ,'info change after png_start_read_image or png_read_update_info'
816
		cStr ,'info change after png_start_read_image or png_read_update_info'
824
		stdcall png_app_error, edi, eax
817
		stdcall png_app_error, edi, eax
825
		jmp .end_f
818
		jmp .end_f
826
	@@:
819
	@@:
827
end if
820
end if
Line 840... Line 833...
840
; the user transform functions.  The application should free any memory
833
; the user transform functions.  The application should free any memory
841
; associated with this pointer before png_write_destroy and png_read_destroy
834
; associated with this pointer before png_write_destroy and png_read_destroy
842
; are called.
835
; are called.
843
 
836
 
Line 844... Line 837...
844
;voidp (png_const_structrp png_ptr)
837
;voidp (png_structrp png_ptr)
845
align 4
838
align 4
846
proc png_get_user_transform_ptr, png_ptr:dword
839
proc png_get_user_transform_ptr, png_ptr:dword
847
	mov eax,[png_ptr]
840
	mov eax,[png_ptr]
848
	cmp eax,0
841
	cmp eax,0
849
	je @f
842
	je @f
850
		mov eax,[eax+png_struct.user_transform_ptr]
843
		mov eax,[eax+png_struct.user_transform_ptr]
851
	@@:
844
	@@:
852
	ret
845
	ret
853
endp
846
endp
Line 854... Line 847...
854
 
847
 
855
;uint_32 (png_const_structrp png_ptr)
848
;uint_32 (png_structrp png_ptr)
856
align 4
849
align 4
857
proc png_get_current_row_number, png_ptr:dword
850
proc png_get_current_row_number, png_ptr:dword
858
	; See the comments in png.inc - this is the sub-image row when reading an
851
	; See the comments in png.inc - this is the sub-image row when reading an
Line 868... Line 861...
868
.end_f:
861
.end_f:
869
	ret
862
	ret
870
endp
863
endp
871
 
864
 
Line 872... Line 865...
872
;byte (png_const_structrp png_ptr)
865
;byte (png_structrp png_ptr)
873
align 4
866
align 4
874
proc png_get_current_pass_number, png_ptr:dword
867
proc png_get_current_pass_number, png_ptr:dword
875
	mov eax,[png_ptr]
868
	mov eax,[png_ptr]
876
	cmp eax,0
869
	cmp eax,0
877
	je @f ;if (..!=0)
870
	je @f ;if (..!=0)