SkJpegEncoder: Specify metadata segments explicitly

For ISO 21496-1 gainmaps, we're going to need to specify several more
metadata segments. These could be added as parameters to the public
SkJpegEncoder::Options, but that might be a bit much.

Instead, add an internal interface to SkJpegEncoderImpl, the static
MakeRGB and MakeYUV functions, whereby one can specify the list
metadata segments directly.

Add the SkJpegMetadataEncoder helper functions AppendICC and AppendXMPStandard, and change all callers to use this interface.

Refactor SkJpegEncoderMgr to have separate initializeRGB,
initializeYUV, and initializeCommon functions. Move the code from
the static Make function into these SkJpegEcoderMgr functions, and
to the new SkJpegEncoderImpl MakeRGB and MakeYUV functions.

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