TheDiamondProject / Graphite

MIT License
16 stars 6 forks source link

[Draft] QuickTime parsing #28

Closed andrews05 closed 3 years ago

andrews05 commented 3 years ago

I've been looking into quicktime compression, specifically the rle (Animation) method which I've encountered a number of. It's pretty straightforward, the only complication is the reference to system colour tables. What do you think would be the best way to implement these? Hard-coded vectors? Include a resource file containing the cluts?

tjhancocks commented 3 years ago

System colour tables are going to be a pain, given the number of those tables. It may be best to include them in a separate rsrc file and include it as a binary blob in the library, that can be loaded into the global resource space, in a similar way to how the "System" resources were accessed.

Open to suggestions here, as it doesn't feel like a straight forward and clean problem.

andrews05 commented 3 years ago

Hm, the resource blob is potentially a good idea - I wouldn't have a clue how to do that though 😆

I've currently got clut 4 and 8 hard-coded as arrays in ResForge (used for icons). It's not too difficult to extract the cluts into arrays.

That said, I've got a PICT looking for clut 40 and I can't find it in the System file. Are these "standard" clut ids perhaps synthesised? http://mirror.informatimago.com/next/developer.apple.com/documentation/mac/QuickDraw/QuickDraw-252.html

andrews05 commented 3 years ago

According to Executor, the grayscale ones are indeed synthesised, while the colour ones are basically aliases of the system clut ids 1-8. I'll start by seeing how to do the grayscale ones...

andrews05 commented 3 years ago

Well this was a little disappointing. After implementing a draft rle decoder and synthesised clut 40, it turns out all my test picts contain only garbage data in the rle, which is subsequently overwritten with packbits/directbits containing the real image.

tjhancocks commented 3 years ago

Ah, that sucks. Still, it will be useful to have the functionality in Graphite for when it is actually required.

tjhancocks commented 3 years ago

I'll take a look over the weekend at embedding a resource file in to the library to hold the required system resources. The way I'm most familiar with may not be portable to MSVC, so it won't work.

andrews05 commented 3 years ago

Ah, that sucks. Still, it will be useful to have the functionality in Graphite for when it is actually required.

Yeah. I've moved the rle draft into a different branch for now, until can find some actual test images. On the plus side, it means we can just skip over such data and get a successful decode from the packbits that follow. I've updated this branch to do that (and throw for anything else) so it should be good to merge, even though it isn't quite what I had planned.