Hugin trunk 0.1
Loading...
Searching...
No Matches
PreviewPanoMaskTool.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
22#ifdef _WIN32
23#include "wx/msw/wrapwin.h"
24#endif
25#include <wx/platform.h>
26#include "PreviewPanoMaskTool.h"
27#ifdef __WXMAC__
28#include <OpenGL/gl.h>
29#else
30#include <GL/gl.h>
31#endif
32
37
39{
40 // we draw to the sentcil buffer the desired shape, and enable the stencil
41 // test before the images are rendered. After they have all been drawn, we
42 // turn off stenciling so the other tools can draw of the complete area.
44}
45
49
51{
53 {
56 glColor3f(0.0, 0.0, 0.0);
57 {
58 // Under a sinusodial projection, we mask off the sides.
60 GetProjectionInfo();
61 double x, y;
63 for (double p = -90; p < 90; p += 1.0)
64 {
65 info->AngularToImage(x, y, -180.0, p);
66 glVertex2d(x, y); glVertex2d(0.0, y);
67 }
68 glEnd();
69 double width = helper->GetViewStatePtr()->GetOptions()->
70 getSize().width();
72 for (double p = -90; p < 90; p += 1.0)
73 {
74 info->AngularToImage(x, y, -180.0, p);
75 glVertex2d(width - x, y); glVertex2d(width, y);
76 }
77 glEnd();
78 }
80 glColor3f(1.0, 1.0, 1.0);
81 break;
83 // Under a albers equal area conic projection, we mask a circle
84 // segment with a hole in the middle. The dimensions and centre
85 // are depended on the projection parameters.
87 glColor3f(0.0, 0.0, 0.0);
90 glColor3f(1.0, 1.0, 1.0);
91 break;
92 default:
93 // most projections don't need any of this.
94 // Always pass the stencil test.
96 break;
97 }
98}
99
options getSize().area()) int wxCALLBACK SortFieldOfViewAscending(wxIntPtr item1
PanoramaOptions::ProjectionFormat getProjection() const
bool AngularToImage(double &image_x, double &image_y, double yaw, double pitch)
void BeforeDrawImagesEvent()
Draw using OpenGL anything the tool requires underneath the images.
void ReallyAfterDrawImagesEvent()
Draw (using OpenGL) the overlays, e.g. crop highlights, guides.
PreviewPanoMaskTool(PreviewToolHelper *helper)
void Activate()
Switch on a tool.
void DisableTexture(bool maskOnly=false)
void NotifyMe(Event event, Tool *tool)
ViewState * GetViewStatePtr()
@ REALLY_DRAW_OVER_IMAGES
Definition ToolHelper.h:83
ToolHelper * helper
The PreviewToolHelper that uses the same preview window and panorama as the tool should.
Definition Tool.h:109
HuginBase::PanoramaOptions * GetOptions()
TextureManager * GetTextureManager()
Definition ViewState.h:104
implementation of huginApp Class
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.
Definition threshold.h:41