libjxl

FORK: libjxl patches used on blog
git clone https://git.neptards.moe/blog/libjxl.git
Log | Files | Refs | Submodules | README | LICENSE

jpegli.h (1099B)


      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_DEC_JPEGLI_H_
      7 #define LIB_EXTRAS_DEC_JPEGLI_H_
      8 
      9 // Decodes JPG pixels and metadata in memory using the libjpegli library.
     10 
     11 #include <jxl/types.h>
     12 #include <stdint.h>
     13 
     14 #include <vector>
     15 
     16 #include "lib/extras/packed_image.h"
     17 #include "lib/jxl/base/data_parallel.h"
     18 #include "lib/jxl/base/status.h"
     19 
     20 namespace jxl {
     21 namespace extras {
     22 
     23 struct JpegDecompressParams {
     24   JxlDataType output_data_type = JXL_TYPE_UINT8;
     25   JxlEndianness output_endianness = JXL_NATIVE_ENDIAN;
     26   bool force_rgb = false;
     27   bool force_grayscale = false;
     28   int num_colors = 0;
     29   bool two_pass_quant = true;
     30   // 0 = none, 1 = ordered, 2 = Floyd-Steinberg
     31   int dither_mode = 2;
     32 };
     33 
     34 Status DecodeJpeg(const std::vector<uint8_t>& compressed,
     35                   const JpegDecompressParams& dparams, ThreadPool* pool,
     36                   PackedPixelFile* ppf);
     37 
     38 }  // namespace extras
     39 }  // namespace jxl
     40 
     41 #endif  // LIB_EXTRAS_DEC_JPEGLI_H_