enc_jpeg_data.h (1314B)
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #ifndef LIB_JXL_JPEG_ENC_JPEG_DATA_H_ 7 #define LIB_JXL_JPEG_ENC_JPEG_DATA_H_ 8 9 #include <cstdint> 10 #include <vector> 11 12 #include "lib/jxl/base/status.h" 13 #include "lib/jxl/color_encoding_internal.h" 14 #include "lib/jxl/enc_params.h" 15 #include "lib/jxl/frame_header.h" 16 #include "lib/jxl/jpeg/jpeg_data.h" 17 18 namespace jxl { 19 20 class CodecInOut; 21 22 namespace jpeg { 23 Status EncodeJPEGData(JPEGData& jpeg_data, std::vector<uint8_t>* bytes, 24 const CompressParams& cparams); 25 26 void SetColorEncodingFromJpegData(const jpeg::JPEGData& jpg, 27 ColorEncoding* color_encoding); 28 Status SetChromaSubsamplingFromJpegData(const JPEGData& jpg, 29 YCbCrChromaSubsampling* cs); 30 Status SetColorTransformFromJpegData(const JPEGData& jpg, 31 ColorTransform* color_transform); 32 33 /** 34 * Decodes bytes containing JPEG codestream into a CodecInOut as coefficients 35 * only, for lossless JPEG transcoding. 36 */ 37 Status DecodeImageJPG(Span<const uint8_t> bytes, CodecInOut* io); 38 39 } // namespace jpeg 40 } // namespace jxl 41 42 #endif // LIB_JXL_JPEG_ENC_JPEG_DATA_H_