org.sunflow.core

## Interface CameraLens

- All Superinterfaces:
    RenderObject
  All Known Implementing Classes:
    FisheyeLens, PinholeLens, SphericalLens, ThinLens

      public interface CameraLens
      extends RenderObject

  Represents a mapping from the 3D scene onto the final image. A camera lens is responsible for determining what ray to cast through each pixel.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Ray` | `getRay(float x, float y, int imageWidth, int imageHeight, double lensX, double lensY, double time)` Create a new `ray`to be cast through pixel (x,y) on the image plane.

    - ### Methods inherited from interface org.sunflow.core.RenderObject

      `update`

- - ### Method Detail

    - #### getRay

          Ray getRay(float x,
                     float y,
                     int imageWidth,
                     int imageHeight,
                     double lensX,
                     double lensY,
                     double time)

      Create a new `ray`to be cast through pixel (x,y) on the image plane. Two sampling parameters are provided for lens sampling. They are guarenteed to be in the interval [0,1). They can be used to perturb the position of the source of the ray on the lens of the camera for DOF effects. A third sampling parameter is provided for motion blur effects. Note that the `Camera` class already handles camera movement motion blur. Rays should be generated in camera space - that is, with the eye at the origin, looking down the -Z axis, with +Y pointing up.
      Parameters:
        `x` - x coordinate of the (sub)pixel
        `y` - y coordinate of the (sub)pixel
        `imageWidth` - image width in pixels
        `imageHeight` - image height in pixels
        `lensX` - x lens sampling parameter
        `lensY` - y lens sampling parameter
        `time` - time sampling parameter
      Returns:
        a new ray passing through the given pixel