Documentation ¶
Overview ¶
Package autostereo provides routines for creating 3D optical illusions from 2D images.
Index ¶
Constants ¶
const DepthOfFieldMax = 1.0
DeptOfFieldMax is the maximum allowable value for the dept of field, as a fraction of viewing distance.
const DepthOfFieldMin = 0.0
DeptOfFieldMin is the minimum allowable value for the dept of field, as a fraction of viewing distance.
const EyeSeparationMax = 125.0
EyeSeparationMax is the maximum allowable value for the eye separation in millimeters.
const EyeSeparationMin = 25.0
EyeSeparationMin is the minium allowable value for the eye separation in millimeters.
Variables ¶
var ErrInvalidDepthMap = errors.New("invalid depth map image")
ErrInvalidDepthMap indicates that a given depth map image is not suitable.
A depth map image must not be nil, must have a size of at lease 1 x 1, and must have a size that is bounded.
var ErrInvalidPattern = errors.New("invalid pattern image")
ErrInvalidPattern indicates that a given pattern image is not suitable.
A pattern image must have a size of at least 1x1 pixels, and must have a size that is bounded.
PaletteBlackAndWhite contains a color palette with just two colors, black and white.
var PaletteCyberPunk = []color.Color{ color.RGBA{R: 10, G: 23, B: 45, A: 255}, color.RGBA{R: 240, G: 0, B: 219, A: 255}, color.RGBA{R: 98, G: 24, B: 130, A: 255}, color.RGBA{R: 19, G: 61, B: 201, A: 255}, color.RGBA{R: 11, G: 196, B: 207, A: 255}, }
PaletteCyberPunk contains a cool looking Cyber Punk palette.
var PaletteGrayScale = []color.Color{ color.Black, color.RGBA{R: 32, G: 32, B: 32, A: 255}, color.RGBA{R: 64, G: 64, B: 64, A: 255}, color.RGBA{R: 96, G: 96, B: 96, A: 255}, color.RGBA{R: 128, G: 128, B: 128, A: 255}, color.RGBA{R: 160, G: 160, B: 160, A: 255}, color.RGBA{R: 192, G: 192, B: 192, A: 255}, color.RGBA{R: 255, G: 255, B: 255, A: 255}, }
PaletteGrayScale contains an eight-color gray-scale palette.
var Palettes = []color.Palette{ PaletteBlackAndWhite, PaletteGrayScale, PaletteCyberPunk, }
Palettes contains a slice of all the pre-defined color palettes.
Functions ¶
func Create ¶
Create returns an image containing an autostereogram created using the given depth map and background pattern. If nil is given for the pattern, a default pattern is generated.
func RandomPattern ¶
RandomPattern returns a pattern with the bounds of the given image.Rectangle and random black and white dots.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains the configuration paramaters that are used when creating an autostereogram.
func (*Config) DepthOfField ¶
SetDepthOfField returns the configured value for the depth of field, as a fraction of the viewing distance.
func (*Config) EyeSepartation ¶
EySeparation returns the configured value for the eye separation in milimeters.
func (*Config) ScreenDPI ¶
ScreenDPI returns the configured value for the screen DPI in dots per inch.
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults sets all the configuration paramaters to their default vaules.
func (*Config) SetDepthOfField ¶
SetDepthOfField sets the value for the depth of field, as a fraction of the viewing distance.
func (*Config) SetEyeSeparation ¶
SetEyeSeparation sets the value for the eye separation in milimeters.
func (*Config) SetSceenDPI ¶
SetScreenDPI sets the value of the screen DPI in dots per inch.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
autostereo
Autostereo is a command-line application for creating 3D optical illusions from 2D images.
|
Autostereo is a command-line application for creating 3D optical illusions from 2D images. |
autostereo-gui
Autostereo-gui is a desktop application for creating and viewing 3D optical illusions from 2D images.
|
Autostereo-gui is a desktop application for creating and viewing 3D optical illusions from 2D images. |