Loading...
Searching...
No Matches
decode_cxx.h
Go to the documentation of this file.
// Copyright (c) the JPEG XL Project Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef JXL_DECODE_CXX_H_
#define JXL_DECODE_CXX_H_
#include <jxl/decode.h>
#include <jxl/memory_manager.h>
#include <memory>
#ifndef __cplusplus
#error "This a C++ only header. Use jxl/decode.h from C sources."
#endif
struct JxlDecoderDestroyStruct {
void operator()(JxlDecoder* decoder) { JxlDecoderDestroy(decoder); }
};
typedef std::unique_ptr<JxlDecoder, JxlDecoderDestroyStruct> JxlDecoderPtr;
static inline JxlDecoderPtr JxlDecoderMake(
const JxlMemoryManager* memory_manager) {
return JxlDecoderPtr(JxlDecoderCreate(memory_manager));
}
#endif // JXL_DECODE_CXX_H_
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