29 #include <vigra/basicimageview.hxx>
30 #include <vigra/copyimage.hxx>
45 vigra::Rect2D outputROI,
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");
82 vigra::Size2D srcImgSize;
83 if (e->image8->width() > 0)
84 srcImgSize = e->image8->size();
85 else if (e->image16->width() > 0)
86 srcImgSize = e->image16->size();
88 srcImgSize = e->imageFloat->size();
94 srcPanoImg.
resize(srcImgSize,
nullptr);
96 vigra::FImage srcFlat;
104 throw std::runtime_error(
"could not retrieve flatfield image for preview generation");
106 if (e->image8->width()) {
107 srcFlat.resize(e->image8->size());
109 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> >()),
111 }
else if (e->image16->width()) {
112 srcFlat.resize(e->image16->size());
114 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt16> >()),
117 srcFlat.resize(e->imageFloat->size());
119 vigra::RGBToGrayAccessor<vigra::RGBValue<float> >()),
127 DEBUG_DEBUG(
"srcPanoImg size: " << srcPanoImg.getSize() <<
" pano roi:" << outROI);
129 if (e->imageFloat->width()) {
139 }
else if (e->image16->width()) {
170 for(std::map<unsigned int, MRemappedImage*>::iterator it =
m_images.begin();
182 DEBUG_DEBUG(
"Remove " << imgNr <<
" from remapped cache");
PanoramaOptions::ProjectionFormat getProjection() const
virtual MRemappedImage * getRemapped(const PanoramaData &pano, const PanoramaOptions &opts, unsigned int imgNr, vigra::Rect2D outputROI, AppBase::ProgressDisplay *progress)
create a remapped pano image.
std::map< unsigned, MRemappedImage * > m_images
virtual ~SmallRemappedImageCache()
void remapImage(SrcImgType &srcImg, const MaskImgType &srcAlpha, const FlatImgType &srcFlat, const SrcPanoImage &src, const PanoramaOptions &dest, vigra::Rect2D outputRect, RemappedPanoImage< DestImgType, MaskImgType > &remapped, AppBase::ProgressDisplay *progress)
remap a single image
vigra::Rect2D estimateOutputROI(const PanoramaData &pano, const PanoramaOptions &opts, unsigned i, const double maxLength)
unsigned int getHeight() const
get panorama height
bool set_contains(const _Container &c, const typename _Container::key_type &key)
static ImageCache & getInstance()
get the global ImageCache object
std::map< unsigned, SrcPanoImage > m_imagesParam
std::shared_ptr< Entry > EntryPtr
a shared pointer to the entry
void resize(const vigra::Size2D &size, VariableMap *potentialLinkedVars)
"resize" image, adjusts all distortion coefficients for usage with a source image of size size potent...
vigra::ImageImportInfo::ICCProfile m_ICCProfile
void setMessage(const std::string &message, const std::string &filename="")
sets the message to given string
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
EntryPtr getSmallImage(const std::string &filename)
get an small image.
vigra::pair< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImage(ROIImage< Image, Alpha > &img)
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
void softFlush()
a soft version of flush.
Nona::RemappedPanoImage< vigra::FRGBImage, vigra::BImage > MRemappedImage
unsigned int getWidth() const
const std::vector< double > & getProjectionParameters() const
Get the optional projection parameters.
std::map< unsigned, PanoramaOptions > m_panoOpts
vigra::pair< typename ROIImage< Image, Alpha >::mask_const_traverser, typename ROIImage< Image, Alpha >::MaskConstAccessor > srcMask(const ROIImage< Image, Alpha > &img)
void copyImage(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc)
void invalidate()
invalidates all images
virtual SrcPanoImage getSrcImage(unsigned imgNr) const =0
get a complete description of a source image
All variables of a source image.
struct to hold a image state for stitching
double outputExposureValue