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_CODEC_PGX_H_ 7 #define LIB_EXTRAS_CODEC_PGX_H_ 8 9 // Encodes/decodes PGX pixels in memory. 10 11 #include <stddef.h> 12 #include <stdint.h> 13 14 #include "lib/extras/color_hints.h" 15 #include "lib/jxl/base/data_parallel.h" 16 #include "lib/jxl/base/padded_bytes.h" 17 #include "lib/jxl/base/span.h" 18 #include "lib/jxl/base/status.h" 19 #include "lib/jxl/codec_in_out.h" 20 #include "lib/jxl/color_encoding_internal.h" 21 22 namespace jxl { 23 namespace extras { 24 25 // Decodes `bytes` into `io`. 26 Status DecodeImagePGX(const Span<const uint8_t> bytes, 27 const ColorHints& color_hints, ThreadPool* pool, 28 CodecInOut* io); 29 30 // Transforms from io->c_current to `c_desired` and encodes into `bytes`. 31 Status EncodeImagePGX(const CodecInOut* io, const ColorEncoding& c_desired, 32 size_t bits_per_sample, ThreadPool* pool, 33 PaddedBytes* bytes); 34 35 } // namespace extras 36 } // namespace jxl 37 38 #endif // LIB_EXTRAS_CODEC_PGX_H_ 39