Isis 3 Programmer Reference
|
Manages a Buffer over a cube. More...
#include <BufferManager.h>
Public Member Functions | |
BufferManager (int maxsamps, int maxlines, int maxbands, int bufsamps, int buflines, int bufbands, Isis::PixelType type, bool reverse=false) | |
Constructs a BufferManager object. More... | |
BufferManager (const BufferManager &other) | |
Constructs a BufferManager object. More... | |
~BufferManager () | |
Destroys the BufferManager object. More... | |
bool | operator++ (int) |
Moves the shape buffer to the next position. More... | |
BufferManager & | operator+= (int i) |
Moves the shape buffer by a certain amount. More... | |
bool | begin () |
Moves the shape buffer to the first position. More... | |
bool | next () |
Moves the shape buffer to the next position. More... | |
bool | end () const |
Returns true if the shape buffer has accessed the end of the cube. More... | |
bool | setpos (BigInt map) |
Sets the position of the shape in the cube. More... | |
void | swap (BufferManager &other) |
Swaps the values of this BufferManager with that of another. More... | |
BufferManager & | operator= (const BufferManager &rhs) |
Creates a new BufferManager with the same values as another. More... | |
int | SampleDimension () const |
Returns the number of samples in the shape buffer. More... | |
int | LineDimension () const |
Returns the number of lines in the shape buffer. More... | |
int | BandDimension () const |
Returns the number of bands in the shape buffer. More... | |
int | size () const |
Returns the total number of pixels in the shape buffer. More... | |
int | Sample (const int index=0) const |
Returns the sample position associated with a shape buffer index. More... | |
int | Line (const int index=0) const |
Returns the line position associated with a shape buffer index. More... | |
int | Band (const int index=0) const |
Returns the band position associated with a shape buffer index. More... | |
void | Position (const int index, int &i_samp, int &i_line, int &i_band) const |
Returns the sample, line, and band position associated with a shape buffer index. More... | |
int | Index (const int i_samp, const int i_line, const int i_band) const |
Given a sample, line, and band position, this returns the appropriate index in the shape buffer. More... | |
double | at (const int index) const |
Returns the value in the shape buffer at the given index. More... | |
double & | operator[] (const int index) |
Returns the value in the shape buffer at given index. More... | |
const double & | operator[] (const int index) const |
Returns the value in the shape buffer at given index. More... | |
double * | DoubleBuffer () const |
Returns the value of the shape buffer. More... | |
void | Copy (const Buffer &in, bool includeRawBuf=true) |
Allows copying of the buffer contents to another Buffer. More... | |
bool | CopyOverlapFrom (const Buffer &in) |
Allows copying of the buffer contents of a larger buffer to another same size or smaller Buffer, using their base positions to relate data. More... | |
void * | RawBuffer () const |
Returns a void pointer to the raw buffer. More... | |
Isis::PixelType | PixelType () const |
Returns the raw buffer pixel type. More... | |
Protected Member Functions | |
int | MaxSamples () const |
Returns the number of samples in the cube. More... | |
int | MaxLines () const |
Returns the number of lines in the cube. More... | |
int | MaxBands () const |
Returns the number of bands in the cube. More... | |
BigInt | MaxMaps () const |
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos method for more info). More... | |
void | SetIncrements (const int sinc, const int linc, const int binc) |
Sets how the shape is incremented through the cube. More... | |
void | SetOffsets (const int soff, const int loff, const int boff) |
Sets the offset of the buffer. More... | |
void | SetBasePosition (const int start_sample, const int start_line, const int start_band) |
This method is used to set the base position of the shape buffer. More... | |
void | SetBaseSample (const int start_samp) |
This method is used to set the base sample position of the shape buffer. More... | |
void | SetBaseLine (const int start_line) |
This method is used to set the base line position of the shape buffer. More... | |
void | SetBaseBand (const int start_band) |
This method is used to set the base band position of the shape buffer. More... | |
void | Allocate () |
Size or resize the memory buffer. More... | |
Protected Attributes | |
int | p_sample |
Starting sample to read/write. More... | |
int | p_nsamps |
Number of samples to read/write. More... | |
int | p_line |
Starting line to read/write. More... | |
int | p_nlines |
Number of lines to read/write. More... | |
int | p_band |
Starting band to read/write. More... | |
int | p_nbands |
Number of bands to read/write. More... | |
int | p_npixels |
Number of pixels (nsamps * nlines * nbands) More... | |
double * | p_buf |
Shape buffer allocated to the size of npixels for handling reads/writes. More... | |
const Isis::PixelType | p_pixelType |
The pixel type of the raw buffer. More... | |
void * | p_rawbuf |
The raw dm read from the disk. More... | |
Private Attributes | |
int | p_maxSamps |
Maximum samples to map. More... | |
int | p_maxLines |
Maximum lines to map. More... | |
int | p_maxBands |
Maximum bands to map. More... | |
int | p_sinc |
Sample increment. More... | |
int | p_linc |
Line increment. More... | |
int | p_binc |
Band increment. More... | |
int | p_soff |
Sample offset. More... | |
int | p_loff |
Line offset. More... | |
int | p_boff |
Band offset. More... | |
int | p_currentSample |
Current sample. More... | |
int | p_currentLine |
Current line. More... | |
int | p_currentBand |
Current band. More... | |
BigInt | p_nmaps |
Total number of objects to map. More... | |
BigInt | p_currentMap |
Current buffer map position. More... | |
bool | p_reverse |
If true the axies are processed in Band, Line, Sample order (e.g., BIL). More... | |
Manages a Buffer over a cube.
This class is used to manage a Buffer over a cube. Recall a Buffer is simply a 3-d shape (or subset) of a cube. For example, a line, tile, or spectra are some possible shapes. A buffer manager will walk the shape over the entire cube to ensure every pixel is accessed. When constructing a BufferManager, arguments for the cube size and buffer size are required. For example, construction for a (100 sample, 200 line, 2 band) cube accessed by a line shape would require the shape buffer to have 100 samples, 1 line, and 1 band. The manager would then access the lines sequentially in the first band and then proceed to the second band. A 100 sample, 1 line, and 2 band shape buffer would access each line but both bands simultaneously. Typically, a BufferManager is not instantiated directly but is used in a derived class such a Line or Tile.
If you would like to see BufferManager being used in implementation, see the LineManager, BoxcarManager, or TileManager class.
Definition at line 52 of file BufferManager.h.
Isis::BufferManager::BufferManager | ( | int | maxsamps, |
int | maxlines, | ||
int | maxbands, | ||
int | bufsamps, | ||
int | buflines, | ||
int | bufbands, | ||
Isis::PixelType | type, | ||
bool | reverse = false |
||
) |
Constructs a BufferManager object.
maxsamps | Maximum samples to map |
maxlines | Maximum lines to map |
maxbands | Maximum bands to map |
bufsamps | Number of samples in the shape buffer |
buflines | Number of lines in the shape buffer |
bufbands | Number of bands in the shape buffer |
type | Type of pixel in raw buffer |
reverse | Modifies the order of progression this buffer takes through the cube. By default, progresses samples first, then lines, then bands. If reverse = true, then the buffer progresses bands first, then lines, then samples. |
Definition at line 45 of file BufferManager.cpp.
References p_reverse, and SetIncrements().
Isis::BufferManager::BufferManager | ( | const BufferManager & | other | ) |
Constructs a BufferManager object.
&other | Reference to a BufferManager to copy |
Definition at line 63 of file BufferManager.cpp.
|
inline |
Destroys the BufferManager object.
Definition at line 63 of file BufferManager.h.
|
protectedinherited |
Size or resize the memory buffer.
Isis::iException::System | - Memory allocation failed |
Definition at line 340 of file Buffer.cpp.
References Isis::Message::MemoryAllocationFailed(), Isis::Buffer::p_buf, Isis::Buffer::p_npixels, Isis::Buffer::p_pixelType, Isis::Buffer::p_rawbuf, Isis::SizeOf(), and Isis::IException::Unknown.
Referenced by Isis::Buffer::Buffer(), and Isis::Brick::Resize().
|
inherited |
Returns the value in the shape buffer at the given index.
index | Index position in buffer. Out of bounds index is trapped. |
Isis::iException::Programmer | - Array Subscript not in range |
Definition at line 231 of file Buffer.cpp.
References Isis::Message::ArraySubscriptNotInRange(), Isis::Buffer::p_buf, Isis::Buffer::p_npixels, and Isis::IException::Programmer.
Referenced by Isis::CubeDataThreadTester::BrickChanged(), Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::fillBuffer(), Isis::StatisticsTool::getStatistics(), Isis::CubeDataThreadTester::ReadBrick(), and Isis::CubeDataThreadTester::ReadWriteBrick().
|
inherited |
Returns the band position associated with a shape buffer index.
The shape buffer is one dimensional. Let us assume a nsamps=2, nlines=3, and nbands=2. Therefore the total size of the shape buffer is 12 and valid index values are 0-11. Indexes 0-5 will return band 1 and 6-11 will return band 2.
index | Shape buffer index to map to a band position. Defaults to 0. |
Definition at line 162 of file Buffer.cpp.
References Isis::Buffer::p_band, Isis::Buffer::p_nlines, and Isis::Buffer::p_nsamps.
Referenced by Isis::CubeIoHandler::bufferLessThan(), Isis::Buffer::CopyOverlapFrom(), Isis::CubeIoHandler::findIntersection(), Isis::SpectralDefinition2D::operator()(), Isis::ImageImporter::operator()(), Isis::ProcessByBrick::ProcessCubesFunctor< T >::operator()(), Isis::Average::operator()(), Isis::CubeDataThread::OverlapIndex(), Isis::Buffer::Position(), Isis::CubeIoHandler::read(), Isis::ProcessRubberSheet::StartProcess(), Isis::CubeIoHandler::synchronousWrite(), Isis::CubeIoHandler::writeIntoDouble(), and Isis::CubeIoHandler::writeIntoRaw().
|
inlineinherited |
Returns the number of bands in the shape buffer.
Definition at line 88 of file Buffer.h.
References Isis::Buffer::p_nbands.
Referenced by Isis::CubeIoHandler::bufferLessThan(), Isis::CubeIoHandler::findIntersection(), Isis::CubeIoHandler::read(), Isis::RegionalCachingAlgorithm::recommendChunksToFree(), Isis::Hillshade::shadedValue(), Isis::CubeIoHandler::synchronousWrite(), Isis::CubeIoHandler::writeIntoDouble(), and Isis::CubeIoHandler::writeIntoRaw().
|
inline |
Moves the shape buffer to the first position.
Definition at line 96 of file BufferManager.h.
References setpos().
Referenced by Isis::Cube::copy(), Isis::ProcessExport::GetBuffersBIL(), Isis::ProcessExport::GetBuffersBIP(), Isis::ProcessExport::GetBuffersBSQ(), Isis::MosaicSceneItem::getStretch(), Isis::ProcessByBrick::PrepProcessCubes(), Isis::FileTool::saveAsFullImage(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessExport::StartProcess(), and Isis::ProcessByBoxcar::StartProcess().
|
inherited |
Allows copying of the buffer contents to another Buffer.
in | The Buffer to be copied. |
includeRawBuf | Whether to include raw dm read from disk |
Isis::iException::Programmer | - Input and Output buffers are not the same size |
Isis::iException::Programmer | - Input and Output buffers do not use the same pixel type |
Definition at line 255 of file Buffer.cpp.
References Isis::Buffer::p_buf, Isis::Buffer::p_npixels, Isis::Buffer::p_pixelType, Isis::Buffer::p_rawbuf, Isis::Buffer::PixelType(), Isis::IException::Programmer, Isis::Buffer::size(), and Isis::SizeOf().
Referenced by Isis::Buffer::Buffer(), Isis::FileTool::copy(), Isis::Cube::copy(), and Isis::FileTool::saveAs_FullResolution().
|
inherited |
Allows copying of the buffer contents of a larger buffer to another same size or smaller Buffer, using their base positions to relate data.
This does not copy the raw buffer.
in | The Buffer to be copied. |
Definition at line 285 of file Buffer.cpp.
References Isis::Buffer::Band(), Isis::Buffer::Index(), Isis::Buffer::Line(), Isis::Buffer::p_band, Isis::Buffer::p_line, Isis::Buffer::p_nbands, Isis::Buffer::p_nlines, Isis::Buffer::p_npixels, Isis::Buffer::p_nsamps, Isis::Buffer::p_sample, Isis::Buffer::Sample(), and Isis::Buffer::size().
|
inlineinherited |
Returns the value of the shape buffer.
Definition at line 138 of file Buffer.h.
References Isis::Buffer::p_buf.
Referenced by Isis::AutoReg::ApplyGradientFilter(), Isis::Process::CalculateStatistics(), Isis::ControlPointEditWidget::demRadius(), Isis::QnetTool::demRadius(), Isis::Chip::Extract(), Isis::SpatialPlotTool::getSpatialStatistics(), Isis::SpectralPlotTool::getSpectralStatistics(), Isis::MosaicSceneItem::getStretch(), Isis::StretchTool::histFromCube(), Isis::Cube::histogram(), Isis::ImageHistogram::ImageHistogram(), Isis::DemShape::localRadius(), Isis::OverlapStatistics::OverlapStatistics(), Isis::Chip::Read(), Isis::HistogramTool::refreshPlot(), Isis::ProcessByQuickFilter::StartProcess(), Isis::Cube::statistics(), Isis::StretchTool::statsFromCube(), Isis::CubeIoHandler::writeIntoDouble(), and Isis::CubeIoHandler::writeIntoRaw().
|
inline |
Returns true if the shape buffer has accessed the end of the cube.
Definition at line 115 of file BufferManager.h.
References p_currentMap, and p_nmaps.
Referenced by Isis::Cube::copy(), setpos(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessExport::StartProcess(), and Isis::ProcessByBoxcar::StartProcess().
|
inherited |
Given a sample, line, and band position, this returns the appropriate index in the shape buffer.
i_samp | Sample position. |
i_line | Line position. |
i_band | Band position. |
Isis::iException::Programmer | - Array Subscript not in range |
Definition at line 197 of file Buffer.cpp.
References Isis::Message::ArraySubscriptNotInRange(), Isis::Buffer::p_band, Isis::Buffer::p_line, Isis::Buffer::p_nbands, Isis::Buffer::p_nlines, Isis::Buffer::p_nsamps, Isis::Buffer::p_sample, and Isis::IException::Programmer.
Referenced by Isis::Buffer::CopyOverlapFrom(), Isis::ViewportBuffer::fillBuffer(), Isis::CubeIoHandler::writeIntoDouble(), and Isis::CubeIoHandler::writeIntoRaw().
|
inherited |
Returns the line position associated with a shape buffer index.
The shape buffer is one dimensional. Let us assume a nsamps=2, nlines=3, and nbands=2. Therefore the total size of the shape buffer is 12 and valid index values are 0-11. Line(0), Line(1), Line(6) and Line(7), will return a 1, Line(2), Line(3), Line(8) and Line(9) will return a 2, and Line(4), Line(5), Line(10), and Line(11) will return a 3.
index | Shape buffer index to map to a line position. Defaults to 0 |
Definition at line 145 of file Buffer.cpp.
References Isis::Buffer::p_line, Isis::Buffer::p_nlines, and Isis::Buffer::p_nsamps.
Referenced by Isis::CubeIoHandler::bufferLessThan(), Isis::Buffer::CopyOverlapFrom(), Isis::CubeViewport::cubeDataChanged(), Isis::ViewportBuffer::DataReady(), Isis::Chip::Extract(), Isis::ViewportBuffer::fillBuffer(), Isis::CubeIoHandler::findIntersection(), Isis::ImageImporter::operator()(), Isis::Nearest::operator()(), Isis::Average::operator()(), Isis::CubeDataThread::OverlapIndex(), Isis::Buffer::Position(), Isis::CubeIoHandler::read(), Isis::EditTool::redoEdit(), Isis::CubeIoHandler::synchronousWrite(), Isis::EditTool::undoEdit(), Isis::QtExporter::writeGrayscale(), Isis::StreamExporter::writeGrayscale(), Isis::QtExporter::writeRgb(), Isis::StreamExporter::writeRgb(), Isis::QtExporter::writeRgba(), Isis::StreamExporter::writeRgba(), and Isis::EditTool::writeToCube().
|
inlineinherited |
Returns the number of lines in the shape buffer.
Definition at line 79 of file Buffer.h.
References Isis::Buffer::p_nlines.
Referenced by Isis::CubeIoHandler::bufferLessThan(), Isis::CubeViewport::cubeDataChanged(), Isis::ViewportBuffer::fillBuffer(), Isis::CubeIoHandler::findIntersection(), Isis::CubeIoHandler::read(), Isis::RegionalCachingAlgorithm::recommendChunksToFree(), Isis::EditTool::redoEdit(), Isis::Hillshade::shadedValue(), Isis::CubeIoHandler::synchronousWrite(), Isis::EditTool::undoEdit(), and Isis::EditTool::writeToCube().
|
inlineprotected |
Returns the number of bands in the cube.
Definition at line 152 of file BufferManager.h.
References p_maxBands.
Referenced by Isis::BandManager::SetBand().
|
inlineprotected |
Returns the number of lines in the cube.
Definition at line 143 of file BufferManager.h.
References p_maxLines.
Referenced by Isis::LineManager::SetLine().
|
inlineprotected |
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos method for more info).
Definition at line 162 of file BufferManager.h.
References p_nmaps.
Referenced by Isis::Brick::Bricks(), and Isis::TileManager::Tiles().
|
inlineprotected |
Returns the number of samples in the cube.
Definition at line 134 of file BufferManager.h.
References p_maxSamps.
Referenced by Isis::SampleManager::SetSample().
|
inline |
Moves the shape buffer to the next position.
Returns true if the next position is valid.
Definition at line 106 of file BufferManager.h.
References p_currentMap, and setpos().
Referenced by Isis::Cube::copy(), operator++(), Isis::ProcessExport::StartProcess(), and Isis::ProcessByBoxcar::StartProcess().
|
inline |
Moves the shape buffer to the next position.
Returns true if the next position is valid.
Definition at line 73 of file BufferManager.h.
References next().
|
inline |
Moves the shape buffer by a certain amount.
Returns a pointer to the BufferManager it was called on.
i | How far to shift the shape buffer |
Definition at line 86 of file BufferManager.h.
References p_currentMap, and setpos().
BufferManager & Isis::BufferManager::operator= | ( | const BufferManager & | rhs | ) |
Creates a new BufferManager with the same values as another.
&rhs | Reference to a BufferManager to swap with |
Definition at line 107 of file BufferManager.cpp.
References swap().
|
inlineinherited |
Returns the value in the shape buffer at given index.
index | Index position in buffer. No out of bounds index is checked |
Definition at line 118 of file Buffer.h.
References Isis::Buffer::p_buf.
|
inlineinherited |
Returns the value in the shape buffer at given index.
index | Index position in buffer. No out of bounds index is checked |
Definition at line 129 of file Buffer.h.
References Isis::Buffer::p_buf.
|
inlineinherited |
Returns the raw buffer pixel type.
Definition at line 160 of file Buffer.h.
References Isis::Buffer::p_pixelType.
Referenced by Isis::Buffer::Copy().
|
inherited |
Returns the sample, line, and band position associated with a shape buffer index.
Performs the same function as the Sample, Line, and Band methods.
index | Shape buffer index to map to a band position. |
i_samp | Sample position in shape buffer at index. |
i_line | Line position in shape buffer at index |
i_band | Band position in shape buffer at index. |
Definition at line 177 of file Buffer.cpp.
References Isis::Buffer::Band(), Isis::Buffer::Line(), and Isis::Buffer::Sample().
|
inlineinherited |
Returns a void pointer to the raw buffer.
Cast this void pointer using information from the PixelType() method
Definition at line 151 of file Buffer.h.
References Isis::Buffer::p_rawbuf.
Referenced by Isis::CubeIoHandler::writeIntoDouble().
|
inherited |
Returns the sample position associated with a shape buffer index.
The shape buffer is one dimensional. Let us assume a nsamps=2, nlines=3, and nbands=2. Therefore the total size of the shape buffer is 12 and valid index values are 0-11. Sample(0), Sample(2), Sample(4), etc will return a 1 while Sample(1), Sample(3), Sample(5), etc will return a 2.
index | Shape buffer index to map to a sample position. Defaults to 0. |
Definition at line 127 of file Buffer.cpp.
References Isis::Buffer::p_nsamps, and Isis::Buffer::p_sample.
Referenced by Isis::CubeIoHandler::bufferLessThan(), Isis::Buffer::CopyOverlapFrom(), Isis::CubeViewport::cubeDataChanged(), Isis::ViewportBuffer::DataReady(), Isis::Chip::Extract(), Isis::ViewportBuffer::fillBuffer(), Isis::CubeIoHandler::findIntersection(), Isis::SpectralDefinition2D::operator()(), Isis::CubeDataThread::OverlapIndex(), Isis::Buffer::Position(), Isis::CubeIoHandler::read(), Isis::EditTool::redoEdit(), Isis::CubeIoHandler::synchronousWrite(), Isis::EditTool::undoEdit(), and Isis::EditTool::writeToCube().
|
inlineinherited |
Returns the number of samples in the shape buffer.
Definition at line 70 of file Buffer.h.
References Isis::Buffer::p_nsamps.
Referenced by Isis::CubeIoHandler::bufferLessThan(), Isis::CubeViewport::cubeDataChanged(), Isis::ViewportBuffer::fillBuffer(), Isis::CubeIoHandler::findIntersection(), Isis::ImageImporter::operator()(), Isis::CubeIoHandler::read(), Isis::RegionalCachingAlgorithm::recommendChunksToFree(), Isis::EditTool::redoEdit(), Isis::Hillshade::shadedValue(), Isis::CubeIoHandler::synchronousWrite(), Isis::EditTool::undoEdit(), Isis::QtExporter::writeGrayscale(), Isis::StreamExporter::writeGrayscale(), Isis::QtExporter::writeRgb(), Isis::StreamExporter::writeRgb(), Isis::QtExporter::writeRgba(), Isis::StreamExporter::writeRgba(), and Isis::EditTool::writeToCube().
|
inlineprotectedinherited |
This method is used to set the base band position of the shape buffer.
start_band | Starting band to set |
Definition at line 193 of file Buffer.h.
References Isis::Buffer::p_band.
Referenced by Isis::Brick::SetBaseBand(), and Isis::Buffer::SetBasePosition().
|
inlineprotectedinherited |
This method is used to set the base line position of the shape buffer.
start_line | Starting line to set |
Definition at line 183 of file Buffer.h.
References Isis::Buffer::p_line.
Referenced by Isis::Brick::SetBaseLine(), and Isis::Buffer::SetBasePosition().
|
protectedinherited |
This method is used to set the base position of the shape buffer.
In general it is used by BufferManager objects to progress sequentially through a cube by line, tile, boxcar, etc.
start_sample | Starting sample to set. |
start_line | Starting line to set. |
start_band | Starting band to set. |
Definition at line 106 of file Buffer.cpp.
References Isis::Buffer::SetBaseBand(), Isis::Buffer::SetBaseLine(), and Isis::Buffer::SetBaseSample().
Referenced by Isis::Brick::SetBasePosition(), setpos(), and Isis::Portal::SetPosition().
|
inlineprotectedinherited |
This method is used to set the base sample position of the shape buffer.
start_samp | Starting sample to set |
Definition at line 173 of file Buffer.h.
References Isis::Buffer::p_sample.
Referenced by Isis::Buffer::SetBasePosition(), and Isis::Brick::SetBaseSample().
|
protected |
Sets how the shape is incremented through the cube.
By default (if this method is not invoked) shapes are moved sequentially through the cube with no overlap. For example, assume a 3 sample by 3 line tile buffer. It would first move across the image from left-to-right starting at sample 1, line 1, and band 1. Upon an increment it would be positioned at sample 4, line 1, and band 1. Each successive increment would cause the sample position to increase by 3 until it exceeds the number of samples in the cube. At that point the shape buffer would be positioned at sample 1, line 4, and band 1 (effectively moving to the next row of tiles). The shape would then continue moving across the cube until it reaches the edge again. Then the next row of tiles would be accessed until the shape reached the bottom of the cube. This default management can be overridden using this method. For example, by setting the increments to (6,3,1) we effectively skip every other tile. By setting them to (6,6,1) we skip every other tile and every other row of tiles. By setting them to (1,1,1) we essentially have NSxNLxNB positions in the cube and the 3x3 tile is managed such that the top left corner of the tile is moved over by 1 sample until it reaches the end of the line then down 1 line and so on until the end of the cube is reached.
sinc | Sample increment |
linc | Line increment |
binc | Band increment |
Definition at line 140 of file BufferManager.cpp.
References p_binc, p_boff, p_currentBand, p_currentLine, p_currentMap, p_currentSample, p_linc, p_loff, p_maxBands, p_maxLines, p_maxSamps, p_nmaps, p_sinc, and p_soff.
Referenced by Isis::BoxcarManager::BoxcarManager(), and BufferManager().
|
protected |
Sets the offset of the buffer.
By default (if this method is not invoked) the offsets are (0,0,0). Offsets are applied when computing the top-left corner of the shape buffer. When used in conjunction with the SetIncrements method, this allows for centering shape buffers around a pixel when passing in negative offsets. For example,with a 3x3x1 shape and offsets of (-1,-1,0) and increments of (1,1,1) would cause the manager to walk a 3x3 buffer through the entire image. Setting the manager position the beginning causes the 3x3 window to be positioned such that sample 1, line 1 of the cube would be at the center of the window and increment would cause sample 2, line 1 to be at the center of the window. Successive increments will move the window in the sample direction until the end of line is reached at which time the buffer would be centered on sample 1, line 2.
soff | Sample offset |
loff | Line offset |
boff | Band offset |
Definition at line 179 of file BufferManager.cpp.
References p_boff, p_loff, and p_soff.
Referenced by Isis::BoxcarManager::BoxcarManager().
bool Isis::BufferManager::setpos | ( | BigInt | map | ) |
Sets the position of the shape in the cube.
This shape fits into the cube a specific number of times.
When p_reverse is left false: (default) For example, a line shape on a 100 sample, 200 line, and 2 band cube would have 200*2 or 400 different positions as there are 400 total lines in the cube. Performing setpos(0) would position the shape at sample 1, line 1, and band 1. While setpos(200) would position the shape at sample 1, line 1, and band 2. Finally, setpos(399) would position the shape at sample 1, line 400, and band 2. Setpos returns true if it was sucessfully in setting the position, and false if the shape is at the end of the cube (beyond index 399 in the case of our example).
When p_reverse is set to true: Following the above cube with 100 samples, 200 lines, and 2 bands, performing the setpos(0) would still position the shape at sample 1, line 1, and band 1. However, setpos(1) would position the shape at sample 1, line 1, band 2, while setpos(200) would position the spame at sample 1, line 100, band 1. Setpos returns true of it was sucessfully in setting the position, and false if the shape is at the end of the cube(beyond final index).
map | Shape buffer position value |
Isis::iException::Programmer | - Invalid value for map argument |
Definition at line 219 of file BufferManager.cpp.
References end(), p_binc, p_boff, p_currentBand, p_currentLine, p_currentMap, p_currentSample, p_linc, p_loff, p_maxBands, p_maxLines, p_maxSamps, p_reverse, p_sinc, p_soff, Isis::IException::Programmer, and Isis::Buffer::SetBasePosition().
Referenced by begin(), next(), Isis::ProcessByBrick::ProcessCubeInPlaceFunctor< T >::operator()(), Isis::ProcessByBrick::ProcessCubeFunctor< T >::operator()(), Isis::ProcessByBrick::ProcessCubesFunctor< T >::operator()(), operator+=(), Isis::BandManager::SetBand(), Isis::Brick::SetBrick(), Isis::LineManager::SetLine(), Isis::SampleManager::SetSample(), and Isis::TileManager::SetTile().
|
inlineinherited |
Returns the total number of pixels in the shape buffer.
Definition at line 97 of file Buffer.h.
References Isis::Buffer::p_npixels.
Referenced by Isis::ProcessMosaic::BandComparison(), Isis::CubeDataThreadTester::BrickChanged(), Isis::Process::CalculateStatistics(), Isis::Buffer::Copy(), Isis::Buffer::CopyOverlapFrom(), Isis::ViewportBuffer::DataReady(), Isis::Chip::Extract(), Isis::ViewportBuffer::fillBuffer(), Isis::ProcessMapMosaic::FillNull(), Isis::CubeIoHandler::getNullChunk(), Isis::MosaicSceneItem::getStretch(), Isis::Cube::histogram(), Isis::ImageHistogram::ImageHistogram(), Isis::ProcessExport::isisOut16s(), Isis::ProcessExport::isisOut16u(), Isis::ProcessExport::isisOut32(), Isis::ProcessExport::isisOut8(), Isis::Average::operator()(), Isis::CubeDataThread::OverlapIndex(), Isis::Calculator::Push(), Isis::CubeIoHandler::read(), Isis::CubeDataThreadTester::ReadBrick(), Isis::CubeDataThreadTester::ReadWriteBrick(), Isis::ProcessMosaic::ResetCountBands(), Isis::ScatterPlotData::ScatterPlotData(), Isis::Hillshade::shadedValue(), Isis::AutoReg::SobelGradient(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessExport::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), Isis::Cube::statistics(), and Isis::EditTool::writeToCube().
void Isis::BufferManager::swap | ( | BufferManager & | other | ) |
Swaps the values of this BufferManager with that of another.
&other | Reference to a BufferManager to swap with |
Definition at line 81 of file BufferManager.cpp.
References p_binc, p_boff, p_currentBand, p_currentLine, p_currentMap, p_currentSample, p_linc, p_loff, p_maxBands, p_maxLines, p_maxSamps, p_nmaps, p_reverse, p_sinc, and p_soff.
Referenced by operator=().
|
protectedinherited |
Starting band to read/write.
Definition at line 204 of file Buffer.h.
Referenced by Isis::Buffer::Band(), Isis::Buffer::Buffer(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::Index(), and Isis::Buffer::SetBaseBand().
|
private |
Band increment.
Definition at line 176 of file BufferManager.h.
Referenced by SetIncrements(), setpos(), and swap().
|
private |
Band offset.
Definition at line 180 of file BufferManager.h.
Referenced by SetIncrements(), SetOffsets(), setpos(), and swap().
|
protectedinherited |
Shape buffer allocated to the size of npixels for handling reads/writes.
Definition at line 208 of file Buffer.h.
Referenced by Isis::Buffer::Allocate(), Isis::Buffer::at(), Isis::Buffer::Copy(), Isis::Buffer::DoubleBuffer(), Isis::Buffer::operator=(), Isis::Buffer::operator[](), Isis::Brick::Resize(), and Isis::Buffer::~Buffer().
|
private |
Current band.
Definition at line 184 of file BufferManager.h.
Referenced by SetIncrements(), setpos(), and swap().
|
private |
Current line.
Definition at line 183 of file BufferManager.h.
Referenced by SetIncrements(), setpos(), and swap().
|
private |
Current buffer map position.
Definition at line 187 of file BufferManager.h.
Referenced by end(), next(), operator+=(), SetIncrements(), setpos(), and swap().
|
private |
Current sample.
Definition at line 182 of file BufferManager.h.
Referenced by SetIncrements(), setpos(), and swap().
|
private |
Line increment.
Definition at line 175 of file BufferManager.h.
Referenced by SetIncrements(), setpos(), and swap().
|
protectedinherited |
Starting line to read/write.
Definition at line 201 of file Buffer.h.
Referenced by Isis::Buffer::Buffer(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::Index(), Isis::Buffer::Line(), and Isis::Buffer::SetBaseLine().
|
private |
Line offset.
Definition at line 179 of file BufferManager.h.
Referenced by SetIncrements(), SetOffsets(), setpos(), and swap().
|
private |
Maximum bands to map.
Definition at line 172 of file BufferManager.h.
Referenced by MaxBands(), SetIncrements(), setpos(), and swap().
|
private |
Maximum lines to map.
Definition at line 171 of file BufferManager.h.
Referenced by MaxLines(), SetIncrements(), setpos(), and swap().
|
private |
Maximum samples to map.
Definition at line 170 of file BufferManager.h.
Referenced by MaxSamples(), SetIncrements(), setpos(), and swap().
|
protectedinherited |
Number of bands to read/write.
Definition at line 205 of file Buffer.h.
Referenced by Isis::Buffer::BandDimension(), Isis::Buffer::Buffer(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::Index(), and Isis::Brick::Resize().
|
protectedinherited |
Number of lines to read/write.
Definition at line 202 of file Buffer.h.
Referenced by Isis::Buffer::Band(), Isis::Buffer::Buffer(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::Index(), Isis::Buffer::Line(), Isis::Buffer::LineDimension(), and Isis::Brick::Resize().
|
private |
Total number of objects to map.
Definition at line 186 of file BufferManager.h.
Referenced by end(), MaxMaps(), SetIncrements(), and swap().
|
protectedinherited |
Number of pixels (nsamps * nlines * nbands)
Definition at line 207 of file Buffer.h.
Referenced by Isis::Buffer::Allocate(), Isis::Buffer::at(), Isis::Buffer::Buffer(), Isis::Buffer::Copy(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::operator=(), Isis::Brick::Resize(), and Isis::Buffer::size().
|
protectedinherited |
Number of samples to read/write.
Definition at line 199 of file Buffer.h.
Referenced by Isis::Buffer::Band(), Isis::Buffer::Buffer(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::Index(), Isis::Buffer::Line(), Isis::Brick::Resize(), Isis::Buffer::Sample(), and Isis::Buffer::SampleDimension().
|
protectedinherited |
The pixel type of the raw buffer.
Definition at line 211 of file Buffer.h.
Referenced by Isis::Buffer::Allocate(), Isis::Buffer::Copy(), and Isis::Buffer::PixelType().
|
protectedinherited |
The raw dm read from the disk.
Definition at line 212 of file Buffer.h.
Referenced by Isis::Buffer::Allocate(), Isis::Buffer::Copy(), Isis::Buffer::RawBuffer(), Isis::Brick::Resize(), and Isis::Buffer::~Buffer().
|
private |
If true the axies are processed in Band, Line, Sample order (e.g., BIL).
If left false, the axies are processed in the Sample, Line, Band order (e.g., BSQ, BIP).
Definition at line 194 of file BufferManager.h.
Referenced by BufferManager(), setpos(), and swap().
|
protectedinherited |
Starting sample to read/write.
Definition at line 198 of file Buffer.h.
Referenced by Isis::Buffer::Buffer(), Isis::Buffer::CopyOverlapFrom(), Isis::Buffer::Index(), Isis::Buffer::Sample(), and Isis::Buffer::SetBaseSample().
|
private |
Sample increment.
Definition at line 174 of file BufferManager.h.
Referenced by SetIncrements(), setpos(), and swap().
|
private |
Sample offset.
Definition at line 178 of file BufferManager.h.
Referenced by SetIncrements(), SetOffsets(), setpos(), and swap().