Isis 3 Programmer Reference
ProcessByTile.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include "ProcessByTile.h"
8 #include "TileManager.h"
9 
10 using namespace std;
11 namespace 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 
40  void ProcessByTile::StartProcess(void
41  funct(Buffer &in, Buffer &out)) {
42 
43  //SetBrickSizesForProcessCube();
44  VerifyCubes(InputOutput);
45  SetBricks(InputOutput);
46  ProcessByBrick::StartProcess(funct);
47  }
48 
49 
63  void ProcessByTile::StartProcess(void funct(Buffer &in)) {
64 
65  VerifyCubes(InPlace);
66  SetBricks(InPlace);
67  //SetBrickSizesForProcessCubeInPlace();
68  ProcessByBrick::StartProcess(funct);
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);
91  ProcessByBrick::StartProcess(funct);
92  }
93 
94 
101  void ProcessByTile::EndProcess() {
102  p_tileSizeSet = false;
103  ProcessByBrick::EndProcess();
104  }
105 
106 
110  void ProcessByTile::Finalize() {
111  p_tileSizeSet = false;
112  ProcessByBrick::Finalize();
113  }
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 
128  ProcessByBrick::SetBrickSize(p_tileSamples, p_tileLines, 1);
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 
139  ProcessByBrick::SetBrickSize(p_tileSamples, p_tileLines, 1);
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 
150  ProcessByBrick::SetBrickSize(p_tileSamples, p_tileLines, 1);
151 
152  break;
153 
154 
155  }
156 
157 
158  }
159 
160 
161 
162 } // end namespace isis
163 
Isis::Buffer
Buffer for reading and writing cube data.
Definition: Buffer.h:53
Isis::IException
Isis exception class.
Definition: IException.h:91
std
Namespace for the standard library.
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16