config

package
v0.0.0-...-77601ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	EyeLocation    geometry.Point
	TargetLocation geometry.Point
	UpVector       geometry.Vector
	VerticalFOV    float64
	AspectRatio    float64
	Aperture       float64
	FocusDistance  float64
	// contains filtered or unexported fields
}

A Camera holds information about the scene's camera and facilitates the casting of Rays into the scene

func (*Camera) GetRay

func (c *Camera) GetRay(u float64, v float64, rng *rand.Rand) geometry.Ray

GetRay returns a Ray from the eye location to a point on the view place u% across and v% up

func (*Camera) Setup

func (c *Camera) Setup(p *Parameters) error

Setup is called after allocating the Camera struct and filling the exported fields It fills the unexported fields, such as derived vectors and measures

type Parameters

type Parameters struct {
	ImageWidth               int               // width of the image in pixels
	ImageHeight              int               // height of the image in pixels
	FileType                 filetype.FileType // image file type (png, jpg, etc.)
	GammaCorrection          float64           // how much gamma correction to perform on the image
	UseScalingTruncation     bool              // should the program truncate over-magnitude colors by scaling linearly as opposed to clamping?
	SamplesPerRound          int               // amount of samples to write per rounds
	RoundCount               int               // amount of rounds per render
	TileWidth                int               // width of a tile in pixels
	TileHeight               int               // height of a tile in pixels
	MaxBounces               int               // amount of reflections to check before giving up
	UseBVH                   bool              // should the program generate and use a Bounding Volume Hierarchy?
	BackgroundColorMagnitude float64           // amount to scale bg color by
	BackgroundColor          shading.Color     // color to return when nothing is intersected
	TMin                     float64           // minimum ray "time" to count intersection
	TMax                     float64           // maximum ray "time" to count intersection
	Scene                    *Scene            // Scene reference
}

Parameters holds top-level information about the program's execution and the image's properties

type PhotolumData

type PhotolumData struct {
	DB *pgxpool.Pool
}

func InitPhotolumData

func InitPhotolumData(log *logrus.Logger) (*PhotolumData, error)

type Scene

type Scene struct {
	Camera  *Camera             // Camera reference
	Objects primitive.Primitive // reference to Objects in the scene
}

type Tile

type Tile struct {
	ID     string
	Origin geometry.Point  // Top left corner of Tile
	Span   geometry.Vector // Width and Height of Tile
}

type TracingPayload

type TracingPayload struct {
	FileType filetype.FileType
	Image    image.Image
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL