Documentation ¶
Index ¶
- Constants
- func DrawColourBars(gc *draw2dimg.GraphicContext, bounds Rectangle, cols ...color.Color) (float64, float64)
- func DrawColourBarsVertical(gc *draw2dimg.GraphicContext, bounds Rectangle, cols ...color.Color) (float64, float64)
- func DrawStringCenter(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64
- func DrawStringLeft(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64
- func DrawStringRight(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64
- func FitString(l, t, r, b, sl, st, sr, sb float64) (float64, float64, float64, float64)
- func FloatToA(v float64) string
- func Limit(d, a, b int) int
- func LimitU16(d int) uint16
- func LimitU32(d int) uint32
- func LimitU8(d int) uint8
- func Max(a, b int) int
- func MaxSlice(a []uint32) uint32
- func MaxU32(a, b uint32) uint32
- func MaxU8(a, b uint8) uint8
- func Min(a, b int) int
- func MinMax(a []uint32) (uint32, uint32)
- func MinU32(a, b uint32) uint32
- func MinU8(a, b uint8) uint8
- func Within(frame, start, end int) bool
- type Alignment
- func (a Alignment) Fill(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, ...) float64
- func (a Alignment) FillStroke(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, ...) float64
- func (a Alignment) Metrics(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, ...) *AlignmentMetrics
- func (a Alignment) Stroke(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, ...) float64
- type AlignmentMetrics
- type Rectangle
- func (r Rectangle) Add(b Rectangle) Rectangle
- func (r Rectangle) AddPath(ctx draw2d.GraphicContext)
- func (r Rectangle) Expand(l, t, right, b float64) Rectangle
- func (r Rectangle) Height() float64
- func (r Rectangle) IsZero() bool
- func (r Rectangle) Rect() image.Rectangle
- func (r Rectangle) Reduce(l, t, right, b float64) Rectangle
- func (r Rectangle) String() string
- func (r Rectangle) Width() float64
Constants ¶
const ( Width4K = 3840 // 4K resolution Height4K = 2160 // 4K resolution ToRad = math.Pi / 180.0 // Degrees to Radians )
const ( TestCardBasePriority = 1100 // TestCards background TestCardLowerPriority = 1125 // TestCards mid-ground TestCardUpperPriority = 1175 // TestCards mid-ground TestCardTopPriority = 1199 // TestCards foreground DialBackgroundPriority = 2000 // Clock dial background ClockPriority = 2040 // Countdown Clock DialForegroundPriority = 2050 // Clock dial foreground TitlePriority = 2100 // Title BoxPriority = 3000 // Box and derivatives if not implicitly defined )
Renderer priorities
Variables ¶
This section is empty.
Functions ¶
func DrawColourBars ¶
func DrawColourBarsVertical ¶
func DrawStringCenter ¶
func DrawStringCenter(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64
func DrawStringLeft ¶
func DrawStringLeft(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64
func DrawStringRight ¶
func DrawStringRight(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64
func LimitU32 ¶
LimitU32 is identical to LimitU16 but used as image.RGBA uses uint32 with uint16 limits
Types ¶
type Alignment ¶
type Alignment uint8
func (Alignment) Fill ¶
func (a Alignment) Fill(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, format string, args ...interface{}) float64
Fill fills the provided string based on this Alignment. If the string contains "\n" then it will be split and rendered as multiple lines.
gc GraphicContext to draw to bounds image.Rectangle of the area to contain the string lineSpacing space to add between lines format,args passed to fmt.Sprintf() before rendering
func (Alignment) FillStroke ¶
func (a Alignment) FillStroke(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, format string, args ...interface{}) float64
FillStroke fills then strokes the string based on this Alignment. If the string contains "\n" then it will be split and rendered as multiple lines.
gc GraphicContext to draw to bounds image.Rectangle of the area to contain the string lineSpacing space to add between lines format,args passed to fmt.Sprintf() before rendering
func (Alignment) Metrics ¶
func (a Alignment) Metrics(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, format string, args ...interface{}) *AlignmentMetrics
func (Alignment) Stroke ¶
func (a Alignment) Stroke(gc *draw2dimg.GraphicContext, bounds image.Rectangle, lineSpacing float64, format string, args ...interface{}) float64
Stroke the string based on this Alignment. If the string contains "\n" then it will be split and rendered as multiple lines.
gc GraphicContext to draw to bounds image.Rectangle of the area to contain the string lineSpacing space to add between lines format,args passed to fmt.Sprintf() before rendering
type AlignmentMetrics ¶
type AlignmentMetrics struct { Bounds image.Rectangle // Bounds of container ContentBounds image.Rectangle // Bounds of string within container MaxLineHeight float64 // Max line height over all lines MaxLineWidth float64 // Max width of all lines BaseLines []float64 // baseline for each line Widths []float64 // Width of each line Lines []string // Line strings // contains filtered or unexported fields }
func (*AlignmentMetrics) Fill ¶
func (m *AlignmentMetrics) Fill(gc *draw2dimg.GraphicContext) float64
Fill fills the string defined in this AlignmentMetrics into the supplied GraphicContext
func (*AlignmentMetrics) FillStroke ¶
func (m *AlignmentMetrics) FillStroke(gc *draw2dimg.GraphicContext) float64
FillStroke first fills then strokes the string defined in this AlignmentMetrics into the supplied GraphicContext
func (*AlignmentMetrics) Merge ¶
func (m *AlignmentMetrics) Merge(b *AlignmentMetrics)
Merge ensures that the line heights of both sets of metrics are the same. This is useful for when two sets need to line up with each other
func (*AlignmentMetrics) Stroke ¶
func (m *AlignmentMetrics) Stroke(gc *draw2dimg.GraphicContext) float64
Stroke the string defined in this AlignmentMetrics into the supplied GraphicContext
type Rectangle ¶
type Rectangle struct {
X1, Y1, X2, Y2 float64
}
func GetStringBounds ¶
func GetStringBounds(gc *draw2dimg.GraphicContext, s string) Rectangle
func RectFromRect ¶
func StringSize ¶
func StringSize(gc *draw2dimg.GraphicContext, s string, a ...interface{}) Rectangle
func (Rectangle) AddPath ¶
func (r Rectangle) AddPath(ctx draw2d.GraphicContext)
Directories ¶
Path | Synopsis |
---|---|
goexr
|
|
exr
Package exr contains an implementation of an OpenEXR image decoder.
|
Package exr contains an implementation of an OpenEXR image decoder. |
Package units defines units of length such as inches or pixels.
|
Package units defines units of length such as inches or pixels. |