Isis 3 Programmer Reference
Brick.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "Brick.h"
8#include "IException.h"
9
10namespace Isis {
19 void Brick::Resize(const int nsamps, const int nlines, const int nbands) {
20 delete [] p_buf;
21 delete [](char *) p_rawbuf;
22 p_nsamps = nsamps;
23 p_nlines = nlines;
24 p_nbands = nbands;
26 Allocate();
27 }
28
42 bool Brick::SetBrick(const int brick) {
43 if(brick < 1) {
44 QString message = "Invalid value for argument [brick]";
45 throw IException(IException::Programmer, message, _FILEINFO_);
46 }
47
48 return setpos(brick - 1);
49 }
50} // end namespace isis
void Resize(const int nsamps, const int nlines, const int nbands)
Resizes the memory buffer to the specified number of samples, lines, and bands.
Definition Brick.cpp:19
bool SetBrick(const int brick)
This method is used to set the position of the brick.
Definition Brick.cpp:42
void * p_rawbuf
The raw dm read from the disk.
Definition Buffer.h:212
int p_npixels
Number of pixels (nsamps * nlines * nbands)
Definition Buffer.h:207
void Allocate()
Size or resize the memory buffer.
Definition Buffer.cpp:340
int p_nlines
Number of lines to read/write.
Definition Buffer.h:202
int p_nbands
Number of bands to read/write.
Definition Buffer.h:205
double * p_buf
Shape buffer allocated to the size of npixels for handling reads/writes.
Definition Buffer.h:208
int p_nsamps
Number of samples to read/write.
Definition Buffer.h:199
bool setpos(BigInt map)
Sets the position of the shape in the cube.
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
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16