Isis 3 Programmer Reference
TileManager.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include "TileManager.h"
8 
9 #include "IException.h"
10 
11 using namespace std;
12 namespace Isis {
13 
25  TileManager::TileManager(const Isis::Cube &cube,
26  const int &bufNumSamples, const int &bufNumLines) :
27  Isis::BufferManager(cube.sampleCount(), cube.lineCount(), cube.bandCount(),
28  bufNumSamples, bufNumLines, 1,
29  cube.pixelType()) {
30 
31  p_numSampTiles = (cube.sampleCount() - 1) / bufNumSamples + 1;
32  p_numLineTiles = (cube.lineCount() - 1) / bufNumLines + 1;
33  }
34 
50  bool TileManager::SetTile(const int tile, const int band) {
51  if(tile < 1) {
52  string message = "Invalid value for argument [tile]";
53  throw IException(IException::Programmer, message, _FILEINFO_);
54  }
55 
56  if(band < 1) {
57  string message = "Invalid value for argument [band]";
58  throw IException(IException::Programmer, message, _FILEINFO_);
59  }
60 
61  int map = (band - 1) * (p_numSampTiles * p_numLineTiles) + tile - 1;
62 
63  return setpos(map);
64  }
65 } // end namespace isis
66 
Isis::BufferManager::setpos
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Definition: BufferManager.cpp:219
Isis::TileManager::SetTile
bool SetTile(const int Tile, const int band=1)
Sets the current tile as requested.
Definition: TileManager.cpp:50
Isis::BufferManager
Manages a Buffer over a cube.
Definition: BufferManager.h:52
Isis::TileManager::p_numSampTiles
int p_numSampTiles
Stores the number of tiles in the sample direction.
Definition: TileManager.h:42
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::TileManager::p_numLineTiles
int p_numLineTiles
Stores the number of tiles in the line direction.
Definition: TileManager.h:43
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16