12#include "ImageHistogram.h"
77 std::pair<double, double>
NextPair(QString &pairs);
85 void AddPair(
const double input,
const double output);
142 void SetMinimum(
const double value) {
145 void SetMaximum(
const double value) {
149 void Load(Pvl &pvl, QString &grpName);
150 void Save(Pvl &pvl, QString &grpName);
151 void Load(QString &file, QString &grpName);
152 void Save(QString &file, QString &grpName);
154 double Map(
const double value)
const;
156 void Parse(
const QString &pairs);
159 QString
Text()
const;
166 double Input(
const int index)
const;
167 double Output(
const int index)
const;
Container of a cube histogram.
void CopyPairs(const Stretch &other)
Copies the stretch pairs from another Stretch object, but maintains special pixel values.
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.
void AddPair(const double input, const double output)
Adds a stretch pair to the list of pairs.
int p_pairs
Number of stretch pairs.
void SetNull(const double value)
Sets the mapping for NULL pixels.
double p_null
Mapping of input NULL values go to this value (default NULL)
Stretch()
Constructs a Stretch object with default mapping of special pixel values to themselves.
std::pair< double, double > NextPair(QString &pairs)
Given a string containing stretch pairs for example "0:0 50:0 100:255 255:255" evaluate the first pai...
std::vector< double > p_output
Array for output side of stretch pairs.
void SetHrs(const double value)
Sets the mapping for HRS pixels.
double p_lrs
Mapping of input LRS values go to this value (default LRS)
double Output(const int index) const
Returns the value of the output side of the stretch pair at the specified index.
double p_minimum
By default this value is set to p_lrs.
double Input(const int index) const
Returns the value of the input side of the stretch pair at the specified index.
double p_maximum
By default this value is set to p_hrs.
std::vector< double > p_input
Array for input side of stretch pairs.
void SetHis(const double value)
Sets the mapping for HIS pixels.
void SetLis(const double value)
Sets the mapping for LIS pixels.
~Stretch()
Destroys the Stretch object.
double p_hrs
Mapping of input HRS values go to this value (default HRS)
double p_his
Mapping of input HIS values go to this value (default HIS)
void ClearPairs()
Clears the stretch pairs.
double Map(const double value) const
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings.
int Pairs() const
Returns the number of stretch pairs.
void Load(Pvl &pvl, QString &grpName)
Loads the stretch pairs from the pvl file into the Stretch object.
void SetLrs(const double value)
Sets the mapping for LRS pixels.
double p_lis
Mapping of input LIS values go to this value (default LIS)
QString Text() const
Converts stretch pair to a string.
This is free and unencumbered software released into the public domain.