func colorToCoef(gen color.Color) Coef {
	r32, g32, b32, _ := gen.RGBA()
	r, g, b := float64(r32>>8), float64(g32>>8), float64(b32>>8)
	return Coef{
		(0.299900*r + 0.587000*g + 0.114000*b) / 0x100,
		(0.595716*r - 0.274453*g - 0.321263*b) / 0x100,
		(0.211456*r - 0.522591*g + 0.311135*b) / 0x100}
}
colorToCoef converts a native Color type into a YIQ Coef. We are using
YIQ because we only have weights for them. (Apart from the score weights,
the store is built to handle different sized Coef's so any length may be
returned.)
package haar
import (
	"image"
	"image/color"
	"math"
)
const ColourChannels = 3
type Coef [ColourChannels]float64
func (coef *Coef) Add(offset Coef) {
	for index := range coef {
		coef[index] += offset[index]
	}
}
func (coef *Coef) Subtract(offset Coef) {
	for index := range coef {
		coef[index] -= offset[index]
	}
}
func (coef *Coef) Divide(value float64) {
	factor := 1.0 / value
	for index := range coef {
		coef[index] *= factor  
	}
}
type Matrix struct {
	Coefs []Coef
	Width uint
	Height uint
}