OpenJPH: /build/openjph/src/OpenJPH/src/core/codestream/ojph_tile.cpp Source File

OpenJPH Open-source implementation of JPEG2000 Part-15

Loading...
Searching...
No Matches
ojph_tile.cpp
Go to the documentation of this file.
1//***************************************************************************/
2// This software is released under the 2-Clause BSD license, included
3// below.
4//
5// Copyright (c) 2019, Aous Naman
6// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
7// Copyright (c) 2019, The University of New South Wales, Australia
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12//
13// 1. Redistributions of source code must retain the above copyright
14// notice, this list of conditions and the following disclaimer.
15//
16// 2. Redistributions in binary form must reproduce the above copyright
17// notice, this list of conditions and the following disclaimer in the
18// documentation and/or other materials provided with the distribution.
19//
20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31//***************************************************************************/
32// This file is part of the OpenJPH software implementation.
33// File: ojph_tile.cpp
34// Author: Aous Naman
35// Date: 28 August 2019
36//***************************************************************************/
37
38
39#include <climits>
40#include <cmath>
41
42#include "ojph_mem.h"
43#include "ojph_params.h"
44#include "ojph_codestream_local.h"
45#include "ojph_tile.h"
46#include "ojph_tile_comp.h"
47
48#include "../transform/ojph_colour.h"
49
50namespace ojph {
51
52 namespace local
53 {
54
56 void tile::pre_alloc(codestream *codestream, const rect& tile_rect,
57 const rect& recon_tile_rect, ui32& num_tileparts)
58 {
59 mem_fixed_allocator* allocator = codestream->get_allocator();
60
61 //allocate tiles_comp
62 const param_siz *szp = codestream->get_siz();
63 ui32 num_comps = szp->get_num_components();
64 allocator->pre_alloc_obj<tile_comp>(num_comps);
65 allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
66 allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
67 allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
68 allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
69 allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
70 allocator->pre_alloc_obj<bool>(num_comps); //for reversible
71 allocator->pre_alloc_obj<ui8>(num_comps); //for nlt_type3
72 allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
73
74 {
75 ui32 tilepart_div = codestream->get_tilepart_div();
76 ui32 t = tilepart_div & OJPH_TILEPART_MASK;
77 if (t == OJPH_TILEPART_NO_DIVISIONS)
78 num_tileparts = 1; //for num_rc_bytes
79 else if (t == OJPH_TILEPART_COMPONENTS)
80 num_tileparts = num_comps;
81 else if (t == OJPH_TILEPART_RESOLUTIONS)
82 {
83 ui32 max_decs = 0;
84 for (ui32 c = 0; c < num_comps; ++c) {
85 ui32 s = codestream->get_coc(c)->get_num_decompositions();
86 max_decs = ojph_max(max_decs, s);
87 }
88 num_tileparts = 1 + max_decs;
89 }
90 else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
91 {
92 num_tileparts = 0;
93 for (ui32 c = 0; c < num_comps; ++c) {
94 ui32 s = codestream->get_coc(c)->get_num_decompositions();
95 num_tileparts += s + 1;
96 }
97 }
98 if (num_tileparts > 255)
99 OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
100 "cannot have more than 255 tile parts.", num_tileparts);
101 }
102
103 ui32 tx0 = tile_rect.org.x;
104 ui32 ty0 = tile_rect.org.y;
105 ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
106 ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
107 ui32 recon_tx0 = recon_tile_rect.org.x;
108 ui32 recon_ty0 = recon_tile_rect.org.y;
109 ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
110 ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
111
112 ui32 width = 0;
113 for (ui32 i = 0; i < num_comps; ++i)
114 {
115 point downsamp = szp->get_downsampling(i);
116
117 ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
118 ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
119 ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
120 ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
121 ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
122 ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
123 ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
124 ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
125
126 rect comp_rect;
127 comp_rect.org.x = tcx0;
128 comp_rect.org.y = tcy0;
129 comp_rect.siz.w = tcx1 - tcx0;
130 comp_rect.siz.h = tcy1 - tcy0;
131
132 rect recon_comp_rect;
133 recon_comp_rect.org.x = recon_tcx0;
134 recon_comp_rect.org.y = recon_tcy0;
135 recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
136 recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
137
138 tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
139 width = ojph_max(width, recon_comp_rect.siz.w);
140 }
141
142 //allocate lines
143 const param_cod* cdp = codestream->get_cod();
144 if (cdp->is_employing_color_transform())
145 {
146 bool reversible[3];
147 for (ui32 i = 0; i < 3; ++i)
148 reversible[i] = codestream->get_coc(i)->is_reversible();
149 if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
150 OJPH_ERROR(0x000300A2, "When the colour transform is employed. "
151 "all colour components must undergo either reversible or "
152 "irreversible wavelet transform; if not, then it is not clear "
153 "what colour transform should be used (reversible or "
154 "irreversible). Here we found that the first three colour "
155 "components uses %s, %s, and %s transforms, respectively.",
156 reversible[0] ? "reversible" : "irreversible",
157 reversible[1] ? "reversible" : "irreversible",
158 reversible[2] ? "reversible" : "irreversible");
159
160 allocator->pre_alloc_obj<line_buf>(3);
161 if (reversible[0])
162 for (int i = 0; i < 3; ++i)
163 allocator->pre_alloc_data<si32>(width, 0);
164 else
165 for (int i = 0; i < 3; ++i)
166 allocator->pre_alloc_data<float>(width, 0);
167 }
168 }
169
171 void tile::finalize_alloc(codestream *codestream, const rect& tile_rect,
172 ui32 tile_idx, ui32& offset,
173 ui32 &num_tileparts)
174 {
175 //this->parent = codestream;
176 mem_fixed_allocator* allocator = codestream->get_allocator();
177
178 sot.init(0, (ui16)tile_idx, 0, 1);
179 prog_order = codestream->access_cod().get_progression_order();
180
181 //allocate tiles_comp
182 const param_siz *szp = codestream->get_siz();
183 const param_nlt *nlp = codestream->get_nlt();
184
185 this->num_bytes = 0;
186 num_comps = szp->get_num_components();
187 skipped_res_for_read = codestream->get_skipped_res_for_read();
188 comps = allocator->post_alloc_obj<tile_comp>(num_comps);
189 comp_rects = allocator->post_alloc_obj<rect>(num_comps);
190 recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
191 line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
192 num_bits = allocator->post_alloc_obj<ui32>(num_comps);
193 is_signed = allocator->post_alloc_obj<bool>(num_comps);
194 reversible = allocator->post_alloc_obj<bool>(num_comps);
195 nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
196 cur_line = allocator->post_alloc_obj<ui32>(num_comps);
197
198 profile = codestream->get_profile();
199 tilepart_div = codestream->get_tilepart_div();
200 need_tlm = codestream->is_tlm_needed();
201 {
202 ui32 tilepart_div = codestream->get_tilepart_div();
203 ui32 t = tilepart_div & OJPH_TILEPART_MASK;
204 if (t == OJPH_TILEPART_NO_DIVISIONS)
205 num_tileparts = 1; //for num_rc_bytes
206 else if (t == OJPH_TILEPART_COMPONENTS)
207 num_tileparts = num_comps;
208 else if (t == OJPH_TILEPART_RESOLUTIONS)
209 {
210 ui32 max_decs = 0;
211 for (ui32 c = 0; c < num_comps; ++c) {
212 ui32 s = codestream->get_coc(c)->get_num_decompositions();
213 max_decs = ojph_max(max_decs, s);
214 }
215 num_tileparts = 1 + max_decs;
216 }
217 else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
218 {
219 num_tileparts = 0;
220 for (ui32 c = 0; c < num_comps; ++c) {
221 ui32 s = codestream->get_coc(c)->get_num_decompositions();
222 num_tileparts += s + 1;
223 }
224 }
225 if (num_tileparts > 255)
226 OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
227 "cannot have more than 255 tile parts.", num_tileparts);
228 }
229
230 this->resilient = codestream->is_resilient();
231 this->tile_rect = tile_rect;
232
233 ui32 tx0 = tile_rect.org.x;
234 ui32 ty0 = tile_rect.org.y;
235 ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
236 ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
237
238 ui32 width = 0;
239 for (ui32 i = 0; i < num_comps; ++i)
240 {
241 ui8 bd; bool is; // used for nlt_type3
242
243 point downsamp = szp->get_downsampling(i);
244 point recon_downsamp = szp->get_recon_downsampling(i);
245
246 ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
247 ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
248 ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
249 ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
250 ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
251 ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
252 ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
253 ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
254
255 line_offsets[i] =
256 recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
257 comp_rects[i].org.x = tcx0;
258 comp_rects[i].org.y = tcy0;
259 comp_rects[i].siz.w = tcx1 - tcx0;
260 comp_rects[i].siz.h = tcy1 - tcy0;
261 recon_comp_rects[i].org.x = recon_tcx0;
262 recon_comp_rects[i].org.y = recon_tcy0;
263 recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
264 recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
265
266 comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
267 recon_comp_rects[i]);
268 width = ojph_max(width, recon_comp_rects[i].siz.w);
269
270 num_bits[i] = szp->get_bit_depth(i);
271 is_signed[i] = szp->is_signed(i);
272 bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
273 if (result == true && (bd != num_bits[i] || is != is_signed[i]))
274 OJPH_ERROR(0x000300A1, "Mismatch between Ssiz (bit_depth = %d, "
275 "is_signed = %s) from SIZ marker segment, and BDnlt "
276 "(bit_depth = %d, is_signed = %s) from NLT marker segment, "
277 "for component %d", i, num_bits[i],
278 is_signed[i] ? "True" : "False", bd, is ? "True" : "False");
279 if (result == false)
280 nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
281 cur_line[i] = 0;
282 reversible[i] = codestream->get_coc(i)->is_reversible();
283 }
284
285 offset += tile_rect.siz.w;
286
287 //allocate lines
288 const param_cod* cdp = codestream->get_cod();
289 this->employ_color_transform = cdp->is_employing_color_transform();
290 if (this->employ_color_transform)
291 {
292 num_lines = 3;
293 lines = allocator->post_alloc_obj<line_buf>(num_lines);
294 if (reversible[0])
295 for (int i = 0; i < 3; ++i)
296 lines[i].wrap(
297 allocator->post_alloc_data<si32>(width, 0), width, 0);
298 else
299 for (int i = 0; i < 3; ++i)
300 lines[i].wrap(
301 allocator->post_alloc_data<float>(width, 0), width, 0);
302 }
303 else
304 {
305 lines = NULL;
306 num_lines = 0;
307 }
308 next_tile_part = 0;
309 }
310
312 bool tile::push(line_buf *line, ui32 comp_num)
313 {
314 constexpr ui8 type3 =
315 param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
316
317 assert(comp_num < num_comps);
318 if (cur_line[comp_num] >= comp_rects[comp_num].siz.h)
319 return false;
320 cur_line[comp_num]++;
321
322 //converts to signed representation
323 //employs color transform if there is a need
324 if (!employ_color_transform || comp_num >= 3)
325 {
326 assert(comp_num < num_comps);
327 ui32 comp_width = comp_rects[comp_num].siz.w;
328 line_buf *tc = comps[comp_num].get_line();
329 if (reversible[comp_num])
330 {
331 si64 shift = (si64)1 << (num_bits[comp_num] - 1);
332 if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
333 rev_convert_nlt_type3(line, line_offsets[comp_num],
334 tc, 0, shift + 1, comp_width);
335 else {
336 shift = is_signed[comp_num] ? 0 : -shift;
337 rev_convert(line, line_offsets[comp_num], tc, 0,
338 shift, comp_width);
339 }
340 }
341 else
342 {
343 if (nlt_type3[comp_num] == type3)
344 irv_convert_to_float_nlt_type3(line, line_offsets[comp_num],
345 tc, num_bits[comp_num], is_signed[comp_num], comp_width);
346 else
347 irv_convert_to_float(line, line_offsets[comp_num],
348 tc, num_bits[comp_num], is_signed[comp_num], comp_width);
349 }
350 comps[comp_num].push_line();
351 }
352 else
353 {
354 si64 shift = (si64)1 << (num_bits[comp_num] - 1);
355 ui32 comp_width = comp_rects[comp_num].siz.w;
356 if (reversible[comp_num])
357 {
358 if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
359 rev_convert_nlt_type3(line, line_offsets[comp_num],
360 lines + comp_num, 0, shift + 1, comp_width);
361 else {
362 shift = is_signed[comp_num] ? 0 : -shift;
363 rev_convert(line, line_offsets[comp_num], lines + comp_num, 0,
364 shift, comp_width);
365 }
366
367 if (comp_num == 2)
368 { // reversible color transform
369 rct_forward(lines + 0, lines + 1, lines + 2,
370 comps[0].get_line(),
371 comps[1].get_line(),
372 comps[2].get_line(), comp_width);
373 comps[0].push_line();
374 comps[1].push_line();
375 comps[2].push_line();
376 }
377 }
378 else
379 {
380 if (nlt_type3[comp_num] == type3)
381 irv_convert_to_float_nlt_type3(line, line_offsets[comp_num],
382 lines + comp_num, num_bits[comp_num], is_signed[comp_num],
383 comp_width);
384 else
385 irv_convert_to_float(line, line_offsets[comp_num],
386 lines + comp_num, num_bits[comp_num], is_signed[comp_num],
387 comp_width);
388 if (comp_num == 2)
389 { // irreversible color transform
390 ict_forward(lines[0].f32, lines[1].f32, lines[2].f32,
391 comps[0].get_line()->f32,
392 comps[1].get_line()->f32,
393 comps[2].get_line()->f32, comp_width);
394 comps[0].push_line();
395 comps[1].push_line();
396 comps[2].push_line();
397 }
398 }
399 }
400
401 return true;
402 }
403
405 bool tile::pull(line_buf* tgt_line, ui32 comp_num)
406 {
407 constexpr ui8 type3 =
408 param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
409
410 assert(comp_num < num_comps);
411 if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
412 return false;
413
414 cur_line[comp_num]++;
415
416 ui32 comp_width = recon_comp_rects[comp_num].siz.w;
417 if (comp_width == 0)
418 return true; // nothing to pull, but not an error
419
420 if (!employ_color_transform || num_comps == 1)
421 {
422 line_buf *src_line = comps[comp_num].pull_line();
423 if (reversible[comp_num])
424 {
425 si64 shift = (si64)1 << (num_bits[comp_num] - 1);
426 if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
427 rev_convert_nlt_type3(src_line, 0, tgt_line,
428 line_offsets[comp_num], shift + 1, comp_width);
429 else {
430 shift = is_signed[comp_num] ? 0 : shift;
431 rev_convert(src_line, 0, tgt_line,
432 line_offsets[comp_num], shift, comp_width);
433 }
434 }
435 else
436 {
437 if (nlt_type3[comp_num] == type3)
438 irv_convert_to_integer_nlt_type3(src_line, tgt_line,
439 line_offsets[comp_num], num_bits[comp_num],
440 is_signed[comp_num], comp_width);
441 else
442 irv_convert_to_integer(src_line, tgt_line,
443 line_offsets[comp_num], num_bits[comp_num],
444 is_signed[comp_num], comp_width);
445 }
446 }
447 else
448 {
449 assert(num_comps >= 3);
450 if (comp_num == 0)
451 {
452 if (reversible[comp_num])
453 rct_backward(comps[0].pull_line(), comps[1].pull_line(),
454 comps[2].pull_line(), lines + 0, lines + 1,
455 lines + 2, comp_width);
456 else
457 ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
458 comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
459 lines[2].f32, comp_width);
460 }
461 if (reversible[comp_num])
462 {
463 si64 shift = (si64)1 << (num_bits[comp_num] - 1);
464 line_buf* src_line;
465 if (comp_num < 3)
466 src_line = lines + comp_num;
467 else
468 src_line = comps[comp_num].pull_line();
469 if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
470 rev_convert_nlt_type3(src_line, 0, tgt_line,
471 line_offsets[comp_num], shift + 1, comp_width);
472 else {
473 shift = is_signed[comp_num] ? 0 : shift;
474 rev_convert(src_line, 0, tgt_line,
475 line_offsets[comp_num], shift, comp_width);
476 }
477 }
478 else
479 {
480 line_buf* lbp;
481 if (comp_num < 3)
482 lbp = lines + comp_num;
483 else
484 lbp = comps[comp_num].pull_line();
485 if (nlt_type3[comp_num] == type3)
486 irv_convert_to_integer_nlt_type3(lbp, tgt_line,
487 line_offsets[comp_num], num_bits[comp_num],
488 is_signed[comp_num], comp_width);
489 else
490 irv_convert_to_integer(lbp, tgt_line,
491 line_offsets[comp_num], num_bits[comp_num],
492 is_signed[comp_num], comp_width);
493 }
494 }
495
496 return true;
497 }
498
499
501 void tile::prepare_for_flush()
502 {
503 this->num_bytes = 0;
504 //prepare precinct headers
505 for (ui32 c = 0; c < num_comps; ++c)
506 num_bytes += comps[c].prepare_precincts();
507 }
508
510 void tile::fill_tlm(param_tlm *tlm)
511 {
512 if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS) {
513 tlm->set_next_pair(sot.get_tile_index(), this->num_bytes);
514 }
515 else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
516 {
517 assert(prog_order != OJPH_PO_PCRL && prog_order != OJPH_PO_CPRL);
518 ui32 max_decs = 0;
519 for (ui32 c = 0; c < num_comps; ++c)
520 max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
521 for (ui32 r = 0; r <= max_decs; ++r)
522 {
523 ui32 bytes = 0;
524 for (ui32 c = 0; c < num_comps; ++c)
525 bytes += comps[c].get_num_bytes(r);
526 tlm->set_next_pair(sot.get_tile_index(), bytes);
527 }
528 }
529 else if (tilepart_div == OJPH_TILEPART_COMPONENTS)
530 {
531 if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
532 {
533 ui32 max_decs = 0;
534 for (ui32 c = 0; c < num_comps; ++c)
535 max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
536 for (ui32 r = 0; r <= max_decs; ++r)
537 for (ui32 c = 0; c < num_comps; ++c)
538 if (r <= comps[c].get_num_decompositions())
539 tlm->set_next_pair(sot.get_tile_index(),
540 comps[c].get_num_bytes(r));
541 }
542 else if (prog_order == OJPH_PO_CPRL)
543 for (ui32 c = 0; c < num_comps; ++c)
544 tlm->set_next_pair(sot.get_tile_index(), comps[c].get_num_bytes());
545 else
546 assert(0); // should not be here
547 }
548 else
549 {
550 assert(prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP);
551 ui32 max_decs = 0;
552 for (ui32 c = 0; c < num_comps; ++c)
553 max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
554 for (ui32 r = 0; r <= max_decs; ++r)
555 for (ui32 c = 0; c < num_comps; ++c)
556 if (r <= comps[c].get_num_decompositions())
557 tlm->set_next_pair(sot.get_tile_index(),
558 comps[c].get_num_bytes(r));
559 }
560 }
561
562
564 void tile::flush(outfile_base *file)
565 {
566 ui32 max_decompositions = 0;
567 for (ui32 c = 0; c < num_comps; ++c)
568 max_decompositions = ojph_max(max_decompositions,
569 comps[c].get_num_decompositions());
570
571 if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
572 {
573 //write tile header
574 if (!sot.write(file, this->num_bytes))
575 OJPH_ERROR(0x00030081, "Error writing to file");
576
577 //write start of data
578 ui16 t = swap_byte(JP2K_MARKER::SOD);
579 if (!file->write(&t, 2))
580 OJPH_ERROR(0x00030082, "Error writing to file");
581 }
582
583
584 //sequence the writing of precincts according to progression order
585 if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
586 {
587 if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
588 {
589 for (ui32 r = 0; r <= max_decompositions; ++r)
590 for (ui32 c = 0; c < num_comps; ++c)
591 comps[c].write_precincts(r, file);
592 }
593 else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
594 {
595 for (ui32 r = 0; r <= max_decompositions; ++r)
596 {
597 ui32 bytes = 0;
598 for (ui32 c = 0; c < num_comps; ++c)
599 bytes += comps[c].get_num_bytes(r);
600
601 //write tile header
602 if (!sot.write(file, bytes, (ui8)r, (ui8)(max_decompositions + 1)))
603 OJPH_ERROR(0x00030083, "Error writing to file");
604
605 //write start of data
606 ui16 t = swap_byte(JP2K_MARKER::SOD);
607 if (!file->write(&t, 2))
608 OJPH_ERROR(0x00030084, "Error writing to file");
609
610 //write precincts
611 for (ui32 c = 0; c < num_comps; ++c)
612 comps[c].write_precincts(r, file);
613 }
614 }
615 else
616 {
617 ui32 num_tileparts = num_comps * (max_decompositions + 1);
618 for (ui32 r = 0; r <= max_decompositions; ++r)
619 for (ui32 c = 0; c < num_comps; ++c)
620 if (r <= comps[c].get_num_decompositions()) {
621 //write tile header
622 if (!sot.write(file, comps[c].get_num_bytes(r),
623 (ui8)(c + r * num_comps), (ui8)num_tileparts))
624 OJPH_ERROR(0x00030085, "Error writing to file");
625 //write start of data
626 ui16 t = swap_byte(JP2K_MARKER::SOD);
627 if (!file->write(&t, 2))
628 OJPH_ERROR(0x00030086, "Error writing to file");
629 comps[c].write_precincts(r, file);
630 }
631 }
632 }
633 else if (prog_order == OJPH_PO_RPCL)
634 {
635 for (ui32 r = 0; r <= max_decompositions; ++r)
636 {
637 if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
638 {
639 ui32 bytes = 0;
640 for (ui32 c = 0; c < num_comps; ++c)
641 bytes += comps[c].get_num_bytes(r);
642 //write tile header
643 if (!sot.write(file, bytes, (ui8)r, (ui8)(max_decompositions + 1)))
644 OJPH_ERROR(0x00030087, "Error writing to file");
645
646 //write start of data
647 ui16 t = swap_byte(JP2K_MARKER::SOD);
648 if (!file->write(&t, 2))
649 OJPH_ERROR(0x00030088, "Error writing to file");
650 }
651 while (true)
652 {
653 bool found = false;
654 ui32 comp_num = 0;
655 point smallest(INT_MAX, INT_MAX), cur;
656 for (ui32 c = 0; c < num_comps; ++c)
657 {
658 if (!comps[c].get_top_left_precinct(r, cur))
659 continue;
660 else
661 found = true;
662
663 if (cur.y < smallest.y)
664 { smallest = cur; comp_num = c; }
665 else if (cur.y == smallest.y && cur.x < smallest.x)
666 { smallest = cur; comp_num = c; }
667 }
668 if (found == true)
669 comps[comp_num].write_one_precinct(r, file);
670 else
671 break;
672 }
673 }
674 }
675 else if (prog_order == OJPH_PO_PCRL)
676 {
677 while (true)
678 {
679 bool found = false;
680 ui32 comp_num = 0;
681 ui32 res_num = 0;
682 point smallest(INT_MAX, INT_MAX), cur;
683 for (ui32 c = 0; c < num_comps; ++c)
684 {
685 for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
686 {
687 if (!comps[c].get_top_left_precinct(r, cur))
688 continue;
689 else
690 found = true;
691
692 if (cur.y < smallest.y)
693 { smallest = cur; comp_num = c; res_num = r; }
694 else if (cur.y == smallest.y && cur.x < smallest.x)
695 { smallest = cur; comp_num = c; res_num = r; }
696 else if (cur.y == smallest.y && cur.x == smallest.x &&
697 c < comp_num)
698 { smallest = cur; comp_num = c; res_num = r; }
699 else if (cur.y == smallest.y && cur.x == smallest.x &&
700 c == comp_num && r < res_num)
701 { smallest = cur; comp_num = c; res_num = r; }
702 }
703 }
704 if (found == true)
705 comps[comp_num].write_one_precinct(res_num, file);
706 else
707 break;
708 }
709 }
710 else if (prog_order == OJPH_PO_CPRL)
711 {
712 for (ui32 c = 0; c < num_comps; ++c)
713 {
714 if (tilepart_div == OJPH_TILEPART_COMPONENTS)
715 {
716 ui32 bytes = comps[c].get_num_bytes();
717 //write tile header
718 if (!sot.write(file, bytes, (ui8)c, (ui8)num_comps))
719 OJPH_ERROR(0x0003008A, "Error writing to file");
720
721 //write start of data
722 ui16 t = swap_byte(JP2K_MARKER::SOD);
723 if (!file->write(&t, 2))
724 OJPH_ERROR(0x0003008B, "Error writing to file");
725 }
726
727 while (true)
728 {
729 bool found = false;
730 ui32 res_num = 0;
731 point smallest(INT_MAX, INT_MAX), cur;
732 for (ui32 r = 0; r <= max_decompositions; ++r)
733 {
734 if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
735 continue;
736 else
737 found = true;
738
739 if (cur.y < smallest.y)
740 { smallest = cur; res_num = r; }
741 else if (cur.y == smallest.y && cur.x < smallest.x)
742 { smallest = cur; res_num = r; }
743 }
744 if (found == true)
745 comps[c].write_one_precinct(res_num, file);
746 else
747 break;
748 }
749 }
750 }
751 else
752 assert(0);
753
754 }
755
757 void tile::parse_tile_header(const param_sot &sot, infile_base *file,
758 const ui64& tile_start_location)
759 {
760 if (sot.get_tile_part_index() != next_tile_part)
761 {
762 if (resilient)
763 OJPH_INFO(0x00030091, "wrong tile part index")
764 else
765 OJPH_ERROR(0x00030091, "wrong tile part index")
766 }
767 ++next_tile_part;
768
769 //tile_end_location used on failure
770 ui64 tile_end_location = tile_start_location + sot.get_payload_length();
771
772 ui32 data_left = sot.get_payload_length(); //bytes left to parse
773 data_left -= (ui32)((ui64)file->tell() - tile_start_location);
774
775 if (data_left == 0)
776 return;
777
778 ui32 max_decompositions = 0;
779 for (ui32 c = 0; c < num_comps; ++c)
780 max_decompositions = ojph_max(max_decompositions,
781 comps[c].get_num_decompositions());
782
783 try
784 {
785 //sequence the reading of precincts according to progression order
786 if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
787 {
788 max_decompositions -= skipped_res_for_read;
789 for (ui32 r = 0; r <= max_decompositions; ++r)
790 for (ui32 c = 0; c < num_comps; ++c)
791 if (data_left > 0)
792 comps[c].parse_precincts(r, data_left, file);
793 }
794 else if (prog_order == OJPH_PO_RPCL)
795 {
796 max_decompositions -= skipped_res_for_read;
797 for (ui32 r = 0; r <= max_decompositions; ++r)
798 {
799 while (true)
800 {
801 bool found = false;
802 ui32 comp_num = 0;
803 point smallest(INT_MAX, INT_MAX), cur;
804 for (ui32 c = 0; c < num_comps; ++c)
805 {
806 if (!comps[c].get_top_left_precinct(r, cur))
807 continue;
808 else
809 found = true;
810
811 if (cur.y < smallest.y)
812 { smallest = cur; comp_num = c; }
813 else if (cur.y == smallest.y && cur.x < smallest.x)
814 { smallest = cur; comp_num = c; }
815 }
816 if (found == true && data_left > 0)
817 comps[comp_num].parse_one_precinct(r, data_left, file);
818 else
819 break;
820 }
821 }
822 }
823 else if (prog_order == OJPH_PO_PCRL)
824 {
825 while (true)
826 {
827 bool found = false;
828 ui32 comp_num = 0;
829 ui32 res_num = 0;
830 point smallest(INT_MAX, INT_MAX), cur;
831 for (ui32 c = 0; c < num_comps; ++c)
832 {
833 for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
834 {
835 if (!comps[c].get_top_left_precinct(r, cur))
836 continue;
837 else
838 found = true;
839
840 if (cur.y < smallest.y)
841 { smallest = cur; comp_num = c; res_num = r; }
842 else if (cur.y == smallest.y && cur.x < smallest.x)
843 { smallest = cur; comp_num = c; res_num = r; }
844 else if (cur.y == smallest.y && cur.x == smallest.x &&
845 c < comp_num)
846 { smallest = cur; comp_num = c; res_num = r; }
847 else if (cur.y == smallest.y && cur.x == smallest.x &&
848 c == comp_num && r < res_num)
849 { smallest = cur; comp_num = c; res_num = r; }
850 }
851 }
852 if (found == true && data_left > 0)
853 comps[comp_num].parse_one_precinct(res_num, data_left, file);
854 else
855 break;
856 }
857 }
858 else if (prog_order == OJPH_PO_CPRL)
859 {
860 for (ui32 c = 0; c < num_comps; ++c)
861 {
862 while (true)
863 {
864 bool found = false;
865 ui32 res_num = 0;
866 point smallest(INT_MAX, INT_MAX), cur;
867 for (ui32 r = 0; r <= max_decompositions; ++r)
868 {
869 if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
870 continue;
871 else
872 found = true;
873
874 if (cur.y < smallest.y)
875 { smallest = cur; res_num = r; }
876 else if (cur.y == smallest.y && cur.x < smallest.x)
877 { smallest = cur; res_num = r; }
878 }
879 if (found == true && data_left > 0)
880 comps[c].parse_one_precinct(res_num, data_left, file);
881 else
882 break;
883 }
884 }
885 }
886 else
887 assert(0);
888
889 }
890 catch (const char *error)
891 {
892 if (resilient)
893 OJPH_INFO(0x00030092, "%s", error)
894 else
895 OJPH_ERROR(0x00030092, "%s", error)
896 }
897 file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
898 }
899
900 }
901}
ojph::infile_base
Definition ojph_file.h:267
ojph::infile_base::seek
seek
Definition ojph_file.h:269
ojph::infile_base::OJPH_SEEK_SET
@ OJPH_SEEK_SET
Definition ojph_file.h:270
ojph::infile_base::tell
virtual si64 tell()=0
ojph::line_buf
Definition ojph_mem.h:161
ojph::local::codestream
Definition ojph_codestream_local.h:69
ojph::local::codestream::is_resilient
bool is_resilient()
Definition ojph_codestream_local.h:105
ojph::local::codestream::get_profile
si32 get_profile() const
Definition ojph_codestream_local.h:119
ojph::local::codestream::get_tilepart_div
ui32 get_tilepart_div() const
Definition ojph_codestream_local.h:120
ojph::local::codestream::get_coc
const param_cod * get_coc(ui32 comp_num)
Definition ojph_codestream_local.h:89
ojph::local::codestream::get_skipped_res_for_read
ui32 get_skipped_res_for_read()
Definition ojph_codestream_local.h:129
ojph::local::codestream::get_siz
const param_siz * get_siz()
Definition ojph_codestream_local.h:83
ojph::local::codestream::get_allocator
mem_fixed_allocator * get_allocator()
Definition ojph_codestream_local.h:97
ojph::local::codestream::get_nlt
const param_nlt * get_nlt()
Definition ojph_codestream_local.h:95
ojph::local::codestream::access_cod
ojph::param_cod access_cod()
Definition ojph_codestream_local.h:85
ojph::local::codestream::get_cod
const param_cod * get_cod()
Definition ojph_codestream_local.h:87
ojph::local::codestream::is_tlm_needed
bool is_tlm_needed() const
Definition ojph_codestream_local.h:121
ojph::local::tile_comp
Definition ojph_tile_comp.h:63
ojph::local::tile_comp::pre_alloc
static void pre_alloc(codestream *codestream, ui32 comp_num, const rect &comp_rect, const rect &recon_comp_rect)
Definition ojph_tile_comp.cpp:54
ojph::local::tile::num_comps
ui32 num_comps
Definition ojph_tile.h:80
ojph::local::tile::nlt_type3
ui8 * nlt_type3
Definition ojph_tile.h:93
ojph::local::tile::pull
bool pull(line_buf *, ui32 comp_num)
Definition ojph_tile.cpp:405
ojph::local::tile::resilient
bool resilient
Definition ojph_tile.h:84
ojph::local::tile::tilepart_div
ui32 tilepart_div
Definition ojph_tile.h:102
ojph::local::tile::next_tile_part
int next_tile_part
Definition ojph_tile.h:98
ojph::local::tile::lines
line_buf * lines
Definition ojph_tile.h:83
ojph::local::tile::tile_rect
rect tile_rect
Definition ojph_tile.h:79
ojph::local::tile::finalize_alloc
void finalize_alloc(codestream *codestream, const rect &tile_rect, ui32 tile_idx, ui32 &offset, ui32 &num_tileparts)
Definition ojph_tile.cpp:171
ojph::local::tile::pre_alloc
static void pre_alloc(codestream *codestream, const rect &tile_rect, const rect &recon_tile_rect, ui32 &num_tileparts)
Definition ojph_tile.cpp:56
ojph::local::tile::need_tlm
bool need_tlm
Definition ojph_tile.h:103
ojph::local::tile::prepare_for_flush
void prepare_for_flush()
Definition ojph_tile.cpp:501
ojph::local::tile::comps
tile_comp * comps
Definition ojph_tile.h:81
ojph::local::tile::fill_tlm
void fill_tlm(param_tlm *tlm)
Definition ojph_tile.cpp:510
ojph::local::tile::recon_comp_rects
rect * recon_comp_rects
Definition ojph_tile.h:86
ojph::local::tile::reversible
bool * reversible
Definition ojph_tile.h:85
ojph::local::tile::profile
int profile
Definition ojph_tile.h:101
ojph::local::tile::num_bytes
ui32 num_bytes
Definition ojph_tile.h:105
ojph::local::tile::is_signed
bool * is_signed
Definition ojph_tile.h:91
ojph::local::tile::flush
void flush(outfile_base *file)
Definition ojph_tile.cpp:564
ojph::local::tile::num_lines
ui32 num_lines
Definition ojph_tile.h:82
ojph::local::tile::cur_line
ui32 * cur_line
Definition ojph_tile.h:92
ojph::local::tile::prog_order
int prog_order
Definition ojph_tile.h:94
ojph::local::tile::skipped_res_for_read
ui32 skipped_res_for_read
Definition ojph_tile.h:88
ojph::local::tile::sot
param_sot sot
Definition ojph_tile.h:97
ojph::local::tile::push
bool push(line_buf *line, ui32 comp_num)
Definition ojph_tile.cpp:312
ojph::local::tile::employ_color_transform
bool employ_color_transform
Definition ojph_tile.h:84
ojph::local::tile::comp_rects
rect * comp_rects
Definition ojph_tile.h:86
ojph::local::tile::parse_tile_header
void parse_tile_header(const param_sot &sot, infile_base *file, const ui64 &tile_start_location)
Definition ojph_tile.cpp:757
ojph::local::tile::line_offsets
ui32 * line_offsets
Definition ojph_tile.h:87
ojph::local::tile::num_bits
ui32 * num_bits
Definition ojph_tile.h:90
ojph::mem_fixed_allocator
Definition ojph_mem.h:59
ojph::mem_fixed_allocator::pre_alloc_data
void pre_alloc_data(size_t num_ele, ui32 pre_size)
Definition ojph_mem.h:72
ojph::mem_fixed_allocator::pre_alloc_obj
void pre_alloc_obj(size_t num_ele)
Definition ojph_mem.h:78
ojph::mem_fixed_allocator::post_alloc_data
T * post_alloc_data(size_t num_ele, ui32 pre_size)
Definition ojph_mem.h:112
ojph::mem_fixed_allocator::post_alloc_obj
T * post_alloc_obj(size_t num_ele)
Definition ojph_mem.h:119
ojph::outfile_base
Definition ojph_file.h:75
ojph::outfile_base::write
virtual size_t write(const void *ptr, size_t size)=0
ojph::param_cod::get_progression_order
int get_progression_order() const
Definition ojph_params.cpp:299
ojph::param_nlt::OJPH_NLT_NO_NLT
@ OJPH_NLT_NO_NLT
Definition ojph_params.h:249
ojph::param_nlt::OJPH_NLT_BINARY_COMPLEMENT_NLT
@ OJPH_NLT_BINARY_COMPLEMENT_NLT
Definition ojph_params.h:252
ojph::local
Definition ojph_bitbuffer_read.h:52
ojph::local::rct_forward
void(* rct_forward)(const line_buf *r, const line_buf *g, const line_buf *b, line_buf *y, line_buf *cb, line_buf *cr, ui32 repeat)
Definition ojph_colour.cpp:90
ojph::local::ict_forward
void(* ict_forward)(const float *r, const float *g, const float *b, float *y, float *cb, float *cr, ui32 repeat)
Definition ojph_colour.cpp:100
ojph::local::irv_convert_to_integer_nlt_type3
void(* irv_convert_to_integer_nlt_type3)(const line_buf *src_line, line_buf *dst_line, ui32 dst_line_offset, ui32 bit_depth, bool is_signed, ui32 width)
Definition ojph_colour.cpp:79
ojph::local::irv_convert_to_float
void(* irv_convert_to_float)(const line_buf *src_line, ui32 src_line_offset, line_buf *dst_line, ui32 bit_depth, bool is_signed, ui32 width)
Definition ojph_colour.cpp:74
ojph::local::ict_backward
void(* ict_backward)(const float *y, const float *cb, const float *cr, float *r, float *g, float *b, ui32 repeat)
Definition ojph_colour.cpp:105
ojph::local::rct_backward
void(* rct_backward)(const line_buf *r, const line_buf *g, const line_buf *b, line_buf *y, line_buf *cb, line_buf *cr, ui32 repeat)
Definition ojph_colour.cpp:95
ojph::local::SOD
@ SOD
Definition ojph_params_local.h:146
ojph::local::irv_convert_to_integer
void(* irv_convert_to_integer)(const line_buf *src_line, line_buf *dst_line, ui32 dst_line_offset, ui32 bit_depth, bool is_signed, ui32 width)
Definition ojph_colour.cpp:69
ojph::local::swap_byte
static ui16 swap_byte(ui16 t)
Definition ojph_codestream_local.h:58
ojph::local::irv_convert_to_float_nlt_type3
void(* irv_convert_to_float_nlt_type3)(const line_buf *src_line, ui32 src_line_offset, line_buf *dst_line, ui32 bit_depth, bool is_signed, ui32 width)
Definition ojph_colour.cpp:84
ojph::local::rev_convert_nlt_type3
void(* rev_convert_nlt_type3)(const line_buf *src_line, const ui32 src_line_offset, line_buf *dst_line, const ui32 dst_line_offset, si64 shift, ui32 width)
Definition ojph_colour.cpp:63
ojph::local::rev_convert
void(* rev_convert)(const line_buf *src_line, const ui32 src_line_offset, line_buf *dst_line, const ui32 dst_line_offset, si64 shift, ui32 width)
Definition ojph_colour.cpp:57
ojph
Definition ojph_img_io.h:52
ojph::si64
int64_t si64
Definition ojph_defs.h:57
ojph::OJPH_PO_LRCP
@ OJPH_PO_LRCP
Definition ojph_params_local.h:59
ojph::OJPH_PO_RLCP
@ OJPH_PO_RLCP
Definition ojph_params_local.h:60
ojph::OJPH_PO_CPRL
@ OJPH_PO_CPRL
Definition ojph_params_local.h:63
ojph::OJPH_PO_PCRL
@ OJPH_PO_PCRL
Definition ojph_params_local.h:62
ojph::OJPH_PO_RPCL
@ OJPH_PO_RPCL
Definition ojph_params_local.h:61
ojph::ui64
uint64_t ui64
Definition ojph_defs.h:56
ojph::ui16
uint16_t ui16
Definition ojph_defs.h:52
ojph::OJPH_TILEPART_RESOLUTIONS
@ OJPH_TILEPART_RESOLUTIONS
Definition ojph_params_local.h:100
ojph::OJPH_TILEPART_NO_DIVISIONS
@ OJPH_TILEPART_NO_DIVISIONS
Definition ojph_params_local.h:99
ojph::OJPH_TILEPART_COMPONENTS
@ OJPH_TILEPART_COMPONENTS
Definition ojph_params_local.h:101
ojph::OJPH_TILEPART_MASK
@ OJPH_TILEPART_MASK
Definition ojph_params_local.h:103
ojph::si32
int32_t si32
Definition ojph_defs.h:55
ojph::error
message_error error
Definition ojph_message.cpp:134
ojph::ui32
uint32_t ui32
Definition ojph_defs.h:54
ojph::ui8
uint8_t ui8
Definition ojph_defs.h:50
ojph_codestream_local.h
ojph_colour.h
ojph_max
#define ojph_max(a, b)
Definition ojph_defs.h:73
ojph_div_ceil
#define ojph_div_ceil(a, b)
Definition ojph_defs.h:70
ojph_mem.h
OJPH_INFO
#define OJPH_INFO(t,...)
MACROs to insert file and line number for info, warning, and error.
Definition ojph_message.h:284
OJPH_ERROR
#define OJPH_ERROR(t,...)
Definition ojph_message.h:288
ojph_params.h
ojph_tile.h
ojph_tile_comp.h
ojph::local::param_cod
Definition ojph_params_local.h:385
ojph::local::param_cod::is_employing_color_transform
bool is_employing_color_transform() const
Definition ojph_params_local.h:537
ojph::local::param_cod::get_num_decompositions
ui8 get_num_decompositions() const
Definition ojph_params_local.h:504
ojph::local::param_cod::is_reversible
bool is_reversible() const
Definition ojph_params.cpp:841
ojph::local::param_nlt
Definition ojph_params_local.h:802
ojph::local::param_nlt::get_nonlinear_transform
bool get_nonlinear_transform(ui32 comp_num, ui8 &bit_depth, bool &is_signed, ui8 &nl_type) const
Definition ojph_params.cpp:1910
ojph::local::param_siz
Definition ojph_params_local.h:166
ojph::local::param_siz::get_bit_depth
ui32 get_bit_depth(ui32 comp_num) const
Definition ojph_params_local.h:252
ojph::local::param_siz::is_signed
bool is_signed(ui32 comp_num) const
Definition ojph_params_local.h:257
ojph::local::param_siz::get_num_components
ui16 get_num_components() const
Definition ojph_params_local.h:251
ojph::local::param_siz::get_recon_downsampling
point get_recon_downsampling(ui32 comp_num) const
Definition ojph_params.cpp:749
ojph::local::param_siz::get_downsampling
point get_downsampling(ui32 comp_num) const
Definition ojph_params_local.h:262
ojph::local::param_sot
Definition ojph_params_local.h:925
ojph::local::param_tlm
Definition ojph_params_local.h:962
ojph::local::param_tlm::set_next_pair
void set_next_pair(ui16 Ttlm, ui32 Ptlm)
Definition ojph_params.cpp:2195
ojph::point
Definition ojph_base.h:58
ojph::point::y
ui32 y
Definition ojph_base.h:60
ojph::point::x
ui32 x
Definition ojph_base.h:60
ojph::rect
Definition ojph_base.h:65
ojph::rect::siz
size siz
Definition ojph_base.h:67
ojph::rect::org
point org
Definition ojph_base.h:66
ojph::size::w
ui32 w
Definition ojph_base.h:50
ojph::size::h
ui32 h
Definition ojph_base.h:51