Beispiel #1
0
func CalculateGammaRamp(gamma float32, ramp []uint16) {
	if len(ramp) < 256 {
		panic("len(ramp) must be > 256")
	}

	C.SDL_CalculateGammaRamp(C.float(gamma), (*C.Uint16)(&ramp[0]))
}
Beispiel #2
0
// CalculateGammaRamp calculates a 256 entry gamma ramp for a gamma value.
// CalculateGammaRamp (https://wiki.libsdl.org/SDL_CalculateGammaRamp)
func CalculateGammaRamp(gamma float32, ramp *[256]uint16) {
	C.SDL_CalculateGammaRamp(C.float(gamma), (*C.Uint16)(unsafe.Pointer(&ramp[0])))
}