libjxl

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

jxl_decompressor.h (753B)


      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 TOOLS_WASM_DEMO_JXL_DECOMPRESSOR_H_
      7 #define TOOLS_WASM_DEMO_JXL_DECOMPRESSOR_H_
      8 
      9 #include <stddef.h>
     10 #include <stdint.h>
     11 
     12 extern "C" {
     13 
     14 typedef struct DecompressorOutput {
     15   uint32_t size = 0;
     16   uint8_t* data = nullptr;
     17 
     18   // The rest is opaque.
     19 } DecompressorOutput;
     20 
     21 /*
     22   Returns (as uint32_t):
     23     0 - OOM
     24     1 - decoding JXL failed
     25     2 - encoding PNG failed
     26     >=4 - OK
     27  */
     28 DecompressorOutput* jxlDecompress(const uint8_t* input, size_t input_size);
     29 
     30 void jxlCleanup(DecompressorOutput* output);
     31 
     32 }  // extern "C"
     33 
     34 #endif  // TOOLS_WASM_DEMO_JXL_DECOMPRESSOR_H_