Loading...
Searching...
No Matches
encode_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_ENCODE_CXX_H_
#define JXL_ENCODE_CXX_H_
#include <jxl/encode.h>
#include <jxl/memory_manager.h>
#include <memory>
#ifndef __cplusplus
#error "This a C++ only header. Use jxl/encode.h from C sources."
#endif
struct JxlEncoderDestroyStruct {
void operator()(JxlEncoder* encoder) { JxlEncoderDestroy(encoder); }
};
typedef std::unique_ptr<JxlEncoder, JxlEncoderDestroyStruct> JxlEncoderPtr;
static inline JxlEncoderPtr JxlEncoderMake(
const JxlMemoryManager* memory_manager) {
return JxlEncoderPtr(JxlEncoderCreate(memory_manager));
}
#endif // JXL_ENCODE_CXX_H_
encode.h
Encoding API for JPEG XL.
JxlMemoryManager
struct JxlMemoryManagerStruct JxlMemoryManager
JxlEncoderPtr
std::unique_ptr< JxlEncoder, JxlEncoderDestroyStruct > JxlEncoderPtr
Definition encode_cxx.h:38
JxlEncoder
struct JxlEncoderStruct JxlEncoder
Definition encode.h:47
JxlEncoderCreate
JXL_EXPORT JxlEncoder * JxlEncoderCreate(const JxlMemoryManager *memory_manager)
JxlEncoderDestroy
JXL_EXPORT void JxlEncoderDestroy(JxlEncoder *enc)
memory_manager.h
Abstraction functions used by JPEG XL to allocate memory.
JxlEncoderDestroyStruct
Struct to call JxlEncoderDestroy from the JxlEncoderPtr unique_ptr.
Definition encode_cxx.h:28
JxlEncoderDestroyStruct::operator()
void operator()(JxlEncoder *encoder)
Calls JxlEncoderDestroy() on the passed encoder.
Definition encode_cxx.h:30