SkJpegMetadataDecoder: Clean-up and de-duplicate code

To SkJpegMetadataDecoderImpl add a constructor that takes image data
(rather than extracted segments) and add a function to extract XMP.

Remove the static function get_xmp_metadata and replace it with the
member function SkJpegMetadataDecoderImpl::getXmpMetadata.

Update the static function extract_gainmap to use this new constructor
and XMP extractor, rather than rolling its own. (We will be wanting
this structure when we add ISO decoding to SkJpegMetadataDecoderImpl).

Inline the static function get_gainmap_info into the member function
SkJpegMetadataDecoderImpl::findGainmapImage.

Rename some variables to follow Skia's style guide.

Rename SkXMP::getGainmapInfoHDRGM and getGainmapInfoHDRGainMap to
getGainmapInfoAdobe and getGainmapInfoApple, to reflect the URIs
checked by the functions (http://ns.adobe.com/hdr-gain-map/1.0/ and
http://ns.apple.com/HDRGainMap/1.0/).

Make SkXmp::getGainmapInfoAdobe allow the info parameters to be
nullptr (for the version check in the base image).

Bug: b/338342146
Change-Id: I750bb3c916a4423faa450401cee8b7ed1a27ee92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/849836
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Christopher Cameron <ccameron@google.com>
Commit-Queue: Christopher Cameron <ccameron@google.com>
4 files changed