LIBJXL
encode.h
Go to the documentation of this file.
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
11#ifndef JXL_ENCODE_H_
12#define JXL_ENCODE_H_
13
14#include "jxl/decode.h"
15#include "jxl/jxl_export.h"
16#include "jxl/memory_manager.h"
17#include "jxl/parallel_runner.h"
18
19#if defined(__cplusplus) || defined(c_plusplus)
20extern "C" {
21#endif
22
30JXL_EXPORT uint32_t JxlEncoderVersion(void);
31
38typedef struct JxlEncoderStruct JxlEncoder;
39
48typedef struct JxlEncoderOptionsStruct JxlEncoderOptions;
49
53typedef enum {
58
62
66
70
72
85JXL_EXPORT JxlEncoder* JxlEncoderCreate(const JxlMemoryManager* memory_manager);
86
94JXL_EXPORT void JxlEncoderReset(JxlEncoder* enc);
95
101JXL_EXPORT void JxlEncoderDestroy(JxlEncoder* enc);
102
115JXL_EXPORT JxlEncoderStatus
117 void* parallel_runner_opaque);
118
139 uint8_t** next_out,
140 size_t* avail_out);
141
164 const JxlEncoderOptions* options, const uint8_t* buffer, size_t size);
165
192 const JxlEncoderOptions* options, const JxlPixelFormat* pixel_format,
193 const void* buffer, size_t size);
194
204JXL_EXPORT void JxlEncoderCloseInput(JxlEncoder* enc);
205
218JXL_EXPORT JxlEncoderStatus
220
234 const uint8_t* icc_profile,
235 size_t size);
236
247
258 const JxlBasicInfo* info);
259
275JXL_EXPORT JxlEncoderStatus
277
293 JXL_BOOL use_container);
294
303JXL_EXPORT JxlEncoderStatus
305
316JXL_EXPORT JxlEncoderStatus
318
330JXL_EXPORT JxlEncoderStatus
332
349JXL_EXPORT JxlEncoderStatus
351
368 JxlEncoder* enc, const JxlEncoderOptions* source);
369
376JXL_EXPORT void JxlColorEncodingSetToSRGB(JxlColorEncoding* color_encoding,
377 JXL_BOOL is_gray);
378
386 JxlColorEncoding* color_encoding, JXL_BOOL is_gray);
387
388#if defined(__cplusplus) || defined(c_plusplus)
389}
390#endif
391
392#endif /* JXL_ENCODE_H_ */
Decoding API for JPEG XL.
JXL_EXPORT JxlEncoderStatus JxlEncoderAddJPEGFrame(const JxlEncoderOptions *options, const uint8_t *buffer, size_t size)
JXL_EXPORT void JxlEncoderCloseInput(JxlEncoder *enc)
JXL_EXPORT JxlEncoderStatus JxlEncoderSetParallelRunner(JxlEncoder *enc, JxlParallelRunner parallel_runner, void *parallel_runner_opaque)
JXL_EXPORT JxlEncoderOptions * JxlEncoderOptionsCreate(JxlEncoder *enc, const JxlEncoderOptions *source)
struct JxlEncoderStruct JxlEncoder
Definition: encode.h:38
JXL_EXPORT JxlEncoder * JxlEncoderCreate(const JxlMemoryManager *memory_manager)
JXL_EXPORT JxlEncoderStatus JxlEncoderProcessOutput(JxlEncoder *enc, uint8_t **next_out, size_t *avail_out)
JXL_EXPORT JxlEncoderStatus JxlEncoderUseContainer(JxlEncoder *enc, JXL_BOOL use_container)
JXL_EXPORT JxlEncoderStatus JxlEncoderOptionsSetLossless(JxlEncoderOptions *options, JXL_BOOL lossless)
JXL_EXPORT void JxlColorEncodingSetToSRGB(JxlColorEncoding *color_encoding, JXL_BOOL is_gray)
JXL_EXPORT JxlEncoderStatus JxlEncoderOptionsSetDecodingSpeed(JxlEncoderOptions *options, int tier)
JXL_EXPORT JxlEncoderStatus JxlEncoderAddImageFrame(const JxlEncoderOptions *options, const JxlPixelFormat *pixel_format, const void *buffer, size_t size)
JXL_EXPORT void JxlEncoderReset(JxlEncoder *enc)
JXL_EXPORT void JxlEncoderInitBasicInfo(JxlBasicInfo *info)
JXL_EXPORT JxlEncoderStatus JxlEncoderSetBasicInfo(JxlEncoder *enc, const JxlBasicInfo *info)
JXL_EXPORT JxlEncoderStatus JxlEncoderSetColorEncoding(JxlEncoder *enc, const JxlColorEncoding *color)
struct JxlEncoderOptionsStruct JxlEncoderOptions
Definition: encode.h:48
JxlEncoderStatus
Definition: encode.h:53
@ JXL_ENC_ERROR
Definition: encode.h:61
@ JXL_ENC_NEED_MORE_OUTPUT
Definition: encode.h:65
@ JXL_ENC_NOT_SUPPORTED
Definition: encode.h:69
@ JXL_ENC_SUCCESS
Definition: encode.h:57
JXL_EXPORT void JxlColorEncodingSetToLinearSRGB(JxlColorEncoding *color_encoding, JXL_BOOL is_gray)
JXL_EXPORT JxlEncoderStatus JxlEncoderOptionsSetEffort(JxlEncoderOptions *options, int effort)
JXL_EXPORT JxlEncoderStatus JxlEncoderOptionsSetDistance(JxlEncoderOptions *options, float distance)
JXL_EXPORT JxlEncoderStatus JxlEncoderSetICCProfile(JxlEncoder *enc, const uint8_t *icc_profile, size_t size)
JXL_EXPORT uint32_t JxlEncoderVersion(void)
JXL_EXPORT void JxlEncoderDestroy(JxlEncoder *enc)
JXL_EXPORT JxlEncoderStatus JxlEncoderStoreJPEGMetadata(JxlEncoder *enc, JXL_BOOL store_jpeg_metadata)
Abstraction functions used by JPEG XL to allocate memory.
JxlParallelRetCode(* JxlParallelRunner)(void *runner_opaque, void *jpegxl_opaque, JxlParallelRunInit init, JxlParallelRunFunction func, uint32_t start_range, uint32_t end_range)
Definition: parallel_runner.h:116
Definition: codestream_header.h:95
Definition: color_encoding.h:101
Definition: memory_manager.h:48
Definition: types.h:85
#define JXL_BOOL
Definition: types.h:27