[a2036a]: src / Panorama / PanoImage.h Maximize Restore History

Download this file

PanoImage.h    124 lines (96 with data), 3.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// -*- c-basic-offset: 4 -*-
//
// Pablo d'Angelo <pablo@mathematik.uni-ulm.de>
// Last change: Time-stamp: <05-May-2003 00:06:14 pablo@island.wh-wurm.uni-ulm.de>
//
//
#ifndef PANOIMAGE_H
#define PANOIMAGE_H
#include <iostream>
#include <Magick++.h>
/*
#include <qstring.h>
#include <qdom.h>
#include <qpixmap.h>
*/
namespace PT {
class Panorama;
/** optimization & stitching options. */
class ImageOptions {
public:
enum ImageSource { DIGITAL_CAMERA, SCANNER };
ImageOptions()
: featherWidth(10),
ignoreFrameWidth(0),
morph(false),
lensNr(0),
source(DIGITAL_CAMERA)
{ };
// isn't the c++ compiler supposed to create a default operator== ?
bool operator==(const ImageOptions & o) const
{
return (featherWidth == o.featherWidth &&
ignoreFrameWidth == o.ignoreFrameWidth &&
morph == o.morph &&
lensNr == o.lensNr &&
source == o.source
);
}
// QDomElement toXML(QDomDocument & doc);
// void setFromXML(const QDomNode & node);
// PT state
/// u10 specify width of feather for stitching. default:10
unsigned int featherWidth;
/// m20 ignore a frame 20 pixels wide. default: 0
unsigned int ignoreFrameWidth;
/// Morph-to-fit using control points.
bool morph;
// the lens of this image
unsigned int lensNr;
/// image source, used to determine the linking of variables
ImageSource source;
};
/** This class holds an source image.
*
* It contains information about its settings for the panorama,
* and holds the Image data (as an ImageMagick image)
*
* An image should not depend on the panorama.
*/
class PanoImage
{
public:
PanoImage(const std::string & filename);
// create from xml node
// PanoImage(QDomNode & node);
virtual ~PanoImage();
virtual const char * isA() const { return "PanoImage"; };
// QDomElement toXML(QDomDocument & doc);
// void setFromXML(QDomNode & node);
std::string getFilename() const
{ return filename; }
const ImageOptions & getOptions() const
{ return options; }
void setOptions(const ImageOptions & opt)
{ options = opt; }
unsigned int getHeight() const
{ return height; }
unsigned int getWidth() const
{ return width; }
void setLens(unsigned int l)
{ options.lensNr = l; }
unsigned int getLens() const
{ return options.lensNr; }
private:
/// common init for all constructors
void init();
/// read image info (size, exif header)
bool readImageInformation();
// image properties needed by Panorama tools.
std::string filename;
int height,width;
bool imageRead;
ImageOptions options;
};
} // namespace
#endif // PANOIMAGE_H