update docs sys function 54.1

git-svn-id: svn://kolibrios.org@6891 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2017-04-29 09:12:39 +00:00
parent e9922b1f71
commit dc5527c5ca
5 changed files with 175 additions and 139 deletions

View File

@ -2577,6 +2577,8 @@ dword-значение цвета 0x00RRGGBB
* 3 = RAW * 3 = RAW
* 4 и выше зарезервировано * 4 и выше зарезервировано
* +8: более детально смотрите файл clipboard_container_rus.txt * +8: более детально смотрите файл clipboard_container_rus.txt
* Функция должна использоваться совместно с 68.11. Приложение должно
предварительно проинициализировать локальную кучу вызовом 68.11.
---------------------- Константы для регистров: ---------------------- ---------------------- Константы для регистров: ----------------------
eax - SF_CLIPBOARD (54) eax - SF_CLIPBOARD (54)

View File

@ -2548,6 +2548,9 @@ Returned value:
* eax = if successful - pointer to a memory with data * eax = if successful - pointer to a memory with data
* eax = 1 - error * eax = 1 - error
* eax = -1 - main list area not found * eax = -1 - main list area not found
Remarks:
* The function must be used in conjunction with 68.11. The
application must pre-initialize the local heap by calling 68.11.
---------------------- Constants for registers: ---------------------- ---------------------- Constants for registers: ----------------------
eax - SF_CLIPBOARD (54) eax - SF_CLIPBOARD (54)

View File

@ -144,7 +144,7 @@ PNG_WRITE_SUPPORTED equ 1
PNG_WRITE_SWAP_ALPHA_SUPPORTED equ 1 PNG_WRITE_SWAP_ALPHA_SUPPORTED equ 1
PNG_WRITE_SWAP_SUPPORTED equ 1 PNG_WRITE_SWAP_SUPPORTED equ 1
PNG_WRITE_TEXT_SUPPORTED equ 0 PNG_WRITE_TEXT_SUPPORTED equ 0
PNG_WRITE_TRANSFORMS_SUPPORTED equ 0 PNG_WRITE_TRANSFORMS_SUPPORTED equ 1
PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED equ 0 PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED equ 0
PNG_WRITE_USER_TRANSFORM_SUPPORTED equ 1 PNG_WRITE_USER_TRANSFORM_SUPPORTED equ 1
PNG_WRITE_WEIGHTED_FILTER_SUPPORTED equ 1 PNG_WRITE_WEIGHTED_FILTER_SUPPORTED equ 1

View File

@ -20,8 +20,8 @@ proc png_set_bgr uses edi, png_ptr:dword
png_debug 1, 'in png_set_bgr' png_debug 1, 'in png_set_bgr'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je @f ;if (..==0) return jz @f ;if (..==0) return
or dword[edi+png_struct.transformations], PNG_BGR or dword[edi+png_struct.transformations], PNG_BGR
@@: @@:
ret ret
@ -34,8 +34,8 @@ proc png_set_swap uses edi, png_ptr:dword
png_debug 1, 'in png_set_swap' png_debug 1, 'in png_set_swap'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je @f ;if (..==0) return jz @f ;if (..==0) return
cmp byte[edi+png_struct.bit_depth],16 cmp byte[edi+png_struct.bit_depth],16
jne @f ;if (..==..) jne @f ;if (..==..)
@ -51,8 +51,8 @@ proc png_set_packing uses edi, png_ptr:dword
png_debug 1, 'in png_set_packing' png_debug 1, 'in png_set_packing'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je @f ;if (..==0) return jz @f ;if (..==0) return
cmp byte[edi+png_struct.bit_depth],8 cmp byte[edi+png_struct.bit_depth],8
jge @f ;if (..<..) jge @f ;if (..<..)
@ -71,8 +71,8 @@ proc png_set_packswap uses edi, png_ptr:dword
png_debug 1, 'in png_set_packswap' png_debug 1, 'in png_set_packswap'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je @f ;if (..==0) return jz @f ;if (..==0) return
cmp byte[edi+png_struct.bit_depth],8 cmp byte[edi+png_struct.bit_depth],8
jge @f ;if (..<..) jge @f ;if (..<..)
@ -87,8 +87,8 @@ proc png_set_shift uses ecx edi, png_ptr:dword, true_bits:dword
png_debug 1, 'in png_set_shift' png_debug 1, 'in png_set_shift'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je @f ;if (..==0) return jz @f ;if (..==0) return
or dword[edi+png_struct.transformations], PNG_SHIFT or dword[edi+png_struct.transformations], PNG_SHIFT
mov ecx,sizeof.png_color_8 mov ecx,sizeof.png_color_8
@ -105,8 +105,8 @@ proc png_set_interlace_handling uses edi, png_ptr:dword
png_debug 1, 'in png_set_interlace handling' png_debug 1, 'in png_set_interlace handling'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je @f jz @f
cmp byte[edi+png_struct.interlaced],0 cmp byte[edi+png_struct.interlaced],0
je @f ;if(..!=0 && ..!=0) je @f ;if(..!=0 && ..!=0)
or dword[edi+png_struct.transformations], PNG_INTERLACE or dword[edi+png_struct.transformations], PNG_INTERLACE
@ -131,8 +131,8 @@ proc png_set_filler uses eax edi, png_ptr:dword, filler:dword, filler_loc:dword
png_debug 1, 'in png_set_filler' png_debug 1, 'in png_set_filler'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je .end_f ;if (..==0) return jz .end_f ;if (..==0) return
; In libpng 1.6 it is possible to determine whether this is a read or write ; In libpng 1.6 it is possible to determine whether this is a read or write
; operation and therefore to do more checking here for a valid call. ; operation and therefore to do more checking here for a valid call.
@ -221,8 +221,8 @@ proc png_set_add_alpha uses eax edi, png_ptr:dword, filler:dword, filler_loc:dwo
png_debug 1, 'in png_set_add_alpha' png_debug 1, 'in png_set_add_alpha'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je .end_f ;if (..==0) return jz .end_f ;if (..==0) return
stdcall png_set_filler, edi, [filler], [filler_loc] stdcall png_set_filler, edi, [filler], [filler_loc]
; The above may fail to do anything. ; The above may fail to do anything.
@ -240,8 +240,8 @@ proc png_set_swap_alpha uses edi, png_ptr:dword
png_debug 1, 'in png_set_swap_alpha' png_debug 1, 'in png_set_swap_alpha'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je .end_f ;if (..==0) return jz .end_f ;if (..==0) return
or dword[edi+png_struct.transformations], PNG_SWAP_ALPHA or dword[edi+png_struct.transformations], PNG_SWAP_ALPHA
.end_f: .end_f:
ret ret
@ -254,8 +254,8 @@ proc png_set_invert_alpha uses edi, png_ptr:dword
png_debug 1, 'in png_set_invert_alpha' png_debug 1, 'in png_set_invert_alpha'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je .end_f ;if (..==0) return jz .end_f ;if (..==0) return
or dword[edi+png_struct.transformations], PNG_INVERT_ALPHA or dword[edi+png_struct.transformations], PNG_INVERT_ALPHA
.end_f: .end_f:
ret ret
@ -267,8 +267,8 @@ proc png_set_invert_mono uses edi, png_ptr:dword
png_debug 1, 'in png_set_invert_mono' png_debug 1, 'in png_set_invert_mono'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je .end_f ;if (..==0) return jz .end_f ;if (..==0) return
or dword[edi+png_struct.transformations], PNG_INVERT_MONO or dword[edi+png_struct.transformations], PNG_INVERT_MONO
.end_f: .end_f:
ret ret
@ -277,55 +277,67 @@ endp
; Invert monochrome grayscale data ; Invert monochrome grayscale data
;void (png_row_infop row_info, bytep row) ;void (png_row_infop row_info, bytep row)
align 4 align 4
proc png_do_invert, row_info:dword, row:dword proc png_do_invert uses eax ebx ecx edx, row_info:dword, row:dword
;ecx - i
;eax - rp
;edx - istop
png_debug 1, 'in png_do_invert' png_debug 1, 'in png_do_invert'
; This test removed from libpng version 1.0.13 and 1.2.0: mov ebx,[row_info]
; if (row_info->bit_depth == 1 && cmp byte[ebx+png_row_info.color_type],PNG_COLOR_TYPE_GRAY
jne .end0
; if (row_info->color_type == PNG_COLOR_TYPE_GRAY) mov eax,[row]
; { mov edx,[ebx+png_row_info.rowbytes]
; bytep rp = row; xor ecx,ecx
; png_size_t i; jmp @f
; png_size_t istop = row_info->rowbytes; align 4
.cycle0:
; for (i = 0; i < istop; i++) inc ecx
; { @@:
; *rp = (byte)(~(*rp)); cmp ecx,edx
; rp++; jae .end_f
; } not byte[eax]
; } inc eax
jmp .cycle0
; else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && .end0:
; row_info->bit_depth == 8) cmp byte[ebx+png_row_info.color_type],PNG_COLOR_TYPE_GRAY_ALPHA
; { jne .end1
; bytep rp = row; cmp byte[ebx+png_row_info.bit_depth],8
; png_size_t i; jne .end1
; png_size_t istop = row_info->rowbytes; mov eax,[row]
mov edx,[ebx+png_row_info.rowbytes]
; for (i = 0; i < istop; i += 2) xor ecx,ecx
; { jmp @f
; *rp = (byte)(~(*rp)); align 4
; rp += 2; .cycle1:
; } add ecx,2
; } @@:
cmp ecx,edx
jae .end_f
not byte[eax]
add eax,2
jmp .cycle1
.end1:
if PNG_16BIT_SUPPORTED eq 1 if PNG_16BIT_SUPPORTED eq 1
; else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && cmp byte[ebx+png_row_info.color_type],PNG_COLOR_TYPE_GRAY_ALPHA
; row_info->bit_depth == 16) jne .end_f
; { cmp byte[ebx+png_row_info.bit_depth],16
; bytep rp = row; jne .end_f
; png_size_t i; mov eax,[row]
; png_size_t istop = row_info->rowbytes; mov edx,[ebx+png_row_info.rowbytes]
xor ecx,ecx
; for (i = 0; i < istop; i += 4) jmp @f
; { align 4
; *rp = (byte)(~(*rp)); .cycle2:
; *(rp + 1) = (byte)(~(*(rp + 1))); add ecx,4
; rp += 4; @@:
; } cmp ecx,edx
; } jae .end_f
not word[eax]
add eax,4
jmp .cycle2
end if end if
.end_f:
ret ret
endp endp
@ -624,76 +636,94 @@ endp
align 4 align 4
proc png_do_bgr, row_info:dword, row:dword proc png_do_bgr, row_info:dword, row:dword
png_debug 1, 'in png_do_bgr' png_debug 1, 'in png_do_bgr'
;ebx - rp
; if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) ;ecx - i
; { ;esi - row_width
; uint_32 row_width = row_info->width; pushad
; if (row_info->bit_depth == 8) mov edi,[row_info]
; { movzx eax,byte[edi+png_row_info.color_type]
; if (row_info->color_type == PNG_COLOR_TYPE_RGB) and eax,PNG_COLOR_MASK_COLOR
; { je .end_f
; bytep rp; mov esi,[edi+png_row_info.width]
; uint_32 i; cmp byte[edi+png_row_info.bit_depth],8
jne .end0
; for (i = 0, rp = row; i < row_width; i++, rp += 3) cmp byte[edi+png_row_info.color_type],PNG_COLOR_TYPE_RGB
; { jne .end1
; byte save = *rp; xor ecx,ecx
; *rp = *(rp + 2); mov ebx,[row]
; *(rp + 2) = save; jmp @f
; } align 4
; } .cycle0:
inc ecx
; else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) add ebx,3
; { @@:
; bytep rp; cmp ecx,esi
; uint_32 i; jae .end_f
mov dl,[ebx]
; for (i = 0, rp = row; i < row_width; i++, rp += 4) mov al,[ebx+2]
; { mov [ebx],al
; byte save = *rp; mov [ebx+2],dl
; *rp = *(rp + 2); jmp .cycle0
; *(rp + 2) = save; .end1:
; } cmp byte[edi+png_row_info.color_type],PNG_COLOR_TYPE_RGB_ALPHA
; } jne .end_f
; } xor ecx,ecx
mov ebx,[row]
jmp @f
align 4
.cycle1:
inc ecx
add ebx,4
@@:
cmp ecx,esi
jae .end_f
mov dl,[ebx]
mov al,[ebx+2]
mov [ebx],al
mov [ebx+2],dl
jmp .cycle1
.end0:
if PNG_16BIT_SUPPORTED eq 1 if PNG_16BIT_SUPPORTED eq 1
; else if (row_info->bit_depth == 16) cmp byte[edi+png_row_info.bit_depth],16
; { jne .end_f
; if (row_info->color_type == PNG_COLOR_TYPE_RGB) cmp byte[edi+png_row_info.color_type],PNG_COLOR_TYPE_RGB
; { jne .end2
; bytep rp; xor ecx,ecx
; uint_32 i; mov ebx,[row]
jmp @f
; for (i = 0, rp = row; i < row_width; i++, rp += 6) align 4
; { .cycle2:
; byte save = *rp; inc ecx
; *rp = *(rp + 4); add ebx,6
; *(rp + 4) = save; @@:
; save = *(rp + 1); cmp ecx,esi
; *(rp + 1) = *(rp + 5); jae .end_f
; *(rp + 5) = save; mov dx,[ebx]
; } mov ax,[ebx+4]
; } mov [ebx],ax
mov [ebx+4],dx
; else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) jmp .cycle2
; { .end2:
; bytep rp; cmp byte[edi+png_row_info.color_type],PNG_COLOR_TYPE_RGB_ALPHA
; uint_32 i; jne .end_f
xor ecx,ecx
; for (i = 0, rp = row; i < row_width; i++, rp += 8) mov ebx,[row]
; { jmp @f
; byte save = *rp; align 4
; *rp = *(rp + 4); .cycle3:
; *(rp + 4) = save; inc ecx
; save = *(rp + 1); add ebx,8
; *(rp + 1) = *(rp + 5); @@:
; *(rp + 5) = save; cmp ecx,esi
; } jae .end_f
; } mov dx,[ebx]
; } mov ax,[ebx+4]
mov [ebx],ax
mov [ebx+4],dx
jmp .cycle3
end if end if
; } .end_f:
popad
ret ret
endp endp
@ -804,8 +834,8 @@ proc png_set_user_transform_info uses eax edi, png_ptr:dword, user_transform_ptr
png_debug 1, 'in png_set_user_transform_info' png_debug 1, 'in png_set_user_transform_info'
mov edi,[png_ptr] mov edi,[png_ptr]
cmp edi,0 test edi,edi
je .end_f jz .end_f
if PNG_READ_USER_TRANSFORM_SUPPORTED eq 1 if PNG_READ_USER_TRANSFORM_SUPPORTED eq 1
mov eax,[edi+png_struct.mode] mov eax,[edi+png_struct.mode]

View File

@ -1842,6 +1842,7 @@ proc png_image_write_init uses ebx ecx edx edi esi, image:dword
test eax,eax test eax,eax
jz .end0 ;if (..!=0) jz .end0 ;if (..!=0)
mov edi,eax mov edi,eax
or dword[eax+png_struct.transformations],PNG_BGR ;transformation rgb for KoliriOS
stdcall png_create_info_struct, edi stdcall png_create_info_struct, edi
;eax = info_ptr ;eax = info_ptr
@ -2753,7 +2754,7 @@ end if
; supported by the rest of the libpng write code; call it directly. ; supported by the rest of the libpng write code; call it directly.
.end9: ;else .end9: ;else
if 1 ;;; IDAT compress all if 1 ;;; IDAT compress all (only 24 bit)
mov ecx,[edx+png_image_write_control.row_bytes] mov ecx,[edx+png_image_write_control.row_bytes]
inc ecx inc ecx
imul ecx,[ebx+png_image.height] imul ecx,[ebx+png_image.height]