#include <assert.h>
#include <math.h>
#include <qmath.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "Jpeg2000Color.h"
Go to the source code of this file.
◆ color_sycc_to_rgb()
Definition at line 237 of file Jpeg2000Color.cpp.
238{
239 if(
img->numcomps < 3)
240 {
242 return;
243 }
244
245 if((
img->comps[0].dx == 1)
246 && (
img->comps[1].dx == 2)
247 && (
img->comps[2].dx == 2)
248 && (
img->comps[0].dy == 1)
249 && (
img->comps[1].dy == 2)
250 && (
img->comps[2].dy == 2))
251 {
253 }
254 else {
255 if((
img->comps[0].dx == 1)
256 && (
img->comps[1].dx == 2)
257 && (
img->comps[2].dx == 2)
258 && (
img->comps[0].dy == 1)
259 && (
img->comps[1].dy == 1)
260 && (
img->comps[2].dy == 1))
261 {
263 }
264 else {
265 if((
img->comps[0].dx == 1)
266 && (
img->comps[1].dx == 1)
267 && (
img->comps[2].dx == 1)
268 && (
img->comps[0].dy == 1)
269 && (
img->comps[1].dy == 1)
270 && (
img->comps[2].dy == 1))
271 {
273 }
274 else
275 {
276 fprintf(
stderr,
"%s:%d:color_sycc_to_rgb\n\tCAN NOT CONVERT\n",
278 return;
279 }
280 }
281 }
283}
const int INNER_RADIUS_MIN
void sycc420_to_rgb(opj_image_t *img)
void sycc444_to_rgb(opj_image_t *img)
void sycc422_to_rgb(opj_image_t *img)
◆ sycc420_to_rgb()
Definition at line 170 of file Jpeg2000Color.cpp.
171{
173 const int *y, *
cb, *
cr, *
ny;
176
179
183
184 y =
img->comps[0].data;
185 cb =
img->comps[1].data;
186 cr =
img->comps[2].data;
187
188 d0 =
r =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
189 d1 =
g =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
190 d2 = b =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
191
193 {
196
198 {
200
202
204
206
208
210
212
214 }
216 }
220
221#if defined(USE_JPWL) || defined(USE_MJ2)
224#else
229#endif
230 img->comps[1].dx =
img->comps[0].dx;
231 img->comps[2].dx =
img->comps[0].dx;
232 img->comps[1].dy =
img->comps[0].dy;
233 img->comps[2].dy =
img->comps[0].dy;
234
235}
void sycc_to_rgb(int offset, int upb, int y, int cb, int cr, int *out_r, int *out_g, int *out_b)
◆ sycc422_to_rgb()
Definition at line 115 of file Jpeg2000Color.cpp.
116{
118 const int *y, *
cb, *
cr;
121
124
128
129 y =
img->comps[0].data;
130 cb =
img->comps[1].data;
131 cr =
img->comps[2].data;
132
133 d0 =
r =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
134 d1 =
g =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
135 d2 = b =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
136
138 {
140 {
142
144
146
147 ++y; ++
r; ++
g; ++b; ++
cb; ++
cr;
148 }
149 }
153
154#if defined(USE_JPWL) || defined(USE_MJ2)
157#else
162#endif
163 img->comps[1].dx =
img->comps[0].dx;
164 img->comps[2].dx =
img->comps[0].dx;
165 img->comps[1].dy =
img->comps[0].dy;
166 img->comps[2].dy =
img->comps[0].dy;
167
168}
◆ sycc444_to_rgb()
Definition at line 82 of file Jpeg2000Color.cpp.
83{
85 const int *y, *
cb, *
cr;
87
90
94
95 y =
img->comps[0].data;
96 cb =
img->comps[1].data;
97 cr =
img->comps[2].data;
98
99 d0 =
r =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
100 d1 =
g =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
101 d2 = b =
static_cast<int*
> (
malloc(
sizeof(
int) *
static_cast<size_t> (
max)));
102
104 {
106
107 ++y; ++
cb; ++
cr; ++
r; ++
g; ++b;
108 }
112
113}
◆ sycc_to_rgb()