Isis 3 Programmer Reference
TileManager.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "TileManager.h"
8
9#include "IException.h"
10
11using namespace std;
12namespace Isis {
13
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
Manages a Buffer over a cube.
bool setpos(BigInt map)
Sets the position of the shape in the cube.
IO Handler for Isis Cubes.
Definition Cube.h:168
int lineCount() const
Definition Cube.cpp:1740
int sampleCount() const
Definition Cube.cpp:1813
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
int p_numLineTiles
Stores the number of tiles in the line direction.
Definition TileManager.h:43
int p_numSampTiles
Stores the number of tiles in the sample direction.
Definition TileManager.h:42
TileManager(const Isis::Cube &cube, const int &bufNumSamples=128, const int &bufNumLines=128)
Constructs a TileManager object.
bool SetTile(const int Tile, const int band=1)
Sets the current tile as requested.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.