Package scene.camera

Class Pixel<T>

java.lang.Object
scene.camera.Pixel<T>
Type Parameters:
T - The generic type T is the type of the data that each pixel knows about itself. This may be simply the center point of the pixel, it may be a collection of many points in the pixel, it may be a ray (or an array of rays) from some point to the pixel, or anything else.

public class Pixel<T>
extends java.lang.Object
This class represents a pixel in a PixelGrid. The pixel knows its position in the grid in terms of the row and column indices.
  • Field Summary

    Fields
    Modifier and Type Field Description
    int col
    The column index of the pixel in its PixelGrid.
    T data
    The data stored by each pixel.
    int row
    The row index of the pixel in its PixelGrid.
  • Constructor Summary

    Constructors
    Constructor Description
    Pixel​(T data, int row, int col)
    Construct a new Pixel with the given row and column indices storing some data about itself.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • data

      public final T data
      The data stored by each pixel. This may be the center point of the pixel for example, or a ray to the pixel.
    • row

      public final int row
      The row index of the pixel in its PixelGrid.
    • col

      public final int col
      The column index of the pixel in its PixelGrid.
  • Constructor Details

    • Pixel

      public Pixel​(T data, int row, int col)
      Construct a new Pixel with the given row and column indices storing some data about itself.
      Parameters:
      data - The data stored by the pixel.
      row - The row index of the pixel.
      col - The column index of the pixel.