Support PNG gainmaps

Two private PNG chunks are defined:
* gmAP: contains a binary blob that is an ISO gainmap payload
* gdAT: contains a PNG-encoded image that is the gainmap.

The base image contains both a gmAP and a gdAT chunk: the gmAP chunk
only contains ISO versioning (for future-proofing).

The gainmap image will contain only a gmAP chunk that actually contains
the gainmap metadata. If there's a nested gdAT chunk upon DEcoding, then
we drop it on the floor.

This is pretty much option B described in:
https://github.com/w3c/png/issues/380#issuecomment-2325163149, but we
are using privately-defined chunks because the spec has not yet been
agreed on yet :)

Bug: b/329469053
Change-Id: I00da00f241eb02d3f19384b3525bd8650b368a9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/926765
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Alec Mouri <alecmouri@google.com>
Auto-Submit: Alec Mouri <alecmouri@google.com>
9 files changed