imager
AQSIS_V 1.6.0


segment Data

USES 393216

param uniform  float gain
param uniform  float gamma
param uniform  float one
param uniform  float min
param uniform  float max
varying  color gaincolor


segment Init
	pushif 1
	pop gain
	pushif 1
	pop gamma
	pushif 255
	pop one
	pushif 0
	pop min
	pushif 255
	pop max


segment Code
	pushv gain
	setfc
	pushv Ci
	mulcc
	pop gaincolor
	pushif 0
	pushv gamma
	pushif 1
	divff
	pushif 0
	pushv gaincolor
	comp
	pow
	pushif 0
	pushv Ci
	comp
	addff
	pushv Ci
	setcomp
	pushif 1
	pushv gamma
	pushif 1
	divff
	pushif 1
	pushv gaincolor
	comp
	pow
	pushif 1
	pushv Ci
	comp
	addff
	pushv Ci
	setcomp
	pushif 2
	pushv gamma
	pushif 1
	divff
	pushif 2
	pushv gaincolor
	comp
	pow
	pushif 2
	pushv Ci
	comp
	addff
	pushv Ci
	setcomp
	pushif 0
	pushv max
	pushv min
	pushif 0
	pushv Ci
	comp
	pushv one
	mulff
	floor
	clamp
	pushv Ci
	setcomp
	pushif 1
	pushv max
	pushv min
	pushif 1
	pushv Ci
	comp
	pushv one
	mulff
	floor
	clamp
	pushv Ci
	setcomp
	pushif 2
	pushv max
	pushv min
	pushif 2
	pushv Ci
	comp
	pushv one
	mulff
	floor
	clamp
	pushv Ci
	setcomp
	pushif 0
	pushv max
	pushv min
	pushif 0
	pushv Oi
	comp
	pushv one
	mulff
	floor
	clamp
	pushv Oi
	setcomp
	pushif 1
	pushv max
	pushv min
	pushif 1
	pushv Oi
	comp
	pushv one
	mulff
	floor
	clamp
	pushv Oi
	setcomp
	pushif 2
	pushv max
	pushv min
	pushif 2
	pushv Oi
	comp
	pushv one
	mulff
	floor
	clamp
	pushv Oi
	setcomp
