zView plugin reader_read output format

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

zView plugin reader_read output format

Postby JeanMars » Sat Oct 06, 2018 5:05 pm

Hi all,

I'm in the process of integrating zView plugins to VISION and I'm not sure what pixel format is returned in buffer by:
boolean CDECL reader_read( IMGINFO info, uint8 *buffer)
I'm looking in zview plugin source code but it's still messy to me.
How to I know which format is returned for a given bit per pixel, i.e:
bitsperpixels=1 (mono): I guess it's the regular ATARI bitplane format
bitsperpixels=2 (4colors): ?
bitsperpixels=4 (16colors): [index1|index2][index3|index4].... ?
bitsperpixels=8 (256colors): [index1][index2]... ?
bitsperpixels=15/16 (32/65K colors): Falcon RRRRRGGGGGGBBBBB 16bits?
bitsperpixels=24 (16M colors): [R][G][B]... ?
bitsperpixels=32 (16M colors with alpha): [A][R][G][B]... ?
Or maybe I missed some documentation, can someone point this out to me?

Also I believe zView plugin have dither feature, should I simply set info->planes to get the line in the desired screen resolution?

Thanks,
Jean

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2368
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: zView plugin reader_read output format

Postby lp » Sat Oct 06, 2018 5:13 pm

Are you calling the LDG modules directly or did you link zorro's zcodeclib?

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sat Oct 06, 2018 5:50 pm

Calling ldg directly

OL
Captain Atari
Captain Atari
Posts: 479
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: zView plugin reader_read output format

Postby OL » Sat Oct 06, 2018 6:06 pm

24 bit format is RGB

JeanMars wrote:Hi all,

I'm in the process of integrating zView plugins to VISION and I'm not sure what pixel format is returned in buffer by:
boolean CDECL reader_read( IMGINFO info, uint8 *buffer)
I'm looking in zview plugin source code but it's still messy to me.
How to I know which format is returned for a given bit per pixel, i.e:
bitsperpixels=1 (mono): I guess it's the regular ATARI bitplane format
bitsperpixels=2 (4colors): ?
bitsperpixels=4 (16colors): [index1|index2][index3|index4].... ?
bitsperpixels=8 (256colors): [index1][index2]... ?
bitsperpixels=15/16 (32/65K colors): Falcon RRRRRGGGGGGBBBBB 16bits?
bitsperpixels=24 (16M colors): [R][G][B]... ?
bitsperpixels=32 (16M colors with alpha): [A][R][G][B]... ?
Or maybe I missed some documentation, can someone point this out to me?

Also I believe zView plugin have dither feature, should I simply set info->planes to get the line in the desired screen resolution?

Thanks,
Jean
OL

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2368
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: zView plugin reader_read output format

Postby lp » Sat Oct 06, 2018 6:15 pm

The zcodeclib does all the heavy work, calling the modules, flipping images upside down if needed (Targa for example are sometimes stored upside down), dithering, resizing, etc. It then builds a bitmap for you with a MFDB.

Sometime ago I did some tests calling zView LDG modules directly. The modules set bitplanes, width, height, number of components, indexed flag, number of colors, and palette depending on the number of planes. This happens in reader_init(). These are returned in the IMAGE info structure. The buffer contents change depending on these values. I hope I explained this correctly.

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sat Oct 06, 2018 6:27 pm

From a design point of view i need to call ldg directly, it wouls be much more difficult for me to integrate zcodec lib as vision has already stuff to handle index to bitplanes conversion, dither etc. And zcodec does not fit into current vision design.
But i need to know which format is outputed by reader_read function, it looks obvious for tc modes but not.for bitplanes <=8.
So any clue?

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2368
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: zView plugin reader_read output format

Postby lp » Sat Oct 06, 2018 6:38 pm

The indexed flag in the structure should be set true. The buffer is then indexes into the palette that's returned.

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sat Oct 06, 2018 7:29 pm

Ah ok,
so if indexed_color is TRUE then buffer points out to indexes with 1 pixel=1byte not depending on the number of planes?
Makes sense as it is just a buffer or a line so no big deal if index is taking 8 times more memory than required (monochrome images).

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sat Oct 06, 2018 7:51 pm

To make sure I understand properly: is there any way for a zview ldg plugin to return a different number of planes than the one stated in the file?
Basically, does ldg support dithering or just return always the image as it is in the file?

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2368
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: zView plugin reader_read output format

Postby lp » Sat Oct 06, 2018 9:38 pm

Correct, pretty sure the buffer is always 1 byte = 1 index. A codec can output image data however it wants, so long as it's one of the data formats zView supports. A codec could output a Degas file in full 24-bit for example, that would not be wise, but it can legally be done. The person writing the codec determines the best data format to use when outputting the image data. If you study the codec sources in the plugin folder you can see how the codecs output image data.

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sat Oct 06, 2018 10:06 pm

data formats zView supports

Where are these formats described? Are they just defining the number of planes (assuming 1byte ndexes for <=256 colors and 16bit Falcon, 24/32RGBA) or even how the image is coded, i.e. pure indexes, bitplanes, True Color organization (e.g. RGB or BGR).
If so is there any documentation?
And is there a way to suggest the plugin the number of planes we expect (e.g a 24bit PNG image to be displayed on a 256 color resolution?)

Thanks,
Jean

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2368
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: zView plugin reader_read output format

Postby lp » Sat Oct 06, 2018 11:04 pm

All I had to go by was the source code to the codecs in the plugin folder. I never found any detailed documentation on the codecs themselves. There is however documentation about the zcodeclib. I think he wrote the codecs for his lib and never expected anyone to use the plugins directly. Just my guess.

You cannot suggest to a codec what you want returned. They are hard coded to decode images in a certain way.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12497
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: zView plugin reader_read output format

Postby wongck » Sun Oct 07, 2018 2:16 am

JeanMars wrote:From a design point of view i need to call ldg directly, it wouls be much more difficult for me to integrate zcodec lib as vision has already stuff to handle index to bitplanes conversion, dither etc. And zcodec does not fit into current vision design.

Only reason i used zcodec was to because I do not need to know all these stuff.... bitplanes conversion, dither etc.
since you already know and have all these done, why bother converting ??
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sun Oct 07, 2018 10:49 am

The main reason i want to avoid using zcodeclib in vision is because i would have to redesign vision, simply too much work as vision's logic to load image from menu, catalog, image browser, batch conversion is based on a similar ldg plugin interface, not zcodec high level routines.
Second one is to not add similar existing routines that would increase vision size unnecessarily.
Btw if i understand correctly a zview ldg will never return a line in atari bitplane mode? I would expect this format to be the most natural one for legacy atari formats such as art, degas, img...
Thanks,
Jean

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2368
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: zView plugin reader_read output format

Postby lp » Sun Oct 07, 2018 3:08 pm

JeanMars wrote:Btw if i understand correctly a zview ldg will never return a line in atari bitplane mode? I would expect this format to be the most natural one for legacy atari formats such as art, degas, img...


Correct. The zcodeclib does this conversion to atari bitmap. Like I said, pretty sure he designed these modules around his lib. For example, if I set the orientation flag because I want an image flipped right side up, then zcodeclib will do this work. However, calling the plugin directly makes this flag somewhat useless, unless you would do the same inside Vision. I have written many codecs, so I do know what output should be. Give me a little time and I will compile a list with some additional notes for you. I have to go back to my sources because my notes are in my source files. ;)

JeanMars
Atari freak
Atari freak
Posts: 67
Joined: Fri Apr 09, 2010 5:15 pm
Location: France
Contact:

Re: zView plugin reader_read output format

Postby JeanMars » Sun Oct 07, 2018 3:15 pm

Hi lp,

that would be very useful to me :-)


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 5 guests