9class wopj_cparameters :
public opj_cparameters_t
13 opj_cparameters_t* str = (opj_cparameters_t*)
this;
14 memset(str, 0,
sizeof(opj_cparameters_t));
15 opj_set_default_encoder_parameters(
this);
29 CodecPtr(opj_codec_t* codec =
nullptr) : m_codec(codec) {}
31 CodecPtr(
const CodecPtr& other) {
32 m_codec = other.m_codec;
33 const_cast<CodecPtr&
>(other).m_codec =
nullptr;
36 CodecPtr& operator=(
const CodecPtr& other) {
39 opj_destroy_codec(m_codec);
41 m_codec = other.m_codec;
42 const_cast<CodecPtr&
>(other).m_codec =
nullptr;
49 opj_destroy_codec(m_codec);
53 opj_codec_t* get()
const {
57 operator opj_codec_t* ()
const {
67 ImagePtr(opj_image_t* image =
nullptr) : m_image(image) {}
69 ImagePtr(
const ImagePtr& other) {
70 m_image = other.m_image;
71 const_cast<ImagePtr&
>(other).m_image =
nullptr;
74 ImagePtr& operator=(
const ImagePtr& other) {
77 opj_image_destroy(m_image);
79 m_image = other.m_image;
80 const_cast<ImagePtr&
>(other).m_image =
nullptr;
87 opj_image_destroy(m_image);
91 opj_image_t* get()
const {
95 operator opj_image_t* ()
const {
100 opj_image_t* m_image;
105 StreamPtr(opj_stream_t* codec =
nullptr) : m_stream(codec) {}
107 StreamPtr(
const StreamPtr& other) {
108 m_stream = other.m_stream;
109 const_cast<StreamPtr&
>(other).m_stream =
nullptr;
112 StreamPtr& operator=(
const StreamPtr& other) {
113 if (
this != &other) {
115 opj_stream_destroy(m_stream);
117 m_stream = other.m_stream;
118 const_cast<StreamPtr&
>(other).m_stream =
nullptr;
125 opj_stream_destroy(m_stream);
129 opj_stream_t* get()
const {
133 operator opj_stream_t* ()
const {
138 opj_stream_t* m_stream;