8#include "CubeStretch.h"
20 m_type(stretchType), m_bandNumber(bandNumber) {
40 m_name =
"DefaultStretch";
52 m_name =
"DefaultName";
63 char *buff = blob.getBuffer();
64 std::string stringFromBuffer(buff, blob.Size());
65 setName(blob.Label()[
"Name"][0]);
66 setType(blob.Label()[
"StretchType"][0]);
67 Parse(QString::fromStdString(stringFromBuffer));
73 CubeStretch::~CubeStretch() {
87 blob.Label()[
"Name"] =
getName();
90 std::string blobString =
Text().toStdString();
91 blob.setData(blobString.c_str(), blobString.size());
105 (
getName() == stretch2.getName()) &&
106 (
Text() == stretch2.Text());
Stores stretch information for a cube.
void setBandNumber(int bandNumber)
Set the band number for the stretch.
int m_bandNumber
Type of stretch. This is only currently used in the AdvancedStretchTool.
bool operator==(CubeStretch &stretch2)
Check if the CubeStretches are equal.
int getBandNumber() const
Get the band number for the stretch.
void setName(QString name)
Set the Stretch name.
Isis::Blob toBlob() const
Serialize the CubeStretch to a Blob.
QString getName() const
Get the Stretch name.
CubeStretch(QString name="DefaultStretch", QString stretchType="Default", int bandNumber=1)
Constructs a CubeStretch object with default mapping of special pixel values to themselves and a prov...
QString m_type
The name of the stretch.
QString getType() const
Get the Type of Stretch.
void setType(QString stretchType)
Set the type of Stretch.
A single keyword-value pair.
void Parse(const QString &pairs)
Parses a string of the form "i1:o1 i2:o2...iN:oN" where each i:o represents an input:output pair.
QString Text() const
Converts stretch pair to a string.
This is free and unencumbered software released into the public domain.