image

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RgbToVec3

func RgbToVec3(r, g, b uint32) geo.Vec3

RgbToVec3 converts rgb bytes to a Vec3 color

func ToFloat added in v0.2.0

func ToFloat(col geo.Vec3, samplesPerPixel int) geo.Vec3

ToFloat converts a color in a Vec3 that is the sum of a given of amounts of samples to a float color. Applies gamma correction to the output color.

func ToRgba

func ToRgba(col geo.Vec3, samplesPerPixel int) color.RGBA

ToRgba converts a color in a Vec3 that is the sum of a given of amounts of samples to a RGBA color. Applies gamma correction to the output color.

Types

type RenderImage

type RenderImage struct {
	ImageWidth  int
	ImageHeight int
	Data        []color.RGBA
}

RenderImage is an image output by the ray tracer. Implements the image.Image interface

func (RenderImage) At

func (ri RenderImage) At(x, y int) color.Color

At returns the color at a given point in the image

func (RenderImage) Bounds

func (ri RenderImage) Bounds() image.Rectangle

Bounds returns the dimensions of the image

func (RenderImage) ColorModel

func (ri RenderImage) ColorModel() color.Model

ColorModel returns the RGBA color model

Jump to

Keyboard shortcuts

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