diff options
Diffstat (limited to 'core/fxcodec/codec/cjpx_decoder.h')
-rw-r--r-- | core/fxcodec/codec/cjpx_decoder.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fxcodec/codec/cjpx_decoder.h b/core/fxcodec/codec/cjpx_decoder.h index 9de9d6c4ab..5be4b874d2 100644 --- a/core/fxcodec/codec/cjpx_decoder.h +++ b/core/fxcodec/codec/cjpx_decoder.h @@ -12,6 +12,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcrt/unowned_ptr.h" +#include "third_party/base/span.h" #include "third_party/libopenjpeg20/openjpeg.h" class CPDF_ColorSpace; @@ -21,20 +22,18 @@ class CJPX_Decoder { explicit CJPX_Decoder(CPDF_ColorSpace* cs); ~CJPX_Decoder(); - bool Init(const unsigned char* src_data, uint32_t src_size); + bool Init(pdfium::span<const uint8_t> src_data); void GetInfo(uint32_t* width, uint32_t* height, uint32_t* components); bool Decode(uint8_t* dest_buf, uint32_t pitch, const std::vector<uint8_t>& offsets); private: - const uint8_t* m_SrcData; - uint32_t m_SrcSize; - // TODO(rharrison): Convert these to unowned ptrs, if possible. - opj_image_t* m_Image; - opj_codec_t* m_Codec; + pdfium::span<const uint8_t> m_SrcData; + UnownedPtr<opj_image_t> m_Image; + UnownedPtr<opj_codec_t> m_Codec; std::unique_ptr<DecodeData> m_DecodeData; - opj_stream_t* m_Stream; + UnownedPtr<opj_stream_t> m_Stream; opj_dparameters_t m_Parameters; UnownedPtr<const CPDF_ColorSpace> const m_ColorSpace; }; |