29#include <vigra/basicimageview.hxx>
30#include <vigra/copyimage.hxx>
65 DEBUG_DEBUG(
"using cached remapped image " << imgNr);
79 if ( (e->image8->width() == 0) && (e->image16->width() == 0) && (e->imageFloat->width() == 0) ) {
80 throw std::runtime_error(
"could not retrieve small source image for preview generation");
83 if (e->image8->width() > 0)
85 else if (e->image16->width() > 0)
98 vigra::BImage srcMask;
104 throw std::runtime_error(
"could not retrieve flatfield image for preview generation");
106 if (e->image8->width()) {
107 srcFlat.resize(e->image8->size());
108 vigra::copyImage(srcImageRange(*(e->image8),
109 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> >()),
111 }
else if (e->image16->width()) {
112 srcFlat.resize(e->image16->size());
113 vigra::copyImage(srcImageRange(*(e->image16),
114 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt16> >()),
117 srcFlat.resize(e->imageFloat->size());
118 vigra::copyImage(srcImageRange(*(e->imageFloat),
119 vigra::RGBToGrayAccessor<vigra::RGBValue<float> >()),
129 if (e->imageFloat->width()) {
131 remapImage(*(e->imageFloat),
139 }
else if (e->image16->width()) {
141 remapImage(*(e->image16),
150 remapImage(*(e->image8),
170 for(std::map<unsigned int, MRemappedImage*>::iterator
it =
m_images.begin();
182 DEBUG_DEBUG(
"Remove " << imgNr <<
" from remapped cache");
@ VIGCORR_FLATFIELD
flatfield correction
EntryPtr getSmallImage(const std::string &filename)
get an small image.
static ImageCache & getInstance()
get the global ImageCache object
std::shared_ptr< Entry > EntryPtr
a shared pointer to the entry
void softFlush()
a soft version of flush.
struct to hold a image state for stitching
vigra::ImageImportInfo::ICCProfile m_ICCProfile
virtual SrcPanoImage getSrcImage(unsigned imgNr) const =0
get a complete description of a source image
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
const std::vector< double > & getProjectionParameters() const
Get the optional projection parameters.
unsigned int getWidth() const
PanoramaOptions::ProjectionFormat getProjection() const
double outputExposureValue
unsigned int getHeight() const
get panorama height
void invalidate()
invalidates all images
virtual MRemappedImage * getRemapped(const PanoramaData &pano, const PanoramaOptions &opts, unsigned int imgNr, vigra::Rect2D outputROI, AppBase::ProgressDisplay *progress)
create a remapped pano image.
Nona::RemappedPanoImage< vigra::FRGBImage, vigra::BImage > MRemappedImage
std::map< unsigned, PanoramaOptions > m_panoOpts
std::map< unsigned, SrcPanoImage > m_imagesParam
virtual ~SmallRemappedImageCache()
std::map< unsigned, MRemappedImage * > m_images
All variables of a source image.
void resize(const vigra::Size2D &size, VariableMap *potentialLinkedVars)
"resize" image, adjusts all distortion coefficients for usage with a source image of size size potent...
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
vigra::Rect2D estimateOutputROI(const PanoramaData &pano, const PanoramaOptions &opts, unsigned i, const double maxLength)
bool set_contains(const _Container &c, const typename _Container::key_type &key)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.