Documentation ¶
Overview ¶
Package wav2png implements the functions required to render an audio waveform as a PNG image. The current implementation supports 16 bit PCM WAV files only.
Index ¶
- Constants
- Variables
- func Antialias(img *image.NRGBA, kernel Kernel) *image.NRGBA
- func Fill(img *image.NRGBA, spec FillSpec)
- func Grid(spec GridSpec, width, height, padding int) *image.NRGBA
- func Render(pcm []float32, fs float64, width, height int, palette Palette, volume float64) *image.NRGBA
- type FillSpec
- type Fit
- type GridSpec
- type Kernel
- type NoGrid
- type Palette
- type RectangularGrid
- func (g RectangularGrid) Border(bounds image.Rectangle, padding int) *image.Rectangle
- func (g RectangularGrid) Colour() color.NRGBA
- func (g RectangularGrid) HLines(bounds image.Rectangle, padding int) []int
- func (g RectangularGrid) Overlay() bool
- func (g RectangularGrid) VLines(bounds image.Rectangle, padding int) []int
- type SolidFill
- type SquareGrid
Constants ¶
Variables ¶
View Source
var Horizontal = Kernel{
{0, 0, 0},
{1, 2, 1},
{0, 0, 0},
}
View Source
var None = Kernel{
{0, 0, 0},
{0, 1, 0},
{0, 0, 0},
}
View Source
var Soft = Kernel{
{1, 2, 1},
{2, 12, 2},
{1, 2, 1},
}
View Source
var Vertical = Kernel{
{0, 1, 0},
{0, 2, 0},
{0, 1, 0},
}
Functions ¶
Types ¶
type GridSpec ¶
type RectangularGrid ¶
type RectangularGrid struct {
// contains filtered or unexported fields
}
func NewRectangularGrid ¶
func (RectangularGrid) Colour ¶
func (g RectangularGrid) Colour() color.NRGBA
func (RectangularGrid) HLines ¶
func (g RectangularGrid) HLines(bounds image.Rectangle, padding int) []int
func (RectangularGrid) Overlay ¶
func (g RectangularGrid) Overlay() bool
type SolidFill ¶
type SolidFill struct {
// contains filtered or unexported fields
}
func NewSolidFill ¶
type SquareGrid ¶
type SquareGrid struct {
// contains filtered or unexported fields
}
func NewSquareGrid ¶
func (SquareGrid) Colour ¶
func (g SquareGrid) Colour() color.NRGBA
func (SquareGrid) Overlay ¶
func (g SquareGrid) Overlay() bool
Click to show internal directories.
Click to hide internal directories.