RISR#1v1.01 {
; Setemkia FallingTree
; Fawn@SpiritSeeker.net (NO spam, please!)
; 13 August 2001
;
; Copyright © 2001 by Setemkia FallingTree
; This algorithm may be freely used and modified, provided Setemkia
; FallingTree is credited for origination
;
; RISR == Radial Inverted Sine Region
; Used to cut out either the inside or outside of a RISR, a star shaped
; region. The number of spokes may be one, in which case the region is
; tear shaped.
;
transform:
bool in = true
float rad = pi/180*@rotation
complex z0 = (#pixel-@center)*(cos(rad)-flip(sin(rad)))
float rz = cabs(z0)
if rz > 1E-20
float s = abs(sin(@spokes/2*atan2(z0)))
if s > 1E-20
float rp = @radius/sqrt(s)
if rz > rp
in = false
endif
endif
endif
if (!@invert && !in) || (@invert && in)
#solid = true
endif
default:
title = "RISR #1 v1.00"
param spokes
caption = "Spokes"
hint = "Number of points (spokes) in the star. An integer >= 1."
default = 3
min = 1
endparam
param radius
caption = "Radius"
hint = "Closest approach of region curve to region center."
default = 0.5
min = 1E-10
endparam
param center
caption = "Center"
hint = "Region center."
default = (0.0,0.0)
endparam
param rotation
caption = "Rotation"
hint = "Rotation of the region in degrees."
default = 0.0
min = -360.0
max = 360.0
endparam
param invert
caption = "Invert Selection"
hint = "If checked, the RIS Region is removed, otherwise \
only the RIS Region remains."
default = false
endparam
}