diff options
author | Jiyong <jiyong.min@samsung.com> | 2023-12-26 10:55:00 +0900 |
---|---|---|
committer | Jiyong <jiyong.min@samsung.com> | 2023-12-26 11:08:07 +0900 |
commit | 3b773d382e34fcfc7c8995d8bd681a6ef0529b02 (patch) | |
tree | 2dd316dd1fb388662a34065d3e15b2298384fbfe /lib/extras/dec/decode.h | |
parent | 7fa2aaed0a5c855460b77fb1fedcc01591ff6470 (diff) | |
download | libjxl-upstream.tar.gz libjxl-upstream.tar.bz2 libjxl-upstream.zip |
Imported Upstream version 0.9.0upstream/0.9.0upstream
Change-Id: I60862786d19d92bb65425923bfeaa8ec236d8722
Diffstat (limited to 'lib/extras/dec/decode.h')
-rw-r--r-- | lib/extras/dec/decode.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/extras/dec/decode.h b/lib/extras/dec/decode.h index 7f0ff70..0f864dd 100644 --- a/lib/extras/dec/decode.h +++ b/lib/extras/dec/decode.h @@ -17,34 +17,40 @@ #include "lib/extras/dec/color_hints.h" #include "lib/jxl/base/span.h" #include "lib/jxl/base/status.h" -#include "lib/jxl/codec_in_out.h" namespace jxl { + +struct SizeConstraints; + namespace extras { -// Codecs supported by CodecInOut::Encode. +// Codecs supported by DecodeBytes. enum class Codec : uint32_t { - kUnknown, // for CodecFromExtension + kUnknown, // for CodecFromPath kPNG, kPNM, kPGX, kJPG, kGIF, - kEXR + kEXR, + kJXL }; -std::vector<Codec> AvailableCodecs(); +bool CanDecode(Codec codec); // If and only if extension is ".pfm", *bits_per_sample is updated to 32 so // that Encode() would encode to PFM instead of PPM. -Codec CodecFromExtension(std::string extension, - size_t* JXL_RESTRICT bits_per_sample = nullptr); +Codec CodecFromPath(std::string path, + size_t* JXL_RESTRICT bits_per_sample = nullptr, + std::string* filename = nullptr, + std::string* extension = nullptr); // Decodes "bytes" info *ppf. // color_space_hint may specify the color space, otherwise, defaults to sRGB. Status DecodeBytes(Span<const uint8_t> bytes, const ColorHints& color_hints, - const SizeConstraints& constraints, - extras::PackedPixelFile* ppf, Codec* orig_codec = nullptr); + extras::PackedPixelFile* ppf, + const SizeConstraints* constraints = nullptr, + Codec* orig_codec = nullptr); } // namespace extras } // namespace jxl |