JWS C++ Library
C++ language utility library
|
Camera for 3D viewing in OpenGL. More...
#include <camera.h>
Public Member Functions | |
Camera_f (float focal_pt_x, float focal_pt_y, float focal_pt_z, float ref_pt_x, float ref_pt_y, float ref_pt_z, float up_x, float up_y, float up_z, float aperture, float clip_near, float clip_far) throw (jwscxx::base::Arg_error) | |
Constructs a Camera_f. | |
Camera_f (const jwsc::Vector_f *focal_pt, const jwsc::Vector_f *ref_pt, const jwsc::Vector_f *up, float aperture, float clip_near, float clip_far) throw (jwscxx::base::Arg_error) | |
Constructs a Camera_f. | |
Camera_f (const Camera_f &c) | |
Constructs a camera by copying another. | |
Camera_f (const char *fname) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) | |
Reads a camera from an input file. | |
Camera_f (std::istream &in) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error) | |
Reads a camera from an input stream. | |
virtual | ~Camera_f () |
Deletes this Camera_f. | |
virtual Camera_f & | operator= (const Camera_f &c) |
Copies a camera into this one. | |
virtual Camera_f * | clone () const |
Clones this camera. | |
const jwsc::Vector_f * | get_u () const |
Returns a constant pointer to the camera right (x) vector. | |
const jwsc::Vector_f * | get_v () const |
Returns a constant pointer to the camera up (y) vector. | |
const jwsc::Vector_f * | get_n () const |
Returns a constant pointer to the camera -view (z) vector. | |
const jwsc::Vector_f * | get_prp () const |
Returns a constant pointer to the camera focal point. | |
const jwsc::Vector_f * | get_vrp () const |
Returns a constant pointer to the camera reference point. | |
float | get_clipping_near () const |
Returns the distance to the near clipping plane. | |
float | get_clipping_far () const |
Returns the distance to the far clipping plane. | |
float | get_focal_length () const |
Returns the focal length. | |
float | get_aperture () const |
Returns the aperature. | |
float | 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 (float 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 (float 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 (float 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 (float f) throw (jwscxx::base::Arg_error) |
Sets the focal length using the same aperture by changing the vrp. | |
virtual void | set_aperture (float aperture) throw (jwscxx::base::Arg_error) |
Sets the vertical aperture. | |
virtual void | set_clipping (float clip_near, float clip_far) throw (jwscxx::base::Arg_error) |
Sets the clipping planes. | |
virtual void | rotate (float angle, float x, float y, float z) throw (jwscxx::base::Arg_error) |
Rotates this Camera_f around a vector. | |
virtual void | rotate (float angle, const jwsc::Vector_f *r) throw (jwscxx::base::Arg_error) |
Rotates this Camera_f around a vector. | |
virtual void | translate (float x, float y, float z) |
Translates this Camera_f. | |
virtual void | translate (const jwsc::Vector_f *t) throw (jwscxx::base::Arg_error) |
Translates this Camera_f. | |
virtual void | look_at (float focal_pt_x, float focal_pt_y, float focal_pt_z, float ref_pt_x, float ref_pt_y, float ref_pt_z, float up_x, float up_y, float up_z) throw (jwscxx::base::Arg_error) |
Sets the position, direction and focal length of the camera. | |
void | look_at (const jwsc::Vector_f *focal_pt, const jwsc::Vector_f *ref_pt, const jwsc::Vector_f *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_f. | |
virtual void | set_gl_projection () const |
Sets the GL projection matrix with this Camera_f. | |
void | get_image_pt_on_focal_plane (jwsc::Vector_f **pt_out, float x, float y) |
Calculates the R^3 world coordinates of a point on the camera focal plane. | |
void | get_image_pt_on_focal_plane (jwsc::Vector_f **pt_out, const jwsc::Vector_f *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_f **pt_out, float x, float 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_f **pt_out, const jwsc::Vector_f *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_f **pt_out, float x, float 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_f **pt_out, const jwsc::Vector_f *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 float | get_gl_viewport_aspect () |
Returns the aspect ration of width to height for the GL viewport. | |
static float | get_gl_viewport_width () |
Returns the viewport width in the GL. | |
static float | 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_f * | vrp |
View reference point (center of the view-plane). | |
jwsc::Vector_f * | prp |
Projection reference point (center of the camera). | |
jwsc::Vector_f * | u |
View-right vector; x-axis of the view coordinates. | |
jwsc::Vector_f * | v |
View-up vector; y-axis of the view coordinates. | |
jwsc::Vector_f * | n |
View-plane normal; z-axis of the view coordinates. | |
float | aperture |
Vertical aperture in degrees. | |
float | focal_length |
Focal length along the view-plane normal from the vrp. | |
float | half_focal_height |
Half of the height of the view plane at the focal length. | |
float | half_near_height |
Half of the height of the near clipping plane. | |
float | near |
Near clipping plane in the GL frustum. | |
float | far |
Far clipping plane in the GL frustum. | |
jwsc::Matrix_f * | R_phi |
Rotation matrix around the z-axis with angle phi. | |
jwsc::Matrix_f * | R_theta |
Rotation matrix around the x-axis with angle theta. | |
jwsc::Matrix_f * | R_psi |
Rotation matrix around the z-axis with angle psi. | |
jwsc::Matrix_f * | R |
Combined psi * theta * phi * theta^T * psi^T matrix. |
Camera for 3D viewing in OpenGL.
Uses single precision, floating point values.
Camera_f::Camera_f | ( | float | focal_pt_x, |
float | focal_pt_y, | ||
float | focal_pt_z, | ||
float | ref_pt_x, | ||
float | ref_pt_y, | ||
float | ref_pt_z, | ||
float | up_x, | ||
float | up_y, | ||
float | up_z, | ||
float | aperture, | ||
float | clip_near, | ||
float | clip_far | ||
) | throw (jwscxx::base::Arg_error) |
Constructs a Camera_f.
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 105 of file camera.cpp.
Camera_f::Camera_f | ( | const jwsc::Vector_f * | focal_pt, |
const jwsc::Vector_f * | ref_pt, | ||
const jwsc::Vector_f * | up, | ||
float | aperture, | ||
float | clip_near, | ||
float | clip_far | ||
) | throw (jwscxx::base::Arg_error) |
Constructs a Camera_f.
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 164 of file camera.cpp.
Camera_f::Camera_f | ( | const Camera_f & | c | ) |
Constructs a camera by copying another.
c | Camera to copy into this one. |
Definition at line 205 of file camera.cpp.
Camera_f::Camera_f | ( | 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 242 of file camera.cpp.
Camera_f::Camera_f | ( | 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 280 of file camera.cpp.
Camera_f::~Camera_f | ( | ) | [virtual] |
Deletes this Camera_f.
Definition at line 297 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 318 of file camera.cpp.
Camera_f * Camera_f::clone | ( | ) | const [virtual] |
Clones this camera.
Implements jwscxx::base::Cloneable.
Reimplemented in jwscxx::graphics::Stereo_camera_f.
Definition at line 343 of file camera.cpp.
const jwsc::Vector_f * Camera_f::get_u | ( | ) | const |
Returns a constant pointer to the camera right (x) vector.
Definition at line 349 of file camera.cpp.
const jwsc::Vector_f * Camera_f::get_v | ( | ) | const |
Returns a constant pointer to the camera up (y) vector.
Definition at line 355 of file camera.cpp.
const jwsc::Vector_f * Camera_f::get_n | ( | ) | const |
Returns a constant pointer to the camera -view (z) vector.
Definition at line 364 of file camera.cpp.
const jwsc::Vector_f * Camera_f::get_prp | ( | ) | const |
Returns a constant pointer to the camera focal point.
Definition at line 370 of file camera.cpp.
const jwsc::Vector_f * Camera_f::get_vrp | ( | ) | const |
Returns a constant pointer to the camera reference point.
Definition at line 376 of file camera.cpp.
float Camera_f::get_clipping_near | ( | ) | const |
Returns the distance to the near clipping plane.
Definition at line 382 of file camera.cpp.
float Camera_f::get_clipping_far | ( | ) | const |
Returns the distance to the far clipping plane.
Definition at line 388 of file camera.cpp.
float Camera_f::get_focal_length | ( | ) | const |
Returns the focal length.
Definition at line 394 of file camera.cpp.
float Camera_f::get_aperture | ( | ) | const |
Returns the aperature.
Definition at line 400 of file camera.cpp.
float Camera_f::get_half_focal_height | ( | ) | const |
Returns half the height of the image plane at the focal length.
Definition at line 407 of file camera.cpp.
void Camera_f::set_f_with_new_aperture_using_prp | ( | float | 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_f.
Definition at line 440 of file camera.cpp.
void Camera_f::set_f_with_same_aperture_using_prp | ( | float | 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_f.
Definition at line 467 of file camera.cpp.
void Camera_f::set_f_with_new_aperture_using_vrp | ( | float | 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_f.
Definition at line 492 of file camera.cpp.
void Camera_f::set_f_with_same_aperture_using_vrp | ( | float | 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_f.
Definition at line 519 of file camera.cpp.
void Camera_f::set_aperture | ( | float | 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_f.
Definition at line 418 of file camera.cpp.
void Camera_f::set_clipping | ( | float | clip_near, |
float | 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_f.
Definition at line 542 of file camera.cpp.
void Camera_f::rotate | ( | float | phi, |
float | x, | ||
float | y, | ||
float | z | ||
) | throw (jwscxx::base::Arg_error) [virtual] |
Rotates this Camera_f 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_f.
Definition at line 565 of file camera.cpp.
void Camera_f::rotate | ( | float | phi, |
const jwsc::Vector_f * | r | ||
) | throw (jwscxx::base::Arg_error) [virtual] |
Rotates this Camera_f 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_f.
Definition at line 645 of file camera.cpp.
void Camera_f::translate | ( | float | x, |
float | y, | ||
float | z | ||
) | [virtual] |
Translates this Camera_f.
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_f.
Definition at line 661 of file camera.cpp.
void Camera_f::translate | ( | const jwsc::Vector_f * | t | ) | throw (jwscxx::base::Arg_error) [virtual] |
Translates this Camera_f.
t | Vector to translate by. |
Reimplemented in jwscxx::graphics::Stereo_camera_f.
Definition at line 672 of file camera.cpp.
void Camera_f::look_at | ( | float | focal_pt_x, |
float | focal_pt_y, | ||
float | focal_pt_z, | ||
float | ref_pt_x, | ||
float | ref_pt_y, | ||
float | ref_pt_z, | ||
float | up_x, | ||
float | up_y, | ||
float | 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_f.
Definition at line 698 of file camera.cpp.
void Camera_f::look_at | ( | const jwsc::Vector_f * | focal_pt, |
const jwsc::Vector_f * | ref_pt, | ||
const jwsc::Vector_f * | 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 772 of file camera.cpp.
void Camera_f::set_gl_modelview | ( | ) | const [virtual] |
Sets the GL model view matrix with this Camera_f.
Switches the GL matrix mode to GL_MODELVIEW, loads the identity matrix, and multiplies the camera rotation and translation matrices.
Definition at line 796 of file camera.cpp.
void Camera_f::set_gl_projection | ( | ) | const [virtual] |
Sets the GL projection matrix with this Camera_f.
Switches the GL matrix mode to GL_PROJECTION, loads the identity matrix, and sets the perspective frustum.
Definition at line 818 of file camera.cpp.
void Camera_f::get_image_pt_on_focal_plane | ( | jwsc::Vector_f ** | pt_out, |
float | x, | ||
float | 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 847 of file camera.cpp.
void Camera_f::get_image_pt_on_focal_plane | ( | jwsc::Vector_f ** | pt_out, |
const jwsc::Vector_f * | 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 897 of file camera.cpp.
void Camera_f::get_image_pt_on_near_clipping_plane | ( | jwsc::Vector_f ** | pt_out, |
float | x, | ||
float | 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 926 of file camera.cpp.
void Camera_f::get_image_pt_on_near_clipping_plane | ( | jwsc::Vector_f ** | pt_out, |
const jwsc::Vector_f * | 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 977 of file camera.cpp.
void Camera_f::get_image_pt_on_far_clipping_plane | ( | jwsc::Vector_f ** | pt_out, |
float | x, | ||
float | 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 1006 of file camera.cpp.
void Camera_f::get_image_pt_on_far_clipping_plane | ( | jwsc::Vector_f ** | pt_out, |
const jwsc::Vector_f * | 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 1058 of file camera.cpp.
float Camera_f::get_gl_viewport_aspect | ( | ) | [static] |
Returns the aspect ration of width to height for the GL viewport.
Definition at line 1074 of file camera.cpp.
float Camera_f::get_gl_viewport_width | ( | ) | [static] |
Returns the viewport width in the GL.
Definition at line 1084 of file camera.cpp.
float Camera_f::get_gl_viewport_height | ( | ) | [static] |
Returns the viewport height in the GL.
Definition at line 1094 of file camera.cpp.
void Camera_f::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 1109 of file camera.cpp.
void Camera_f::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 1145 of file camera.cpp.
void Camera_f::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 1173 of file camera.cpp.
void Camera_f::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_f.
Definition at line 1205 of file camera.cpp.
void Camera_f::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_f.
Definition at line 1389 of file camera.cpp.
jwsc::Vector_f* jwscxx::graphics::Camera_f::vrp [protected] |
jwsc::Vector_f* jwscxx::graphics::Camera_f::prp [protected] |
jwsc::Vector_f* jwscxx::graphics::Camera_f::u [protected] |
jwsc::Vector_f* jwscxx::graphics::Camera_f::v [protected] |
jwsc::Vector_f* jwscxx::graphics::Camera_f::n [protected] |
float jwscxx::graphics::Camera_f::aperture [protected] |
float jwscxx::graphics::Camera_f::focal_length [protected] |
float jwscxx::graphics::Camera_f::half_focal_height [protected] |
float jwscxx::graphics::Camera_f::half_near_height [protected] |
float jwscxx::graphics::Camera_f::near [protected] |
float jwscxx::graphics::Camera_f::far [protected] |
jwsc::Matrix_f* jwscxx::graphics::Camera_f::R_phi [protected] |
jwsc::Matrix_f* jwscxx::graphics::Camera_f::R_theta [protected] |
jwsc::Matrix_f* jwscxx::graphics::Camera_f::R_psi [protected] |
jwsc::Matrix_f* jwscxx::graphics::Camera_f::R [protected] |