segdisp

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package segdisp provides utilities used by all segment display types.

Index

Constants

View Source
const (
	// MinCols is the smallest valid amount of columns in a cell area.
	MinCols = 6
	// MinRowPixels is the smallest valid amount of rows in a cell area.
	MinRows = 5
)

Minimum valid size of a cell canvas in order to draw a segment display.

Variables

This section is empty.

Functions

func Required

func Required(cellArea image.Rectangle) (image.Rectangle, error)

Required when given an area of cells, returns either an area of the same size or a smaller area that is required to draw one segment display (i.e. one character). Returns a smaller area when the provided area didn't have the required aspect ratio. Returns an error if the area is too small to draw a segment display, i.e. smaller than MinCols x MinRows.

func SegmentSize

func SegmentSize(ar image.Rectangle) int

SegmentSize given an area for the display segment determines the size of individual segments, i.e. the width of a vertical or the height of a horizontal segment.

func ToBraille

func ToBraille(cvs *canvas.Canvas) (*braille.Canvas, image.Rectangle, error)

ToBraille converts the canvas into a braille canvas and returns a pixel area with aspect ratio adjusted for the segment display.

Types

This section is empty.

Directories

Path Synopsis
Package dotseg simulates a segment display that can draw dots.
Package dotseg simulates a segment display that can draw dots.
testdotseg
Package testdotseg provides helpers for tests that use the dotseg package.
Package testdotseg provides helpers for tests that use the dotseg package.
Package segment provides functions that draw a single segment.
Package segment provides functions that draw a single segment.
testsegment
Package testsegment provides helpers for tests that use the segment package.
Package testsegment provides helpers for tests that use the segment package.
Package sixteen simulates a 16-segment display drawn on a canvas.
Package sixteen simulates a 16-segment display drawn on a canvas.
testsixteen
Package testsixteen provides helpers for tests that use the sixteen package.
Package testsixteen provides helpers for tests that use the sixteen package.

Jump to

Keyboard shortcuts

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