JWS C++ Library
C++ language utility library
|
Camera for 3D viewing in OpenGL. More...
#include <camera.h>
Public Member Functions | |
Camera_d (double focal_pt_x, double focal_pt_y, double focal_pt_z, double ref_pt_x, double ref_pt_y, double ref_pt_z, double up_x, double up_y, double up_z, double aperture, double clip_near, double clip_far) throw (jwscxx::base::Arg_error) | |
Constructs a Camera_d. | |
Camera_d (const jwsc::Vector_d *focal_pt, const jwsc::Vector_d *ref_pt, const jwsc::Vector_d *up, double aperture, double clip_near, double clip_far) throw (jwscxx::base::Arg_error) | |
Constructs a Camera_d. | |
Camera_d (const Camera_d &c) | |
Constructs a camera by copying another. | |
Camera_d (const char *fname) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) | |
Reads a camera from an input file. | |
Camera_d (std::istream &in) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) | |
Reads a camera from an input stream. | |
virtual | ~Camera_d () |
Deletes this Camera_d. | |
virtual Camera_d & | operator= (const Camera_d &c) |
Copies a camera into this one. | |
virtual Camera_d * | clone () const |
Clones this camera. | |
const jwsc::Vector_d * | get_u () const |
Returns a constant pointer to the camera right (x) vector. | |
const jwsc::Vector_d * | get_v () const |
Returns a constant pointer to the camera up (y) vector. | |
const jwsc::Vector_d * | get_n () const |
Returns a constant pointer to the camera -view (z) vector. | |
const jwsc::Vector_d * | get_prp () const |
Returns a constant pointer to the camera focal point. | |
const jwsc::Vector_d * | get_vrp () const |
Returns a constant pointer to the camera reference point. | |
double | get_clipping_near () const |
Returns the distance to the near clipping plane. | |
double | get_clipping_far () const |
Returns the distance to the far clipping plane. | |
double | get_focal_length () const |
Returns the focal length. | |
double | get_aperture () const |
Returns the aperature. | |
double | get_half_focal_height () const |
Returns half the height of the image plane at the focal length. | |
virtual void | set_f_with_new_aperture_using_prp (double f) throw (jwscxx::base::Arg_error) |
Sets the focal length and updates the aperture by changing the left and right prp. | |
virtual void | set_f_with_same_aperture_using_prp (double f) throw (jwscxx::base::Arg_error) |
Sets the focal length using the same aperture by changing the left and right prp. | |
virtual void | set_f_with_new_aperture_using_vrp (double f) throw (jwscxx::base::Arg_error) |
Sets the focal length and updates the aperture by changing the vrp. | |
virtual void | set_f_with_same_aperture_using_vrp (double f) throw (jwscxx::base::Arg_error) |
Sets the focal length using the same aperture by changing the vrp. | |
virtual void | set_aperture (double aperture) throw (jwscxx::base::Arg_error) |
Sets the vertical aperture. | |
virtual void | set_clipping (double clip_near, double clip_far) throw (jwscxx::base::Arg_error) |
Sets the clipping planes. | |
virtual void | rotate (double angle, double x, double y, double z) throw (jwscxx::base::Arg_error) |
Rotates this Camera_d around a vector. | |
virtual void | rotate (double angle, const jwsc::Vector_d *r) throw (jwscxx::base::Arg_error) |
Rotates this Camera_d around a vector. | |
virtual void | translate (double x, double y, double z) |
Translates this Camera_d. | |
virtual void | translate (const jwsc::Vector_d *t) throw (jwscxx::base::Arg_error) |
Translates this Camera_d. | |
virtual void | look_at (double focal_pt_x, double focal_pt_y, double focal_pt_z, double ref_pt_x, double ref_pt_y, double ref_pt_z, double up_x, double up_y, double up_z) throw (jwscxx::base::Arg_error) |
Sets the position, direction and focal length of the camera. | |
void | look_at (const jwsc::Vector_d *focal_pt, const jwsc::Vector_d *ref_pt, const jwsc::Vector_d *up) throw (jwscxx::base::Arg_error) |
Sets the position, direction and focal length of the camera. | |
virtual void | set_gl_modelview () const |
Sets the GL model view matrix with this Camera_d. | |
virtual void | set_gl_projection () const |
Sets the GL projection matrix with this Camera_d. | |
void | get_image_pt_on_focal_plane (jwsc::Vector_d **pt_out, double x, double y) |
Calculates the R^3 world coordinates of a point on the camera focal plane. | |
void | get_image_pt_on_focal_plane (jwsc::Vector_d **pt_out, const jwsc::Vector_d *pt_in) throw (jwscxx::base::Arg_error) |
Calculates the R^3 world coordinates of a point on the camera focal plane. | |
void | get_image_pt_on_near_clipping_plane (jwsc::Vector_d **pt_out, double x, double y) |
Calculates the R^3 world coordinates of a point on the near camera clipping plane. | |
void | get_image_pt_on_near_clipping_plane (jwsc::Vector_d **pt_out, const jwsc::Vector_d *pt_in) throw (jwscxx::base::Arg_error) |
Calculates the R^3 world coordinates of a point on the near camera clipping plane. | |
void | get_image_pt_on_far_clipping_plane (jwsc::Vector_d **pt_out, double x, double y) |
Calculates the R^3 world coordinates of a point on the far camera clipping plane. | |
void | get_image_pt_on_far_clipping_plane (jwsc::Vector_d **pt_out, const jwsc::Vector_d *pt_in) throw (jwscxx::base::Arg_error) |
Calculates the R^3 world coordinates of a point on the far camera clipping plane. | |
virtual void | read (std::istream &in) throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) |
Reads this camera from an input stream. | |
virtual void | write (std::ostream &out) const throw (jwscxx::base::IO_error) |
Writes this camera to an output stream. | |
Static Public Member Functions | |
static double | get_gl_viewport_aspect () |
Returns the aspect ration of width to height for the GL viewport. | |
static double | get_gl_viewport_width () |
Returns the viewport width in the GL. | |
static double | get_gl_viewport_height () |
Returns the viewport height in the GL. | |
static void | capture_gl_view (jwsc::Image_f **img_out) |
Captures an image from the GL view (image) plane. | |
static void | capture_gl_view (const char *fname) throw (jwscxx::base::IO_error) |
Captures an image from the GL view (image) plane. | |
static void | capture_gl_view (const char *fname_base, uint32_t N) throw (jwscxx::base::IO_error) |
Captures an image from the GL view (image) plane. | |
Protected Attributes | |
jwsc::Vector_d * | vrp |
View reference point (center of the view-plane). | |
jwsc::Vector_d * | prp |
Projection reference point (center of the camera). | |
jwsc::Vector_d * | u |
View-right vector; x-axis of the view coordinates. | |
jwsc::Vector_d * | v |
View-up vector; y-axis of the view coordinates. | |
jwsc::Vector_d * | n |
View-plane normal; z-axis of the view coordinates. | |
double | aperture |
Vertical aperture in degrees. | |
double | focal_length |
Focal length along the view-plane normal from the vrp. | |
double | half_focal_height |
Half of the height of the view plane at the focal length. | |
double | half_near_height |
Half of the height of the near clipping plane. | |
double | near |
Near clipping plane in the GL frustum. | |
double | far |
Far clipping plane in the GL frustum. | |
jwsc::Matrix_d * | R_phi |
Rotation matrix around the z-axis with angle phi. | |
jwsc::Matrix_d * | R_theta |
Rotation matrix around the x-axis with angle theta. | |
jwsc::Matrix_d * | R_psi |
Rotation matrix around the z-axis with angle psi. | |
jwsc::Matrix_d * | R |
Combined psi * theta * phi * theta^T * psi^T matrix. |
Camera for 3D viewing in OpenGL.
Uses double precision, floating point values.
Camera_d::Camera_d | ( | double | focal_pt_x, |
double | focal_pt_y, | ||
double | focal_pt_z, | ||
double | ref_pt_x, | ||
double | ref_pt_y, | ||
double | ref_pt_z, | ||
double | up_x, | ||
double | up_y, | ||
double | up_z, | ||
double | aperture, | ||
double | clip_near, | ||
double | clip_far | ||
) | throw (jwscxx::base::Arg_error) |
Constructs a Camera_d.
focal_pt_x | X-coord of the focal point. |
focal_pt_y | Y-coord of the focal point. |
focal_pt_z | Z-coord of the focal point. |
ref_pt_x | X-coord of the reference point. |
ref_pt_y | Y-coord of the reference point. |
ref_pt_z | Z-coord of the reference point. |
up_x | X-coord of the up vector. |
up_y | Y-coord of the up vector. |
up_z | Z-coord of the up vector. |
aperture | Angle, in degrees, of the vertical field of view. |
clip_near | Near clipping plane for the GL frustum. Must be >= 0. |
clip_far | Far clipping plane for the GL frustum. Must be >= 0. |
jwscxx::base::Arg_error | Invalid up vector, aperture, or clipping planes. |
Definition at line 1432 of file camera.cpp.
Camera_d::Camera_d | ( | const jwsc::Vector_d * | focal_pt, |
const jwsc::Vector_d * | ref_pt, | ||
const jwsc::Vector_d * | up, | ||
double | aperture, | ||
double | clip_near, | ||
double | clip_far | ||
) | throw (jwscxx::base::Arg_error) |
Constructs a Camera_d.
focal_pt | Focal point. |
ref_pt | Reference point. |
up | Up vector. |
aperture | Angle, in degrees, of the vertical field of view. |
clip_near | Near clipping plane for the GL frustum. Must be >= 0. |
clip_far | Far clipping plane for the GL frustum. Must be >= 0. |
jwscxx::base::Arg_error | Invalid up vector, aperture, or clipping planes. |
Definition at line 1491 of file camera.cpp.
Camera_d::Camera_d | ( | const Camera_d & | c | ) |
Constructs a camera by copying another.
c | Camera to copy into this one. |
Definition at line 1532 of file camera.cpp.
Camera_d::Camera_d | ( | const char * | fname | ) | throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) |
Reads a camera from an input file.
The file format is expected to be in ASCII as follows
Type: type_info name VRP: x y z PRP: x y z U: x y z V: x y z N: x y z F: focal_length Aperture: aperture Near: near Far: far
fname | Input file to read this camera from. |
jwscxx::base::IO_error | Could not read from in. |
jwscxx::base::Arg_error | Invalid arguments in file to read from. |
Definition at line 1569 of file camera.cpp.
Camera_d::Camera_d | ( | std::istream & | in | ) | throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) |
Reads a camera from an input stream.
The file format is expected to be in ASCII as follows
Type: type_info name VRP: x y z PRP: x y z U: x y z V: x y z N: x y z F: focal_length Aperture: aperture Near: near Far: far
in | Input stream to read this camera from. |
jwscxx::base::IO_error | Could not read from in. |
jwscxx::base::Arg_error | Invalid arguments in file to read from. |
Definition at line 1607 of file camera.cpp.
Camera_d::~Camera_d | ( | ) | [virtual] |
Deletes this Camera_d.
Definition at line 1624 of file camera.cpp.
Copies a camera into this one.
Performs a deep copy of this camera.
c | Camera to copy into this one. |
Definition at line 1645 of file camera.cpp.
Camera_d * Camera_d::clone | ( | ) | const [virtual] |
Clones this camera.
Implements jwscxx::base::Cloneable.
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1670 of file camera.cpp.
const jwsc::Vector_d * Camera_d::get_u | ( | ) | const |
Returns a constant pointer to the camera right (x) vector.
Definition at line 1676 of file camera.cpp.
const jwsc::Vector_d * Camera_d::get_v | ( | ) | const |
Returns a constant pointer to the camera up (y) vector.
Definition at line 1682 of file camera.cpp.
const jwsc::Vector_d * Camera_d::get_n | ( | ) | const |
Returns a constant pointer to the camera -view (z) vector.
Definition at line 1691 of file camera.cpp.
const jwsc::Vector_d * Camera_d::get_prp | ( | ) | const |
Returns a constant pointer to the camera focal point.
Definition at line 1697 of file camera.cpp.
const jwsc::Vector_d * Camera_d::get_vrp | ( | ) | const |
Returns a constant pointer to the camera reference point.
Definition at line 1703 of file camera.cpp.
double Camera_d::get_clipping_near | ( | ) | const |
Returns the distance to the near clipping plane.
Definition at line 1709 of file camera.cpp.
double Camera_d::get_clipping_far | ( | ) | const |
Returns the distance to the far clipping plane.
Definition at line 1715 of file camera.cpp.
double Camera_d::get_focal_length | ( | ) | const |
Returns the focal length.
Definition at line 1721 of file camera.cpp.
double Camera_d::get_aperture | ( | ) | const |
Returns the aperature.
Definition at line 1727 of file camera.cpp.
double Camera_d::get_half_focal_height | ( | ) | const |
Returns half the height of the image plane at the focal length.
Definition at line 1734 of file camera.cpp.
void Camera_d::set_f_with_new_aperture_using_prp | ( | double | f | ) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the focal length and updates the aperture by changing the left and right prp.
In order to keep the size of the view the same, computes a new aperture from the new focal length.
f | New focal length. |
jwscxx::base::Arg_error | Invalid focal length. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1767 of file camera.cpp.
void Camera_d::set_f_with_same_aperture_using_prp | ( | double | f | ) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the focal length using the same aperture by changing the left and right prp.
The aperture is not changed, instead the size of the image plane is changed.
f | New focal length. |
jwscxx::base::Arg_error | Invalid focal length. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1794 of file camera.cpp.
void Camera_d::set_f_with_new_aperture_using_vrp | ( | double | f | ) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the focal length and updates the aperture by changing the vrp.
The aperture is updated to make the image plane the same size with the new focal length.
f | New focal length. |
jwscxx::base::Arg_error | Invalid focal length. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1819 of file camera.cpp.
void Camera_d::set_f_with_same_aperture_using_vrp | ( | double | f | ) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the focal length using the same aperture by changing the vrp.
The aperture is not changed, instead the size of the image plane is changed.
f | New focal length. |
jwscxx::base::Arg_error | Invalid focal length. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1846 of file camera.cpp.
void Camera_d::set_aperture | ( | double | aperture | ) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the vertical aperture.
aperture | New vertical aperture, in degrees. |
jwscxx::base::Arg_error | Angle must be >= 0. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1745 of file camera.cpp.
void Camera_d::set_clipping | ( | double | clip_near, |
double | clip_far | ||
) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the clipping planes.
clip_near | Near clipping plane for the GL frustum. Must be >= 0. |
clip_far | Far clipping plane for the GL frustum. Must be >= 0. |
jwscxx::base::Arg_error | Invalid clipping planes. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1869 of file camera.cpp.
void Camera_d::rotate | ( | double | phi, |
double | x, | ||
double | y, | ||
double | z | ||
) | throw (jwscxx::base::Arg_error) [virtual] |
Rotates this Camera_d around a vector.
phi | Angle to rotate, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
x | X-coord of the vector to rotate around. |
y | Y-coord of the vector to rotate around. |
z | Z-coord of the vector to rotate around. |
jwscxx::base::Arg_error | Invalid vector to rotate around. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1892 of file camera.cpp.
void Camera_d::rotate | ( | double | phi, |
const jwsc::Vector_d * | r | ||
) | throw (jwscxx::base::Arg_error) [virtual] |
Rotates this Camera_d around a vector.
phi | Angle to rotate, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
r | Vector to rotate around. |
jwscxx::base::Arg_error | Invalid vector to rotate around. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1973 of file camera.cpp.
void Camera_d::translate | ( | double | x, |
double | y, | ||
double | z | ||
) | [virtual] |
Translates this Camera_d.
x | X-coord of the vector to translate by. |
y | Y-coord of the vector to translate by. |
z | Z-coord of the vector to translate by. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 1989 of file camera.cpp.
void Camera_d::translate | ( | const jwsc::Vector_d * | t | ) | throw (jwscxx::base::Arg_error) [virtual] |
Translates this Camera_d.
t | Vector to translate by. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 2000 of file camera.cpp.
void Camera_d::look_at | ( | double | focal_pt_x, |
double | focal_pt_y, | ||
double | focal_pt_z, | ||
double | ref_pt_x, | ||
double | ref_pt_y, | ||
double | ref_pt_z, | ||
double | up_x, | ||
double | up_y, | ||
double | up_z | ||
) | throw (jwscxx::base::Arg_error) [virtual] |
Sets the position, direction and focal length of the camera.
focal_pt_x | X-coord of the focal point. |
focal_pt_y | Y-coord of the focal point. |
focal_pt_z | Z-coord of the focal point. |
ref_pt_x | X-coord of the reference point. |
ref_pt_y | Y-coord of the reference point. |
ref_pt_z | Z-coord of the reference point. |
up_x | X-coord of the up vector. |
up_y | Y-coord of the up vector. |
up_z | Z-coord of the up vector. |
jwscxx::base::Arg_error | Invalid arguments. |
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 2026 of file camera.cpp.
void Camera_d::look_at | ( | const jwsc::Vector_d * | focal_pt, |
const jwsc::Vector_d * | ref_pt, | ||
const jwsc::Vector_d * | up | ||
) | throw (jwscxx::base::Arg_error) |
Sets the position, direction and focal length of the camera.
focal_pt | Focal point. |
ref_pt | Reference point. |
up | Up vector. |
jwscxx::base::Arg_error | Invalid arguments. |
Definition at line 2100 of file camera.cpp.
void Camera_d::set_gl_modelview | ( | ) | const [virtual] |
Sets the GL model view matrix with this Camera_d.
Switches the GL matrix mode to GL_MODELVIEW, loads the identity matrix, and multiplies the camera rotation and translation matrices.
Definition at line 2124 of file camera.cpp.
void Camera_d::set_gl_projection | ( | ) | const [virtual] |
Sets the GL projection matrix with this Camera_d.
Switches the GL matrix mode to GL_PROJECTION, loads the identity matrix, and sets the perspective frustum.
Definition at line 2146 of file camera.cpp.
void Camera_d::get_image_pt_on_focal_plane | ( | jwsc::Vector_d ** | pt_out, |
double | x, | ||
double | y | ||
) |
Calculates the R^3 world coordinates of a point on the camera focal plane.
The center of the image is (u,v) = (0,0), where increasing u is up and increasing v is to the right.
When the function returns, *pt_out is an R^3 vector representing the point (u,v) on the camera focal plane in world coordinates.
pt_out | Result parameter. If *pt_out == 0, then a vector is allocated; otherwise, its space is re-used. |
x | X-coordinate of the point on the image plane. |
y | Y-coordinate of the point on the image plane. |
Definition at line 2175 of file camera.cpp.
void Camera_d::get_image_pt_on_focal_plane | ( | jwsc::Vector_d ** | pt_out, |
const jwsc::Vector_d * | pt_in | ||
) | throw (jwscxx::base::Arg_error) |
Calculates the R^3 world coordinates of a point on the camera focal plane.
The center of the image is (u,v) = (0,0), where increasing u is up and increasing v is to the right.
When the function returns, *pt_out is an R^3 vector representing the point (u,v) on the camera focal plane in world coordinates.
pt_out | Result parameter. If *pt_out == 0, then a vector is allocated; otherwise, its space is re-used. |
pt_in | Point on the image plane. |
jwscxx::base::Arg_error | pt_in is not an R^2 vector. |
Definition at line 2225 of file camera.cpp.
void Camera_d::get_image_pt_on_near_clipping_plane | ( | jwsc::Vector_d ** | pt_out, |
double | x, | ||
double | y | ||
) |
Calculates the R^3 world coordinates of a point on the near camera clipping plane.
The center of the image is (u,v) = (0,0), where increasing u is up and increasing v is to the right.
When the function returns, *pt_out is an R^3 vector representing the point (u,v) projected onto the near camera clipping plane in world coordinates.
pt_out | Result parameter. If *pt_out == 0, then a vector is allocated; otherwise, its space is re-used. |
x | X-coordinate of the point on the image plane. |
y | Y-coordinate of the point on the image plane. |
Definition at line 2254 of file camera.cpp.
void Camera_d::get_image_pt_on_near_clipping_plane | ( | jwsc::Vector_d ** | pt_out, |
const jwsc::Vector_d * | pt_in | ||
) | throw (jwscxx::base::Arg_error) |
Calculates the R^3 world coordinates of a point on the near camera clipping plane.
The center of the image is (u,v) = (0,0), where increasing u is up and increasing v is to the right.
When the function returns, *pt_out is an R^3 vector representing the point (u,v) projected onto the near camera clipping plane in world coordinates.
pt_out | Result parameter. If *pt_out == 0, then a vector is allocated; otherwise, its space is re-used. |
pt_in | Point on the image plane. |
jwscxx::base::Arg_error | pt_in is not an R^2 vector. |
Definition at line 2305 of file camera.cpp.
void Camera_d::get_image_pt_on_far_clipping_plane | ( | jwsc::Vector_d ** | pt_out, |
double | x, | ||
double | y | ||
) |
Calculates the R^3 world coordinates of a point on the far camera clipping plane.
The center of the image is (u,v) = (0,0), where increasing u is up and increasing v is to the right.
When the function returns, *pt_out is an R^3 vector representing the point (u,v) projected onto the far camera clipping plane in world coordinates.
pt_out | Result parameter. If *pt_out == 0, then a vector is allocated; otherwise, its space is re-used. |
x | X-coordinate of the point on the image plane. |
y | Y-coordinate of the point on the image plane. |
Definition at line 2334 of file camera.cpp.
void Camera_d::get_image_pt_on_far_clipping_plane | ( | jwsc::Vector_d ** | pt_out, |
const jwsc::Vector_d * | pt_in | ||
) | throw (jwscxx::base::Arg_error) |
Calculates the R^3 world coordinates of a point on the far camera clipping plane.
The center of the image is (u,v) = (0,0), where increasing u is up and increasing v is to the right.
When the function returns, *pt_out is an R^3 vector representing the point (u,v) projected onto the far camera clipping plane in world coordinates.
pt_out | Result parameter. If *pt_out == 0, then a vector is allocated; otherwise, its space is re-used. |
pt_in | Point on the image plane. |
jwscxx::base::Arg_error | pt_in is not an R^2 vector. |
Definition at line 2386 of file camera.cpp.
double Camera_d::get_gl_viewport_aspect | ( | ) | [static] |
Returns the aspect ration of width to height for the GL viewport.
Definition at line 2402 of file camera.cpp.
double Camera_d::get_gl_viewport_width | ( | ) | [static] |
Returns the viewport width in the GL.
Definition at line 2412 of file camera.cpp.
double Camera_d::get_gl_viewport_height | ( | ) | [static] |
Returns the viewport height in the GL.
Definition at line 2422 of file camera.cpp.
void Camera_d::capture_gl_view | ( | jwsc::Image_f ** | img_out | ) | [static] |
Captures an image from the GL view (image) plane.
img_out | Result parameter. If *img_out is 0, an image is allocated; otherwise its space is re-used. |
jwscxx::base::IO_error |
Definition at line 2437 of file camera.cpp.
void Camera_d::capture_gl_view | ( | const char * | fname | ) | throw (jwscxx::base::IO_error) [static] |
Captures an image from the GL view (image) plane.
fname | File name to write the captured view image to. |
jwscxx::base::IO_error |
Definition at line 2473 of file camera.cpp.
void Camera_d::capture_gl_view | ( | const char * | fname_fmt, |
uint32_t | N | ||
) | throw (jwscxx::base::IO_error) [static] |
Captures an image from the GL view (image) plane.
An example for fname_fmt is
image-%04d.tiff
fname_fmt | Format for the file name with one printf style integer conversion for the file number. |
N | Number of the captured image. |
jwscxx::base::IO_error |
Definition at line 2501 of file camera.cpp.
void Camera_d::read | ( | std::istream & | in | ) | throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) [virtual] |
Reads this camera from an input stream.
The file format is expected to be in ASCII as follows
Type: type_info name VRP: x y z PRP: x y z U: x y z V: x y z N: x y z F: focal_length Aperture: aperture Near: near Far: far
in | Input stream to read this camera from. |
jwscxx::base::IO_error | Could not read from in. |
jwscxx::base::Arg_error | Invalid arguments in the file to read from. |
Implements jwscxx::base::Readable.
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 2533 of file camera.cpp.
void Camera_d::write | ( | std::ostream & | out | ) | const throw (jwscxx::base::IO_error) [virtual] |
Writes this camera to an output stream.
The file format is in ASCII as follows
Type: type_info name VRP: x y z PRP: x y z U: x y z V: x y z N: x y z F: focal_length Aperture: aperture Near: near Far: far
out | Output stream to write this camera to. |
jwscxx::base::IO_error | Could not write to out. |
Implements jwscxx::base::Writeable.
Reimplemented in jwscxx::graphics::Stereo_camera_d.
Definition at line 2717 of file camera.cpp.
jwsc::Vector_d* jwscxx::graphics::Camera_d::vrp [protected] |
jwsc::Vector_d* jwscxx::graphics::Camera_d::prp [protected] |
jwsc::Vector_d* jwscxx::graphics::Camera_d::u [protected] |
jwsc::Vector_d* jwscxx::graphics::Camera_d::v [protected] |
jwsc::Vector_d* jwscxx::graphics::Camera_d::n [protected] |
double jwscxx::graphics::Camera_d::aperture [protected] |
double jwscxx::graphics::Camera_d::focal_length [protected] |
double jwscxx::graphics::Camera_d::half_focal_height [protected] |
double jwscxx::graphics::Camera_d::half_near_height [protected] |
double jwscxx::graphics::Camera_d::near [protected] |
double jwscxx::graphics::Camera_d::far [protected] |
jwsc::Matrix_d* jwscxx::graphics::Camera_d::R_phi [protected] |
jwsc::Matrix_d* jwscxx::graphics::Camera_d::R_theta [protected] |
jwsc::Matrix_d* jwscxx::graphics::Camera_d::R_psi [protected] |
jwsc::Matrix_d* jwscxx::graphics::Camera_d::R [protected] |