packed_image_convert.h (1641B)
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_EXTRAS_PACKED_IMAGE_CONVERT_H_ 7 #define LIB_EXTRAS_PACKED_IMAGE_CONVERT_H_ 8 9 // Helper functions to convert from the external image types to the internal 10 // CodecInOut to help transitioning to the external types. 11 12 #include <jxl/types.h> 13 14 #include "lib/extras/packed_image.h" 15 #include "lib/jxl/base/status.h" 16 #include "lib/jxl/codec_in_out.h" 17 18 namespace jxl { 19 namespace extras { 20 21 // Converts an external PackedPixelFile to the internal CodecInOut for use with 22 // internal functions directly. 23 Status ConvertPackedPixelFileToCodecInOut(const PackedPixelFile& ppf, 24 ThreadPool* pool, CodecInOut* io); 25 26 // Converts an internal CodecInOut for use with internal function to an external 27 // PackedPixelFile. 28 Status ConvertCodecInOutToPackedPixelFile(const CodecInOut& io, 29 const JxlPixelFormat& pixel_format, 30 const ColorEncoding& c_desired, 31 ThreadPool* pool, 32 PackedPixelFile* ppf); 33 34 PackedPixelFile ConvertImage3FToPackedPixelFile(const Image3F& image, 35 const ColorEncoding& c_enc, 36 JxlPixelFormat format, 37 ThreadPool* pool); 38 } // namespace extras 39 } // namespace jxl 40 41 #endif // LIB_EXTRAS_PACKED_IMAGE_CONVERT_H_