Isis 3.0 Object Programmers' Reference |
Home |
#include <Brick.h>
Inheritance diagram for Isis::Brick:
This class is a Buffer. The shape of the buffer is three dimensional in the line, sample, and band directions. This class provides a random access window into a cube. The position can be set to any line, sample and band, including outside the image.
For internal use only.
Definition at line 53 of file Brick.h.
Public Member Functions | |
Brick (const int nsamps, const int nlines, const int nbands, const Isis::PixelType type) | |
Constructs a Brick object. | |
Brick (const Isis::Cube &cube, const int &bufNumSamples, const int &bufNumLines, const int &bufNumBands) | |
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. | |
void | SetBaseSample (const int start_samp) |
This method is used to set the base sample position of the shape buffer. | |
void | SetBaseLine (const int start_line) |
This method is used to set the base line position of the shape buffer. | |
void | SetBaseBand (const int start_band) |
This method is used to set the base band position of the shape buffer. | |
void | Resize (const int nsamps, const int nlines, const int nbands) |
Resizes the memory buffer to the specified number of samples, lines, and bands. | |
bool | SetBrick (const int brick) |
Sets the current brick as requested. | |
int | Bricks () |
Returns the number of Bricks in the cube. | |
bool | operator++ (int) |
Moves the shape buffer to the next position. | |
bool | begin () |
Moves the shape buffer to the first position. | |
bool | next () |
Moves the shape buffer to the next position. | |
bool | end () const |
Returns true if the shape buffer has accessed the end of the cube. | |
int | SampleDimension () const |
Returns the number of samples in the shape buffer. | |
int | LineDimension () const |
Returns the number of lines in the shape buffer. | |
int | BandDimension () const |
Returns the number of bands in the shape buffer. | |
int | size () const |
Returns the total number of pixels in the shape buffer. | |
int | Sample (const int index=0) const |
Returns the sample position associated with a shape buffer index. | |
int | Line (const int index=0) const |
Returns the line position associated with a shape buffer index. | |
int | Band (const int index=0) const |
Returns the band position associated with a shape buffer index. | |
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. | |
int | Index (const int i_samp, const int i_line, const int i_band) const throw (Isis::iException &) |
Given a sample, line, and band position, this returns the appropriate index in the shape buffer. | |
double | at (const int index) const |
Returns the value in the shape buffer at the given index. | |
double & | operator[] (const int index) |
Returns the value in the shape buffer at given index. | |
double * | DoubleBuffer () const |
Returns the value of the shape buffer. | |
void | Copy (const Buffer &in) |
Allows copying of the buffer contents to another Buffer. | |
void * | RawBuffer () const |
Returns a void pointer to the raw buffer. | |
Isis::PixelType | PixelType () const |
Returns the raw buffer pixel type. | |
Protected Member Functions | |
bool | setpos (const BigInt map) |
Sets the position of the shape in the cube. | |
int | MaxSamples () const |
Returns the number of samples in the cube. | |
int | MaxLines () const |
Returns the number of lines in the cube. | |
int | MaxBands () const |
Returns the number of bands in the cube. | |
BigInt | MaxMaps () const |
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos method for more info). | |
void | SetIncrements (const int sinc, const int linc, const int binc) |
Sets how the shape is incremented through the cube. | |
void | SetOffsets (const int soff, const int loff, const int boff) |
Sets the offset of the buffer. | |
void | Allocate () |
Size or resize the memory buffer. | |
Protected Attributes | |
int | p_sample |
Starting sample to read/write. | |
int | p_nsamps |
Number of samples to read/write. | |
int | p_line |
Starting line to read/write. | |
int | p_nlines |
Number of lines to read/write. | |
int | p_band |
Starting band to read/write. | |
int | p_nbands |
Number of bands to read/write. | |
int | p_npixels |
Number of pixels (nsamps * nlines * nbands). | |
double * | p_buf |
Shape buffer allocated to the size of npixels for handling reads/writes. | |
const Isis::PixelType | p_pixelType |
The pixel type of the raw buffer. | |
void * | p_rawbuf |
The raw dm read from the disk. |
|
Constructs a Brick object.
|
|
Size or resize the memory buffer.
Definition at line 295 of file Buffer.cpp. References _FILEINFO_, Isis::Message::MemoryAllocationFailed(), Isis::iException::Message(), Isis::Buffer::p_buf, Isis::Buffer::p_npixels, Isis::Buffer::p_pixelType, Isis::Buffer::p_rawbuf, and Isis::SizeOf(). Referenced by Isis::Buffer::Buffer(), and Resize(). |
|
Returns the value in the shape buffer at the given index.
Definition at line 234 of file Buffer.cpp. References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), Isis::iException::Message(), Isis::Buffer::p_buf, and Isis::Buffer::p_npixels. |
|
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.
Definition at line 167 of file Buffer.cpp. References Isis::Buffer::p_band, Isis::Buffer::p_nlines, and Isis::Buffer::p_nsamps. Referenced by Isis::Buffer::Position(), Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::ProcessRubberSheet::SlowGeom(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
Returns the number of bands in the shape buffer.
Definition at line 97 of file Buffer.h. References Isis::Buffer::p_nbands. |
|
Moves the shape buffer to the first position.
Definition at line 120 of file BufferManager.h. References Isis::BufferManager::setpos(). Referenced by Isis::ProcessExport::StartProcess(), and Isis::ProcessExport::StartProcessBIP(). |
|
Returns the number of Bricks in the cube.
Definition at line 134 of file Brick.h. References Isis::BufferManager::MaxMaps(). |
|
Allows copying of the buffer contents to another Buffer.
Definition at line 255 of file Buffer.cpp. References _FILEINFO_, in, Isis::iException::Message(), Isis::Buffer::p_npixels, and Isis::Buffer::size(). Referenced by Isis::Buffer::Buffer(), and Qisis::FileTool::copy(). |
|
Returns the value of the shape buffer.
Definition at line 131 of file Buffer.h. References Isis::Buffer::p_buf. Referenced by Qisis::CubeViewport::computeStretch(), Isis::ProcessRubberSheet::SlowGeom(), Isis::CubeIoHandler::ToDouble(), and Isis::CubeIoHandler::ToRaw(). |
|
Returns true if the shape buffer has accessed the end of the cube.
Definition at line 135 of file BufferManager.h. References Isis::BufferManager::p_currentMap, and Isis::BufferManager::p_nmaps. Referenced by Isis::ProcessExport::StartProcess(). |
|
Given a sample, line, and band position, this returns the appropriate index in the shape buffer.
Definition at line 200 of file Buffer.cpp. References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), and Isis::iException::Message(). Referenced by Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
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.
Definition at line 151 of file Buffer.cpp. References Isis::Buffer::p_line, Isis::Buffer::p_nlines, and Isis::Buffer::p_nsamps. Referenced by Isis::Buffer::Position(), Isis::ProcessRubberSheet::QuadTree(), Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::ProcessRubberSheet::SlowGeom(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
Returns the number of lines in the shape buffer.
Definition at line 90 of file Buffer.h. References Isis::Buffer::p_nlines. |
|
Returns the number of bands in the cube.
Definition at line 161 of file BufferManager.h. References Isis::BufferManager::p_maxBands. Referenced by Isis::BandManager::SetBand(). |
|
Returns the number of lines in the cube.
Definition at line 154 of file BufferManager.h. References Isis::BufferManager::p_maxLines. Referenced by Isis::LineManager::SetLine(). |
|
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos method for more info).
Definition at line 169 of file BufferManager.h. References Isis::BufferManager::p_nmaps. Referenced by Bricks(), and Isis::TileManager::Tiles(). |
|
Returns the number of samples in the cube.
Definition at line 147 of file BufferManager.h. References Isis::BufferManager::p_maxSamps. Referenced by Isis::SampleManager::SetSample(). |
|
Moves the shape buffer to the next position. Returns true if the next position is valid.
Definition at line 128 of file BufferManager.h. References Isis::BufferManager::p_currentMap, and Isis::BufferManager::setpos(). Referenced by Isis::BufferManager::operator++(), and Isis::ProcessExport::StartProcess(). |
|
Moves the shape buffer to the next position. Returns true if the next position is valid.
Definition at line 113 of file BufferManager.h. References Isis::BufferManager::next(). |
|
Returns the value in the shape buffer at given index.
Definition at line 124 of file Buffer.h. References Isis::Buffer::p_buf. |
|
Returns the raw buffer pixel type.
Definition at line 147 of file Buffer.h. References Isis::Buffer::p_pixelType. Referenced by Isis::CubeIoHandler::ToDouble(), and Isis::CubeIoHandler::ToRaw(). |
|
Returns the sample, line, and band position associated with a shape buffer index. Performs the same function as the Sample, Line, and Band methods.
Definition at line 181 of file Buffer.cpp. References Isis::Buffer::Band(), Isis::Buffer::Line(), and Isis::Buffer::Sample(). |
|
Returns a void pointer to the raw buffer. Cast this void pointer using information from the PixelType() method
Definition at line 140 of file Buffer.h. References Isis::Buffer::p_rawbuf. Referenced by Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::CubeIoHandler::ToDouble(), Isis::CubeIoHandler::ToRaw(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
Resizes the memory buffer to the specified number of samples, lines, and bands.
Definition at line 35 of file Brick.cpp. References Isis::Buffer::Allocate(), Isis::Buffer::p_buf, Isis::Buffer::p_nbands, Isis::Buffer::p_nlines, Isis::Buffer::p_npixels, Isis::Buffer::p_nsamps, and Isis::Buffer::p_rawbuf. Referenced by Qisis::CubeViewport::computeStretch(), and Qisis::CubeViewport::paintPixmap(). |
|
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.
Definition at line 134 of file Buffer.cpp. References Isis::Buffer::p_nsamps, and Isis::Buffer::p_sample. Referenced by Qisis::CubeViewport::paintPixmap(), Isis::Buffer::Position(), Isis::ProcessRubberSheet::QuadTree(), Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::ProcessRubberSheet::SlowGeom(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
Returns the number of samples in the shape buffer.
Definition at line 83 of file Buffer.h. References Isis::Buffer::p_nsamps. Referenced by Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
This method is used to set the base band position of the shape buffer.
Reimplemented from Isis::Buffer. Definition at line 115 of file Brick.h. References Isis::Buffer::SetBaseBand(). |
|
This method is used to set the base line position of the shape buffer.
Reimplemented from Isis::Buffer. Definition at line 107 of file Brick.h. References Isis::Buffer::SetBaseLine(). |
|
This method is used to set the base position of the shape buffer. It is used to progress sequentially through a cube by brick.
Reimplemented from Isis::Buffer. Definition at line 89 of file Brick.h. References Isis::Buffer::SetBasePosition(). Referenced by Qisis::CubeViewport::bluePixel(), Qisis::CubeViewport::computeStretch(), Qisis::CubeViewport::grayPixel(), Qisis::CubeViewport::greenPixel(), Qisis::CubeViewport::paintPixmap(), Qisis::CubeViewport::redPixel(), Isis::ImagePolygon::SetImage(), and Qisis::EditTool::writeToCube(). |
|
This method is used to set the base sample position of the shape buffer.
Reimplemented from Isis::Buffer. Definition at line 99 of file Brick.h. References Isis::Buffer::SetBaseSample(). |
|
Sets the current brick as requested.
Definition at line 58 of file Brick.cpp. References _FILEINFO_, Isis::iException::Message(), and Isis::BufferManager::setpos(). |
|
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.
Definition at line 88 of file BufferManager.cpp. References Isis::BufferManager::p_binc, Isis::BufferManager::p_boff, Isis::BufferManager::p_currentBand, Isis::BufferManager::p_currentLine, Isis::BufferManager::p_currentMap, Isis::BufferManager::p_currentSample, Isis::BufferManager::p_linc, Isis::BufferManager::p_loff, Isis::BufferManager::p_maxBands, Isis::BufferManager::p_maxLines, Isis::BufferManager::p_maxSamps, Isis::BufferManager::p_nmaps, Isis::BufferManager::p_sinc, and Isis::BufferManager::p_soff. Referenced by Isis::BoxcarManager::BoxcarManager(), and Isis::BufferManager::BufferManager(). |
|
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.
Definition at line 126 of file BufferManager.cpp. References Isis::BufferManager::p_boff, Isis::BufferManager::p_loff, and Isis::BufferManager::p_soff. Referenced by Isis::BoxcarManager::BoxcarManager(). |
|
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 othe 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).
Definition at line 165 of file BufferManager.cpp. References _FILEINFO_, Isis::iException::Message(), Isis::BufferManager::p_binc, Isis::BufferManager::p_currentBand, Isis::BufferManager::p_currentLine, Isis::BufferManager::p_currentMap, Isis::BufferManager::p_currentSample, Isis::BufferManager::p_linc, Isis::BufferManager::p_maxBands, Isis::BufferManager::p_maxLines, Isis::BufferManager::p_nmaps, Isis::BufferManager::p_reverse, and Isis::BufferManager::p_sinc. Referenced by Isis::BufferManager::begin(), Isis::BufferManager::next(), Isis::BandManager::SetBand(), SetBrick(), Isis::LineManager::SetLine(), Isis::SampleManager::SetSample(), and Isis::TileManager::SetTile(). |
|
Returns the total number of pixels in the shape buffer.
Definition at line 104 of file Buffer.h. References Isis::Buffer::p_npixels. Referenced by Isis::Buffer::Copy(), Isis::ProcessMapMosaic::FillNull(), Isis::ProcessExport::isisOut16s(), Isis::ProcessExport::isisOut16u(), Isis::ProcessExport::isisOut32(), Isis::ProcessExport::isisOut8(), Qisis::CubeViewport::paintPixmap(), Isis::Calculator::Push(), Isis::ProcessRubberSheet::QuadTree(), Isis::CubeTileHandler::Read(), Isis::CubeBsqHandler::Read(), Isis::ProcessRubberSheet::SlowGeom(), Isis::ProcessExport::StartProcess(), Isis::CubeIoHandler::ToDouble(), Isis::CubeIoHandler::ToRaw(), Isis::CubeTileHandler::Write(), and Isis::CubeBsqHandler::Write(). |
|
Starting band to read/write.
Definition at line 183 of file Buffer.h. Referenced by Isis::Buffer::Band(), Isis::Buffer::Buffer(), and Isis::Buffer::SetBaseBand(). |
|
Shape buffer allocated to the size of npixels for handling reads/writes.
Definition at line 187 of file Buffer.h. Referenced by Isis::Buffer::Allocate(), Isis::Buffer::at(), Isis::Buffer::DoubleBuffer(), Isis::Buffer::operator=(), Isis::Buffer::operator[](), Resize(), and Isis::Buffer::~Buffer(). |
|
Starting line to read/write.
Definition at line 180 of file Buffer.h. Referenced by Isis::Buffer::Buffer(), Isis::Buffer::Line(), and Isis::Buffer::SetBaseLine(). |
|
Number of bands to read/write.
Definition at line 184 of file Buffer.h. Referenced by Isis::Buffer::BandDimension(), Isis::Buffer::Buffer(), and Resize(). |
|
Number of lines to read/write.
Definition at line 181 of file Buffer.h. Referenced by Isis::Buffer::Band(), Isis::Buffer::Buffer(), Isis::Buffer::Line(), Isis::Buffer::LineDimension(), and Resize(). |
|
Number of pixels (nsamps * nlines * nbands).
Definition at line 186 of file Buffer.h. Referenced by Isis::Buffer::Allocate(), Isis::Buffer::at(), Isis::Buffer::Buffer(), Isis::Buffer::Copy(), Isis::Buffer::operator=(), Resize(), and Isis::Buffer::size(). |
|
Number of samples to read/write.
Definition at line 178 of file Buffer.h. Referenced by Isis::Buffer::Band(), Isis::Buffer::Buffer(), Isis::Buffer::Line(), Resize(), Isis::Buffer::Sample(), and Isis::Buffer::SampleDimension(). |
|
The pixel type of the raw buffer.
Definition at line 190 of file Buffer.h. Referenced by Isis::Buffer::Allocate(), and Isis::Buffer::PixelType(). |
|
The raw dm read from the disk.
Definition at line 191 of file Buffer.h. Referenced by Isis::Buffer::Allocate(), Isis::Buffer::RawBuffer(), Resize(), and Isis::Buffer::~Buffer(). |
|
Starting sample to read/write.
Definition at line 177 of file Buffer.h. Referenced by Isis::Buffer::Buffer(), Isis::Buffer::Sample(), and Isis::Buffer::SetBaseSample(). |