Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ColorModel color.Model = ThresholdColorModel(128)
ColorModel is the default color model for bitmaps.
Functions ¶
func ThresholdColorModel ¶
ThresholdColorModel returns a color model with the given threshold.
Types ¶
type Device ¶
type Device interface { MaxWidth() int DPI() float64 PrintBitmap(img *Image) error Feed(lines int) error }
A Device is an infinitely-tall, 1-bit output device with a maximum width and a DPI.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
A Image is a 1-bit image.
func ForDevice ¶
ForDevice converts the input image to a device-appropriate bitmap, downscaling and dithering as necessary.
func NewThreshold ¶
NewWithThreshold creates a new Image with the given bounds and threshold.
func (*Image) At ¶
At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
Set bits return color.White; unset bits return color.Black.
func (*Image) Bounds ¶
Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).
func (*Image) ColorModel ¶
ColorModel returns the Image's color model.