tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

packed_image_convert.h (1516B)


      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 StatusOr<PackedPixelFile> ConvertImage3FToPackedPixelFile(
     35    const Image3F& image, const ColorEncoding& c_enc, JxlPixelFormat format,
     36    ThreadPool* pool);
     37 }  // namespace extras
     38 }  // namespace jxl
     39 
     40 #endif  // LIB_EXTRAS_PACKED_IMAGE_CONVERT_H_