Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
|
HDR Output is a class that is used to output HDR (and associated .fla, .raw) files. More...
#include <hdr_output.h>
Public Member Functions | |
hdr_output () | |
hdr_output (bool save_reflectance) | |
hdr_output (int data_type) | |
hdr_output (bool save_reflectance, int data_type) | |
virtual | ~hdr_output () |
void | save (scyl::pipeline *in, std::string filename) |
save() takes a pipeline object and file name and writes out a HDR file and associated data file (default .fla) based on the input data. More... | |
void | set_data_type (int in) |
int | data_type () |
Public Member Functions inherited from scyl::output | |
output () | |
virtual | ~output () |
Static Public Member Functions | |
static void | write_hdr (std::string file_path, std::string file_basename, std::string data_extension, const arma::fcube &I, const arma::fvec &wavelengths, int data_type=4, std::string description="") |
write out a hdr / data file pair to disk. File wil use BSQ encoding with float data type (currently fixed) More... | |
Private Attributes | |
bool | m_save_reflectance |
int | m_data_type |
HDR Output is a class that is used to output HDR (and associated .fla, .raw) files.
This could be done stand-alone, but it is recommended to be used as a helper object with a Pipeline:
scyl::output * output = scyl::hdr_output(); pipeline.set_output(output); pipeline.save("path/to/output.hsz");
If you just want to write out an image as a HDR file, use the static function 'write_hdr()' contained within this class.
scyl::hdr_output::hdr_output | ( | ) |
Output Constructor
scyl::hdr_output::hdr_output | ( | bool | save_reflectance | ) |
Output Constructor
save_reflectance | If true, save the redlectance cube instead of the image cube. |
scyl::hdr_output::hdr_output | ( | int | data_type | ) |
Output Constructor
data_type | specifies the data type to use. 1 = 8 bit unsigned, 2 = 16 bit signed, 4 = 32 bit float (default), 12 = 16 bit unsigned. |
scyl::hdr_output::hdr_output | ( | bool | save_reflectance, |
int | data_type | ||
) |
Output Constructor
save_reflectance | If true, save the redlectance cube instead of the image cube. |
data_type | specifies the data type to use. 1 = 8 bit unsigned, 2 = 16 bit signed, 4 = 32 bit float (default), 12 = 16 bit unsigned. |
|
virtual |
Output Destructor
int scyl::hdr_output::data_type | ( | ) |
|
virtual |
save() takes a pipeline object and file name and writes out a HDR file and associated data file (default .fla) based on the input data.
If the input filename is '.hdr' then the data file extension will be '.fla'. if the file extension is anything else, it is assumed to be the name of the data file, and the '.hdr' file will be created with the same base name.
If the object was constructed with the boolean argument 'save_reflectance' set to true, this function will save the reflectance cube.
in | A pointer to the pipeline object to be saved |
filename | A string file path to the intended save location (eg /path/to/file.hdr ) See above for details. |
Exception | Invalid file argument |
Exception | Missing data in Pipeline object preventing saving |
Implements scyl::output.
void scyl::hdr_output::set_data_type | ( | int | in | ) |
in | data_type 1 = 8 bit unsigned, 2 = 16 bit signed, 4 = 32 bit float (default), 12 = 16 bit unsigned. |
|
static |
write out a hdr / data file pair to disk. File wil use BSQ encoding with float data type (currently fixed)
file_path | - The directory to write the file to (e.g. /data/image) |
file_basename | - The file basename (e.g. image001) |
data_extension | - The data file extension |
I | - The image/data cube to be saved |
wavelengths | - Wavelength vector (same number of bands as I/data |
data_type | - Specifies the data type to use. 1 = 8 bit unsigned, 2 = 16 bit signed, 4 = 32 bit float (default), 12 = 16 bit unsigned. |
description | - Optional string description. |
|
private |
|
private |