base

package
v0.0.0-...-37f3e00 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AllocLarge uint = AllocMedium * 1024

A large number

View Source
const AllocMedium uint = AllocSmall * 64

A medium sized number

View Source
const AllocSmall uint = 1024

A small number

View Source
const AllocTiny uint = 128

A tiny allocation

Variables

This section is empty.

Functions

func AppPictureAspectRatio

func AppPictureAspectRatio(app RenderApplication) float64

func Dbg

func Dbg(things ...interface{})

func PictureAspectRatio

func PictureAspectRatio(width uint, height uint) float64

Types

type BaseConfig

type BaseConfig struct {
	IterateLimit uint8
	DivergeLimit float64
}

type BaseNumerics

type BaseNumerics struct {
	WholeWidth  uint
	WholeHeight uint
	PicXMin     int
	PicXMax     int // exclusive maximum
	PicYMin     int
	PicYMax     int // exclusive maximum
}

Numerics that are aware of a picture and of the Mandelbrot iteration limit

func Make

func (*BaseNumerics) PictureMax

func (base *BaseNumerics) PictureMax() (int, int)

func (*BaseNumerics) PictureMin

func (base *BaseNumerics) PictureMin() (int, int)

func (*BaseNumerics) PictureSubImage

func (base *BaseNumerics) PictureSubImage(rect image.Rectangle)

Change the drawing context to a sub-part of the image

func (*BaseNumerics) RestorePicBounds

func (base *BaseNumerics) RestorePicBounds()

type EscapeValue

type EscapeValue struct {
	InvDiv uint8
	InSet  bool
}

type MockRenderApplication

type MockRenderApplication struct {
	TBaseConfig        bool
	TPictureDimensions bool

	Base BaseConfig

	PictureWidth  uint
	PictureHeight uint
}

func (*MockRenderApplication) BaseConfig

func (mock *MockRenderApplication) BaseConfig() BaseConfig

func (*MockRenderApplication) PictureDimensions

func (mock *MockRenderApplication) PictureDimensions() (uint, uint)

type OpaqueProxyFlyweight

type OpaqueProxyFlyweight interface {
	ClaimExtrinsics()
	Extrinsically(func())
}

OpaqueProxyFlyweight enables implementation of its eponymous design pattern. You need lots of objects, but creating them is expensive. You want to externalize state, but your object is opaque (you access it through an interface) Only these objects can know the type of the external state. So create an extension of this object that acts like a proxy When needed, it will grab the extrinsic, without exposing the details to the client.

type PixelMember

type PixelMember struct {
	I      int
	J      int
	Member EscapeValue
}

PixelMember is a EscapeValue associated with a pixel

type RenderApplication

type RenderApplication interface {
	// Basic configuration
	BaseConfig() BaseConfig
	PictureDimensions() (uint, uint)
}

A facade used by subsystems to interact with the application at large

Jump to

Keyboard shortcuts

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