Isis Developer Reference
Blobber.h
Go to the documentation of this file.
1 #ifndef Blobber_h
2 #define Blobber_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <QString>
11 
12 #include <tnt/tnt_array2d.h>
13 
14 namespace Isis {
15  class Cube;
16  class Table;
17 
98  class Blobber {
99  public:
100  Blobber();
101  Blobber(const QString &blobname, const QString &fieldname,
102  const QString &name = "Blob");
103  Blobber(Cube &cube, const QString &blobname,
104  const QString &fieldname, const QString &name = "Blob");
106  virtual ~Blobber() { }
107 
108  Blobber deepcopy() const;
109 
119  void setName(const QString &name) {
120  _name = name;
121  }
122 
132  void setBlobName(const QString &bname) {
133  _blobname = bname;
134  }
135 
144  void setFieldName(const QString &fname) {
145  _fieldname = fname;
146  }
147 
152  inline int size() const {
153  return (Lines() * Samples());
154  }
155 
160  inline int Lines() const {
161  return (_buf.dim1());
162  }
167  inline int Samples() const {
168  return (_buf.dim2());
169  }
170 
175  QString getName() const {
176  return (_name);
177  }
178 
183  QString getBlobName() const {
184  return (_blobname);
185  }
186 
191  QString getFieldName() const {
192  return (_fieldname);
193  }
194 
206  inline double *operator[](int i) {
207  return (_buf[i]);
208  }
221  inline double const *operator[](int i) const {
222  return (_buf[i]);
223  }
224 
225 // Load options for reading the BLOB from ISIS files
226  void load(const QString &filename);
227  void load(Cube &cube);
228 
229 
230  protected:
231  typedef TNT::Array2D<double> BlobBuf;
232 
238  inline const BlobBuf &ref() const {
239  return (_buf);
240  }
241 
242  private:
243  QString _blobname;
244  QString _fieldname;
245  QString _name;
246  BlobBuf _buf;
247 
248 // Low/level I/O and conversion methods
249  void loadDouble(Table &tbl);
250  void loadInteger(Table &tbl);
251  double int2ToDouble(unsigned int value) const;
252  double int2ToDouble(int value) const;
253  };
254 };
255 
256 #endif
257 
Isis::LOW_INSTR_SAT2
const short LOW_INSTR_SAT2
Definition: SpecialPixel.h:156
Table.h
Cube.h
Isis::Blobber
Base class for accessing ISIS blobs.
Definition: Blobber.h:98
Isis::Blobber::size
int size() const
Returns the total number of elements (rows * columns) in blob.
Definition: Blobber.h:152
TableField.h
SpecialPixel.h
Isis::Cube::readTable
Table readTable(const QString &name)
Read a Table from the cube.
Definition: Cube.cpp:952
Isis::HIGH_REPR_SATUI4
const unsigned int HIGH_REPR_SATUI4
Definition: SpecialPixel.h:176
Isis::Blobber::Samples
int Samples() const
Number of columns or samples in the BLOB.
Definition: Blobber.h:167
Isis::Blobber::Blobber
Blobber()
Default basic constructor that is mostly not useful.
Definition: Blobber.cpp:27
Blobber.h
Isis::HIGH_REPR_SAT8
const double HIGH_REPR_SAT8
Definition: SpecialPixel.h:116
Isis::TableField::isInteger
bool isInteger() const
Determines whether the field type is Integer.
Definition: TableField.cpp:122
Isis::Blobber::BlobBuf
TNT::Array2D< double > BlobBuf
Internal buffer uses TNT.
Definition: Blobber.h:231
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Blobber::setName
void setName(const QString &name)
Specifies the name of this class instantiation.
Definition: Blobber.h:119
Isis::HIGH_REPR_SAT2
const short HIGH_REPR_SAT2
Definition: SpecialPixel.h:158
Isis::Blobber::setFieldName
void setFieldName(const QString &fname)
Sets field name in the ISIS BLOB object that contains data.
Definition: Blobber.h:144
Isis::Table
Class for storing Table blobs information.
Definition: Table.h:61
Isis::NULL8
const double NULL8
Definition: SpecialPixel.h:94
Isis::Blobber::deepcopy
Blobber deepcopy() const
Create a unique copy of this blob.
Definition: Blobber.cpp:107
Isis::HIGH_INSTR_SAT2
const short HIGH_INSTR_SAT2
Definition: SpecialPixel.h:157
Isis::Blobber::~Blobber
virtual ~Blobber()
Destructor of this object.
Definition: Blobber.h:106
Isis::HIGH_INSTR_SAT8
const double HIGH_INSTR_SAT8
Definition: SpecialPixel.h:110
Isis::Blobber::getFieldName
QString getFieldName() const
Retreive the name of the field in the Tabel object BLOB.
Definition: Blobber.h:191
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::NULL2
const short NULL2
Definition: SpecialPixel.h:154
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::TableField::isDouble
bool isDouble() const
Determines whether the field type is Double.
Definition: TableField.cpp:132
Isis::Blobber::getBlobName
QString getBlobName() const
Retrieves the name of the Table object.
Definition: Blobber.h:183
Isis::HIGH_INSTR_SATUI4
const unsigned int HIGH_INSTR_SATUI4
Definition: SpecialPixel.h:175
Isis::Blobber::operator[]
double const * operator[](int i) const
Returns the ith row/line in the BLOB that can be further referenced into samples.
Definition: Blobber.h:221
Isis::LOW_INSTR_SATUI4
const unsigned int LOW_INSTR_SATUI4
Definition: SpecialPixel.h:174
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::Blobber::load
void load(const QString &filename)
Loads the contents of a BLOB from a cube file.
Definition: Blobber.cpp:120
Isis::LOW_REPR_SATUI4
const unsigned int LOW_REPR_SATUI4
Definition: SpecialPixel.h:173
Isis::Blobber::setBlobName
void setBlobName(const QString &bname)
Sets the name of the ISIS BLOB object that contains the data.
Definition: Blobber.h:132
Isis::Blobber::operator[]
double * operator[](int i)
Returns the ith row/line in the BLOB that can be further referenced into samples.
Definition: Blobber.h:206
Isis::Blobber::Lines
int Lines() const
Number of rows or lines in the BLOB.
Definition: Blobber.h:160
Isis::LOW_REPR_SAT8
const double LOW_REPR_SAT8
Definition: SpecialPixel.h:98
Isis::Table::Records
int Records() const
Returns the number of records.
Definition: Table.cpp:313
Isis::Blobber::ref
const BlobBuf & ref() const
Returns a const reference to the internal buffer for ease of use to derived objects.
Definition: Blobber.h:238
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
Isis::LOW_INSTR_SAT8
const double LOW_INSTR_SAT8
Definition: SpecialPixel.h:104
Isis::NULLUI4
const unsigned int NULLUI4
Definition: SpecialPixel.h:172
Isis::LOW_REPR_SAT2
const short LOW_REPR_SAT2
Definition: SpecialPixel.h:155
Progress.h
Isis::Blobber::getName
QString getName() const
Returns the name of the BLOB given to refer to this instantiation.
Definition: Blobber.h:175
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::TableField
Class for storing an Isis::Table's field information.
Definition: TableField.h:47