Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::HdrRgbFilm Class Reference

A film that records RGB values internally. Although film samples are added as spectral values, they are automatically converted to linear sRGB values for storage. More...

#include <HdrRgbFilm.h>

Inheritance diagram for ph::HdrRgbFilm:
ph::TSamplingFilm< math::Spectrum > ph::Film ph::IMoveOnly

Public Member Functions

 HdrRgbFilm ()=default
 
 HdrRgbFilm (int64 actualWidthPx, int64 actualHeightPx, const SampleFilter &filter)
 
 HdrRgbFilm (int64 actualWidthPx, int64 actualHeightPx, const math::TAABB2D< int64 > &effectiveWindowPx, const SampleFilter &filter)
 
void addSample (float64 xPx, float64 yPx, const math::Spectrum &sample) override
 Applies filter to sample value and add to the film. Generally, this method can produce higher quality result by reconstruct the image function with a filter.
 
void setPixel (float64 xPx, float64 yPx, const math::Spectrum &sample) override
 Let the pixel developes to the specified sample value. An interface for using the film as an ordinary image. This method may disturb sample weights. Using this method with addSample() may result in image artifacts unless the implementation says otherwise.
 
void clear () override
 Set all pixel data to its initial state.
 
void setEffectiveWindowPx (const math::TAABB2D< int64 > &effectiveWindow) override
 Set the region where the film will be used. Implementation is advised to take advantage of this and only allocate memory for the part within the effective window.
 
void mergeWith (const HdrRgbFilm &other)
 
void addRgbSample (float64 xPx, float64 yPx, const math::Vector3R &rgb)
 Add a pixel sample.
 
void addRgbSample (float64 xPx, float64 yPx, const math::Vector3D &rgb)
 
void setRgbPixel (float64 xPx, float64 yPx, const math::Vector3R &rgb, float64 weight=1)
 Set a pixel directly. Filter is not applied when setting a pixel directly (effectively applying a box filter). The pixel coordinate is not integral as the implementation may choose to store the values in higher resolution (e.g., super sampling).
 
void setRgbPixel (float64 xPx, float64 yPx, const math::Vector3D &rgb, float64 weight=1)
 
- Public Member Functions inherited from ph::TSamplingFilm< math::Spectrum >
 TSamplingFilm ()=default
 
 TSamplingFilm (int64 actualWidthPx, int64 actualHeightPx, const SampleFilter &filter)
 
 TSamplingFilm (int64 actualWidthPx, int64 actualHeightPx, const math::TAABB2D< int64 > &effectiveWindowPx, const SampleFilter &filter)
 
void setEffectiveWindowPx (const math::TAABB2D< int64 > &effectiveWindow) override
 Set the region where the film will be used. Implementation is advised to take advantage of this and only allocate memory for the part within the effective window.
 
void setSoftEdge (bool useSoftEdge, float32 softness=1.0f)
 Whether to increase the sampling window converage for prettier boundaries in developed frame. In renderings where the image is divided into tiles and sampled independently, the resulting image may have visible artifacts along tile boundaries. This can be alleviated by increasing the size of each tile, so edge pixels can receive more information, reducing their variance. This costs slightly more memory, and tiles will have overlapping sampling regions (may need more care for concurrency).
 
math::TVector2< float64 > getSampleResPx () const
 
const math::TAABB2D< float64 > & getSampleWindowPx () const
 
const SampleFiltergetFilter () const
 
SamplingFilmDimensions getDimensions () const
 
bool isSoftEdged () const
 
- Public Member Functions inherited from ph::Film
 Film ()
 
 Film (int64 actualWidthPx, int64 actualHeightPx)
 
 Film (int64 actualWidthPx, int64 actualHeightPx, const math::TAABB2D< int64 > &effectiveWindowPx)
 
 Film (Film &&other)=default
 
Filmoperator= (Film &&other)=default
 
virtual ~Film ()=default
 
virtual void setActualResPx (const math::TVector2< int64 > &actualResPx)
 Set the apparent size of the film. If only a sub-region of the film is going to be used, set the effective window accordingly may improve performance especially in memory usage.
 
void develop (HdrRgbFrame &out_frame) const
 
void develop (HdrRgbFrame &out_frame, const math::TAABB2D< int64 > &regionPx) const
 
const math::TVector2< int64 > & getActualResPx () const
 
math::TVector2< int64 > getEffectiveResPx () const
 
const math::TAABB2D< int64 > & getEffectiveWindowPx () const
 

Detailed Description

A film that records RGB values internally. Although film samples are added as spectral values, they are automatically converted to linear sRGB values for storage.

Constructor & Destructor Documentation

◆ HdrRgbFilm() [1/3]

ph::HdrRgbFilm::HdrRgbFilm ( )
default

◆ HdrRgbFilm() [2/3]

ph::HdrRgbFilm::HdrRgbFilm ( int64 actualWidthPx,
int64 actualHeightPx,
const SampleFilter & filter )

◆ HdrRgbFilm() [3/3]

ph::HdrRgbFilm::HdrRgbFilm ( int64 actualWidthPx,
int64 actualHeightPx,
const math::TAABB2D< int64 > & effectiveWindowPx,
const SampleFilter & filter )

Member Function Documentation

◆ addRgbSample() [1/2]

void ph::HdrRgbFilm::addRgbSample ( float64 xPx,
float64 yPx,
const math::Vector3D & rgb )

◆ addRgbSample() [2/2]

void ph::HdrRgbFilm::addRgbSample ( float64 xPx,
float64 yPx,
const math::Vector3R & rgb )
inline

Add a pixel sample.

Parameters
xPxThe pixel's x coordinate.
yPxThe pixel's y coordinate.
rgbThe RGB values of the pixel.

◆ addSample()

void ph::HdrRgbFilm::addSample ( float64 xPx,
float64 yPx,
const math::Spectrum & sample )
overridevirtual

Applies filter to sample value and add to the film. Generally, this method can produce higher quality result by reconstruct the image function with a filter.

Parameters
xPxThe x coordinate in raster space.
yPxThe y coordinate in raster space.
sampleThe value to add as a sample.

Implements ph::TSamplingFilm< math::Spectrum >.

◆ clear()

void ph::HdrRgbFilm::clear ( )
overridevirtual

Set all pixel data to its initial state.

Implements ph::TSamplingFilm< math::Spectrum >.

◆ mergeWith()

void ph::HdrRgbFilm::mergeWith ( const HdrRgbFilm & other)

◆ setEffectiveWindowPx()

void ph::HdrRgbFilm::setEffectiveWindowPx ( const math::TAABB2D< int64 > & effectiveWindow)
overridevirtual

Set the region where the film will be used. Implementation is advised to take advantage of this and only allocate memory for the part within the effective window.

Reimplemented from ph::Film.

◆ setPixel()

void ph::HdrRgbFilm::setPixel ( float64 xPx,
float64 yPx,
const math::Spectrum & sample )
overridevirtual

Let the pixel developes to the specified sample value. An interface for using the film as an ordinary image. This method may disturb sample weights. Using this method with addSample() may result in image artifacts unless the implementation says otherwise.

Parameters
xPxThe x coordinate in raster space.
yPxThe y coordinate in raster space.
sampleThe value the pixel will develop to.

Implements ph::TSamplingFilm< math::Spectrum >.

◆ setRgbPixel() [1/2]

void ph::HdrRgbFilm::setRgbPixel ( float64 xPx,
float64 yPx,
const math::Vector3D & rgb,
float64 weight = 1 )

◆ setRgbPixel() [2/2]

void ph::HdrRgbFilm::setRgbPixel ( float64 xPx,
float64 yPx,
const math::Vector3R & rgb,
float64 weight = 1 )
inline

Set a pixel directly. Filter is not applied when setting a pixel directly (effectively applying a box filter). The pixel coordinate is not integral as the implementation may choose to store the values in higher resolution (e.g., super sampling).

Parameters
xPxThe pixel's x coordinate.
yPxThe pixel's y coordinate.
rgbThe RGB values of the pixel.
weightThe weight of the pixel.

The documentation for this class was generated from the following files: