Isis 3 Programmer Reference
ProcessByTile.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "ProcessByTile.h"
8#include "TileManager.h"
9
10using namespace std;
11namespace Isis {
12
20 void ProcessByTile::SetTileSize(const int ns, const int nl) {
21 p_tileSamples = ns;
22 p_tileLines = nl;
23 p_tileSizeSet = true;
24 }
25
41 funct(Buffer &in, Buffer &out)) {
42
43 //SetBrickSizesForProcessCube();
44 VerifyCubes(InputOutput);
45 SetBricks(InputOutput);
47 }
48
49
63 void ProcessByTile::StartProcess(void funct(Buffer &in)) {
64
65 VerifyCubes(InPlace);
66 SetBricks(InPlace);
67 //SetBrickSizesForProcessCubeInPlace();
69 }
70
71
86 void ProcessByTile::StartProcess(void funct(std::vector<Buffer *> &in,
87 std::vector<Buffer *> &out)) {
88 //SetBrickSizesForProcessCubes();
89 VerifyCubes(InputOutputList);
90 SetBricks(InputOutputList);
92 }
93
94
105
106
114
115
116 void ProcessByTile::SetBricks(IOCubes cn){
117
118 switch(cn) {
119
120 case InPlace:
121
122 // Make sure the tile size has been set
123 if(!p_tileSizeSet) {
124 string m = "Use the SetTileSize method to set the tile size";
125 throw IException(IException::Programmer, m, _FILEINFO_);
126 }
127
129
130 break;
131
132
133 case InputOutput:
134 if(!p_tileSizeSet) {
135 string m = "Use the SetTileSize method to set the tile size";
136 throw IException(IException::Programmer, m, _FILEINFO_);
137 }
138
140
141 break;
142
143 case InputOutputList:
144
145 if(!p_tileSizeSet) {
146 string m = "Use the SetTileSize method to set the tile size";
147 throw IException(IException::Programmer, m, _FILEINFO_);
148 }
149
151
152 break;
153
154
155 }
156
157
158 }
159
160
161
162} // end namespace isis
163
Buffer for reading and writing cube data.
Definition Buffer.h:53
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
void Finalize()
Cleans up by closing cubes and freeing memory.
void VerifyCubes(IOCubes cn)
Verifies the dimensions of the input/output cubes.
virtual void StartProcess(void funct(Buffer &in))
Starts the systematic processing of the input cube by moving an arbitrarily-shaped brick through the ...
void SetBrickSize(int ns, int nl, int nb)
Sets the input and output bricks sizes to the given number of samples, lines, and bands.
void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
void StartProcess(void funct(Buffer &in))
Starts the systematic processing of the input cube by moving an arbitrary shaped tile through the cub...
void SetTileSize(const int ns, const int nl)
Sets the tile size.
void Finalize()
Cleans up by closing cubes and freeing memory.
int p_tileSamples
Number of samples in the tile.
int p_tileLines
Number of lines in the tile.
void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
bool p_tileSizeSet
Indicates whether the tile size has been set.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.