diff options
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/jpeg/enc_jpeg_data.h')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/jpeg/enc_jpeg_data.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/jpeg/enc_jpeg_data.h b/third_party/jpeg-xl/lib/jxl/jpeg/enc_jpeg_data.h new file mode 100644 index 0000000000..f9a3a95e23 --- /dev/null +++ b/third_party/jpeg-xl/lib/jxl/jpeg/enc_jpeg_data.h @@ -0,0 +1,42 @@ +// Copyright (c) the JPEG XL Project Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef LIB_JXL_JPEG_ENC_JPEG_DATA_H_ +#define LIB_JXL_JPEG_ENC_JPEG_DATA_H_ + +#include <cstdint> +#include <vector> + +#include "lib/jxl/base/status.h" +#include "lib/jxl/color_encoding_internal.h" +#include "lib/jxl/enc_params.h" +#include "lib/jxl/frame_header.h" +#include "lib/jxl/jpeg/jpeg_data.h" + +namespace jxl { + +class CodecInOut; + +namespace jpeg { +Status EncodeJPEGData(JPEGData& jpeg_data, std::vector<uint8_t>* bytes, + const CompressParams& cparams); + +void SetColorEncodingFromJpegData(const jpeg::JPEGData& jpg, + ColorEncoding* color_encoding); +Status SetChromaSubsamplingFromJpegData(const JPEGData& jpg, + YCbCrChromaSubsampling* cs); +Status SetColorTransformFromJpegData(const JPEGData& jpg, + ColorTransform* color_transform); + +/** + * Decodes bytes containing JPEG codestream into a CodecInOut as coefficients + * only, for lossless JPEG transcoding. + */ +Status DecodeImageJPG(Span<const uint8_t> bytes, CodecInOut* io); + +} // namespace jpeg +} // namespace jxl + +#endif // LIB_JXL_JPEG_ENC_JPEG_DATA_H_ |