Documentation ¶
Index ¶
- type AreaMapping
- type BoxBorder
- type BoxBorders
- type BoxMargin
- type BoxMargins
- type BoxOffset
- type BoxPadding
- type BoxPaddings
- type DynamicMemoryDrawer
- type FloatStack
- type ImageMap
- type Page
- type RenderableDomElement
- func (e *RenderableDomElement) FontVariant() string
- func (e RenderableDomElement) GetBackgroundColor() color.Color
- func (e *RenderableDomElement) GetBackgroundImage() image.Image
- func (e *RenderableDomElement) GetBackgroundRepeat() string
- func (e RenderableDomElement) GetBorderBottomColor() color.Color
- func (e RenderableDomElement) GetBorderBottomStyle() string
- func (e RenderableDomElement) GetBorderBottomWidth() int
- func (e RenderableDomElement) GetBorderLeftColor() color.Color
- func (e RenderableDomElement) GetBorderLeftStyle() string
- func (e RenderableDomElement) GetBorderLeftWidth() int
- func (e RenderableDomElement) GetBorderRightColor() color.Color
- func (e RenderableDomElement) GetBorderRightStyle() string
- func (e RenderableDomElement) GetBorderRightWidth() int
- func (e RenderableDomElement) GetBorderTopColor() color.Color
- func (e RenderableDomElement) GetBorderTopStyle() string
- func (e RenderableDomElement) GetBorderTopWidth() int
- func (e RenderableDomElement) GetColor() color.Color
- func (e RenderableDomElement) GetContainerWidth(containerWidth int) int
- func (e RenderableDomElement) GetDisplayProp() string
- func (e RenderableDomElement) GetFloat() string
- func (e *RenderableDomElement) GetFontFace(fsize int) font.Face
- func (e *RenderableDomElement) GetFontFamily() css.FontFamily
- func (e *RenderableDomElement) GetFontSize() int
- func (e *RenderableDomElement) GetFontStyle() font.Style
- func (e *RenderableDomElement) GetFontWeight() font.Weight
- func (e RenderableDomElement) GetHeight() int
- func (e *RenderableDomElement) GetLineHeight() int
- func (e *RenderableDomElement) GetListStyleType() string
- func (e RenderableDomElement) GetMarginBottomSize() int
- func (e RenderableDomElement) GetMarginLeftSize() int
- func (e RenderableDomElement) GetMarginRightSize() int
- func (e RenderableDomElement) GetMarginTopSize() int
- func (e RenderableDomElement) GetMaxHeight() int
- func (e RenderableDomElement) GetMaxWidth() int
- func (e RenderableDomElement) GetMinHeight() int
- func (e RenderableDomElement) GetMinWidth() int
- func (e *RenderableDomElement) GetOverflow() string
- func (e RenderableDomElement) GetPaddingBottom() int
- func (e RenderableDomElement) GetPaddingLeft() int
- func (e RenderableDomElement) GetPaddingRight() int
- func (e RenderableDomElement) GetPaddingTop() int
- func (e *RenderableDomElement) GetTextDecoration() string
- func (e RenderableDomElement) GetTextIndent(containerWidth int) int
- func (e RenderableDomElement) GetTextTransform() string
- func (e *RenderableDomElement) GetVerticalAlign() string
- func (e *RenderableDomElement) GetWhiteSpace() string
- func (e RenderableDomElement) GetWidth() int
- func (e *RenderableDomElement) InvalidateLayout()
- func (e *RenderableDomElement) Layout(ctx context.Context, viewportSize image.Point) error
- func (e *RenderableDomElement) RenderInto(ctx context.Context, dst draw.Image, cursor image.Point) error
- func (e RenderableDomElement) String() string
- func (e *RenderableDomElement) Walk(callback func(*RenderableDomElement))
- type Renderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaMapping ¶
type AreaMapping struct { Area image.Rectangle Content *RenderableDomElement }
type BoxBorders ¶
type BoxMargins ¶
type BoxPadding ¶
type BoxPadding BoxOffset
type BoxPaddings ¶
type BoxPaddings struct { Top BoxPadding Bottom BoxPadding Left BoxPadding Right BoxPadding }
type DynamicMemoryDrawer ¶
type DynamicMemoryDrawer struct {
// contains filtered or unexported fields
}
func NewDynamicMemoryDrawer ¶
func NewDynamicMemoryDrawer(r image.Rectangle) *DynamicMemoryDrawer
func (*DynamicMemoryDrawer) Bounds ¶
func (d *DynamicMemoryDrawer) Bounds() image.Rectangle
func (*DynamicMemoryDrawer) ColorModel ¶
func (d *DynamicMemoryDrawer) ColorModel() color.Model
func (*DynamicMemoryDrawer) GrowBounds ¶
func (d *DynamicMemoryDrawer) GrowBounds(r image.Rectangle)
type FloatStack ¶
type FloatStack []*RenderableDomElement
A FloatStack represents the floating elements that haven't yet been cleared. There's generally two FloatStacks, one for the left elements, and one for the right elements. Once dot advances past the FloatStack, they're removed from the stack.
func (FloatStack) ClearFloats ¶
func (f FloatStack) ClearFloats(dot image.Point) FloatStack
Remove any floats that are past dot from the float stack and return the floats that have not yet been cleared.
func (FloatStack) MaxX ¶
func (f FloatStack) MaxX(loc image.Point) int
MaxX returns the highest X coordinate in the FloatStack, at height loc. This is mostly used to get the left edge of left floats at a certain height.
func (FloatStack) NextFloatHeight ¶
func (f FloatStack) NextFloatHeight() int
type ImageMap ¶
type ImageMap []AreaMapping
func NewImageMap ¶
func NewImageMap() ImageMap
func (*ImageMap) Add ¶
func (imap *ImageMap) Add(el *RenderableDomElement, location image.Rectangle)
func (ImageMap) At ¶
func (imap ImageMap) At(x, y int) *RenderableDomElement
type Page ¶
type Page struct { Content *RenderableDomElement Background color.Color URL *url.URL // contains filtered or unexported fields }
Represents a page to be rendered
func (*Page) ReapplyStyles ¶
func (p *Page) ReapplyStyles()
type RenderableDomElement ¶
type RenderableDomElement struct { *dom.Element Styles *css.StyledElement ConditionalStyles struct { Unconditional *css.StyledElement FirstLine, FirstLetter *css.StyledElement } Parent *RenderableDomElement FirstChild *RenderableDomElement NextSibling *RenderableDomElement PrevSibling *RenderableDomElement CSSOuterBox image.Image ContentOverlay image.Image // The location within the parent to draw the OverlayedContent //DrawRectangle image.Rectangle //BoxOrigin image.Point BoxDrawRectangle image.Rectangle BoxContentRectangle image.Rectangle ImageMap ImageMap PageLocation *url.URL State css.State // contains filtered or unexported fields }
func (*RenderableDomElement) FontVariant ¶
func (e *RenderableDomElement) FontVariant() string
func (RenderableDomElement) GetBackgroundColor ¶
func (e RenderableDomElement) GetBackgroundColor() color.Color
func (*RenderableDomElement) GetBackgroundImage ¶
func (e *RenderableDomElement) GetBackgroundImage() image.Image
func (*RenderableDomElement) GetBackgroundRepeat ¶
func (e *RenderableDomElement) GetBackgroundRepeat() string
func (RenderableDomElement) GetBorderBottomColor ¶
func (e RenderableDomElement) GetBorderBottomColor() color.Color
func (RenderableDomElement) GetBorderBottomStyle ¶
func (e RenderableDomElement) GetBorderBottomStyle() string
func (RenderableDomElement) GetBorderBottomWidth ¶
func (e RenderableDomElement) GetBorderBottomWidth() int
func (RenderableDomElement) GetBorderLeftColor ¶
func (e RenderableDomElement) GetBorderLeftColor() color.Color
func (RenderableDomElement) GetBorderLeftStyle ¶
func (e RenderableDomElement) GetBorderLeftStyle() string
func (RenderableDomElement) GetBorderLeftWidth ¶
func (e RenderableDomElement) GetBorderLeftWidth() int
func (RenderableDomElement) GetBorderRightColor ¶
func (e RenderableDomElement) GetBorderRightColor() color.Color
func (RenderableDomElement) GetBorderRightStyle ¶
func (e RenderableDomElement) GetBorderRightStyle() string
func (RenderableDomElement) GetBorderRightWidth ¶
func (e RenderableDomElement) GetBorderRightWidth() int
func (RenderableDomElement) GetBorderTopColor ¶
func (e RenderableDomElement) GetBorderTopColor() color.Color
func (RenderableDomElement) GetBorderTopStyle ¶
func (e RenderableDomElement) GetBorderTopStyle() string
func (RenderableDomElement) GetBorderTopWidth ¶
func (e RenderableDomElement) GetBorderTopWidth() int
func (RenderableDomElement) GetColor ¶
func (e RenderableDomElement) GetColor() color.Color
func (RenderableDomElement) GetContainerWidth ¶
func (e RenderableDomElement) GetContainerWidth(containerWidth int) int
func (RenderableDomElement) GetDisplayProp ¶
func (e RenderableDomElement) GetDisplayProp() string
func (RenderableDomElement) GetFloat ¶
func (e RenderableDomElement) GetFloat() string
func (*RenderableDomElement) GetFontFace ¶
func (e *RenderableDomElement) GetFontFace(fsize int) font.Face
func (*RenderableDomElement) GetFontFamily ¶
func (e *RenderableDomElement) GetFontFamily() css.FontFamily
func (*RenderableDomElement) GetFontSize ¶
func (e *RenderableDomElement) GetFontSize() int
func (*RenderableDomElement) GetFontStyle ¶
func (e *RenderableDomElement) GetFontStyle() font.Style
func (*RenderableDomElement) GetFontWeight ¶
func (e *RenderableDomElement) GetFontWeight() font.Weight
func (RenderableDomElement) GetHeight ¶
func (e RenderableDomElement) GetHeight() int
func (*RenderableDomElement) GetLineHeight ¶
func (e *RenderableDomElement) GetLineHeight() int
func (*RenderableDomElement) GetListStyleType ¶
func (e *RenderableDomElement) GetListStyleType() string
func (RenderableDomElement) GetMarginBottomSize ¶
func (e RenderableDomElement) GetMarginBottomSize() int
func (RenderableDomElement) GetMarginLeftSize ¶
func (e RenderableDomElement) GetMarginLeftSize() int
func (RenderableDomElement) GetMarginRightSize ¶
func (e RenderableDomElement) GetMarginRightSize() int
func (RenderableDomElement) GetMarginTopSize ¶
func (e RenderableDomElement) GetMarginTopSize() int
func (RenderableDomElement) GetMaxHeight ¶
func (e RenderableDomElement) GetMaxHeight() int
func (RenderableDomElement) GetMaxWidth ¶
func (e RenderableDomElement) GetMaxWidth() int
func (RenderableDomElement) GetMinHeight ¶
func (e RenderableDomElement) GetMinHeight() int
func (RenderableDomElement) GetMinWidth ¶
func (e RenderableDomElement) GetMinWidth() int
func (*RenderableDomElement) GetOverflow ¶
func (e *RenderableDomElement) GetOverflow() string
func (RenderableDomElement) GetPaddingBottom ¶
func (e RenderableDomElement) GetPaddingBottom() int
func (RenderableDomElement) GetPaddingLeft ¶
func (e RenderableDomElement) GetPaddingLeft() int
func (RenderableDomElement) GetPaddingRight ¶
func (e RenderableDomElement) GetPaddingRight() int
func (RenderableDomElement) GetPaddingTop ¶
func (e RenderableDomElement) GetPaddingTop() int
func (*RenderableDomElement) GetTextDecoration ¶
func (e *RenderableDomElement) GetTextDecoration() string
func (RenderableDomElement) GetTextIndent ¶
func (e RenderableDomElement) GetTextIndent(containerWidth int) int
func (RenderableDomElement) GetTextTransform ¶
func (e RenderableDomElement) GetTextTransform() string
func (*RenderableDomElement) GetVerticalAlign ¶
func (e *RenderableDomElement) GetVerticalAlign() string
func (*RenderableDomElement) GetWhiteSpace ¶
func (e *RenderableDomElement) GetWhiteSpace() string
func (RenderableDomElement) GetWidth ¶
func (e RenderableDomElement) GetWidth() int
func (*RenderableDomElement) InvalidateLayout ¶
func (e *RenderableDomElement) InvalidateLayout()
func (*RenderableDomElement) RenderInto ¶
func (RenderableDomElement) String ¶
func (e RenderableDomElement) String() string
func (*RenderableDomElement) Walk ¶
func (e *RenderableDomElement) Walk(callback func(*RenderableDomElement))
type Renderer ¶
type Renderer interface { // Lays out an element in preparation for rendering Layout(ctx context.Context, viewportSize image.Point) error // Draws the element into dst, scrolled so that the top left of the // image is at cursor. Layout must be called before RenderInto. RenderInto(ctx context.Context, dst draw.Image, cursor image.Point) error }
A RenderableElement is something that can be rendered to an image.
Click to show internal directories.
Click to hide internal directories.