]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/mobile/jni/thirdparty/openjpeg/libopenjpeg/mct.h
Add MuPDF native source codes
[hornmich/skoda-qr-demo.git] / QRScanner / mobile / jni / thirdparty / openjpeg / libopenjpeg / mct.h
1 /*
2  * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
3  * Copyright (c) 2002-2007, Professor Benoit Macq
4  * Copyright (c) 2001-2003, David Janssens
5  * Copyright (c) 2002-2003, Yannick Verschueren
6  * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
7  * Copyright (c) 2005, Herve Drolon, FreeImage Team
8  * Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France 
9  * Copyright (c) 2012, CS Systemes d'Information, France
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef __MCT_H
35 #define __MCT_H
36 /**
37 @file mct.h
38 @brief Implementation of a multi-component transforms (MCT)
39
40 The functions in MCT.C have for goal to realize reversible and irreversible multicomponent
41 transform. The functions in MCT.C are used by some function in TCD.C.
42 */
43
44 /** @defgroup MCT MCT - Implementation of a multi-component transform */
45 /*@{*/
46
47 /** @name Exported functions */
48 /*@{*/
49 /* ----------------------------------------------------------------------- */
50 /**
51 Apply a reversible multi-component transform to an image
52 @param c0 Samples for red component
53 @param c1 Samples for green component
54 @param c2 Samples blue component
55 @param n Number of samples for each component
56 */
57 void opj_mct_encode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
58 /**
59 Apply a reversible multi-component inverse transform to an image
60 @param c0 Samples for luminance component
61 @param c1 Samples for red chrominance component
62 @param c2 Samples for blue chrominance component
63 @param n Number of samples for each component
64 */
65 void opj_mct_decode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
66 /**
67 Get norm of the basis function used for the reversible multi-component transform
68 @param compno Number of the component (0->Y, 1->U, 2->V)
69 @return 
70 */
71 OPJ_FLOAT64 opj_mct_getnorm(OPJ_UINT32 compno);
72
73 /**
74 Apply an irreversible multi-component transform to an image
75 @param c0 Samples for red component
76 @param c1 Samples for green component
77 @param c2 Samples blue component
78 @param n Number of samples for each component
79 */
80 void opj_mct_encode_real(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
81 /**
82 Apply an irreversible multi-component inverse transform to an image
83 @param c0 Samples for luminance component
84 @param c1 Samples for red chrominance component
85 @param c2 Samples for blue chrominance component
86 @param n Number of samples for each component
87 */
88 void opj_mct_decode_real(OPJ_FLOAT32* c0, OPJ_FLOAT32* c1, OPJ_FLOAT32* c2, OPJ_UINT32 n);
89 /**
90 Get norm of the basis function used for the irreversible multi-component transform
91 @param compno Number of the component (0->Y, 1->U, 2->V)
92 @return 
93 */
94 OPJ_FLOAT64 opj_mct_getnorm_real(OPJ_UINT32 compno);
95
96 /**
97 FIXME DOC
98 @param p_coding_data    MCT data
99 @param n                size of components
100 @param p_data           components
101 @param p_nb_comp        nb of components (i.e. size of p_data)
102 @param is_signed        tells if the data is signed
103 @return OPJ_FALSE if function encounter a problem, OPJ_TRUE otherwise
104 */
105 OPJ_BOOL opj_mct_encode_custom(
106                                            OPJ_BYTE * p_coding_data,
107                                            OPJ_UINT32 n,
108                                            OPJ_BYTE ** p_data,
109                                            OPJ_UINT32 p_nb_comp,
110                                            OPJ_UINT32 is_signed);
111 /**
112 FIXME DOC
113 @param pDecodingData    MCT data
114 @param n                size of components
115 @param pData            components
116 @param pNbComp          nb of components (i.e. size of p_data)
117 @param isSigned         tells if the data is signed
118 @return OPJ_FALSE if function encounter a problem, OPJ_TRUE otherwise
119 */
120 OPJ_BOOL opj_mct_decode_custom(
121                                            OPJ_BYTE * pDecodingData,
122                                            OPJ_UINT32 n,
123                                            OPJ_BYTE ** pData,
124                                            OPJ_UINT32 pNbComp,
125                                            OPJ_UINT32 isSigned);
126 /**
127 FIXME DOC
128 @param pNorms           MCT data
129 @param p_nb_comps       size of components
130 @param pMatrix          components
131 @return 
132 */
133 void opj_calculate_norms(   OPJ_FLOAT64 * pNorms,
134                             OPJ_UINT32 p_nb_comps,
135                             OPJ_FLOAT32 * pMatrix);
136 /**
137 FIXME DOC 
138 */
139 const OPJ_FLOAT64 * opj_mct_get_mct_norms (void);
140 /**
141 FIXME DOC 
142 */
143 const OPJ_FLOAT64 * opj_mct_get_mct_norms_real (void);
144 /* ----------------------------------------------------------------------- */
145 /*@}*/
146
147 /*@}*/
148
149 #endif /* __MCT_H */