Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6780 → Rev 6779

/programs/develop/libraries/libs-dev/libimg/png/libpng/png.inc
743,8 → 743,41
; full explanation, see example.c for the summary. This just provides
; a simple one line description of the use of each function.
 
; The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in
; pngconf.h and in the *.dfn files in the scripts directory.
 
; PNG_EXPORT(ordinal, type, name, (args));
 
; ordinal: ordinal that is used while building
; *.def files. The ordinal value is only
; relevant when preprocessing png.h with
; the *.dfn files for building symbol table
; entries, and are removed by pngconf.h.
; type: return type of the function
; name: function name
; args: function arguments, with types
 
; When we wish to append attributes to a function prototype we use
; the PNG_EXPORTA() macro instead.
 
; PNG_EXPORTA(ordinal, type, name, (args), attributes);
 
; ordinal, type, name, and args: same as in PNG_EXPORT().
; attributes: function attributes
 
macro PNG_EXPORT ordinal, typ, nam, arg
{
align 4
nam:
local .end_t
local .m_txt
jmp .end_t
.m_txt db `nam,13,10,0
.end_t:
stdcall dbg_print,txt_zv,.m_txt
ret
}
 
; Simple signature checking function. This is the same as calling
; png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
 
910,6 → 943,23
PNG_FILTER_HEURISTIC_WEIGHTED equ 2 ;Experimental feature
PNG_FILTER_HEURISTIC_LAST equ 3 ;Not a valid value
 
; These next functions are called for input/output, memory, and error
; handling. They are in the file pngrio.c, pngwio.c, and pngerror.c,
; and call standard C I/O routines such as fread(), fwrite(), and
; fprintf(). These functions can be made to use other I/O routines
; at run time for those applications that need to handle I/O in a
; different manner by calling png_set_???_fn(). See libpng-manual.txt for
; more information.
 
 
; Replace the default data input function with a user supplied one.
PNG_EXPORT 78, void, png_set_read_fn, '(png_structrp png_ptr, voidp io_ptr, png_rw_ptr read_data_fn)'
 
 
; Reassign responsibility for freeing existing data, whether allocated
; by libpng or by the application; this works on the png_info structure passed
; in, it does not change the state for other png_info structures.
 
; It is unlikely that this function works correctly as of 1.6.0 and using it
; may result either in memory leaks or double free of allocated data.
 
935,16 → 985,29
PNG_FREE_MUL equ 0x4220 ;PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN
 
;if PNG_ERROR_TEXT_SUPPORTED
; The same, but the chunk name is prepended to the error string.
;PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,
; charp error_message), PNG_NORETURN);
 
;#else
; Fatal error in PNG image of libpng - can't continue
;PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);
;# define png_chunk_error(s1,s2) png_err(s1)
;end if
 
; Non-fatal error in libpng, chunk name is prepended to message.
PNG_EXPORT 106, void, png_chunk_warning, '(png_const_structrp png_ptr, charp warning_message)'
;#else
;# define png_warning(s1,s2) ((void)(s1))
;# define png_chunk_warning(s1,s2) ((void)(s1))
 
; Benign error in libpng. Can continue, but may have a problem.
; User can choose whether to handle as a fatal error or as a warning.
PNG_EXPORT 107, void, png_benign_error, '(png_const_structrp png_ptr, charp warning_message)'
 
;if PNG_READ_SUPPORTED
; Same, chunk name is prepended to message (only during read)
PNG_EXPORT 108, void, png_chunk_benign_error, '(png_const_structrp png_ptr, charp warning_message)'
 
;#else
;# ifdef PNG_ALLOW_BENIGN_ERRORS
/programs/develop/libraries/libs-dev/libimg/png/libpng/pngwrite.asm
2946,8 → 2946,7
je .end1
 
add ecx,16*1024
movzx eax,word[edi+png_struct.zstream.avail_out]
sub ecx,eax
sub cx,[edi+png_struct.zstream.avail_out]
cmp word[edi+png_struct.zstream.avail_out],0
je .cycle4 ;while (strm.avail_out == 0)
if 0
2968,6 → 2967,7
stdcall optimize_cmf, [m1], eax
@@:
end if
 
stdcall png_write_complete_chunk, edi, png_IDAT, [m1], ecx
or dword[edi+png_struct.mode],PNG_HAVE_IDAT
 
/programs/develop/libraries/libs-dev/libimg/png/libpng/pngwutil.asm
410,7 → 410,8
jne .end1 ;if (..==..)
mov eax,[edi+png_struct.flags]
and eax,PNG_FLAG_ZLIB_CUSTOM_STRATEGY
jz @f ;if (..!=0)
cmp eax,0
je @f ;if (..!=0)
mov eax,[edi+png_struct.zlib_strategy]
mov dword[strategy],eax
jmp .end2
476,7 → 477,8
; Check against the previous initialized values, if any.
mov eax,[edi+png_struct.flags]
and eax,PNG_FLAG_ZSTREAM_INITIALIZED
jz .end4
cmp eax,0
je .end4
mov eax,[level]
cmp [edi+png_struct.zlib_set_level],eax
jne @f
518,7 → 520,8
add ecx,png_struct.zstream
mov eax,[edi+png_struct.flags]
and eax,PNG_FLAG_ZSTREAM_INITIALIZED
jz @f ;if (..!=0)
cmp eax,0
je @f ;if (..!=0)
stdcall [deflateReset], ecx
jmp .end5
@@: ;else
1097,7 → 1100,8
jg @f
mov eax,[edi+png_struct.mng_features_permitted]
and eax,PNG_FLAG_MNG_EMPTY_PLTE
jnz .end1
cmp eax,0
jne .end1
cmp [num_pal],0
jne .end1
@@:
1114,7 → 1118,8
 
movzx eax,byte[edi+png_struct.color_type]
and eax,PNG_COLOR_MASK_COLOR
jnz @f ;if (..==0)
cmp eax,0
jne @f ;if (..==0)
png_warning edi, 'Ignoring request to write a PLTE chunk in grayscale PNG'
jmp .end_f
@@:
1271,7 → 1276,8
if PNG_WRITE_OPTIMIZE_CMF_SUPPORTED eq 1
mov eax,[edi+png_struct.mode]
and eax,PNG_HAVE_IDAT
jnz @f
cmp eax,0
jne @f
cmp byte[edi+png_struct.compression_type],PNG_COMPRESSION_TYPE_BASE
jne @f ;if (..==0 && ..==..)
stdcall png_image_size, edi
1321,8 → 1327,7
mov edx,[edi+png_struct.zbuffer_list]
add edx,png_compression_buffer.output
mov ecx,[edi+png_struct.zbuffer_size]
movzx eax,word[edi+png_struct.zstream.avail_out]
sub ecx,eax
sub cx,[edi+png_struct.zstream.avail_out]
;edx = data
;ecx = size
 
1329,7 → 1334,8
if PNG_WRITE_OPTIMIZE_CMF_SUPPORTED eq 1
mov eax,[edi+png_struct.mode]
and eax,PNG_HAVE_IDAT
jnz @f
cmp eax,0
jne @f
cmp byte[edi+png_struct.compression_type],PNG_COMPRESSION_TYPE_BASE
jne @f ;if (..==0 && ..==..)
stdcall png_image_size, edi
2417,7 → 2423,8
je @f
mov eax,[edi+png_struct.transformations]
and eax,PNG_INTERLACE
jnz @f ;if(..!=0 && ..==0)
cmp eax,0
jne @f ;if(..!=0 && ..==0)
movzx ecx,byte[png_pass_yinc]
mov eax,[edi+png_struct.height]
add eax,ecx
2472,7 → 2479,8
mov dword[edi+png_struct.row_number],0
mov eax,[edi+png_struct.transformations]
and eax,PNG_INTERLACE
jz @f ;if (..!=0)
cmp eax,0
je @f ;if (..!=0)
inc byte[edi+png_struct.pass]
jmp .end1
@@: ;else
2512,7 → 2520,8
 
mov eax,[edi+png_struct.transformations]
and eax,PNG_INTERLACE
jnz .cycle0end ;if(..!=0) break
cmp eax,0
jne .cycle0end ;if(..!=0) break
 
cmp dword[edi+png_struct.usr_width],0
je .cycle0
2867,7 → 2876,7
shr ah,1
sub al,ah
stosb
png_setup_abs dword[sum]
png_setup_abs [sum]
inc ebx
loop .cycle0
 
2888,7 → 2897,7
rol eax,8
sub al,ah
stosb
png_setup_abs dword[sum]
png_setup_abs [sum]
mov eax,[sum]
cmp eax,[lmins]
jg .cycle1end ;if (..>..) ;We are already worse, don't continue.
3131,7 → 3140,8
@@:
mov eax,[filter_to_do]
and eax,PNG_FILTER_NONE
jz .end0
cmp eax,0
je .end0
cmp dword[filter_to_do],PNG_FILTER_NONE
je .end0 ;else if (..!=0 && ..!=..)
; Overflow not possible and multiple filters in the list, including the
3161,7 → 3171,8
jmp .end1
@@:
and eax,PNG_FILTER_SUB
jz .end1 ;else if (..!=0)
cmp eax,0
je .end1 ;else if (..!=0)
stdcall png_setup_sub_row, edi, [bpp], [row_bytes], [mins]
cmp eax,[mins]
jge .end1 ;if (..<..)
3187,7 → 3198,8
jmp .end2
@@:
and eax,PNG_FILTER_UP
jz .end2 ;else if (..!=0)
cmp eax,0
je .end2 ;else if (..!=0)
stdcall png_setup_up_row, edi, [row_bytes], [mins]
cmp eax,[mins]
jge .end2 ;if (..<..)
3213,7 → 3225,8
jmp .end3
@@:
and eax,PNG_FILTER_AVG
jz .end3 ;else if (..!=0)
cmp eax,0
je .end3 ;else if (..!=0)
stdcall png_setup_avg_row, edi, [bpp], [row_bytes], [mins]
cmp eax,[mins]
jge .end3 ;if (..<..)
3239,7 → 3252,8
jmp .end4
@@:
and eax,PNG_FILTER_PAETH
jz .end4 ;else if (..!=0)
cmp eax,0
je .end4 ;else if (..!=0)
stdcall png_setup_paeth_row, edi, [bpp], [row_bytes], [mins]
cmp eax,[mins]
jge .end4 ;if (..<..)