isce3 0.25.0
Loading...
Searching...
No Matches
Tile.icc
1//-*- C++ -*-
2//-*- coding: utf-8 -*-
3//
4// Author: Bryan Riel
5// Copyright 2018
6//
7
8#if !defined(ISCE_IMAGE_TILE_ICC)
9#error "Tile.icc is an implementation detail of class Tile"
10#endif
11
12#define IDX1D(i,j,w) (((i)*(w))+(j))
13
14// Default constructor
15template <typename T>
16isce3::image::Tile<T>::Tile() {}
17
18// Copy constructor
19template <typename T>
20isce3::image::Tile<T>::Tile(const Tile & refTile) :
21 _width(refTile.width()),
22 _rowStart(refTile.rowStart()), _rowEnd(refTile.rowEnd()),
23 _firstImageRow(refTile.firstImageRow()), _lastImageRow(refTile.lastImageRow()) {}
24
25// Allocate dynamic memory
26template <typename T>
27void isce3::image::Tile<T>::allocate() {
28 _data.resize(length() * _width);
29}
30
31// Get tile length (disallow setting of tile length)
32template <typename T>
33size_t isce3::image::Tile<T>::length() const {
34 return _lastImageRow - _firstImageRow;
35}
36
37// Get tile width
38template <typename T>
39size_t isce3::image::Tile<T>::width() const {
40 return _width;
41}
42
43// Set tile width
44template <typename T>
45void isce3::image::Tile<T>::width(size_t widthVal) {
46 _width = widthVal;
47}
48
49// Get row start index
50template <typename T>
51size_t isce3::image::Tile<T>::rowStart() const {
52 return _rowStart;
53}
54
55// Set row start index
56template <typename T>
57void isce3::image::Tile<T>::rowStart(size_t value) {
58 _rowStart = value;
59}
60
61// Get row end index
62template <typename T>
63size_t isce3::image::Tile<T>::rowEnd() const {
64 return _rowEnd;
65}
66
67// Set row end index
68template <typename T>
69void isce3::image::Tile<T>::rowEnd(size_t value) {
70 _rowEnd = value;
71}
72
73// Get index of first row of image
74template <typename T>
75size_t isce3::image::Tile<T>::firstImageRow() const {
76 return _firstImageRow;
77}
78
79// Set index of first row of image
80template <typename T>
81void isce3::image::Tile<T>::firstImageRow(size_t value) {
82 _firstImageRow = value;
83}
84
85// Get index of last row of image
86template <typename T>
87size_t isce3::image::Tile<T>::lastImageRow() const {
88 return _lastImageRow;
89}
90
91// Set index of last row of image
92template <typename T>
93void isce3::image::Tile<T>::lastImageRow(size_t value) {
94 _lastImageRow = value;
95}
96
97// Get reference to underlying data
98template <typename T>
99std::valarray<T> & isce3::image::Tile<T>::data() {
100 return _data;
101}
102
103// Print out relevant attributes
104template <typename T>
106declare(pyre::journal::info_t & info) const {
107 info << "Tile parameters:" << pyre::journal::newline
108 << " - first image row : " << firstImageRow() << pyre::journal::newline
109 << " - last image row : " << lastImageRow() << pyre::journal::newline
110 << " - row start : " << rowStart() << pyre::journal::newline
111 << " - row end : " << rowEnd() << pyre::journal::newline
112 << " - width : " << width() << pyre::journal::newline;
113}
114
115// end of file
Definition Tile.h:15

Generated for ISCE3.0 by doxygen 1.13.2.