Hugintrunk
0.1
|
A preview panel that renders the pictures using the panotools library. More...
#include <PreviewPanel.h>
Public Types | |
enum | BlendMode { BLEND_COPY, BLEND_DIFFERENCE } |
Public Member Functions | |
PreviewPanel () | |
ctor. More... | |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel") |
void | Init (PreviewFrame *parent, HuginBase::Panorama *pano) |
virtual | ~PreviewPanel () |
dtor. More... | |
void | panoramaChanged (HuginBase::Panorama &pano) |
Notification about a Panorama change. More... | |
void | panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr) |
notifies about changes to images More... | |
void | SetAutoUpdate (bool enabled) |
void | ForceUpdate () |
void | SetBlendMode (BlendMode b) |
![]() | |
virtual | ~PanoramaObserver () |
Private Types | |
typedef HuginBase::Nona::RemappedPanoImage < vigra::BRGBImage, vigra::BImage > | RemappedImage |
Private Member Functions | |
void | DrawPreview (wxDC &dc) |
void | updatePreview () |
void | mapPreviewImage (unsigned int imgNr) |
void | OnResize (wxSizeEvent &e) |
recalculate panorama to fit the panel More... | |
void | OnPaint (wxPaintEvent &event) |
void | OnMouse (wxMouseEvent &e) |
void | mousePressRMBEvent (wxMouseEvent &e) |
void | mousePressLMBEvent (wxMouseEvent &e) |
void | OnUpdatePreview (wxCommandEvent &e) |
void | DrawOutline (const std::vector< hugin_utils::FDiff2D > &points, wxDC &dc, int offX, int offY) |
void | mouse2erect (int xm, int ym, double &xd, double &yd) |
Private Attributes | |
HuginBase::Panorama * | pano |
the model More... | |
bool | m_autoPreview |
vigra::Diff2D | m_panoImgSize |
wxBitmap * | m_panoBitmap |
HuginBase::UIntSet | m_dirtyImgs |
HuginBase::PanoramaOptions | opts |
HuginBase::PTools::Transform * | m_pano2erect |
SmallRemappedImageCache | m_remapCache |
BlendMode | m_blendMode |
PreviewFrame * | parentWindow |
wxCursor * | m_cursor |
bool | m_state_rendering |
bool | m_rerender |
bool | m_imgsDirty |
A preview panel that renders the pictures using the panotools library.
Lets hope this works out fine..
Definition at line 40 of file PreviewPanel.h.
|
private |
Definition at line 42 of file PreviewPanel.h.
Enumerator | |
---|---|
BLEND_COPY | |
BLEND_DIFFERENCE |
Definition at line 69 of file PreviewPanel.h.
PreviewPanel::PreviewPanel | ( | ) |
ctor.
Definition at line 49 of file PreviewPanel.cpp.
|
virtual |
dtor.
Definition at line 95 of file PreviewPanel.cpp.
References DEBUG_TRACE, m_cursor, m_pano2erect, m_panoBitmap, pano, and HuginBase::Panorama::removeObserver().
bool PreviewPanel::Create | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxTAB_TRAVERSAL , |
||
const wxString & | name = "panel" |
||
) |
Definition at line 57 of file PreviewPanel.cpp.
References DEBUG_DEBUG, DEBUG_TRACE, huginApp::Get(), huginApp::GetXRCPath(), m_cursor, m_state_rendering, mousePressLMBEvent(), mousePressRMBEvent(), OnMouse(), OnPaint(), and OnResize().
Referenced by PreviewFrame::PreviewFrame().
|
private |
Definition at line 702 of file PreviewPanel.cpp.
References m_panoImgSize, and hugin_utils::roundi().
|
private |
Definition at line 460 of file PreviewPanel.cpp.
References DEBUG_DEBUG, DEBUG_TRACE, HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getROI(), HuginBase::PanoramaOptions::getSize(), vigra_ext::EMoR::h, m_panoBitmap, m_panoImgSize, celeste::min(), and pano.
Referenced by OnPaint().
void PreviewPanel::ForceUpdate | ( | ) |
Definition at line 175 of file PreviewPanel.cpp.
References updatePreview().
Referenced by mousePressLMBEvent(), mousePressRMBEvent(), PreviewFrame::OnAutoPreviewToggle(), PreviewFrame::OnFullScreen(), OnResize(), PreviewFrame::OnUpdate(), panoramaChanged(), and PreviewFrame::updatePano().
void PreviewPanel::Init | ( | PreviewFrame * | parent, |
HuginBase::Panorama * | pano | ||
) |
Definition at line 87 of file PreviewPanel.cpp.
References HuginBase::Panorama::addObserver(), pano, and parentWindow.
Referenced by PreviewFrame::PreviewFrame().
|
private |
|
private |
Definition at line 684 of file PreviewPanel.cpp.
References m_pano2erect, m_panoImgSize, and HuginBase::PTools::Transform::transform().
Referenced by mousePressLMBEvent(), mousePressRMBEvent(), and OnMouse().
|
private |
Definition at line 619 of file PreviewPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), DEBUG_DEBUG, DEG_TO_RAD, ForceUpdate(), PanoCommand::GlobalCmdHist::getInstance(), Matrix3::GetRotationPT(), m_autoPreview, mouse2erect(), pano, RAD_TO_DEG, and Matrix3::SetRotationPT().
Referenced by Create().
|
private |
Definition at line 647 of file PreviewPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), DEBUG_DEBUG, DEG_TO_RAD, ForceUpdate(), PanoCommand::GlobalCmdHist::getInstance(), m_autoPreview, mouse2erect(), pano, and RAD_TO_DEG.
Referenced by Create().
|
private |
Definition at line 675 of file PreviewPanel.cpp.
References mouse2erect(), and parentWindow.
Referenced by Create().
|
private |
|
private |
recalculate panorama to fit the panel
Definition at line 606 of file PreviewPanel.cpp.
References DEBUG_TRACE, ForceUpdate(), HuginBase::SmallRemappedImageCache::invalidate(), m_autoPreview, m_panoImgSize, and m_remapCache.
Referenced by Create().
|
private |
|
virtual |
Notification about a Panorama change.
This function will always be called, even when the change could be handled by panoramaImageAdded() or other notify functions.
This allows lazy observers to just listen to panoramaChanged().
Implements HuginBase::PanoramaObserver.
Definition at line 109 of file PreviewPanel.cpp.
References DEBUG_DEBUG, ForceUpdate(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::PanoramaOptions::getVFOV(), HuginBase::SmallRemappedImageCache::invalidate(), m_autoPreview, m_imgsDirty, m_remapCache, opts, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::outputRangeCompression, and updatePreview().
|
virtual |
notifies about changes to images
Images might have been added/removed. to find out how many images are still there, use Panorama::getNrOfImages.
pano | the panorama object that changed |
changed | set of changed images |
Implements HuginBase::PanoramaObserver.
Definition at line 163 of file PreviewPanel.cpp.
References DEBUG_TRACE, and m_imgsDirty.
void PreviewPanel::SetAutoUpdate | ( | bool | enabled | ) |
Definition at line 180 of file PreviewPanel.cpp.
References m_autoPreview, and updatePreview().
Referenced by PreviewFrame::OnAutoPreviewToggle(), and PreviewFrame::PreviewFrame().
void PreviewPanel::SetBlendMode | ( | BlendMode | b | ) |
Definition at line 169 of file PreviewPanel.cpp.
References m_blendMode, and updatePreview().
Referenced by PreviewFrame::OnBlendChoice(), and PreviewFrame::PreviewFrame().
|
private |
Definition at line 229 of file PreviewPanel.cpp.
References vigra_ext::applyMapping(), BLEND_COPY, BLEND_DIFFERENCE, HuginBase::Color::CorrectImage(), vigra_ext::EMoR::createEMoRLUT(), vigra_ext::createGammaLUT(), HuginBase::PTools::Transform::createTransform(), DEBUG_DEBUG, DEBUG_ERROR, DEBUG_INFO, DEBUG_TRACE, vigra_ext::destImage(), vigra_ext::destImageRange(), HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, huginApp::Get(), HuginBase::Panorama::getActiveImages(), HuginBase::PanoramaOptions::getHeight(), HuginBase::Color::detail::GetMonitorProfile(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getSize(), HuginBase::Panorama::getSrcImage(), HuginBase::PanoramaOptions::getWidth(), huginApp::HasMonitorProfile(), HUGIN_IMGCACHE_MAPPING_FLOAT, hugin_utils::HuginMessageBox(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::iccProfile, HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::iccProfile, vigra_ext::INTERP_BILINEAR, HuginBase::PanoramaOptions::interpolator, m_blendMode, m_pano2erect, m_panoBitmap, m_panoImgSize, m_remapCache, m_rerender, m_state_rendering, celeste::max(), celeste::min(), opts, HuginBase::PanoramaOptions::OUTPUT_HDR, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::outputMode, HuginBase::PanoramaOptions::outputRangeCompression, pano, parentWindow, vigra_ext::pow(), HuginBase::PanoramaOptions::remapUsingGPU, HuginBase::BaseSrcPanoImage::RESPONSE_EMOR, HuginBase::BaseSrcPanoImage::RESPONSE_GAMMA, HuginBase::BaseSrcPanoImage::RESPONSE_LINEAR, hugin_utils::round(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setROI(), HuginBase::SrcPanoImage::setSize(), HuginBase::PanoramaOptions::setWidth(), vigra_ext::srcImage(), vigra_ext::srcImageRange(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch(), and vigra::omp::transformImage().
Referenced by ForceUpdate(), panoramaChanged(), SetAutoUpdate(), and SetBlendMode().
|
private |
Definition at line 98 of file PreviewPanel.h.
Referenced by mousePressLMBEvent(), mousePressRMBEvent(), OnResize(), panoramaChanged(), and SetAutoUpdate().
|
private |
Definition at line 116 of file PreviewPanel.h.
Referenced by SetBlendMode(), and updatePreview().
|
private |
Definition at line 119 of file PreviewPanel.h.
Referenced by Create(), and ~PreviewPanel().
|
private |
Definition at line 105 of file PreviewPanel.h.
|
private |
Definition at line 123 of file PreviewPanel.h.
Referenced by panoramaChanged(), and panoramaImagesChanged().
|
private |
Definition at line 111 of file PreviewPanel.h.
Referenced by mouse2erect(), updatePreview(), and ~PreviewPanel().
|
private |
Definition at line 102 of file PreviewPanel.h.
Referenced by DrawPreview(), updatePreview(), and ~PreviewPanel().
|
private |
Definition at line 100 of file PreviewPanel.h.
Referenced by DrawOutline(), DrawPreview(), mouse2erect(), OnResize(), and updatePreview().
|
private |
Definition at line 114 of file PreviewPanel.h.
Referenced by OnResize(), panoramaChanged(), and updatePreview().
|
private |
Definition at line 122 of file PreviewPanel.h.
Referenced by updatePreview().
|
private |
Definition at line 121 of file PreviewPanel.h.
Referenced by Create(), and updatePreview().
|
private |
Definition at line 108 of file PreviewPanel.h.
Referenced by panoramaChanged(), and updatePreview().
|
private |
the model
Definition at line 96 of file PreviewPanel.h.
Referenced by DrawPreview(), Init(), mousePressLMBEvent(), mousePressRMBEvent(), updatePreview(), and ~PreviewPanel().
|
private |
Definition at line 118 of file PreviewPanel.h.
Referenced by Init(), OnMouse(), and updatePreview().