Icaros Viewer

miker1264 · 6193

miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
on: October 01, 2019, 10:54:07 AM
This is the first release of my "Icaros Viewer".

I updated it to display 32bit BMPX files with Alpha Transparency.
It can also Load and Display several other picture types.

In the next few weeks I will add a small context menu.
It will then be able to additionally Save As, Save As IFF, Save As PNG.

In the next version I will also disable the message at startup with dimensions.
It will be part of the "About" information instead. Pictures will then open directly. :-)
« Last Edit: October 01, 2019, 11:05:03 AM by miker1264 »



paolone

  • Moderator
  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #1 on: October 01, 2019, 02:07:02 PM
Good! I will download ASAP.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #2 on: October 01, 2019, 02:33:36 PM
Good! I will download ASAP.

@paolone
Here is the revised viewer. I changed line #250 to not display the dimensions on open.

I used: gcc viewer.c -o "Icaros Viewer"

That is a simple compiling. It uses datatypes.
I assume it's the same for compiling x64.

Double-Click the App Icon to open Picture Files.
« Last Edit: October 01, 2019, 08:44:37 PM by miker1264 »



ilBarbax

  • Newbie
  • *
    • Posts: 14
    • Karma: +2/-0
Reply #3 on: October 02, 2019, 02:51:59 AM
Miker,

why not to put your finger on the Multiviewer. Current version has some menu disabled and some functionality still missing.



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #4 on: October 02, 2019, 03:27:28 AM
Miker,

why not to put your finger on the Multiviewer. Current version has some menu disabled and some functionality still missing.
I

I was thinking about that but I have to be able to recompile it after making changes. I'm one step closer now with paolone's Ubuntu x64. The disabled menu items result because MultiView checks for DTM_WRITE for ILBM which is currently incomplete so it's disabled.

MultiView uses a display method where it Adds Datatypes to a window as a gadget. So it relies completely on datatypes. But it could use some improvement.



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #5 on: October 02, 2019, 04:27:38 AM
Well Miker :D



paolone

  • Moderator
  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #6 on: October 02, 2019, 04:53:06 AM

@paolone
Here is the revised viewer. I changed line #250 to not display the dimensions on open.

I used: gcc viewer.c -o "Icaros Viewer"

That is a simple compiling. It uses datatypes.
I assume it's the same for compiling x64.


Well, yes and no.


Yes, because viewer on x64 compiles and runs well.

No, because gcc on aros x64 does not work, so I had to use a metamake file as many times explained on icarosdesktop.org

to be precise, I put your viewer.c file into ~/sources/icaros/viewer/

then I created a mmakefile.src like the following:

Code: [Select]
clude $(SRCDIR)/config/aros.cfg


#MM local-icaros-viewer : includes linklibs


FILES := viewer
EXEDIR := $(AROS_CONTRIB)/$(AROS_DIR_DEVELOPER)/Build
NOWARN_FLAGS := $(NOWARN_FORMAT)
USER_CFLAGS := $(NOWARN_FLAGS)


%build_prog mmake=local-icaros-viewer \
    progname=viewer targetdir=$(EXEDIR) \
    files=$(FILES)


%common

then I launched build with:

Code: [Select]
make local-icaros-viewer
and this created the 'viewer' executable in Extras/Developer/Build. I copied it from there, added your icon, and everything went fine.




PS: avoid giving names with spaces to executables, even though AROS can handle them, people can always forget to use quotes in their paths.
« Last Edit: October 02, 2019, 05:03:27 AM by paolone »



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #7 on: October 02, 2019, 05:58:59 AM
@paolone

Very good to know as far as metamake. Following your very good example I can now put together a few metamake files including the one for the bmp datatype you asked for earlier.

Is this method also used to compile Magellan and Multiview and other modules for 64 bit?

The file naming makes sense now that you mention it. Thanks for pointing that out for me.



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #8 on: October 02, 2019, 06:26:00 AM
The viewer is a work in progress. In lieu of a simple menu I could instead use two simple keyboard shortcuts - Ctrl + S for "Save As PNG" and Ctrl + Q to "Quit Program".

I've worked out a way to use Save As PNG to quickly assemble PNG Icon Files. Open the first image and use Ctrl + S. Then a file requester appears. Save the File to a location in the format "File.info".

Then open the second image but when selecting the file name to save choose the recently saved .info file instead. It will prompt that the File Exists. Overwrite? Select Yes. It then notices the .info file extension and prompts again before saving "PNG File Exists. Would you like to Append?" If you choose Yes it will append the second image to the first to make a nice new png icon file in just a few seconds.

Also, using the INFO and ICO datatypes the Viewer can load and display icon files. It may be possible to use Arrow Keys to toggle multiple images. When you find one you like choose "Save As PNG" (Ctrl + S) and save the current image. Arrow keys may alao be used to display multiple images in a folder such as jpeg or even raw (dcraw) images, but I haven't gotten that far yet. Do we yet have a RAW Datatype?

The same method can be used for any Save As PNG menu item. If MultiView had a Save As PNG menu option, could it save png icon files as well?

BTW - Here are two 32bit images to test the viewer, one original 32bit png and the corresponding 32bit bmpx, both with alpha transparency.
« Last Edit: October 02, 2019, 06:43:19 AM by miker1264 »



paolone

  • Moderator
  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #9 on: October 02, 2019, 08:07:07 AM
@paolone

Very good to know as far as metamake. Following your very good example I can now put together a few metamake files including the one for the bmp datatype you asked for earlier.

Is this method also used to compile Magellan and Multiview and other modules for 64 bit?


I'm happy my example helped you understanding how the logic of metamake works. However, I suggest you to take some time and look for other mmakefile.src files included with AROS sources (in my development VM, just look for them in ~/sources), you will notice that they can be very different from each others. Some will be very simple, basic ones like mine, but others can be very, very complex, exacly like it happens with common 'makefile'.


We surely have a mmakefile.src for MultiView, since it's part of AROS programs. But unluckily we haven't anything similar for Magellan, which is not available for 64bit AROS.


The problem with bigger, 3rd party programs, is that they might use different tools to compile, they might have their own toolchain and we simply can't force everyone to use metamake files as we'd wish. Everyone must be free to use whatever they like. Unluckily, this also means that they will have to keep their AROS headers and files as much updated as possible, because otherwise their binaries wouldn't run on current system.


Just to be clear: except the ones I personally released, NO OTHER x86-64 PROGRAM ever released on The Archives is working on Icaros 64. Neither various MCC zune libraries, nor MuiMapparium or the recent Leu, nor fpc. That's simply because the ABI slightly changed between the time their authors compiled the binaries, and today. AND they are also using a older x86-64 AROS base to compile. This 'moving target' nature of AROS 64 is the main motivation why I waited for so much, before even trying to make a 64bit distribution. And I simply CAN'T ask several people to rebuild their programs every time AROS changes. If they used metamake files, however, thir effort would be little: just updating AROS sources and rebuild would be enough.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #10 on: October 02, 2019, 08:23:15 AM
@paolone

Yes. I understand that the mmake files may be different. Thanks for the example file. I actually made one for the bmp datatype just now.

"This 'moving target' nature of AROS 64 is the main motivation why I waited for so much, before even trying to make a 64bit distribution. And I simply CAN'T ask several people to rebuild their programs every time AROS changes. If they used metamake files, however, thir effort would be little: just updating AROS sources and rebuild would be enough."

The last part is very true. Any way possible to streamline the build process would be beneficial to everyone.



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #11 on: October 04, 2019, 08:35:13 AM
Now that I have the Preconfigured Development Environment for Linux set up and working I'd like to make a few Unofficial changes to MultiView.

Until ILBM datatype is complete with Save-ILBM I'd like to add save functions for IFF and PNG.
« Last Edit: October 04, 2019, 08:59:57 AM by miker1264 »



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #12 on: October 04, 2019, 09:38:25 AM
when you working at multiview again miker?



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #13 on: October 04, 2019, 11:55:35 AM
when you working at multiview again miker?

I'm going to compile my "Hello 64bit AROS World" program (Icaros Viewer). Then do a test compiling of MultiView. Then I can make a few unofficial changes to allow it to save.

It will be my own temporary version until the datatype save functions are all working well.

Save As will be a direct copy of the original to the destination. Save As IFF will use built in save functions for ILBM. And Save As PNG will use picture datatypes to save. Supply any supported basename for the last one to save as any picture type. In theory at least. We'll see.



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #14 on: October 04, 2019, 12:25:08 PM
there is support for postscript printers you can add this :D

hi