summaryrefslogtreecommitdiff
path: root/src/lib/openmj2/jp2.h
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-05-15 12:21:30 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-05-15 12:21:30 +0200
commit3c2972f924857016bb454201c7e92f25de9105ee (patch)
treedee91c4c200c2e97c83fd4c46588bf923f23852c /src/lib/openmj2/jp2.h
parent28d2eabca79d06378843d1e94fecfb4a5e22178d (diff)
Reformat: apply reformattin on .h files (#128)
Diffstat (limited to 'src/lib/openmj2/jp2.h')
-rw-r--r--src/lib/openmj2/jp2.h132
1 files changed, 65 insertions, 67 deletions
diff --git a/src/lib/openmj2/jp2.h b/src/lib/openmj2/jp2.h
index fbd17a4d..582fb50c 100644
--- a/src/lib/openmj2/jp2.h
+++ b/src/lib/openmj2/jp2.h
@@ -1,6 +1,6 @@
/*
- * The copyright in this software is being made available under the 2-clauses
- * BSD License, included below. This software may be subject to other third
+ * The copyright in this software is being made available under the 2-clauses
+ * BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
@@ -42,52 +42,48 @@
/** @defgroup JP2 JP2 - JPEG-2000 file format reader/writer */
/*@{*/
-#define JP2_JP 0x6a502020 /**< JPEG 2000 signature box */
-#define JP2_FTYP 0x66747970 /**< File type box */
-#define JP2_JP2H 0x6a703268 /**< JP2 header box */
-#define JP2_IHDR 0x69686472 /**< Image header box */
-#define JP2_COLR 0x636f6c72 /**< Colour specification box */
-#define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */
-#define JP2_URL 0x75726c20 /**< URL box */
-#define JP2_DTBL 0x6474626c /**< Data Reference box */
-#define JP2_BPCC 0x62706363 /**< Bits per component box */
-#define JP2_JP2 0x6a703220 /**< File type fields */
-#define JP2_PCLR 0x70636c72 /**< Palette box */
-#define JP2_CMAP 0x636d6170 /**< Component Mapping box */
-#define JP2_CDEF 0x63646566 /**< Channel Definition box */
+#define JP2_JP 0x6a502020 /**< JPEG 2000 signature box */
+#define JP2_FTYP 0x66747970 /**< File type box */
+#define JP2_JP2H 0x6a703268 /**< JP2 header box */
+#define JP2_IHDR 0x69686472 /**< Image header box */
+#define JP2_COLR 0x636f6c72 /**< Colour specification box */
+#define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */
+#define JP2_URL 0x75726c20 /**< URL box */
+#define JP2_DTBL 0x6474626c /**< Data Reference box */
+#define JP2_BPCC 0x62706363 /**< Bits per component box */
+#define JP2_JP2 0x6a703220 /**< File type fields */
+#define JP2_PCLR 0x70636c72 /**< Palette box */
+#define JP2_CMAP 0x636d6170 /**< Component Mapping box */
+#define JP2_CDEF 0x63646566 /**< Channel Definition box */
/* ----------------------------------------------------------------------- */
-/**
+/**
Channel description: channel index, type, association
*/
-typedef struct opj_jp2_cdef_info
-{
+typedef struct opj_jp2_cdef_info {
unsigned short cn, typ, asoc;
} opj_jp2_cdef_info_t;
-/**
+/**
Channel descriptions and number of descriptions
*/
-typedef struct opj_jp2_cdef
-{
+typedef struct opj_jp2_cdef {
opj_jp2_cdef_info_t *info;
unsigned short n;
} opj_jp2_cdef_t;
-/**
+/**
Component mappings: channel index, mapping type, palette index
*/
-typedef struct opj_jp2_cmap_comp
-{
+typedef struct opj_jp2_cmap_comp {
unsigned short cmp;
unsigned char mtyp, pcol;
} opj_jp2_cmap_comp_t;
-/**
+/**
Palette data: table entries, palette columns
*/
-typedef struct opj_jp2_pclr
-{
+typedef struct opj_jp2_pclr {
unsigned int *entries;
unsigned char *channel_sign;
unsigned char *channel_size;
@@ -95,11 +91,10 @@ typedef struct opj_jp2_pclr
unsigned short nr_entries, nr_channels;
} opj_jp2_pclr_t;
-/**
-Collector for ICC profile, palette, component mapping, channel description
+/**
+Collector for ICC profile, palette, component mapping, channel description
*/
-typedef struct opj_jp2_color
-{
+typedef struct opj_jp2_color {
unsigned char *icc_profile_buf;
int icc_profile_len;
@@ -108,51 +103,51 @@ typedef struct opj_jp2_color
unsigned char jp2_has_colr;
} opj_jp2_color_t;
-/**
+/**
JP2 component
*/
typedef struct opj_jp2_comps {
- int depth;
- int sgnd;
- int bpcc;
+ int depth;
+ int sgnd;
+ int bpcc;
} opj_jp2_comps_t;
/**
JPEG-2000 file format reader/writer
*/
typedef struct opj_jp2 {
- /** codec context */
- opj_common_ptr cinfo;
- /** handle to the J2K codec */
- opj_j2k_t *j2k;
- unsigned int w;
- unsigned int h;
- unsigned int numcomps;
- unsigned int bpc;
- unsigned int C;
- unsigned int UnkC;
- unsigned int IPR;
- unsigned int meth;
- unsigned int approx;
- unsigned int enumcs;
- unsigned int precedence;
- unsigned int brand;
- unsigned int minversion;
- unsigned int numcl;
- unsigned int *cl;
- opj_jp2_comps_t *comps;
- unsigned int j2k_codestream_offset;
- unsigned int j2k_codestream_length;
- opj_bool ignore_pclr_cmap_cdef;
+ /** codec context */
+ opj_common_ptr cinfo;
+ /** handle to the J2K codec */
+ opj_j2k_t *j2k;
+ unsigned int w;
+ unsigned int h;
+ unsigned int numcomps;
+ unsigned int bpc;
+ unsigned int C;
+ unsigned int UnkC;
+ unsigned int IPR;
+ unsigned int meth;
+ unsigned int approx;
+ unsigned int enumcs;
+ unsigned int precedence;
+ unsigned int brand;
+ unsigned int minversion;
+ unsigned int numcl;
+ unsigned int *cl;
+ opj_jp2_comps_t *comps;
+ unsigned int j2k_codestream_offset;
+ unsigned int j2k_codestream_length;
+ opj_bool ignore_pclr_cmap_cdef;
} opj_jp2_t;
/**
JP2 Box
*/
typedef struct opj_jp2_box {
- int length;
- int type;
- int init_pos;
+ int length;
+ int type;
+ int init_pos;
} opj_jp2_box_t;
/** @name Exported functions */
@@ -185,7 +180,7 @@ Destroy a JP2 decompressor handle
void jp2_destroy_decompress(opj_jp2_t *jp2);
/**
Setup the decoder decoding parameters using user parameters.
-Decoding parameters are returned in jp2->j2k->cp.
+Decoding parameters are returned in jp2->j2k->cp.
@param jp2 JP2 decompressor handle
@param parameters decompression parameters
*/
@@ -197,7 +192,8 @@ Decode an image from a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
-opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
+opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio,
+ opj_codestream_info_t *cstr_info);
/**
Creates a JP2 compression structure
@param cinfo Codec context info
@@ -210,13 +206,14 @@ Destroy a JP2 compressor handle
*/
void jp2_destroy_compress(opj_jp2_t *jp2);
/**
-Setup the encoder parameters using the current image and using user parameters.
-Coding parameters are returned in jp2->j2k->cp.
+Setup the encoder parameters using the current image and using user parameters.
+Coding parameters are returned in jp2->j2k->cp.
@param jp2 JP2 compressor handle
@param parameters compression parameters
@param image input filled image
*/
-void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
+void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters,
+ opj_image_t *image);
/**
Encode an image into a JPEG-2000 file stream
@param jp2 JP2 compressor handle
@@ -225,7 +222,8 @@ Encode an image into a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
-opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
+opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image,
+ opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */
/*@}*/