Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
scyl::hdr_output Class Reference

HDR Output is a class that is used to output HDR (and associated .fla, .raw) files. More...

#include <hdr_output.h>

Inheritance diagram for scyl::hdr_output:
scyl::output

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
 

Detailed Description

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.

Constructor & Destructor Documentation

scyl::hdr_output::hdr_output ( )

Output Constructor

scyl::hdr_output::hdr_output ( bool  save_reflectance)

Output Constructor

Parameters
save_reflectanceIf true, save the redlectance cube instead of the image cube.
scyl::hdr_output::hdr_output ( int  data_type)

Output Constructor

Parameters
data_typespecifies 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

Parameters
save_reflectanceIf true, save the redlectance cube instead of the image cube.
data_typespecifies 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 ( )
virtual

Output Destructor

Member Function Documentation

int scyl::hdr_output::data_type ( )
Returns
the data_type the class is currently set to use
void scyl::hdr_output::save ( scyl::pipeline in,
std::string  filename 
)
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.

Parameters
inA pointer to the pipeline object to be saved
filenameA string file path to the intended save location (eg /path/to/file.hdr ) See above for details.
Exceptions
ExceptionInvalid file argument
ExceptionMissing data in Pipeline object preventing saving

Implements scyl::output.

void scyl::hdr_output::set_data_type ( int  in)
Parameters
indata_type 1 = 8 bit unsigned, 2 = 16 bit signed, 4 = 32 bit float (default), 12 = 16 bit unsigned.
void scyl::hdr_output::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 = "" 
)
static

write out a hdr / data file pair to disk. File wil use BSQ encoding with float data type (currently fixed)

Parameters
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.

Member Data Documentation

int scyl::hdr_output::m_data_type
private
bool scyl::hdr_output::m_save_reflectance
private

The documentation for this class was generated from the following files: