common.h (1382B)
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 // This file contains the C API of the common encoder/decoder part of libjpegli 7 // library, which is based on the C API of libjpeg, with the function names 8 // changed from jpeg_* to jpegli_*, while compressor and decompressor object 9 // definitions are included directly from jpeglib.h 10 // 11 // Applications can use the libjpegli library in one of the following ways: 12 // 13 // (1) Include jpegli/encode.h and/or jpegli/decode.h, update the function 14 // names of the API and link against libjpegli. 15 // 16 // (2) Leave the application code unchanged, but replace the libjpeg.so library 17 // with the one built by this project that is API- and ABI-compatible with 18 // libjpeg-turbo's version of libjpeg.so. 19 20 #ifndef LIB_JPEGLI_COMMON_H_ 21 #define LIB_JPEGLI_COMMON_H_ 22 23 #include "lib/jxl/base/include_jpeglib.h" // NOLINT 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 struct jpeg_error_mgr* jpegli_std_error(struct jpeg_error_mgr* err); 30 31 void jpegli_abort(j_common_ptr cinfo); 32 33 void jpegli_destroy(j_common_ptr cinfo); 34 35 JQUANT_TBL* jpegli_alloc_quant_table(j_common_ptr cinfo); 36 37 JHUFF_TBL* jpegli_alloc_huff_table(j_common_ptr cinfo); 38 39 #ifdef __cplusplus 40 } // extern "C" 41 #endif 42 43 #endif // LIB_JPEGLI_COMMON_H_