Documentation ¶
Index ¶
- Constants
- Variables
- func CanvasSize(address string) (int, int)
- func FetchImage(bounds *image.Rectangle, address string, conns int, stop chan bool) (img *image.NRGBA)
- func Flut(t FlutTask, stop chan bool, wg *sync.WaitGroup)
- func OffsetCmd(x, y int) []byte
- type FlutTask
- type FlutTaskData
- type FlutTaskOpts
- type Performance
- type RenderOrder
Constants ¶
const ( LeftToRight = 0b000 TopToBottom = 0b001 RightToLeft = 0b010 BottomToTop = 0b011 Shuffle = 0b100 )
Variables ¶
var PerformanceReporter = initPerfReporter()
PerformanceReporter provides pixelflut performance metrics, when Enabled is true.
@speed: Note that enabling costs ~9% bomb performance under high throughput.
Functions ¶
func CanvasSize ¶
CanvasSize returns the size of the canvas as returned by the server
func FetchImage ¶
func FetchImage(bounds *image.Rectangle, address string, conns int, stop chan bool) (img *image.NRGBA)
FetchImage asynchronously uses `conns` to fetch pixels within `bounds` from a pixelflut server at `address`, and writes them into the returned Image. If bounds is nil, the server's entire canvas is fetched.
func OffsetCmd ¶
OffsetCmd applies offset to all following requests. Not supported by all servers. example: https://github.com/TobleMiner/shoreline.
Types ¶
type FlutTask ¶
type FlutTask struct { FlutTaskOpts Img FlutTaskData }
FlutTask contains all data that is needed to flut
func (FlutTask) IsFlutable ¶
IsFlutable indicates if a task is properly initialized & not paused
type FlutTaskData ¶
FlutTaskData contains the actual pixeldata to flut, separated because of size
type FlutTaskOpts ¶
type FlutTaskOpts struct { Address string MaxConns int Offset image.Point Paused bool RGBSplit bool // @cleanup: replace with `FX: []Effect` RandOffset bool RenderOrder RenderOrder }
FlutTaskOpts specifies parameters of the flut
type Performance ¶
type Performance struct { Enabled bool Conns int BytesPerSec int BytesTotal int // contains filtered or unexported fields }
Performance contains pixelflut metrics
func (Performance) String ¶
func (p Performance) String() string
type RenderOrder ¶
type RenderOrder uint8
func NewOrder ¶
func NewOrder(v string) RenderOrder
func (RenderOrder) IsReverse ¶
func (t RenderOrder) IsReverse() bool
func (RenderOrder) IsVertical ¶
func (t RenderOrder) IsVertical() bool
func (RenderOrder) String ¶
func (t RenderOrder) String() string