PhotoGENius V1.0.0
A basic library for generating photorealistic images, developed for the course Numerical techniques for photorealistic image generation.
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12]
 CPGENLib.BRDFAn abstract class representing a Bidirectional Reflectance Distribution Function (BRDF).
 CPGENLib.DiffuseBRDFA class representing an ideal diffuse BRDF.
 CPGENLib.SpecularBRDFA class representing an ideal mirror BRDF.
 CPGENLib.Color
 CException
 CPGENLib.GrammarErrorExceptionAn error found by the lexer/parser while reading a scene file. The fields of this type are the following:

Message a user-frendly error message
sourceLocation a sourceLocation object pointing out the name of the file, the line number and the column number where the error occured
 CPGENLib.RuntimeError
 CPGENLib.ExpectParse
 CFormatException
 CPGENLib.InvalidPfmFileFormat
 CPGENLib.HdrImageA High-Dynamic-Range 2D image. This class has 3 members:

Width number (int) of columns in the 2D matrix of colors
Height number (int) of rows in the 2D matrix of colors
Pixel the 2D matrix (array of Color), represented as a 1D array
 CPGENLib.HitRecordA class holding information about a ray-shape intersection. The parameters defined in this dataclass are the following:

WorldPoint a Point object holding the world coordinates of the hit point
Normal a Normal object holding the orientation of the normal to the surface where the hit happened
SurfacePoint a Vec2d object holding the position of the hit point on the surface of the object
t a floating-point value specifying the distance from the origin of the ray where the hit happened
Ray a Ray object that hit the surface
Material the parameter Material of the Shape object hit by the ray
 CPGENLib.ICameraAn interface representing an observer. Interface for camera: the method FireRay will be implemented in two different ways by OrthogonalCamera and PerspectiveCamera.
 CPGENLib.OrthogonalCameraThis struct implements an observer seeing the world through an orthogonal projection.
 CPGENLib.PerspectiveCameraThis class implements an observer seeing the world through a perspective projection.
 CPGENLib.ImageTracerSend rays from the Camera (observer) to corresponding pixels of an HdrImage (screen), converting "u-v" Camera coordinates to "column-raw" index of the HdrImage.

Image must be a :class:.HdrImage object that has already been initialized
Camera must be a descendeant of the :class:.Camera object
Pcg random number generator
SamplePerSize If SamplesPerSide is larger than zero, stratified sampling will be applied to each pixel in the image, using the random number generator pcg
 CPGENLib.InputStreamThis class implements a wrapper around a stream, with the following additional capabilities:

  1. It tracks the line number and column number;
  2. It permits to "un-read" characters and tokens.
 CPGENLib.MaterialA class representing a Material. The parameters defined in this dataclass are the following:

Brdf
EmittedRadiance
 CPGENLib.NormalA normal vector in 3D space. This struct has three floating-point fields: x, y, and z.
 CPGENLib.PCGPCG Uniform Pseudo-random Number Generator.
 CPGENLib.PigmentThis abstract class represents a pigment with a function that associates a color with each point on a parametric surface (u,v).
 CPGENLib.CheckeredPigmentA checkered pigment. The number of rows/columns in the checkered pattern is tunable, but you cannot have a different number of repetitions along the u/v directions. The parameters defined in this dataclass are the following:

Col1 first Color
Col2 second Color
NumStep int number of repetition
 CPGENLib.ImagePigmentThe texture is given through a PFM image. The parameters defined in this dataclass are the following:

Image HdrImageobject
 CPGENLib.UniformPigmentA uniform pigment.
 CPGENLib.PointA point in 3D space. This struct has three floating-point fields: x, y, and z.
 CPGENLib.PointLightThe class holds information about a pointlight (a Dirac's delta in the rendering equation) used by the PointLight Renderer. The fields are the following:

Position a Point object holding the position of the point light in 3D space
Color a Color object being the color of the point light
LinearRadius a float number used to compute the solid angle subtended by the light at a given distance d (r/d)^2
 CPGENLib.Ray
 CPGENLib.RendererA class implementing a solver of the rendering equation. This is an abstract class; you should use a derived concrete class. This class has 2 members:

World type World
BackGroundColor type Color
 CPGENLib.FlatRendererThis renderer estimates the solution of the rendering equation by neglecting any contribution of the light. It just uses the pigment of each surface to determine how to compute the final radiance.
 CPGENLib.OnOffRendererA on/off renderer, produces black and white images and is useful for debugging purposes. Other than Renderer's member it has the third member

Color type Color
 CPGENLib.PathTracerThe algorithm implemented here allows the caller to tune number of rays thrown at each iteration, as well as the maximum depth. It implements Russian roulette to reduce the number of recursive calls.

Pcg Random number generator
NumbOfRays Number of rays to be fired at each iteration
MaxDepth Maximum number of reflections for any ray
RussianRouletteLimit Minimum number of reflections for the Russian Roulette algorith to start
 CPGENLib.PointLightRendererClass that implements a Point Light renderer. The solid angle integral of the rendering equations can be simplified, because the integrand contains some localized Dirac deltas.
 CPGENLib.SceneA scene read from a scene file.
 CPGENLib.ShapeInterface for a generic 3D shape: the method RayIntersection is implemented in different concrete shapes.
 CPGENLib.CylinderClass to represent a cylinder.
 CPGENLib.SphereA 3D unit sphere centered on the axes origin.
 CPGENLib.XyPlaneA 2D plane that you can put in the scene. Unless transformations are applied, the z=0 plane is constructed.
 CPGENLib.SourceLocationThe class points out a specific location in a source file. The fields are:

FileName name of the file or empty string;
LineNum number of line;
ColNum number of column;
 CPGENLib.TokenA lexical token, used when parsing a scene file.
 CPGENLib.IdentifierTokenA token containing an identifier.
 CPGENLib.KeywordTokenA token containing a keyword. Parameters:

Location a SourceLocation object holding informations about token location in the file (filename, number of column, number of rows)
Keyword a KeywordList object holding the possible Keyword options
 CPGENLib.LiteralNumberTokenA token containing a literal number.
 CPGENLib.StopTokenA token representing the end of a file.
 CPGENLib.StringTokenA token containing a literal string.
 CPGENLib.SymbolTokenA token containing a symbol (i.e., a variable name).
 CPGENLib.TransformationAn affine transformation. This class encodes an affine transformation. It has been designed with the aim of making the calculation of the inverse transformation particularly efficient.
 CPGENLib.Tuple
 CPGENLib.VecA 3D vector. This class has three floating-point fields: x, y, and z.
 CPGENLib.Vec2dA 2D vector, with two floating point fields u and v.
 CPGENLib.World