fix build break

This commit is contained in:
Mark Mine 2003-02-06 21:37:45 +00:00
parent a8be1f883b
commit 2633a4af43
3 changed files with 26 additions and 26 deletions

View File

@ -27,7 +27,7 @@
// This is the focal-length constant for fisheye lenses. See
// stitchFisheyeLens.h.
static const double k = 60.0;
static const double cylindrical_k = 60.0;
StitchCylindricalLens::
StitchCylindricalLens() {
@ -39,7 +39,7 @@ get_focal_length(double width_mm) const {
return _focal_length;
}
if (_flags & F_fov) {
return width_mm * k / _fov;
return width_mm * cylindrical_k / _fov;
}
return 0.0;
}
@ -50,7 +50,7 @@ get_hfov(double width_mm) const {
return _fov;
}
if (_flags & F_focal_length) {
return width_mm * k / _focal_length;
return width_mm * cylindrical_k / _focal_length;
}
return 0.0;
}
@ -66,8 +66,8 @@ extrude(const LPoint2d &point_mm, double width_mm) const {
LVector2d v2 = point_mm;
double fl = get_focal_length(width_mm);
return LVector3d(sin(deg_2_rad(v2[0] * k / fl)) * fl,
cos(deg_2_rad(v2[0] * k / fl)) * fl,
return LVector3d(sin(deg_2_rad(v2[0] * cylindrical_k / fl)) * fl,
cos(deg_2_rad(v2[0] * cylindrical_k / fl)) * fl,
v2[1]);
}
@ -88,7 +88,7 @@ project(const LVector3d &vec, double width_mm) const {
// The x position is the angle about the Z axis.
double x =
rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / k;
rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / cylindrical_k;
// The y position is the Z height divided by the perspective
// distance.
@ -107,7 +107,7 @@ project_left(const LVector3d &vec, double width_mm) const {
LVector2d xy(v3[0], v3[1]);
double x =
(rad_2_deg(atan2(-xy[0], -xy[1])) - 180.0) *
get_focal_length(width_mm) / k;
get_focal_length(width_mm) / cylindrical_k;
double y = v3[2] / length(xy) * get_focal_length(width_mm);
return LPoint2d(x, y);
@ -123,7 +123,7 @@ project_right(const LVector3d &vec, double width_mm) const {
LVector2d xy(v3[0], v3[1]);
double x =
(rad_2_deg(atan2(-xy[0], -xy[1])) + 180.0) *
get_focal_length(width_mm) / k;
get_focal_length(width_mm) / cylindrical_k;
double y = v3[2] / length(xy) * get_focal_length(width_mm);
return LPoint2d(x, y);

View File

@ -39,7 +39,7 @@
// for 35mm film. Don't know how well this extends to other lenses
// and other negative sizes.
static const double k = 60.0;
static const double fisheye_k = 60.0;
StitchFisheyeLens::
StitchFisheyeLens() {
@ -51,7 +51,7 @@ get_focal_length(double width_mm) const {
return _focal_length;
}
if (_flags & F_fov) {
return width_mm * k / _fov;
return width_mm * fisheye_k / _fov;
}
return 0.0;
}
@ -62,7 +62,7 @@ get_hfov(double width_mm) const {
return _fov;
}
if (_flags & F_focal_length) {
return width_mm * k / _focal_length;
return width_mm * fisheye_k / _focal_length;
}
return 0.0;
}
@ -85,7 +85,7 @@ extrude(const LPoint2d &point_mm, double width_mm) const {
v2 /= r;
// Now get the point r units around the circle in the YZ plane.
double dist = r * k / get_focal_length(width_mm);
double dist = r * fisheye_k / get_focal_length(width_mm);
LVector3d p(0.0, cos(deg_2_rad(dist)), sin(deg_2_rad(dist)));
// And rotate this point around the Y axis.
@ -128,7 +128,7 @@ project(const LVector3d &vec, double width_mm) const {
// along the great circle to the point.
double r = 90.0 - rad_2_deg(atan2(x[0], x[1]));
return y * (r * get_focal_length(width_mm) / k);
return y * (r * get_focal_length(width_mm) / fisheye_k);
}
void StitchFisheyeLens::
@ -200,9 +200,9 @@ pick_up_singularity(TriangleRasterizer &rast,
// from forward.
double outer_mm =
(180 * get_focal_length(width_mm) / k);
(180 * get_focal_length(width_mm) / fisheye_k);
double inner_mm =
((180 - _singularity_tolerance * 2) * get_focal_length(width_mm) / k);
((180 - _singularity_tolerance * 2) * get_focal_length(width_mm) / fisheye_k);
int xsize = rast._output->get_x_size();
int ysize = rast._output->get_y_size();

View File

@ -29,7 +29,7 @@
// This is the focal-length constant for fisheye lenses. See
// stitchFisheyeLens.h.
static const double k = 60.0;
static const double psphere_k = 60.0;
StitchPSphereLens::
StitchPSphereLens() {
@ -41,7 +41,7 @@ get_focal_length(double width_mm) const {
return _focal_length;
}
if (_flags & F_fov) {
return width_mm * k / _fov;
return width_mm * psphere_k / _fov;
}
return 0.0;
}
@ -52,7 +52,7 @@ get_hfov(double width_mm) const {
return _fov;
}
if (_flags & F_focal_length) {
return width_mm * k / _focal_length;
return width_mm * psphere_k / _focal_length;
}
return 0.0;
}
@ -63,8 +63,8 @@ extrude(const LPoint2d &point_mm, double width_mm) const {
double fl = get_focal_length(width_mm);
return LVector3d::forward() *
LMatrix3d::rotate_mat(v2[1] * k / fl, LVector3d::right()) *
LMatrix3d::rotate_mat(-v2[0] * k / fl, LVector3d::up());
LMatrix3d::rotate_mat(v2[1] * psphere_k / fl, LVector3d::right()) *
LMatrix3d::rotate_mat(-v2[0] * psphere_k / fl, LVector3d::up());
}
@ -83,14 +83,14 @@ project(const LVector3d &vec, double width_mm) const {
// The x position is the angle about the Z axis.
double x =
rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / k;
rad_2_deg(atan2(xy[0], xy[1])) * get_focal_length(width_mm) / psphere_k;
// Unroll the Z angle, and the y position is the angle about the X
// axis.
xy = normalize(xy);
LVector2d yz(v3[0]*xy[0] + v3[1]*xy[1], v3[2]);
double y =
rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / k;
rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / psphere_k;
return LPoint2d(x, y);
}
@ -105,12 +105,12 @@ project_left(const LVector3d &vec, double width_mm) const {
LVector2d xy(v3[0], v3[1]);
double x =
(rad_2_deg(atan2(-xy[0], -xy[1])) - 180.0) *
get_focal_length(width_mm) / k;
get_focal_length(width_mm) / psphere_k;
xy = normalize(xy);
LVector2d yz(v3[0]*xy[0] + v3[1]*xy[1], v3[2]);
double y =
rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / k;
rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / psphere_k;
return LPoint2d(x, y);
}
@ -125,12 +125,12 @@ project_right(const LVector3d &vec, double width_mm) const {
LVector2d xy(v3[0], v3[1]);
double x =
(rad_2_deg(atan2(-xy[0], -xy[1])) + 180.0) *
get_focal_length(width_mm) / k;
get_focal_length(width_mm) / psphere_k;
xy = normalize(xy);
LVector2d yz(v3[0]*xy[0] + v3[1]*xy[1], v3[2]);
double y =
rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / k;
rad_2_deg(atan2(yz[1], yz[0])) * get_focal_length(width_mm) / psphere_k;
return LPoint2d(x, y);
}