func (w *Waveform) SetScaleClipping() error {
	return w.SetOptions(ScaleClipping())
}
SetScaleClipping applies sets the scaleClipping member true for the receiving
Waveform struct.
package waveform
import "fmt"
var (
	errBGColorFunctionNil = &OptionsError{
		Option: "bgColorFunction",
		Reason: "function cannot be nil",
	}
	errFGColorFunctionNil = &OptionsError{
		Option: "fgColorFunction",
		Reason: "function cannot be nil",
	}
	errSampleFunctionNil = &OptionsError{
		Option: "sampleFunction",
		Reason: "function cannot be nil",
	}
	errResolutionZero = &OptionsError{
		Option: "resolution",
		Reason: "resolution cannot be 0",
	}
	errScaleXZero = &OptionsError{
		Option: "scale",
		Reason: "X scale cannot be 0",
	}
	errScaleYZero = &OptionsError{
		Option: "scale",
		Reason: "Y scale cannot be 0",
	}
)
type OptionsError struct {
	Option string
	Reason string
}
func (e *OptionsError) Error() string {
	return fmt.Sprintf("%s: %s", e.Option, e.Reason)
}
type OptionsFunc func(*Waveform) error
func (w *Waveform) SetOptions(options ...OptionsFunc) error {
	for _, o := range options {
		if o == nil {
			continue
		}
		if err := o(w); err != nil {
			return err
		}
	}
	return nil
}
func BGColorFunction(function ColorFunc) OptionsFunc {
	return func(w *Waveform) error {
		return w.setBGColorFunction(function)
	}
}
func (w *Waveform) SetBGColorFunction(function ColorFunc) error {
	return w.SetOptions(BGColorFunction(function))
}
func (w *Waveform) setBGColorFunction(function ColorFunc) error {
	if function == nil {
		return errBGColorFunctionNil
	}
	w.bgColorFn = function
	return nil
}
func FGColorFunction(function ColorFunc) OptionsFunc {
	return func(w *Waveform) error {
		return w.setFGColorFunction(function)
	}
}
func (w *Waveform) SetFGColorFunction(function ColorFunc) error {
	return w.SetOptions(FGColorFunction(function))
}
func (w *Waveform) setFGColorFunction(function ColorFunc) error {
	if function == nil {
		return errFGColorFunctionNil
	}
	w.fgColorFn = function
	return nil
}
func Resolution(resolution uint) OptionsFunc {
	return func(w *Waveform) error {
		return w.setResolution(resolution)
	}
}
func (w *Waveform) SetResolution(resolution uint) error {
	return w.SetOptions(Resolution(resolution))
}
func (w *Waveform) setResolution(resolution uint) error {
	if resolution == 0 {
		return errResolutionZero
	}
	w.resolution = resolution
	return nil
}
func SampleFunction(function SampleReduceFunc) OptionsFunc {
	return func(w *Waveform) error {
		return w.setSampleFunction(function)
	}
}
func (w *Waveform) SetSampleFunction(function SampleReduceFunc) error {
	return w.SetOptions(SampleFunction(function))
}
func (w *Waveform) setSampleFunction(function SampleReduceFunc) error {
	if function == nil {
		return errSampleFunctionNil
	}
	w.sampleFn = function
	return nil
}
func Scale(x uint, y uint) OptionsFunc {
	return func(w *Waveform) error {
		return w.setScale(x, y)
	}
}
func (w *Waveform) SetScale(x uint, y uint) error {
	return w.SetOptions(Scale(x, y))
}
func (w *Waveform) setScale(x uint, y uint) error {
	if x == 0 {
		return errScaleXZero
	}
	if y == 0 {
		return errScaleYZero
	}
	w.scaleX = x
	w.scaleY = y
	return nil
}
func ScaleClipping() OptionsFunc {
	return func(w *Waveform) error {
		return w.setScaleClipping(true)
	}
}