OpenJPH
Open-source implementation of JPEG2000 Part-15
ojph_tile.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_tile.h
34// Author: Aous Naman
35// Date: 28 August 2019
36//***************************************************************************/
37
38
39#ifndef OJPH_TILE_H
40#define OJPH_TILE_H
41
42#include "ojph_defs.h"
43#include "ojph_file.h"
44#include "ojph_params_local.h"
45
46namespace ojph {
47
49 //defined elsewhere
50 struct line_buf;
51 class codestream;
52
53 namespace local {
54
56 //defined here
57 class tile_comp;
58
60 class tile
61 {
62 public:
63 static void pre_alloc(codestream *codestream, const rect& tile_rect,
64 const rect& recon_tile_rect, ui32 &num_tileparts);
66 const rect& recon_tile_rect, ui32 tile_idx,
67 ui32 offset, ui32 &num_tileparts);
68
69 bool push(line_buf *line, ui32 comp_num);
70 void prepare_for_flush();
71 void fill_tlm(param_tlm* tlm);
72 void flush(outfile_base *file);
73 void parse_tile_header(const param_sot& sot, infile_base *file,
74 const ui64& tile_start_location);
75 bool pull(line_buf *, ui32 comp_num);
77
78 private:
79 //codestream *parent;
89
91 bool *is_signed;
94
95 private:
98
99 private:
101 ui32 tilepart_div; // tilepart division value
102 bool need_tlm; // true if tlm markers are needed
103
104 ui32 num_bytes; // number of bytes in this tile
105 // used for tile length
106 };
107
108 }
109}
110
111#endif // !OJPH_TILE_H
bool pull(line_buf *, ui32 comp_num)
Definition: ojph_tile.cpp:321
line_buf * lines
Definition: ojph_tile.h:84
static void pre_alloc(codestream *codestream, const rect &tile_rect, const rect &recon_tile_rect, ui32 &num_tileparts)
Definition: ojph_tile.cpp:56
void prepare_for_flush()
Definition: ojph_tile.cpp:404
rect recon_tile_rect
Definition: ojph_tile.h:80
tile_comp * comps
Definition: ojph_tile.h:82
void fill_tlm(param_tlm *tlm)
Definition: ojph_tile.cpp:413
rect * recon_comp_rects
Definition: ojph_tile.h:86
bool * is_signed
Definition: ojph_tile.h:91
void flush(outfile_base *file)
Definition: ojph_tile.cpp:467
void finalize_alloc(codestream *codestream, const rect &tile_rect, const rect &recon_tile_rect, ui32 tile_idx, ui32 offset, ui32 &num_tileparts)
Definition: ojph_tile.cpp:133
ui32 skipped_res_for_read
Definition: ojph_tile.h:88
param_sot sot
Definition: ojph_tile.h:96
bool push(line_buf *line, ui32 comp_num)
Definition: ojph_tile.cpp:236
bool employ_color_transform
Definition: ojph_tile.h:85
rect * comp_rects
Definition: ojph_tile.h:86
void parse_tile_header(const param_sot &sot, infile_base *file, const ui64 &tile_start_location)
Definition: ojph_tile.cpp:660
ui32 * line_offsets
Definition: ojph_tile.h:87
rect get_tile_rect()
Definition: ojph_tile.h:76
uint64_t ui64
Definition: ojph_defs.h:56
uint32_t ui32
Definition: ojph_defs.h:54