Documentation ¶
Index ¶
- Constants
- func Collapse(reg RegionNumerics, sizelim int) bool
- func DrawUniform(context paint.DrawingContext, region RegionNumerics)
- func RenderSequenceRegion(reg RegionNumerics, ctx draw.DrawingContext)
- func SequenceCollapse(num RegionNumerics) []base.PixelMember
- func Subdivide(reg RegionNumerics) bool
- func Uniform(reg RegionNumerics) bool
- type MockFactory
- type MockNumerics
- func (mock *MockNumerics) Children() []RegionNumerics
- func (mock *MockNumerics) ClaimExtrinsics()
- func (mock *MockNumerics) Extrinsically(f func())
- func (mock *MockNumerics) MandelbrotPoints() []base.EscapeValue
- func (mock *MockNumerics) Rect() image.Rectangle
- func (mock *MockNumerics) RegionMember() base.EscapeValue
- func (mock *MockNumerics) RegionSequence() ProxySequence
- func (mock *MockNumerics) SampleDivs() (<-chan uint8, chan<- bool)
- func (mock *MockNumerics) Split()
- func (mock *MockNumerics) Subdivide() bool
- type MockProxySequence
- type MockRegionProvider
- type MockRenderApplication
- type ProxySequence
- type Region
- type RegionConfig
- type RegionNumerics
- type RegionNumericsFactory
- type RegionProvider
- type RegionRenderStrategy
- type RegionType
- type RenderApplication
- type Subdivider
Constants ¶
const ( UniformPath = RegionType(iota) CollapsePath SubdividePath )
Variables ¶
This section is empty.
Functions ¶
func Collapse ¶
func Collapse(reg RegionNumerics, sizelim int) bool
Collapse returns true if the region is below the necessary size for subdivision
func DrawUniform ¶
func DrawUniform(context paint.DrawingContext, region RegionNumerics)
DrawUniform draws a rectangle of uniform colour on to the image.
func RenderSequenceRegion ¶
func RenderSequenceRegion(reg RegionNumerics, ctx draw.DrawingContext)
RenderSequentialRegion takes a RegionNumerics but renders the region in a sequential (column-wise) manner
func SequenceCollapse ¶
func SequenceCollapse(num RegionNumerics) []base.PixelMember
SequenceCollapse is analogous to RenderSequentialRegion, but it returns the Mandelbrot render results rather than drawing them to the image.
func Subdivide ¶
func Subdivide(reg RegionNumerics) bool
Subdivide takes a RegionNumerics and tries to split the region into subregions. It returns true if the subdivision occurred. The subdivision won't occur if the region is Uniform or in an area where glitches are likely.
func Uniform ¶
func Uniform(reg RegionNumerics) bool
Uniform returns true if the region has the same Mandelbrot escape value across its bounds.
Types ¶
type MockFactory ¶
type MockFactory struct { TBuild bool Numerics *MockNumerics }
func (*MockFactory) Build ¶
func (mock *MockFactory) Build() RegionNumerics
type MockNumerics ¶
type MockNumerics struct { TExtrinsically bool TClaimExtrinsics bool TRect bool TSplit bool TMandelbrotPoints bool TRegionMember bool TSubdivide bool TChildren bool TSampleDivs bool TRegionSequence bool Path RegionType MockChildren []*MockNumerics MockSequence *MockProxySequence AppCollapseSize int }
func (*MockNumerics) Children ¶
func (mock *MockNumerics) Children() []RegionNumerics
func (*MockNumerics) ClaimExtrinsics ¶
func (mock *MockNumerics) ClaimExtrinsics()
func (*MockNumerics) Extrinsically ¶
func (mock *MockNumerics) Extrinsically(f func())
func (*MockNumerics) MandelbrotPoints ¶
func (mock *MockNumerics) MandelbrotPoints() []base.EscapeValue
func (*MockNumerics) Rect ¶
func (mock *MockNumerics) Rect() image.Rectangle
func (*MockNumerics) RegionMember ¶
func (mock *MockNumerics) RegionMember() base.EscapeValue
func (*MockNumerics) RegionSequence ¶
func (mock *MockNumerics) RegionSequence() ProxySequence
func (*MockNumerics) SampleDivs ¶
func (mock *MockNumerics) SampleDivs() (<-chan uint8, chan<- bool)
func (*MockNumerics) Split ¶
func (mock *MockNumerics) Split()
func (*MockNumerics) Subdivide ¶
func (mock *MockNumerics) Subdivide() bool
type MockProxySequence ¶
type MockProxySequence struct { sequence.MockNumerics TClaimExtrinsics bool TExtrinsically bool }
func (*MockProxySequence) ClaimExtrinsics ¶
func (mock *MockProxySequence) ClaimExtrinsics()
func (*MockProxySequence) Extrinsically ¶
func (mock *MockProxySequence) Extrinsically(f func())
type MockRegionProvider ¶
type MockRegionProvider struct { TRegionConfig bool TRegionNumericsFactory bool RegConfig RegionConfig RegionFactory RegionNumericsFactory }
func (*MockRegionProvider) RegionConfig ¶
func (mock *MockRegionProvider) RegionConfig() RegionConfig
func (*MockRegionProvider) RegionNumericsFactory ¶
func (mock *MockRegionProvider) RegionNumericsFactory() RegionNumericsFactory
type MockRenderApplication ¶
type MockRenderApplication struct { base.MockRenderApplication draw.MockContextProvider MockRegionProvider }
type ProxySequence ¶
type ProxySequence interface { base.OpaqueProxyFlyweight sequence.SequenceNumerics }
type Region ¶
func InitRegion ¶
func InitRegion(bn *base.BaseNumerics) Region
type RegionConfig ¶
type RegionNumerics ¶
type RegionNumerics interface { base.OpaqueProxyFlyweight Subdivider Children() []RegionNumerics // Bad to include method in extended interface, but how else? }
RegionNumerics provides rendering calculations for the "region" render strategy.
type RegionNumericsFactory ¶
type RegionNumericsFactory interface {
Build() RegionNumerics
}
type RegionProvider ¶
type RegionProvider interface { // Configuration for particular render strategies RegionConfig() RegionConfig RegionNumericsFactory() RegionNumericsFactory }
type RegionRenderStrategy ¶
type RegionRenderStrategy struct {
// contains filtered or unexported fields
}
func Make ¶
func Make(app RenderApplication) *RegionRenderStrategy
func (RegionRenderStrategy) Render ¶
func (renderer RegionRenderStrategy) Render() (*image.NRGBA, error)
The RegionRenderStrategy implements RenderNumerics with this method that draws the Mandelbrot set uses a "similar rectangles" optimization
func (RegionRenderStrategy) SubdivideRegions ¶
func (renderer RegionRenderStrategy) SubdivideRegions(whole RegionNumerics) ([]RegionNumerics, []RegionNumerics)
type RegionType ¶
type RegionType uint
type RenderApplication ¶
type RenderApplication interface { base.RenderApplication draw.ContextProvider RegionProvider }
type Subdivider ¶
type Subdivider interface { Rect() image.Rectangle Split() MandelbrotPoints() []base.EscapeValue SampleDivs() (<-chan uint8, chan<- bool) RegionMember() base.EscapeValue RegionSequence() ProxySequence }