English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 27 August 2019, 07:52   #1
Steffest
Registered User

 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 130
OS4 Icons - ARGB data structure

Hello,

I'm writing some tools to work with Amiga icons in javascript.

Currently I can decode them properly and convert them to PNG or whatever and I am now implementing the other way around: writing Amiga icons.

I've got OS1->OS3 style icons covered, including ColorIcons, but I am somewhat struggling with OS4 ARGB icons.

In the ARGB chuck of the IFF FORM there are a few bytes before the Zlib compressed image data begins that I'm not sure about what they mean and I can't find any documentation for it.
I can decode those icons fine by just ignore those bytes, but when writing them, obviously this doesn't work.

Does anyone have an idea what the exact datastructure for OS4 ARGB icons is?
I looked in the icon.library of PeterK and this seem to be the relevant section, but there are a lot of question marks there :-)

ADD.L D4,D0 ; size=header+image
MOVE.L #"ARGB",(A0)+ ; ARGB label
MOVE.L D0,(A0)+ ; ARGB chunk size
MOVEQ #1,D0
MOVE.L D0,(A0)+ ; type ????
SUBQ.L #1,D4
MOVE.L D4,(A0)+ ; z-image size - 1
CLR.W (A0) ; padd ????
MOVE.L A3,D2 ; ARGB header
MOVEQ #18,D3 ; size of header
BSR.S .writeoneblock
MOVE.L $116(A2),D2 ; ARGB zlib-image
MOVE.L $112(A2),D3 ; zlib-image size
BRA.S .writesecondblock

And I most admit I can hardly make head or tail from Assembler code.
So those few bytes between the ARGB chunk label and the ARGB zlib-image. what are those exactly?

In case anyone is interesed, my code currently is at
https://github.com/steffest/Amiga-Icon-converter/

The main purpose for adding writing support is that I'm creating some new icons and want to
  • integrate converting them into my toolchain so I can generate them in batch automatically from a photoshop file
  • have complete control over the palette so I can optimise it and generate all formats in one step: truecolor ones with alpha for OS4, 32 color ones with optimised palette for Classic OS, 8 color MUI style ones for low-end Amigas
Steffest is offline  
Old 27 August 2019, 08:08   #2
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 45
Posts: 1,295
Send a message via Yahoo to Samurai_Crow
The paletted OS4 icons each have their own palette so my guess is it is an indication that it's not a paletted icon. Also, you might check the IFF FORM and Chunk registry at http://wiki.amigaos.net/wiki/IFF_FOR...Chunk_Registry
Samurai_Crow is offline  
Old 27 August 2019, 08:21   #3
Steffest
Registered User

 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 130
Quote:
Originally Posted by Samurai_Crow View Post
The paletted OS4 icons each have their own palette so my guess is it is an indication that it's not a paletted icon. Also, you might check the IFF FORM and Chunk registry at http://wiki.amigaos.net/wiki/IFF_FOR...Chunk_Registry
Sadly no mention of ARGB in the chunk registry.
Wouldn't the "ARGB" in itself not be indication enough that there's no palette?
Would it be safe to assume the first Long is always 1 as it appears to be?

Maybe I should just scan all OS4 icons i can find to figure it out :-)
Steffest is offline  
Old 27 August 2019, 14:39   #4
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 2,529
I regret, but I also could not find any exact information about the ARGB chunk in the net. I'm using the same data structure which all OS4 ARGB icons seem to have as far as I scanned them. I have no idea what this longword which always appears to be 1 stands for, or if the null word at the end of the header is just a padd word or reserved for future use or whatever.

The FORM chunk:

#"FORM"
size of FORM
#"ICON"
#"FACE"
size of FACE = 6
byte width-1
byte height-1
byte flags, bit 0 = frameless, bit 1 = ARGB
byte aspect ratio, not used, $11 (for 1:1)
word for palette-mapped icons, number of colors of the larger colormap, no meaning for ARGB

the ARGB chunk:

#"ARGB"
zlib image size + 10 ($A) bytes for the header, label and size are not counted
1.l
zlib image size - 1
0.w
followed by the zlib image data

Last edited by PeterK; 27 August 2019 at 15:01.
PeterK is offline  
Old 27 August 2019, 14:57   #5
Steffest
Registered User

 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 130
Quote:
Originally Posted by PeterK View Post
I
byte flags, bit 0 = frameless, bit 1 = ARGB
Ah!
Many thanks Peter.

Didn't know bit 1 of the flags indicated an ARGB icon, that's probably why my own generated icons didn't display well on a real Amiga.

No doubt you scanned LOTS of icons so I'll stick with the "1" value and the zero padding Word.

Thanks!
Steffest

Last edited by Steffest; 27 August 2019 at 14:57. Reason: type
Steffest is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
DualPNG and OS4 icons on OS3 James Amiga scene 16 23 December 2018 18:45
OS 3.5 icons on 3.1 & WHDLoad hangs when displaying icons PoulpSquad support.WinUAE 22 14 September 2012 00:57
Display 32bit OS4 Icons in Amiga OS3.x! klesterjr News 12 28 February 2007 17:31
OS4 update - A late xmas present from the OS4 team Paul News 1 28 December 2004 20:48

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06409 seconds with 13 queries