tor-browser

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

enc_external_image.h (2996B)


      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_ENC_EXTERNAL_IMAGE_H_
      7 #define LIB_JXL_ENC_EXTERNAL_IMAGE_H_
      8 
      9 // Interleaved image for color transforms and Codec.
     10 
     11 #include <jxl/types.h>
     12 #include <stddef.h>
     13 #include <stdint.h>
     14 
     15 #include "lib/jxl/base/data_parallel.h"
     16 #include "lib/jxl/base/span.h"
     17 #include "lib/jxl/base/status.h"
     18 #include "lib/jxl/color_encoding_internal.h"
     19 #include "lib/jxl/image.h"
     20 #include "lib/jxl/image_bundle.h"
     21 
     22 namespace jxl {
     23 Status ConvertFromExternalNoSizeCheck(const uint8_t* data, size_t xsize,
     24                                      size_t ysize, size_t stride,
     25                                      size_t bits_per_sample,
     26                                      JxlPixelFormat format, size_t c,
     27                                      ThreadPool* pool, ImageF* channel);
     28 
     29 Status ConvertFromExternalNoSizeCheck(const uint8_t* data, size_t xsize,
     30                                      size_t ysize, size_t stride,
     31                                      const ColorEncoding& c_current,
     32                                      size_t color_channels,
     33                                      size_t bits_per_sample,
     34                                      JxlPixelFormat format, ThreadPool* pool,
     35                                      ImageBundle* ib);
     36 
     37 Status ConvertFromExternal(const uint8_t* data, size_t size, size_t xsize,
     38                           size_t ysize, size_t bits_per_sample,
     39                           JxlPixelFormat format, size_t c, ThreadPool* pool,
     40                           ImageF* channel);
     41 
     42 // Convert an interleaved pixel buffer to the internal ImageBundle
     43 // representation. This is the opposite of ConvertToExternal().
     44 Status ConvertFromExternal(Span<const uint8_t> bytes, size_t xsize,
     45                           size_t ysize, const ColorEncoding& c_current,
     46                           size_t color_channels, size_t bits_per_sample,
     47                           JxlPixelFormat format, ThreadPool* pool,
     48                           ImageBundle* ib);
     49 Status ConvertFromExternal(Span<const uint8_t> bytes, size_t xsize,
     50                           size_t ysize, const ColorEncoding& c_current,
     51                           size_t bits_per_sample, JxlPixelFormat format,
     52                           ThreadPool* pool, ImageBundle* ib);
     53 Status BufferToImageF(const JxlPixelFormat& pixel_format, size_t xsize,
     54                      size_t ysize, const void* buffer, size_t size,
     55                      ThreadPool* pool, ImageF* channel);
     56 Status BufferToImageBundle(const JxlPixelFormat& pixel_format, uint32_t xsize,
     57                           uint32_t ysize, const void* buffer, size_t size,
     58                           jxl::ThreadPool* pool,
     59                           const jxl::ColorEncoding& c_current,
     60                           jxl::ImageBundle* ib);
     61 
     62 }  // namespace jxl
     63 
     64 #endif  // LIB_JXL_ENC_EXTERNAL_IMAGE_H_