00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "camera.h"
00025
00026 namespace lux
00027 {
00028
00029 struct Lens {
00030 Lens(const bool ent, const float n, const float ap,
00031 boost::shared_ptr<Shape> shape)
00032 : entering(ent), eta(n), aperture(ap), shape(shape) {}
00033 bool entering;
00034 float eta;
00035 float aperture;
00036 boost::shared_ptr<Shape> shape;
00037 };
00038
00039 class RealisticCamera : public Camera {
00040 public:
00041 RealisticCamera(const Transform &world2cam, const float Screen[4],
00042 float hither, float yon, float sopen,
00043 float sclose, float filmdistance, float aperture_diameter, string specfile,
00044 float filmdiag, Film *film);
00045 ~RealisticCamera(void);
00046 float GenerateRay(const Sample &sample, Ray *) const;
00047
00048 static Camera *CreateCamera(const ParamSet ¶ms, const Transform &world2cam, Film *film);
00049
00050 private:
00051 float ParseLensData(const string& specfile);
00052
00053 float filmDistance, filmDist2, filmDiag;
00054 float apertureDiameter, distToBack, backAperture;
00055
00056 vector<boost::shared_ptr<Lens> > lenses;
00057
00058 Transform RasterToFilm, RasterToCamera, FilmToCamera;
00059 };
00060
00061 }
00062