LIBJXL

Loading...
Searching...
No Matches
decode_cxx.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
14
15#ifndef JXL_DECODE_CXX_H_
16#define JXL_DECODE_CXX_H_
17
18#include <jxl/decode.h>
19#include <jxl/memory_manager.h>
20
21#include <memory>
22
23#ifndef __cplusplus
24#error "This a C++ only header. Use jxl/decode.h from C sources."
25#endif
26
28 struct JxlDecoderDestroyStruct {
30 void operator()(JxlDecoder* decoder) { JxlDecoderDestroy(decoder); }
31};
32
38 typedef std::unique_ptr<JxlDecoder, JxlDecoderDestroyStruct> JxlDecoderPtr;
39
51 static inline JxlDecoderPtr JxlDecoderMake(
52 const JxlMemoryManager* memory_manager) {
53 return JxlDecoderPtr(JxlDecoderCreate(memory_manager));
54}
55
56#endif // JXL_DECODE_CXX_H_
57
decode.h
Decoding API for JPEG XL.
JxlDecoderPtr
std::unique_ptr< JxlDecoder, JxlDecoderDestroyStruct > JxlDecoderPtr
Definition decode_cxx.h:38
JxlDecoderCreate
JXL_EXPORT JxlDecoder * JxlDecoderCreate(const JxlMemoryManager *memory_manager)
JxlDecoderDestroy
JXL_EXPORT void JxlDecoderDestroy(JxlDecoder *dec)
JxlDecoder
struct JxlDecoderStruct JxlDecoder
Definition decode.h:84
memory_manager.h
Abstraction functions used by JPEG XL to allocate memory.
JxlDecoderDestroyStruct
Struct to call JxlDecoderDestroy from the JxlDecoderPtr unique_ptr.
Definition decode_cxx.h:28
JxlDecoderDestroyStruct::operator()
void operator()(JxlDecoder *decoder)
Calls JxlDecoderDestroy() on the passed decoder.
Definition decode_cxx.h:30
JxlMemoryManagerStruct
Definition memory_manager.h:51