Documentation on grAb data?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Documentation on grAb data?

Postby DavidN » Sat Oct 24, 2020 10:17 am

I'm writing a tool for myself to do a couple of things that setpng can't, such as being able to copy grAb data from one sprite to another - is there any documentation on the grAb chunk's format? The source for setpng doesn't seem to be available any more, and the wiki page https://zdoom.org/wiki/GrAb describes it as 8 bytes long, representing the X and Y coordinates of the offset - but there are four more mystery bytes that I'm not sure about.

Image

This is a file with offsets [1, 1] compared to the same image with offsets [35, 148] - 00 00 00 01 00 00 00 01 and 00 00 00 23 00 00 00 94. But what are the next four bytes before the chunk ends?
User avatar
DavidN
 
 
 
Joined: 28 Dec 2015

Re: Documentation on grAb data?

Postby Graf Zahl » Sat Oct 24, 2020 1:05 pm

The final 4 bytes are not part of the chunk itself but a CRC checksum that must be prepended to each PNG chunk, it's part of the PNG format.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Documentation on grAb data?

Postby DavidN » Sat Oct 24, 2020 1:49 pm

Thank you! I'll go and look that up.
User avatar
DavidN
 
 
 
Joined: 28 Dec 2015


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 2 guests