The spica renderer
perspective.h
1 #ifdef _MSC_VER
2 #pragma once
3 #endif
4 
5 #ifndef _SPICA_PERSPECTIVE_CAMERA_H_
6 #define _SPICA_PERSPECTIVE_CAMERA_H_
7 
8 #include "core/cobject.h"
9 #include "core/vector3d.h"
10 #include "core/camera.h"
11 
12 namespace spica {
13 
17 class SPICA_EXPORTS PerspectiveCamera : public Camera {
18 public:
19  // Public methods
22  PerspectiveCamera(const Transform& cameraToWorld,
23  const Bounds2d& screen, double lensRadius,
24  double focalLength, double fov,
25  std::shared_ptr<Film> film);
26 
27  PerspectiveCamera(const PerspectiveCamera&) = default;
28  ~PerspectiveCamera() = default;
29 
30  PerspectiveCamera& operator=(const PerspectiveCamera&) = default;
31 
32  Ray spawnRay(const Point2i& pixel, const Point2d& randFilm,
33  const Point2d& randLens, double* pdfPos = nullptr,
34  double* pdfDir = nullptr) const override;
35 
36  Spectrum We(const Ray& ray, Point2d* pRaster = nullptr) const override;
37  void pdfWe(const Ray& ray, double* pdfPos, double* pdfDir) const override;
38  Spectrum sampleWi(const Interaction& ref, const Point2d& rand,
39  Vector3d* wi, double* pdf, Point2d* pRaster,
40  VisibilityTester* vis) const override;
41 
42 private:
43  // Private fields
44  Vector3d uCamera_, vCamera_;
45  double areaWorld_;
46 
47 }; // class OrthographicCamera
48 
49 SPICA_EXPORT_PLUGIN(PerspectiveCamera, "Perspective camera");
50 
51 } // namespace spica
52 
53 #endif // _SPICA_PERSPECTIVE_CAMERA_H_
RGB spectrum.
Definition: spectrum.h:18
Ray class.
Definition: ray.h:24
Perspective camera.
Definition: perspective.h:17
The transformation operator class.
Definition: transform.h:17
Definition: renderparams.h:27
Definition: bounds2d.h:16
Definition: visibility_tester.h:15
Definition: camera.h:16
Definition: interaction.h:23