LIBJXL: jxl/decode_cxx.h Source File

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 <memory>
19
20#include "jxl/decode.h"
21
22#if !(defined(__cplusplus) || defined(c_plusplus))
23#error "This a C++ only header. Use jxl/decode.h from C sources."
24#endif
25
27 struct JxlDecoderDestroyStruct {
29 void operator()(JxlDecoder* decoder) { JxlDecoderDestroy(decoder); }
30};
31
37 typedef std::unique_ptr<JxlDecoder, JxlDecoderDestroyStruct> JxlDecoderPtr;
38
50static inline JxlDecoderPtr JxlDecoderMake(
51 const JxlMemoryManager* memory_manager) {
52 return JxlDecoderPtr(JxlDecoderCreate(memory_manager));
53}
54
55#endif // JXL_DECODE_CXX_H_
56
decode.h
Decoding API for JPEG XL.
JxlDecoderCreate
JXL_EXPORT JxlDecoder * JxlDecoderCreate(const JxlMemoryManager *memory_manager)
JxlDecoderPtr
std::unique_ptr< JxlDecoder, JxlDecoderDestroyStruct > JxlDecoderPtr
Definition decode_cxx.h:37
JxlDecoderDestroy
JXL_EXPORT void JxlDecoderDestroy(JxlDecoder *dec)
JxlDecoder
struct JxlDecoderStruct JxlDecoder
Definition decode.h:85
JxlDecoderDestroyStruct
Struct to call JxlDecoderDestroy from the JxlDecoderPtr unique_ptr.
Definition decode_cxx.h:27
JxlDecoderDestroyStruct::operator()
void operator()(JxlDecoder *decoder)
Calls JxlDecoderDestroy() on the passed decoder.
Definition decode_cxx.h:29
JxlMemoryManagerStruct
Definition memory_manager.h:51