imager
AQSIS_V 1.6.0


segment Data

USES 8782080

param uniform  color TopColor
param uniform  color BottomColor
param uniform  float Sharpness
param uniform  float MidPoint
param uniform  float Frequency
param uniform  float Angle
varying  float diffmid
varying  float f
varying  float g
varying  float x
varying  float y
varying  color blend
varying  color cgc
uniform  float gg[2]
varying  float lenx
varying  float leny
varying  float resolution[3]
varying  float b0::rad
varying  float b0::rx
varying  float b0::ry


segment Init
	pushif 0.35
	pushif 0.35
	pushif 0.35
	settc
	pop TopColor
	pushif 0.85
	pushif 0.85
	pushif 0.85
	settc
	pop BottomColor
	pushif 0
	pop Sharpness
	pushif 0.5
	pop MidPoint
	pushif 1
	pop Frequency
	pushif 0
	pop Angle


segment Code
	pushv MidPoint
	pushif 1
	subff
	pop diffmid
	pushv P
	xcomp
	pop x
	pushv P
	ycomp
	pop y
	S_CLEAR
	pushif 0
	pushv Angle
	neff
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 0
	pushif 180
	pushv Angle
	pushif 3.14159
	mulff
	divff
	pop b0::rad
	pushv b0::rad
	sin
	pushv y
	mulff
	pushv b0::rad
	cos
	pushv x
	mulff
	subff
	pop b0::rx
	pushv b0::rad
	cos
	pushv y
	mulff
	pushv b0::rad
	sin
	pushv x
	mulff
	addff
	pop b0::ry
	pushv b0::rx
	pop x
	pushv b0::ry
	pop y
:0
	RS_POP
	pushis "Format"
	option resolution
	drop
	pushif 0
	ipushv resolution
	pushv x
	pushv Frequency
	mulff
	divff
	pop lenx
	pushif 1
	ipushv resolution
	pushv y
	pushv Frequency
	mulff
	divff
	pop leny
	pushif 0.5
	log
	pushif 0.999
	pushif 0.001
	pushv diffmid
	clamp
	log
	divff
	pushv leny
	pow
	pop f
	pushv Sharpness
	pushv f
	pushif 0.495
	pushv Sharpness
	mulff
	pushif 1
	subff
	pushif 0.495
	pushv Sharpness
	mulff
	smoothstep
	pushv f
	fmix
	pop g
	pushv g
	pushv BottomColor
	pushv TopColor
	cmix
	pop blend
	pushif 1
	pushif 0
	ipop gg
	pushv blend
	pop cgc
	S_CLEAR
	pushif 1
	pushis "Exposure"
	option gg
	eqff
	S_GET
	RS_PUSH
	RS_GET
	RS_JZ 1
	pushif 1
	ipushv gg
	pushif 1
	divff
	pushif 0
	ipushv gg
	pushif 0
	pushv blend
	comp
	mulff
	pow
	pushif 0
	pushv cgc
	setcomp
	pushif 1
	ipushv gg
	pushif 1
	divff
	pushif 0
	ipushv gg
	pushif 1
	pushv blend
	comp
	mulff
	pow
	pushif 1
	pushv cgc
	setcomp
	pushif 1
	ipushv gg
	pushif 1
	divff
	pushif 0
	ipushv gg
	pushif 2
	pushv blend
	comp
	mulff
	pow
	pushif 2
	pushv cgc
	setcomp
:1
	RS_POP
	pushv cgc
	pushv alpha
	pushif 1
	subff
	mulfc
	pop blend
	pushv blend
	pushv Ci
	addcc
	pop cgc
	pushif 1
	pop alpha
	pushv cgc
	pop Ci
	pushv alpha
	setfc
	pop Oi
