OpenJPH
Open-source implementation of JPEG2000 Part-15
ojph_resolution.h
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_resolution.h
34// Author: Aous Naman
35// Date: 28 August 2019
36//***************************************************************************/
37
38
39#ifndef OJPH_RESOLUTION_H
40#define OJPH_RESOLUTION_H
41
42#include "ojph_defs.h"
43
44namespace ojph {
45
47 //defined elsewhere
48 struct line_buf;
49 class mem_elastic_allocator;
50 class codestream;
51
52 namespace local {
53
55 //defined here
56 class tile_comp;
57 struct precinct;
58 class subband;
59
62 {
63 public:
64
65 public:
66 static void pre_alloc(codestream *codestream, const rect& res_rect,
67 const rect& recon_res_rect, ui32 res_num);
69 const rect& recon_res_rect, ui32 comp_num,
71 tile_comp *parent_tile_comp,
73
74 line_buf* get_line() { return lines + 0; }
75 void push_line();
77 rect get_rect() { return res_rect; }
79
81 void write_precincts(outfile_base *file);
82 bool get_top_left_precinct(point &top_left);
85 void parse_all_precincts(ui32& data_left, infile_base *file);
86 void parse_one_precinct(ui32& data_left, infile_base *file);
87
88 ui32 get_num_bytes() const { return num_bytes; }
89 ui32 get_num_bytes(ui32 resolution_num) const;
90
91 private:
96 ui32 num_bytes; // number of bytes in this resolution
97 // used for tilepart length
104 //precincts stuff
110 ui32 level_index[20]; //more than enough
111 point cur_precinct_loc; //used for progressing spatial modes (2, 3, 4)
112 //wavelet machinery
116 };
117
118 }
119}
120
121#endif // !OJPH_RESOLUTION_H
bool get_top_left_precinct(point &top_left)
void parse_one_precinct(ui32 &data_left, infile_base *file)
mem_elastic_allocator * elastic
void write_precincts(outfile_base *file)
resolution * next_resolution()
void finalize_alloc(codestream *codestream, const rect &res_rect, const rect &recon_res_rect, ui32 comp_num, ui32 res_num, point comp_downsamp, tile_comp *parent_tile_comp, resolution *parent_res)
void parse_all_precincts(ui32 &data_left, infile_base *file)
static void pre_alloc(codestream *codestream, const rect &res_rect, const rect &recon_res_rect, ui32 res_num)
void write_one_precinct(outfile_base *file)
uint32_t ui32
Definition: ojph_defs.h:54