summaryrefslogtreecommitdiff
path: root/tek.go
diff options
context:
space:
mode:
Diffstat (limited to 'tek.go')
-rw-r--r--tek.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/tek.go b/tek.go
index 34c3bb6..84adc65 100644
--- a/tek.go
+++ b/tek.go
@@ -5,15 +5,11 @@ import (
"os"
)
-const (
- height = 3072
- width = 4096
-)
-
type Out struct {
io.Writer
hix, hiy, lox, loy, eb byte
xterm bool
+ height, width int
}
func (o *Out) escString(s string) {
@@ -29,6 +25,8 @@ func NewOut(w io.Writer) *Out {
return &Out{
Writer: w,
xterm: os.Getenv("TERM") == "xterm",
+ height: 3072,
+ width: 4096,
}
}
@@ -64,9 +62,13 @@ func limit(val, max int) int {
return val
}
+func (o *Out) Dim() (w, h int) {
+ return o.width, o.height
+}
+
func (o *Out) Plot(x, y int) {
- x = limit(x, width)
- y = limit(y, height)
+ x = limit(x, o.width)
+ y = limit(y, o.height)
hiy := byte(y>>7) & 0x1f
loy := byte(y>>2) & 0x1f