Documentation
¶
Index ¶
- Constants
- func PixelIndex(x, y float64, width, height int) (int, bool)
- type BidirectionalCamera
- type Camera
- type Camera3D
- type CameraNDim
- type CameraType
- type Film
- func (f *Film) ElementCount() int
- func (f *Film) HasSpectralBins() bool
- func (f *Film) Init(shape ...int) *Film
- func (f *Film) InitSpectralBins(count int, minNM, maxNM float64)
- func (f *Film) LoadFromFile(filename string) error
- func (f *Film) RecordSpectralSample(pixel int, wavelengthNM, value float64)
- func (f *Film) Reset()
- func (f *Film) SaveToFile(filename string) error
- func (f *Film) SpectralBinCenterNM(bin int) float64
- func (f *Film) SpectralBinIndex(wavelengthNM float64) int
- type FilmProjection
- type HyperbolicCamera
- type PixelWindow
- type ProjectiveCamera
- type RayCamera
- type SpectralSample
- type SphericalCamera
Constants ¶
const ( DefaultSpectralBinCount = 64 MaxSpectralBinCount = 4096 )
Film is a scene-linear spectral image. It deliberately carries no observer, tristimulus working space, display transform, or image-encoding policy.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BidirectionalCamera ¶
type BidirectionalCamera interface {
ProjectiveCamera
Endpoint() *mat.VecDense
PDFDirection(direction *mat.VecDense) float64
}
BidirectionalCamera exposes the endpoint information and directional density required to put camera sampling in the same path-space measure as light and surface sampling. The density is with respect to solid angle and includes uniform sampling over the complete film, rather than conditioning on one already-selected pixel.
type Camera3D ¶
type Camera3D struct {
Camera
Position *mat.VecDense // Camera origin in scene space.
Coordinates []*mat.VecDense // Camera basis vectors: forward, right, up.
FieldOfViews []float64 // Vertical and horizontal field-of-view angles in degrees.
Ortho bool // Uses orthographic projection when true.
// contains filtered or unexported fields
}
func NewCamera3D ¶
func NewCamera3D() *Camera3D
func (*Camera3D) GenerateRay ¶
func (*Camera3D) ProjectPoint ¶
func (c *Camera3D) ProjectPoint(point *mat.VecDense) (FilmProjection, bool)
ProjectPoint maps a world-space point to the box-filtered pinhole film. The returned Jacobian omits the receiving surface cosine because the camera does not know that surface's normal.
type CameraNDim ¶
type CameraNDim struct {
Camera
Position *mat.VecDense // Camera origin in N-dimensional space.
Coordinates []*mat.VecDense // Camera basis vectors.
FieldOfViews []float64 // Field-of-view angle per dimension.
Ortho bool // Uses orthographic projection when true.
// contains filtered or unexported fields
}
func NewCameraNDim ¶
func NewCameraNDim() *CameraNDim
func (*CameraNDim) GenerateRay ¶
func (*CameraNDim) Prepare ¶
func (c *CameraNDim) Prepare() error
type CameraType ¶
type CameraType string
const ( CameraType3D CameraType = "3d" CameraTypeNDim CameraType = "n_dim" CameraTypeHyperbolic CameraType = "hyperbolic" CameraTypeSpherical CameraType = "spherical" )
type Film ¶
type Film struct {
Shape []int `json:"shape"`
OutputFilm string `json:"output_film,omitempty"`
PixelWindows []PixelWindow `json:"pixel_windows,omitempty"`
Samples int64 `json:"samples"`
SpectralBinCount int `json:"spectral_bin_count,omitempty"`
SpectralBins []maths.Tensor[float64] `json:"spectral_bins"`
SpectralMinNM float64 `json:"spectral_min_nm"`
SpectralMaxNM float64 `json:"spectral_max_nm"`
}
func (*Film) ElementCount ¶
func (*Film) HasSpectralBins ¶
func (*Film) InitSpectralBins ¶
func (*Film) LoadFromFile ¶
func (*Film) RecordSpectralSample ¶
func (*Film) Reset ¶
func (f *Film) Reset()
Reset clears accumulated radiance while preserving the Film configuration.
func (*Film) SaveToFile ¶
func (*Film) SpectralBinCenterNM ¶
func (*Film) SpectralBinIndex ¶
type FilmProjection ¶
type FilmProjection struct {
Position []float64
ToCamera *mat.VecDense
Distance float64
Jacobian float64
}
FilmProjection describes the pinhole-camera mapping of a scene point. Jacobian converts an area density at the point into a box-filtered pixel density; callers multiply it by abs(dot(surfaceNormal, ToCamera)).
type HyperbolicCamera ¶
type HyperbolicCamera struct {
Camera3D
// contains filtered or unexported fields
}
HyperbolicCamera is a Camera3D whose local camera frame is orthonormalized under the Klein H^3 metric at the camera position. In the Klein model, geodesics are Euclidean chords, but angles and field-of-view live in the tangent metric g_p rather than in the ambient Euclidean dot product.
func NewHyperbolicCamera ¶
func NewHyperbolicCamera() *HyperbolicCamera
func (*HyperbolicCamera) GenerateRay ¶
func (*HyperbolicCamera) Prepare ¶
func (c *HyperbolicCamera) Prepare() error
type PixelWindow ¶
func NormalizePixelWindows ¶
func NormalizePixelWindows(windows []PixelWindow, shape []int) ([]PixelWindow, error)
type ProjectiveCamera ¶
type ProjectiveCamera interface {
RayCamera
ProjectPoint(point *mat.VecDense) (FilmProjection, bool)
}
ProjectiveCamera is implemented by cameras that can receive light-tracing splats. ProjectPoint is the inverse of GenerateRay's raster mapping.
type SpectralSample ¶
type SphericalCamera ¶
type SphericalCamera struct {
Camera
Position *mat.VecDense
Coordinates []*mat.VecDense // Camera basis vectors: forward, right, up.
FieldOfViews []float64 // Vertical and horizontal field-of-view angles in degrees.
// contains filtered or unexported fields
}
SphericalCamera lives on S^3 embedded in R^4. Position is a unit vector; Coordinates are R^4 basis vectors projected into T_p and orthonormalized at Prepare time.
func NewSphericalCamera ¶
func NewSphericalCamera() *SphericalCamera
func (*SphericalCamera) GenerateRay ¶
func (*SphericalCamera) Prepare ¶
func (c *SphericalCamera) Prepare() error