/* * Copyright 2024 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkJpegMetadataDecoderImpl_DEFINED #define SkJpegMetadataDecoderImpl_DEFINED #include "include/core/SkRefCnt.h" #include "include/private/SkJpegMetadataDecoder.h" #include #ifdef SK_CODEC_DECODES_JPEG_GAINMAPS #include "include/private/SkXmp.h" #endif // SK_CODEC_DECODES_JPEG_GAINMAPS class SkData; class SkJpegSourceMgr; struct SkGainmapInfo; using SkJpegMarker = SkJpegMetadataDecoder::Segment; using SkJpegMarkerList = std::vector; class SkJpegMetadataDecoderImpl : public SkJpegMetadataDecoder { public: SkJpegMetadataDecoderImpl(SkJpegMarkerList markerList); SkJpegMetadataDecoderImpl(sk_sp data); bool findGainmapImage(SkJpegSourceMgr* sourceMgr, sk_sp& outGainmapImageData, SkGainmapInfo& outGainmapInfo) const; #ifdef SK_CODEC_DECODES_JPEG_GAINMAPS std::unique_ptr getXmpMetadata() const; #endif // SK_CODEC_DECODES_JPEG_GAINMAPS // SkJpegMetadataDecoder implementation: sk_sp getExifMetadata(bool copyData) const override; sk_sp getICCProfileData(bool copyData) const override; sk_sp getISOGainmapMetadata(bool copyData) const override; bool mightHaveGainmapImage() const override; bool findGainmapImage(sk_sp baseImageData, sk_sp& outGainmapImageData, SkGainmapInfo& outGainmapInfo) override; private: SkJpegMarkerList fMarkerList; }; #endif // SkJpegMetadataDecoderImpl_DEFINED