Documentation ¶
Index ¶
- func ReadImageDimension(imagePath string) (*image.Config, error)
- func ReadImageFromFile(imageFilePath string) (*image.Image, error)
- type Anchor
- type Border
- type Box
- func (b *Box) AddToChildren(element Element)
- func (b *Box) AlignWithAnchor(anchor Anchor, X float64, Y float64)
- func (b *Box) ApplyAlign()
- func (b *Box) ApplyChildPosition()
- func (b *Box) CalculationDimension(parent Element)
- func (b *Box) GetAnchor(anchor Anchor) (X, Y float64)
- func (b *Box) GetChildren() []Element
- func (b *Box) GetDimension() (float64, float64)
- func (b *Box) GetWeight() float64
- func (b *Box) Render(renderContext *RenderContext)
- func (b *Box) TransformChildPosition()
- type BoxSizing
- type ChildAlign
- type Dimension
- type DrawArea
- type Edge
- type Element
- type ElementBorder
- type ElementDimension
- func (e *ElementDimension) GetDimension() (float64, float64)
- func (e *ElementDimension) GetHeight() float64
- func (e *ElementDimension) GetWeight() float64
- func (e *ElementDimension) GetWidth() float64
- func (e *ElementDimension) SetDimension(width float64, height float64)
- func (e *ElementDimension) SetDimensionDelta(width float64, height float64)
- func (e *ElementDimension) SetHeight(height float64)
- func (e *ElementDimension) SetWeight(weight float64)
- func (e *ElementDimension) SetWidth(width float64)
- type ElementPadding
- type ElementPosition
- func (b *ElementPosition) GetPosition() (float64, float64)
- func (b *ElementPosition) GetX() float64
- func (b *ElementPosition) GetY() float64
- func (b *ElementPosition) MoveDelta(x float64, y float64)
- func (b *ElementPosition) SetPosition(x float64, y float64)
- func (b *ElementPosition) SetX(x float64)
- func (b *ElementPosition) SetY(y float64)
- func (b *ElementPosition) UpdatePosition(x float64, y float64) (float64, float64)
- type HorizonListLayoutManager
- type ImageBox
- type ImageElement
- type ImageFit
- type ImageResourceLibrary
- type LayoutManager
- type ParagraphBox
- type Position
- type PreloadElement
- type RenderContext
- type RenderEngine
- func (e *RenderEngine) CalculationElementsDimension(imageResources *ImageResourceLibrary)
- func (e *RenderEngine) LoadCanvasImageFromFile(imageFilePath string) error
- func (e *RenderEngine) NewCanvas(width int, height int) error
- func (e *RenderEngine) PlaceElements(imageResources *ImageResourceLibrary)
- func (e *RenderEngine) RenderElements(imageResources *ImageResourceLibrary)
- func (e *RenderEngine) RenderImage()
- func (e *RenderEngine) SaveAsPNG(outputImageFilePath string) error
- func (e *RenderEngine) SetDoc(doc Element)
- type RenderQueueElement
- type RenderTask
- type TextBox
- type VerticalListLayoutManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Box ¶
type Box struct { ElementPosition ElementDimension Children []Element ChildrenAlign ChildAlign Color string LayoutManager LayoutManager DrawArea DrawArea Padding ElementPadding BoxSizing BoxSizing Border ElementBorder }
func (*Box) AddToChildren ¶
func (*Box) ApplyAlign ¶
func (b *Box) ApplyAlign()
func (*Box) ApplyChildPosition ¶
func (b *Box) ApplyChildPosition()
func (*Box) CalculationDimension ¶
func (*Box) GetChildren ¶
func (*Box) GetDimension ¶
func (*Box) Render ¶
func (b *Box) Render(renderContext *RenderContext)
func (*Box) TransformChildPosition ¶
func (b *Box) TransformChildPosition()
type ChildAlign ¶
type ChildAlign int
const ( MainAxisTop ChildAlign = iota + 1 MainAxisCenter MainAxisBottom CrossAxisLeft CrossAxisCenter CrossAxisRight MainCrossAxisCenter )
type Dimension ¶
type Dimension interface { GetDimension() (width float64, height float64) GetWidth() float64 GetHeight() float64 SetHeight(height float64) SetWidth(width float64) SetDimension(width float64, height float64) SetDimensionDelta(width float64, height float64) GetWeight() float64 SetWeight(weight float64) CalculationDimension(parent Element) }
type ElementBorder ¶
type ElementDimension ¶
type ElementDimension struct { Width float64 Height float64 Weight float64 ParentRelativeScaleWidth float64 ParentRelativeScaleHeight float64 ParentRelativeDeltaWidth float64 ParentRelativeDeltaHeight float64 UserParentRelative bool }
func (*ElementDimension) GetDimension ¶
func (e *ElementDimension) GetDimension() (float64, float64)
func (*ElementDimension) GetHeight ¶
func (e *ElementDimension) GetHeight() float64
func (*ElementDimension) GetWeight ¶
func (e *ElementDimension) GetWeight() float64
func (*ElementDimension) GetWidth ¶
func (e *ElementDimension) GetWidth() float64
func (*ElementDimension) SetDimension ¶
func (e *ElementDimension) SetDimension(width float64, height float64)
func (*ElementDimension) SetDimensionDelta ¶
func (e *ElementDimension) SetDimensionDelta(width float64, height float64)
func (*ElementDimension) SetHeight ¶
func (e *ElementDimension) SetHeight(height float64)
func (*ElementDimension) SetWeight ¶
func (e *ElementDimension) SetWeight(weight float64)
func (*ElementDimension) SetWidth ¶
func (e *ElementDimension) SetWidth(width float64)
type ElementPadding ¶
type ElementPosition ¶
type ElementPosition struct { X float64 Y float64 ParentDeltaX float64 ParentDeltaY float64 SiblingDeltaX float64 SiblingDeltaY float64 UseParentDelta bool UseSiblingDelta bool // contains filtered or unexported fields }
func (*ElementPosition) GetPosition ¶
func (b *ElementPosition) GetPosition() (float64, float64)
func (*ElementPosition) GetX ¶
func (b *ElementPosition) GetX() float64
func (*ElementPosition) GetY ¶
func (b *ElementPosition) GetY() float64
func (*ElementPosition) MoveDelta ¶
func (b *ElementPosition) MoveDelta(x float64, y float64)
func (*ElementPosition) SetPosition ¶
func (b *ElementPosition) SetPosition(x float64, y float64)
func (*ElementPosition) SetX ¶
func (b *ElementPosition) SetX(x float64)
func (*ElementPosition) SetY ¶
func (b *ElementPosition) SetY(y float64)
func (*ElementPosition) UpdatePosition ¶
func (b *ElementPosition) UpdatePosition(x float64, y float64) (float64, float64)
type HorizonListLayoutManager ¶
type HorizonListLayoutManager struct { }
func (*HorizonListLayoutManager) Place ¶
func (v *HorizonListLayoutManager) Place(element *Box)
type ImageBox ¶
type ImageBox struct { Box Src string Image *ImageElement OriginDimension bool Fit ImageFit }
func (*ImageBox) CalculationDimension ¶
func (*ImageBox) Preload ¶
func (b *ImageBox) Preload(ctx *RenderContext)
func (*ImageBox) Render ¶
func (b *ImageBox) Render(renderContext *RenderContext)
type ImageElement ¶
func NewImageElement ¶
func NewImageElement(imagePath string) (*ImageElement, error)
type ImageResourceLibrary ¶
type ImageResourceLibrary struct {
Images []*ImageElement
}
func (*ImageResourceLibrary) GetImageWithPath ¶
func (l *ImageResourceLibrary) GetImageWithPath(imagePath string) (target *ImageElement)
func (*ImageResourceLibrary) LoadFromResource ¶
func (l *ImageResourceLibrary) LoadFromResource(imageFilePath string) error
type LayoutManager ¶
type LayoutManager interface {
Place(box *Box)
}
type ParagraphBox ¶
func (*ParagraphBox) Preload ¶
func (t *ParagraphBox) Preload(ctx *RenderContext)
func (*ParagraphBox) Render ¶
func (t *ParagraphBox) Render(renderContext *RenderContext)
type PreloadElement ¶
type PreloadElement interface {
Preload(ctx *RenderContext)
}
type RenderContext ¶
type RenderContext struct { Context *gg.Context ImageResourceLibrary *ImageResourceLibrary Parent Element Sibling Element }
type RenderEngine ¶
func (*RenderEngine) CalculationElementsDimension ¶
func (e *RenderEngine) CalculationElementsDimension(imageResources *ImageResourceLibrary)
func (*RenderEngine) LoadCanvasImageFromFile ¶
func (e *RenderEngine) LoadCanvasImageFromFile(imageFilePath string) error
func (*RenderEngine) PlaceElements ¶
func (e *RenderEngine) PlaceElements(imageResources *ImageResourceLibrary)
func (*RenderEngine) RenderElements ¶
func (e *RenderEngine) RenderElements(imageResources *ImageResourceLibrary)
func (*RenderEngine) RenderImage ¶
func (e *RenderEngine) RenderImage()
func (*RenderEngine) SaveAsPNG ¶
func (e *RenderEngine) SaveAsPNG(outputImageFilePath string) error
func (*RenderEngine) SetDoc ¶
func (e *RenderEngine) SetDoc(doc Element)
type RenderQueueElement ¶
type RenderQueueElement struct { Root Element Context *RenderContext }
type RenderTask ¶
type TextBox ¶
func (*TextBox) Preload ¶
func (t *TextBox) Preload(ctx *RenderContext)
func (TextBox) Render ¶
func (t TextBox) Render(renderContext *RenderContext)
type VerticalListLayoutManager ¶
type VerticalListLayoutManager struct { }
func (*VerticalListLayoutManager) Place ¶
func (v *VerticalListLayoutManager) Place(element *Box)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.