isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Tile.h
1 // -*- C++ -*-
2 // -*- coding: utf-8 -*-
3 //
4 // Author: Bryan Riel
5 // Copyright 2018
6 //
7 
8 #ifndef ISCE_IMAGE_TILE_H
9 #define ISCE_IMAGE_TILE_H
10 #pragma once
11 
12 #include "forward.h"
13 
14 #include <complex>
15 #include <valarray>
16 
17 // pyre
18 #include <pyre/journal.h>
19 
20 // Definition
21 template <typename T>
22 class isce3::image::Tile {
23 
24  public:
25  // Constructors
26  inline Tile();
27  inline Tile(const Tile &);
28 
29  // Getters for geometry
30  inline int length() const;
31  inline int width() const;
32  inline int rowStart() const;
33  inline int rowEnd() const;
34  inline int firstImageRow() const;
35  inline int lastImageRow() const;
36 
37  // Setters for geometry
38  inline void width(int);
39  inline void rowStart(int);
40  inline void rowEnd(int);
41  inline void firstImageRow(int);
42  inline void lastImageRow(int);
43 
44  // Allocate memory
45  inline void allocate();
46 
47  // Print out relevant attributes
48  inline void declare(pyre::journal::info_t &) const;
49 
50  // Overload subscript operator to access valarray data
51  inline T & operator[](size_t index) {return _data[index];}
52  // Read-only subscript operator
53  inline const T & operator[](size_t index) const {return _data[index];}
54 
55  // Overload () operator for 2D access
56  inline T & operator()(size_t row, size_t col) {return _data[row*_width+col];}
57  // Read-only () operator for 2D access
58  inline const T & operator()(size_t row, size_t col) const {return _data[row*_width+col];}
59 
60  // Get reference to underlying data
61  inline std::valarray<T> & data();
62 
63  private:
64  // Geometry
65  int _width, _rowStart, _rowEnd, _firstImageRow, _lastImageRow;
66 
67  // Data
68  std::valarray<T> _data;
69 };
70 
71 // Get inline implementations of Tile
72 #define ISCE_IMAGE_TILE_ICC
73 #include "Tile.icc"
74 #undef ISCE_IMAGE_TILE_ICC
75 
76 #endif
77 
78 // end of file
Definition: forward.h:7

Generated for ISCE3.0 by doxygen 1.8.5.