PhotoGENius V1.0.0
A basic library for generating photorealistic images, developed for the course Numerical techniques for photorealistic image generation.
Public Member Functions | Public Attributes | List of all members
PGENLib.ImageTracer Struct Reference

Send 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
More...

Public Member Functions

 ImageTracer (HdrImage image, ICamera camera, PCG pcg, int samplePerSide=1)
 Constructor with parameters. If SamplePerSide is usefull to implement the antialiasing: if it's not zero, stratified sampling will be applied to each pixel in the image, using the random number generator pcg. More...
 
 ImageTracer (HdrImage image, ICamera camera, int samplePerSide=1)
 Constructor with parameters. If SamplePerSide is usefull to implement the antialiasing: if it's not zero, stratified sampling will be applied to each pixel in the image, using the random number generator pcg. More...
 
Ray FireRay (int col, int row, float uPixel=0.5f, float vPixel=0.5f)
 Shoot one light ray through image pixel of coordinates (col, row), which are measured in the same way as in HdrImage: the bottom left corner is placed at (0, 0). The parameters (uPixel, vPixel) specify where the ray should cross the pixel: (0.5f, 0.5f) represents the pixel's center. More...
 
void FireAllRays (Func< Ray, Color > func)
 Shoot several light rays crossing each of the pixels in the image. For each pixel of the HdrImage object, fire one ray and pass it to the function func, which must accept a Ray as its only parameter and must return a Color object, representing the color to assign to that pixel in the image. More...
 

Public Attributes

HdrImage Image
 
ICamera Camera
 
PCG Pcg
 
int SamplePerSide
 

Detailed Description

Send 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

Constructor & Destructor Documentation

◆ ImageTracer() [1/2]

PGENLib.ImageTracer.ImageTracer ( HdrImage  image,
ICamera  camera,
PCG  pcg,
int  samplePerSide = 1 
)

Constructor with parameters. If SamplePerSide is usefull to implement the antialiasing: if it's not zero, stratified sampling will be applied to each pixel in the image, using the random number generator pcg.

Parameters
image
camera
pcg
samplePerSide

◆ ImageTracer() [2/2]

PGENLib.ImageTracer.ImageTracer ( HdrImage  image,
ICamera  camera,
int  samplePerSide = 1 
)

Constructor with parameters. If SamplePerSide is usefull to implement the antialiasing: if it's not zero, stratified sampling will be applied to each pixel in the image, using the random number generator pcg.

Parameters
image
camera
samplePerSide

Member Function Documentation

◆ FireAllRays()

void PGENLib.ImageTracer.FireAllRays ( Func< Ray, Color func)

Shoot several light rays crossing each of the pixels in the image. For each pixel of the HdrImage object, fire one ray and pass it to the function func, which must accept a Ray as its only parameter and must return a Color object, representing the color to assign to that pixel in the image.

Parameters
func

◆ FireRay()

Ray PGENLib.ImageTracer.FireRay ( int  col,
int  row,
float  uPixel = 0.5f,
float  vPixel = 0.5f 
)

Shoot one light ray through image pixel of coordinates (col, row), which are measured in the same way as in HdrImage: the bottom left corner is placed at (0, 0). The parameters (uPixel, vPixel) specify where the ray should cross the pixel: (0.5f, 0.5f) represents the pixel's center.

Parameters
colType int
rowType int
uPixelType float in the range [0, 1], default = 0.5
vPixelType float in the range [0, 1], default = 0.5
Returns

The documentation for this struct was generated from the following file: