summaryrefslogtreecommitdiff
path: root/plugins/AdvaImg/src/FreeImage/J2KHelper.h
blob: a8121f164e6e963e6f8002f17256a29c503de733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef J2K_HELPER_H
#define J2K_HELPER_H

// ==========================================================
// Helper functions (see J2KHelper.cpp)
// ==========================================================

/** 
FreeImageIO wrapper
*/
typedef struct tagJ2KFIO_t {
	FreeImageIO *io;		//! FreeImage IO
    fi_handle handle;		//! FreeImage handle
	opj_stream_t *stream;	//! OpenJPEG stream
} J2KFIO_t;

/**
Stream constructor
*/
J2KFIO_t* opj_freeimage_stream_create(FreeImageIO *io, fi_handle handle, BOOL bRead);

/**
Stream destructor
*/
void opj_freeimage_stream_destroy(J2KFIO_t* fio);

/**
Conversion opj_image_t => FIBITMAP
*/
FIBITMAP* J2KImageToFIBITMAP(int format_id, const opj_image_t *image, BOOL header_only);
/**
Conversion FIBITMAP => opj_image_t
*/
opj_image_t* FIBITMAPToJ2KImage(int format_id, FIBITMAP *dib, const opj_cparameters_t *parameters);

#endif // J2K_HELPER_H