Hugintrunk
0.1
|
An abstract base class for objects that calculate an approximate remap specified by quadrilatrials. More...
#include <MeshRemapper.h>
Classes | |
class | ArrayCoords |
A class for exchanging coordinates by value. More... | |
class | Coords |
A class for exchanging pointers to coordinates. More... | |
Public Member Functions | |
MeshRemapper (HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state) | |
virtual | ~MeshRemapper () |
virtual void | UpdateAndResetIndex () |
virtual bool | GetNextFaceCoordinates (Coords *result)=0 |
Get the texture and vertex coordinates for the next face. More... | |
Protected Member Functions | |
void | SetCrop () |
Fill the crop values of the MeshRemapper from the source image. More... | |
void | ClipFace (Coords *face) |
Crop a face to the source image, return true if there is anything left. More... | |
bool | GiveClipFaceResult (Coords *result) |
Get a face that was produced by ClipFace. More... | |
Protected Attributes | |
VisualizationState * | visualization_state |
HuginBase::Panorama * | m_pano |
HuginBase::SrcPanoImage * | image |
float | scale |
The number number of units between vertex coorinates that gives a pixel in the display. More... | |
double | height |
The sizes of the input images in pixels. More... | |
double | width |
HuginBase::PTools::Transform | transform |
A transform to use to remap the images. More... | |
HuginBase::SrcPanoImage::CropMode | crop_mode |
Crop mode of the source image. More... | |
double | crop_x1 |
double | crop_x2 |
double | crop_y1 |
double | crop_y2 |
double | circle_crop_centre_x |
double | circle_crop_centre_y |
double | circle_crop_radius_x |
double | circle_crop_radius_y |
bool | circle_crop |
Private Attributes | |
std::vector < MeshRemapper::ArrayCoords > | face_list |
List for results when clipping faces. More... | |
An abstract base class for objects that calculate an approximate remap specified by quadrilatrials.
Each quadrilatrial has vertex coordinates and texture coordinates. The texture coordinates specify for each vertex a point on the image to be mapped to that vertex location, where the range 0 to 1 in either direction is the entirity of the image. The vertex locations are the coordinates in the output in pixels. (They are scaled down to fit in the preview).
A MeshManager then converts the faces specifed into a format sutible for the whatever graphics system is being used to draw them.
Definition at line 43 of file MeshRemapper.h.
MeshRemapper::MeshRemapper | ( | HuginBase::Panorama * | m_pano, |
HuginBase::SrcPanoImage * | image, | ||
VisualizationState * | visualization_state | ||
) |
Definition at line 32 of file MeshRemapper.cpp.
References image, m_pano, and visualization_state.
|
virtual |
Definition at line 41 of file MeshRemapper.cpp.
|
protected |
Crop a face to the source image, return true if there is anything left.
SetCrop() must have been called beforehand with up to date information.
Definition at line 308 of file MeshRemapper.cpp.
References circle_crop, circle_crop_centre_x, circle_crop_centre_y, circle_crop_radius_x, circle_crop_radius_y, A_Polygon::Clip(), A_Polygon::ConvertToQuads(), crop_x1, crop_x2, crop_y1, crop_y2, face_list, M_PI, and MeshRemapper::Coords::tex_c.
Referenced by TexCoordRemapper::GetNextFaceCoordinates(), and VertexCoordRemapper::GetNextFaceCoordinates().
|
pure virtual |
Get the texture and vertex coordinates for the next face.
The coordinates are ordered [left / right][top / bottom][x coord / y coord].
Implemented in VertexCoordRemapper, TexCoordRemapper, ChoosyRemapper, and LayoutRemapper.
Referenced by ChoosyRemapper::GetNextFaceCoordinates().
|
protected |
Get a face that was produced by ClipFace.
result | Place to copy the face to. The pointers in result must be valid. |
Definition at line 356 of file MeshRemapper.cpp.
References face_list, MeshRemapper::Coords::tex_c, and MeshRemapper::Coords::vertex_c.
Referenced by TexCoordRemapper::GetNextFaceCoordinates(), and VertexCoordRemapper::GetNextFaceCoordinates().
|
protected |
Fill the crop values of the MeshRemapper from the source image.
Definition at line 61 of file MeshRemapper.cpp.
References circle_crop, circle_crop_centre_x, circle_crop_centre_y, circle_crop_radius_x, circle_crop_radius_y, HuginBase::BaseSrcPanoImage::CROP_CIRCLE, crop_mode, crop_x1, crop_x2, crop_y1, crop_y2, height, image, and width.
Referenced by TexCoordRemapper::UpdateAndResetIndex(), and VertexCoordRemapper::UpdateAndResetIndex().
|
virtual |
Reimplemented in VertexCoordRemapper, TexCoordRemapper, ChoosyRemapper, and LayoutRemapper.
Definition at line 45 of file MeshRemapper.cpp.
References VisualizationState::GetScale(), height, image, scale, visualization_state, and width.
Referenced by ChoosyRemapper::UpdateAndResetIndex(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 103 of file MeshRemapper.h.
Referenced by ClipFace(), VertexCoordRemapper::GetNextFaceCoordinates(), and SetCrop().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), and SetCrop().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), and SetCrop().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), and SetCrop().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), and SetCrop().
|
protected |
Crop mode of the source image.
Definition at line 99 of file MeshRemapper.h.
Referenced by SetCrop().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), TexCoordRemapper::GetNextFaceCoordinates(), SetCrop(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), TexCoordRemapper::GetNextFaceCoordinates(), SetCrop(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), TexCoordRemapper::GetNextFaceCoordinates(), SetCrop(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 100 of file MeshRemapper.h.
Referenced by ClipFace(), TexCoordRemapper::GetNextFaceCoordinates(), SetCrop(), and VertexCoordRemapper::UpdateAndResetIndex().
|
private |
List for results when clipping faces.
Definition at line 118 of file MeshRemapper.h.
Referenced by ClipFace(), and GiveClipFaceResult().
|
protected |
The sizes of the input images in pixels.
Children should use this to scale their texture coordinates since the Tranform uses image pixels rather than scaling each image to the range 0 to 1.
Definition at line 94 of file MeshRemapper.h.
Referenced by TexCoordRemapper::GetNextFaceCoordinates(), VertexCoordRemapper::GetNextFaceCoordinates(), VertexCoordRemapper::RecursiveUpdate(), SetCrop(), TexCoordRemapper::SetSize(), ChoosyRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), and UpdateAndResetIndex().
|
protected |
Definition at line 85 of file MeshRemapper.h.
Referenced by TexCoordRemapper::GetNextFaceCoordinates(), VertexCoordRemapper::GetNextFaceCoordinates(), MeshRemapper(), SetCrop(), TexCoordRemapper::SetSize(), LayoutRemapper::UpdateAndResetIndex(), ChoosyRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), UpdateAndResetIndex(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 84 of file MeshRemapper.h.
Referenced by MeshRemapper(), and ChoosyRemapper::UpdateAndResetIndex().
|
protected |
The number number of units between vertex coorinates that gives a pixel in the display.
Definition at line 89 of file MeshRemapper.h.
Referenced by TexCoordRemapper::SetSize(), VertexCoordRemapper::TestSubdivide(), and UpdateAndResetIndex().
|
protected |
A transform to use to remap the images.
Definition at line 96 of file MeshRemapper.h.
Referenced by VertexCoordRemapper::RecursiveUpdate(), LayoutRemapper::UpdateAndResetIndex(), ChoosyRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 83 of file MeshRemapper.h.
Referenced by VertexCoordRemapper::DiscontinuityFlip(), MeshRemapper(), TexCoordRemapper::SetSize(), VertexCoordRemapper::TestSubdivide(), LayoutRemapper::UpdateAndResetIndex(), ChoosyRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), UpdateAndResetIndex(), and VertexCoordRemapper::UpdateAndResetIndex().
|
protected |
Definition at line 94 of file MeshRemapper.h.
Referenced by TexCoordRemapper::GetNextFaceCoordinates(), VertexCoordRemapper::GetNextFaceCoordinates(), VertexCoordRemapper::RecursiveUpdate(), SetCrop(), TexCoordRemapper::SetSize(), ChoosyRemapper::UpdateAndResetIndex(), TexCoordRemapper::UpdateAndResetIndex(), and UpdateAndResetIndex().