internal/affine/colorm.go
func (c *ColorM) Add(other *ColorM) *ColorM {
	lhsb := colorMIdentityBody
	lhst := colorMIdentityTranslate
	rhsb := colorMIdentityBody
	rhst := colorMIdentityTranslate
	if other.isInited() {
		if other.body != nil {
			lhsb = other.body
		}
		if other.translate != nil {
			lhst = other.translate
		}
	}
	if c.isInited() {
		if c.body != nil {
			rhsb = c.body
		}
		if c.translate != nil {
			rhst = c.translate
		}
	}

	newC := &ColorM{
		body:      make([]float32, 16),
		translate: make([]float32, 4),
	}
	for i := range lhsb {
		newC.body[i] = lhsb[i] + rhsb[i]
	}
	for i := range lhst {
		newC.translate[i] = lhst[i] + rhst[i]
	}

	return newC
}
func (c *ColorM) Add(other *ColorM) *ColorM {
	lhsb := colorMIdentityBody
	lhst := colorMIdentityTranslate
	rhsb := colorMIdentityBody
	rhst := colorMIdentityTranslate
	if other.isInited() {
		if other.body != nil {
			lhsb = other.body
		}
		if other.translate != nil {
			lhst = other.translate
		}
	}
	if c.isInited() {
		if c.body != nil {
			rhsb = c.body
		}
		if c.translate != nil {
			rhst = c.translate
		}
	}

	newC := &ColorM{
		body:      make([]float32, 16),
		translate: make([]float32, 4),
	}
	for i := range lhsb {
		newC.body[i] = lhsb[i] + rhsb[i]
	}
	for i := range lhst {
		newC.translate[i] = lhst[i] + rhst[i]
	}

	return newC
}
func ( c * ColorM ) Add ( other * ColorM ) * ColorM { lhsb := colorMIdentityBody lhst := colorMIdentityTranslate rhsb := colorMIdentityBody rhst := colorMIdentityTranslate if other . isInited ( ) { if other . body != nil { lhsb = other . body } if other . translate != nil { lhst = other . translate } } if c . isInited ( ) { if c . body != nil { rhsb = c . body } if c . translate != nil { rhst = c . translate } } newC := & ColorM { body : make ( [ ] float32 , 16 ) , translate : make ( [ ] float32 , 4 ) , } for i := range lhsb { newC . body [ i ] = lhsb [ i ] + rhsb [ i ] } for i := range lhst { newC . translate [ i ] = lhst [ i ] + rhst [ i ] } return newC }
// Add is deprecated.
Add is deprecated .