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

Function init

core/image/s3.go:26–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func init() {
27 RegisterConverter(S3_DXT1_RGB, RGBA_U8_NORM, func(src []byte, w, h, d int) ([]byte, error) {
28 return decode4x4Blocks(src, w, h, d, func(r binary.Reader, dst []pixel) {
29 decodeDXT1(r, dst, func(p *pixel) {
30 p.setToBlackRGB()
31 })
32 })
33 })
34 RegisterConverter(S3_DXT1_RGBA, RGBA_U8_NORM, func(src []byte, w, h, d int) ([]byte, error) {
35 return decode4x4Blocks(src, w, h, d, func(r binary.Reader, dst []pixel) {
36 decodeDXT1(r, dst, func(p *pixel) {
37 p.setToBlackRGBA()
38 })
39 })
40 })
41 RegisterConverter(S3_DXT3_RGBA, RGBA_U8_NORM, func(src []byte, w, h, d int) ([]byte, error) {
42 return decode4x4Blocks(src, w, h, d, func(r binary.Reader, dst []pixel) {
43 decodeAlphaDXT3(r, dst)
44 decodeColorDXT3_5(r, dst)
45 })
46 })
47 RegisterConverter(S3_DXT5_RGBA, RGBA_U8_NORM, func(src []byte, w, h, d int) ([]byte, error) {
48 return decode4x4Blocks(src, w, h, d, func(r binary.Reader, dst []pixel) {
49 decodeAlphaDXT5(r, dst)
50 decodeColorDXT3_5(r, dst)
51 })
52 })
53}
54
55type pixel struct {
56 r, g, b, a int

Callers

nothing calls this directly

Calls 8

RegisterConverterFunction · 0.85
decode4x4BlocksFunction · 0.85
decodeDXT1Function · 0.85
decodeAlphaDXT3Function · 0.85
decodeColorDXT3_5Function · 0.85
decodeAlphaDXT5Function · 0.85
setToBlackRGBMethod · 0.80
setToBlackRGBAMethod · 0.80

Tested by

no test coverage detected