142 for (
unsigned short int v = 0;
v < 4;
v++)
145 unsigned short int x = (
v == 2 ||
v==3) ? 1 : 0,
146 y = (
v == 1 ||
v==2) ? 1 : 0;
147 for (
unsigned short int a = 0; a < 2; a++)
162 return verts[
v].tex_c[0] * l[0] +
verts[
v].tex_c[1] * l[1] + l[2] > 0;
167 const double cl[3])
const
177 dy =
v2->tex_c[1] -
v1->tex_c[1];
192 double t = (-
cl[0] *
v1->tex_c[0] -
cl[1] *
v1->tex_c[1] -
cl[2]) /
193 (
cl[0] * dx +
cl[1] * dy),
195 x = dx *
t +
v1->tex_c[0],
196 y = dy *
t +
v1->tex_c[1],
200 xc =
v1->vertex_c[0] *
td1 +
v2->vertex_c[0] *
t,
201 yc =
v1->vertex_c[1] *
td1 +
v2->vertex_c[1] *
t;
250 std::vector<MeshRemapper::ArrayCoords> result;
270 for (
unsigned short int c = 0; c < 2; c++)
273 quad.tex_c [0][0][c] =
verts[ 0 ].tex_c [c];
274 quad.vertex_c[0][1][c] =
verts[
i - 1].vertex_c[c];
275 quad.tex_c [0][1][c] =
verts[
i - 1].tex_c [c];
276 quad.vertex_c[1][1][c] =
verts[
i ].vertex_c[c];
278 quad.vertex_c[1][0][c] =
verts[
i + 1].vertex_c[c];
279 quad.tex_c [1][0][c] =
verts[
i + 1].tex_c [c];
281 result.push_back(
quad);
288 for (
unsigned short int c = 0; c < 2; c++)
291 quad.tex_c [0][0][c] =
verts[ 0 ].tex_c [c];
292 quad.vertex_c[0][1][c] =
verts[
i - 1].vertex_c[c];
293 quad.tex_c [0][1][c] =
verts[
i - 1].tex_c [c];
294 quad.vertex_c[1][1][c] =
verts[
i ].vertex_c[c];
296 quad.vertex_c[1][0][c] =
verts[
i ].vertex_c[c];
299 result.push_back(
quad);
362 for (
unsigned short int x = 0; x < 2; x++)
364 for (
unsigned short int y = 0; y < 2; y++)
366 for (
unsigned short int c = 0; c < 2; c++)
bool Inside(const unsigned int vertex, const double clip_line[3]) const
std::vector< Vertex > verts
A_Polygon Clip(const double clip_line[3])
Vertex Intersect(const unsigned int v1, const unsigned int v2, const double clip_line[3]) const
std::vector< MeshRemapper::ArrayCoords > ConvertToQuads()
All variables of a source image.
A class for exchanging coordinates by value.
A class for exchanging pointers to coordinates.
double(* vertex_c)[2][2]
The coordinate in the panorama, in its pixel space.
double(* tex_c)[2][2]
The coordinate in the source image ranging from 0 to 1.
double circle_crop_radius_y
HuginBase::SrcPanoImage::CropMode crop_mode
Crop mode of the source image.
HuginBase::SrcPanoImage * image
void ClipFace(Coords *face)
Crop a face to the source image, return true if there is anything left.
bool GiveClipFaceResult(Coords *result)
Get a face that was produced by ClipFace.
double height
The sizes of the input images in pixels.
float scale
The number number of units between vertex coorinates that gives a pixel in the display.
MeshRemapper(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state)
double circle_crop_centre_y
double circle_crop_radius_x
virtual void UpdateAndResetIndex()
std::vector< MeshRemapper::ArrayCoords > face_list
List for results when clipping faces.
VisualizationState * visualization_state
double circle_crop_centre_x
void SetCrop()
Fill the crop values of the MeshRemapper from the source image.
HuginBase::Panorama * m_pano
include file for the hugin project
include file for the hugin project
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.