Documentation
¶
Index ¶
- Constants
- Variables
- func CpToRune(cp CodePoint) rune
- func ErrorDiffusionDithering(src image.Image, dst *Image, k DiffusionKernel)
- func OrderedDithering(src image.Image, dst *Image, thMap ThresholdMap)
- func PixRectToCpRect(r image.Rectangle) image.Rectangle
- func Thresholding(src image.Image, dst *Image, threshold8 uint8)
- type CodePoint
- type Color
- type DiffusionKernel
- type Ditherer
- type Image
- func (p *Image) At(px, py int) color.Color
- func (p *Image) Bounds() image.Rectangle
- func (p *Image) ByteLen() int
- func (p *Image) Clear() *Image
- func (p *Image) ColorModel() color.Model
- func (p *Image) CpAt(x, y int) CodePoint
- func (p *Image) CpOffset(x, y int) int
- func (p *Image) DotAt(px, py int) Color
- func (p *Image) Fill(cp CodePoint) *Image
- func (p *Image) FlipBits() *Image
- func (p *Image) FlipH() *Image
- func (p *Image) FlipV() *Image
- func (p *Image) RGBA64At(x, y int) color.RGBA64
- func (p *Image) String() string
- func (p *Image) SubImage(r image.Rectangle) *Image
- func (p *Image) SubImagePix(r image.Rectangle) *Image
- type Renderer
- type ThresholdMap
Constants ¶
View Source
const (
DefaultThreshold = 128
)
Variables ¶
View Source
var Atkinson = DiffusionKernel{ Base: 8, Rows: [][]int32{ {1, 1}, {1, 1, 1}, {1}, }, }
View Source
var Burkes = DiffusionKernel{ Base: 32, Rows: [][]int32{ {8, 4}, {2, 4, 8, 4, 2}, }, }
View Source
var ColorModel = color.ModelFunc(colorModel)
View Source
var FloydSteinberg = DiffusionKernel{ Base: 16, Rows: [][]int32{ {7}, {3, 5, 1}, }, }
View Source
var JarvisJudiceNinke = DiffusionKernel{ Base: 48, Rows: [][]int32{ {7, 5}, {3, 5, 7, 5, 3}, {1, 3, 5, 3, 1}, }, }
View Source
var Sierra = DiffusionKernel{ Base: 32, Rows: [][]int32{ {5, 3}, {2, 4, 5, 4, 2}, {2, 3, 2}, }, }
View Source
var SierraLite = DiffusionKernel{ Base: 4, Rows: [][]int32{ {2}, {1, 1}, }, }
Functions ¶
func ErrorDiffusionDithering ¶ added in v0.3.0
func ErrorDiffusionDithering(src image.Image, dst *Image, k DiffusionKernel)
func OrderedDithering ¶ added in v0.2.0
func OrderedDithering(src image.Image, dst *Image, thMap ThresholdMap)
Types ¶
type DiffusionKernel ¶
type Ditherer ¶
type Ditherer struct {
// contains filtered or unexported fields
}
func (*Ditherer) ErrorDiffusion ¶ added in v0.3.0
func (d *Ditherer) ErrorDiffusion(src image.Image, dst *Image, k DiffusionKernel)
type Image ¶ added in v0.3.0
func NewImagePix ¶ added in v0.3.0
NewImagePix creates empty image with given size in pixels.
func (*Image) ColorModel ¶ added in v0.3.0
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
type ThresholdMap ¶ added in v0.2.0
ThresholdMap valid example: [0 2] [3 1]
func GenerateThresholdMap ¶ added in v0.2.0
func GenerateThresholdMap(n int) ThresholdMap
Source Files
¶
Click to show internal directories.
Click to hide internal directories.