MCPcopy Create free account
hub / github.com/google/gapid / decodeColorDXT3_5

Function decodeColorDXT3_5

core/image/s3.go:135–151  ·  view source on GitHub ↗
(r binary.Reader, dst []pixel)

Source from the content-addressed store, hash-verified

133}
134
135func decodeColorDXT3_5(r binary.Reader, dst []pixel) {
136 c0, c1, codes := r.Uint16(), r.Uint16(), r.Uint32()
137 p0, p1 := expand565(int(c0)), expand565(int(c1))
138 for i := 0; i < 16; i++ {
139 switch codes & 0x3 {
140 case 0:
141 dst[i].setColorFrom(p0)
142 case 1:
143 dst[i].setColorFrom(p1)
144 case 2:
145 dst[i].setToMix3(p0, p1)
146 case 3:
147 dst[i].setToMix3(p1, p0)
148 }
149 codes >>= 2
150 }
151}
152
153func decodeAlphaDXT3(r binary.Reader, dst []pixel) {
154 a := r.Uint64()

Callers 1

initFunction · 0.85

Calls 5

expand565Function · 0.85
setColorFromMethod · 0.80
setToMix3Method · 0.80
Uint16Method · 0.65
Uint32Method · 0.65

Tested by

no test coverage detected