#include <iostream>
#include <cvb/spectral/spectral.hpp>
#include <cvb/spectral/cube.hpp>
#include <cvb/spectral/arithmetic.hpp>
#include <cvb/spectral/interpolator.hpp>
#include <cvb/spectral/convert_color_space.hpp>
int main()
{
try
{
Cvb::String objectHeader(path + CVB_LIT(
"ColorCube.hdr"));
Cvb::String objectBinary(path + CVB_LIT(
"ColorCube.bin"));
Cvb::String whiteRefHeader(path + CVB_LIT(
"WhiteCube.hdr"));
Cvb::String whiteRefBinary(path + CVB_LIT(
"WhiteCube.bin"));
Cvb::String blackRefHeader(path + CVB_LIT(
"DarkCube.hdr"));
Cvb::String blackRefBinary(path + CVB_LIT(
"DarkCube.bin"));
std::cout << "Load cube from: \n\t" <<
objectHeader << "\n\t" << objectBinary << std::endl;
std::cout << "White Reference: \n\t" <<
whiteRefHeader << "\n\t" << whiteRefBinary << std::endl;
std::cout << "Black Reference: \n\t" <<
blackRefHeader << "\n\t" << blackRefBinary << std::endl;
std::cout << "Normalization done!" << std::endl;
Cvb::Spectral::StdObserver::CIE2006_2deg,
Cvb::Spectral::StdIlluminant::D65,
Cvb::Spectral::InterpolationMethod::Linear);
std::cout << "Lab calculation done!" << std::endl;
std::cout << "sRGB calculation done!" << std::endl;
labImg->Save(labFilename);
rgbImg->Save(rgbFilename);
std::cout << "Saved Lab image to:\n\t" <<
labFilename << std::endl;
std::cout << "Saved sRGB image to:\n\t" <<
rgbFilename << std::endl;
}
catch (const std::exception& error)
{
std::cout << error.what() << std::endl;
}
}
static std::unique_ptr< Cube > Load(Cvb::String EnviHeader, Cvb::String EnviBinary)
static std::unique_ptr< Interpolator > Create(const Cube &cube, StdObserver stdObserver, StdIlluminant stdIlluminant, InterpolationMethod interpolationMethod)
std::unique_ptr< Image > LabToRGB8(const Image &LabImage, const Interpolator &interpolator)
std::unique_ptr< Cube > Normalization(const Cube &cubeIn, const Cube &whiteReference, const Cube &blackReference, NormalizationMethod normalizationMethod)
std::unique_ptr< Image > CubeToLab(const Cube &cube, const Interpolator &interpolator)
String ExpandPath(const String &path)