Page 6 of 7

Re: libimg

Posted: Sun Sep 20, 2020 5:02 pm
by dunkaist
Script app-dynamic.lds is not in $(SDK_DIR)/lib/ but in $(SDK_DIR)/sources/newlib/

loadboxlib.obj and other obj's needed can be compiled with fasm from source in C_Layer/ASM

I have no idea what issue you faced since you didn't provide any information.

Re: libimg

Posted: Sun Sep 20, 2020 6:36 pm
by maxcodehack
Я сколько искал, очень маленького примерчика так и не нашел

Для TCC

Для kos32-gcc:
Downloaded 204 times

Re: libimg

Posted: Tue Nov 17, 2020 3:26 am
by Leency
Начал мимолетное знакомство с Blender'ом и он сохранил картинку с глубиной цвета 64 бита О_о я такого раньше не встречал...
Кто-то сталкивался, зачем такое нужно?

Мне аж интересно стало открывается ли она в Колибри и таки да - открывается без проблем.
Изображения по-разному отображались на 16-битом "экране" эмулятора, но при 32 отличий не заметил.

Файлы:
https://imgur.com/a/Z2harCK

Re: libimg

Posted: Tue Nov 17, 2020 5:18 am
by dunkaist
Leency wrote:Файлы:
https://imgur.com/a/Z2harCK

Code: Select all

$ gm identify -verbose ZAX6lLa.png | grep Depth -A4
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      8 bits
    Green:    8 bits
    Blue:     8 bits
    Opacity:  1 bits
    
$ gm identify -verbose tsQZcP4.png | grep Depth -A4
  Depth: 16 bits-per-pixel component
  Channel Depths:
    Red:      16 bits
    Green:    16 bits
    Blue:     16 bits
    Opacity:  1 bits
http://www.graphicsmagick.org/

Re: libimg

Posted: Thu Nov 19, 2020 6:01 pm
by Leency
Ок, зачем такое нужно?
HDR?

Re: libimg

Posted: Thu Nov 19, 2020 7:01 pm
by dunkaist
For image processing and for hardware that supports more than 8 bits per channel.

For example,
Philips 203V5LSB26 supports "16.7M" colors. Which is 2^(8*3) = 16,777,216, i.e. 3 color channels, 8bpp each.
Philips 329P9H supports "1.07 billion" colors. Which is 2^(10*3) = 1,073,741,824, i.e. 3 color channels, 10bpp each.

KolibriOS doesn't support such color modes.

Re: libimg

Posted: Thu Nov 19, 2020 11:15 pm
by Leency
dunkaist wrote:For image processing and for hardware that supports more than 8 bits per channel.

For example,
Philips 203V5LSB26 supports "16.7M" colors. Which is 2^(8*3) = 16,777,216, i.e. 3 color channels, 8bpp each.
Philips 329P9H supports "1.07 billion" colors. Which is 2^(10*3) = 1,073,741,824, i.e. 3 color channels, 10bpp each.

KolibriOS doesn't support such color modes.
Wow, thanks for the article, now its clear.

Re: libimg

Posted: Tue Dec 08, 2020 9:25 pm
by dunkaist
There has been alpha blending code in libimg for quite a long time, I wrapped it into img.blend function and exported in #8341.

I also committed an example in #8342.
BTW, the example uses img.from_file function, which helps to avoid calling file.open, file.read and file.close from libio.

Re: libimg

Posted: Tue Dec 08, 2020 9:44 pm
by Leency
dunkaist wrote:There has been alpha blending code in libimg for quite a long time, I wrapped it into img.blend function and exported in #8341.

I also committed an example in #8342.
BTW, the example uses img.from_file function, which helps to avoid calling file.open, file.read and file.close from libio.
dunkaist, thanks a lot! I will try to implement it after fix all issues of image support in WebView.

BTW, what about adding such blend into KIV for PNG and ICONS?

Re: libimg

Posted: Tue Dec 08, 2020 10:03 pm
by dunkaist
Leency wrote:BTW, what about adding such blend into KIV for PNG and ICONS?
It is to be done one day.

Re: libimg

Posted: Fri Dec 11, 2020 6:06 am
by Leency
#8363 libimg: img.decode now checks that _length is not null (fix crash)

Re: libimg

Posted: Sat Dec 12, 2020 11:13 pm
by IgorA
После ревизии 8341 перестала компилироваться libimg через файл build.bat
After revision 8341 libimg stopped compiling through the build.bat file
Leency wrote:#8363 libimg: img.decode now checks that _length is not null (fix crash)
Думаю так будет оптимальнее, хотя пока не проверял работоспособность по причине указанной выше
Spoiler:

Code: Select all

proc img.decode _data, _length, _options ;////////////////////////////////////////////////////////;;
;;------------------------------------------------------------------------------------------------;;
;? decodes loaded into memory graphic file                                                        ;;
;;------------------------------------------------------------------------------------------------;;
;> [_data]    = pointer to file in memory                                                         ;;
;> [_length]  = size in bytes of memory area pointed to by [_data]                                ;;
;> [_options] = 0 / pointer to the structure of additional options                                ;;
;;------------------------------------------------------------------------------------------------;;
;< eax = 0 / pointer to image                                                                     ;;
;;================================================================================================;;
    mov eax, [_length]
    or  eax,eax
    jz  .fail
    push    ebx
    mov ebx, img.formats_table
    @@: stdcall [ebx + FormatsTableEntry.Is], [_data], [_length]
    or  eax, eax
    jnz @f
    add ebx, sizeof.FormatsTableEntry
    cmp dword[ebx], eax ;0
    jnz @b
    pop ebx
  .fail:
    ret
    @@: mov eax, [ebx + FormatsTableEntry.Decode]
    pop ebx
    leave
    jmp eax
endp

Re: libimg

Posted: Sun Dec 13, 2020 3:48 am
by Leency
dunkaist wrote:BTW, the example uses img.from_file function, which helps to avoid calling file.open, file.read and file.close from libio.
Thanks for a hint with img.from_file. It helped me to decrease the C-- app sizes in #8381, in general we got 2 additional IMG sectors free.

#8383 also brings 3 IMG sectors more.

Re: libimg

Posted: Sun Dec 13, 2020 9:58 am
by dunkaist
IgorA wrote:После ревизии 8341 перестала компилироваться libimg через файл build.bat
After revision 8341 libimg stopped compiling through the build.bat file
I don't understand why people keep using *.bat and make files to build KolibriOS. There is build.txt in the root of the repository that explains how to build with tup. You don't need Windows-specific bat files or GNU-specific makefiles. Just use tup. Tup files are used on the autobuild server and therefore are always up-to-date. Custom bat files and makefiles are to be avoided if tup autobuild is set up.

Re: libimg

Posted: Mon Dec 21, 2020 5:20 pm
by IgorA
rev 8463
Сделано сохранение 32 битных изображений в png. (В файле libimg.asm пробелы заменились на табуляции, но это вышло случайно :? тут виноват редактор FASMW)

Сохранение делается почти так-же как и с 24 битами, но вместо изображения

Code: Select all

stdcall [img_create], [buf_png.w], [buf_png.h], Image.bpp24
...
создается изображение:

Code: Select all

stdcall [img_create], [buf_png.w], [buf_png.h], Image.bpp32
...
Made saving of 32 bit images in png. (In the libimg.asm file, spaces were replaced with tabs, but this came out by accident :? Tutat FASMW editor)