35 if (e->imageFloat->size().area() > 0)
41 vigra::RGBToGrayAccessor<vigra::RGBValue<float> >
ga;
42 vigra::FindAverageAndVariance<float>
mean;
43 vigra::inspectImage(srcImageRange(*(e->imageFloat),
ga),
mean);
45 vigra::BRGBImage
mappedImg(e->imageFloat->size());
57 return wxImage(img->width(), img->height(), (
unsigned char *)img->data(),
true);
72 double iRatio = img.GetWidth() / (
double)img.GetHeight();
75 sz = control->GetContainingSizer()->GetSize();
91 if (std::max(img.GetWidth(), img.GetHeight()) > (
ULONG_MAX >> 16))
103 vigra::ImageImportInfo::ICCProfile iccProfile;
113 scaledBitmap.SetScaleFactor(control->GetDPIScaleFactor());
115 control->GetParent()->Layout();
142 if (
event.entry.get())
144 ImageCache::getInstance().postEvent(
event.request,
event.entry);
149 ImageCache::getInstance().removeRequest(
event.request);
153 wxTheApp->GetTopWindow()->GetEventHandler()->AddPendingEvent(e);
164 wxTheApp->GetTopWindow()->GetEventHandler()->AddPendingEvent(
event);
172 unsigned long mem_high = wxConfigBase::Get()->Read(
"/ImageCache/UpperBoundHigh", 0l);
static ImageCache & getInstance()
get the global ImageCache object
std::shared_ptr< Request > RequestPtr
Reference counted request for an image to load.
std::shared_ptr< Entry > EntryPtr
a shared pointer to the entry
void SetUpperLimit(const unsigned long long newUpperLimit)
sets the upper limit, which is used by softFlush()
void relayImageLoaded(ImageReadyEvent &event)
Relay image loaded event when the UI thread is ready to process it.
static void imageLoadedAsync(HuginBase::ImageCache::RequestPtr request, HuginBase::ImageCache::EntryPtr entry)
Queue up an image loaded event when an image has just loaded.
Event for when a requested image finished loading.
virtual wxEvent * Clone() const
HuginBase::ImageCache::EntryPtr entry
HuginBase::ImageCache::RequestPtr request
ImageReadyEvent(HuginBase::ImageCache::RequestPtr request, HuginBase::ImageCache::EntryPtr entry)
#define HUGIN_IMGCACHE_UPPERBOUND
#define HUGIN_IMGCACHE_MAPPING_FLOAT
void CorrectImage(wxImage &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsHPROFILE &monitorProfile)
apply color correction to given image using input iccProfile and monitor profile
void applyMapping(vigra::triple< SrcIterator, SrcIterator, SrcAccessor > img, vigra::pair< DestIterator, DestAccessor > dest, T min, T max, int mapping)
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.
functions to manage ROI's
wxImage imageCacheEntry2wxImage(ImageCache::EntryPtr e)
void UpdateImageCacheSize()
update the image cache size from the settings in wxConfig
wxDEFINE_EVENT(EVT_IMAGE_READY, ImageReadyEvent)
void GeneratePreviewSelectedFile(wxStaticBitmap *control, ImageCache::EntryPtr cacheEntry, const bool hasMonitorProfile, const cmsHPROFILE &monitorProfile)
load given image from image cache and display in wxStaticBitmap control
HuginBase::ImageCache::ImageCacheRGB8Ptr ImageCacheRGB8Ptr
WXIMPEX void UpdateImageCacheSize()
update the image cache size from the settings in wxConfig