33 #include <Base/Image/Image.hh>
34 #include <Base/Image/ImageIO.hh>
35 #include <Image/ConvertHDR.hh>
36 #include <Base/Common/FileHandling.hh>
37 #include <Base/Image/ImageConvert.hh>
44 int main(
int argc,
char *argv[])
48 cerr<< argv[0] <<
" <ppmfile1> <ppmfile2> ... "<<endl;
60 for(
int i = 1; i < argc; i++){
62 cout <<
"argv[i] " << argv[i] << endl;
64 cerr <<
"error loading file " << argv[i] << endl;
71 BIASERR(
"could not convert ushort image to uchar");
76 BIASERR(
"could not convert ushort image to uchar");
92 #ifdef BUILD_IMAGE_USHORT
98 for(
int i = 1; i < argc; i++){
100 cout <<
"argv[i] " << argv[i] << endl;
102 cerr <<
"error loading file " << argv[i] << endl;
107 BIASERR(
"could not convert ushort image to uchar");
This class handles conversions of HDR images to for example unsigned char.
static int ImportImage(const std::string &filename, ImageBase &result)
Try to load/import an image from a file using external libs.
int ToUnsignedCharGamma(BIAS::Image< StorageType > &src, BIAS::Image< unsigned char > &dst, float gamma, unsigned int currentMaxVal)
Conversion to unsigned char image, leaves min/max part intact.
static std::string LeadingZeroString(const int &n, const unsigned int &digits=DEFAULT_LEADING_ZEROS)
Create a string with leading zeroes from number.
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void SetZero()
zeroes the image
static int ToGrey(const ImageBase &source, ImageBase &dest)
wrapper for the templated function ToGrey