plugin RenderEffect RedCross  name:"RedCross"
classID:#(0xcb7d9cd0, 0x23aa2a27)
(

parameters rc_main rollout:rc_roll
(
rc_color type:#color default:(color 255 0 0) ui:rc_color
rc_opacity type:#float default:100 ui:rc_opacity
rc_thickness type:#integer default:10  ui:rc_thickness
)

rollout rc_roll "RedCross"
(
group "Info"
(
label rc_label01 "This RenderEffect draws a Cross over the image."
label rc_label02 "To be used for sample images not for commercial use."
)

group "Settings"
(
colorpicker rc_color "Cross Color:" color:(color 255 0 0) align:#right fieldwidth:46
spinner rc_opacity "Cross Opacity:" range:[10,100,100] fieldwidth:38 type:#float
spinner rc_thickness "Cross Thickness:" range:[1,100,10] fieldwidth:38 type:#integer
)

group "About..."
(
label fc_label03 "Red Cross"
label fc_label07 "Version 1.1 - 05/06/2000"
label fc_label04 ""
label fc_label05 "Code by Borislav Petrov"
label fc_label06 "http://www.gfxcentral.com/bobo/"
)

)

on apply img do
(
pixel_array = #(rc_color)

h_delta = img.width as float / img.height 
counter = 0.0
for j = 0 to img.height-1 do 
(
counter += h_delta
for i = 1 to rc_thickness do
	(
	
	if rc_opacity == 100 then
	(
	old_array = #(rc_color)
	)
	else
	(
	old_array = getpixels img [counter+i-(rc_thickness/2),j] 1
	)
	
	if old_array[1] != undefined then
	(
	old_array[1] *= ((100.0-rc_opacity)/100.0)
	old_array[1] += rc_opacity*pixel_array[1]/100.0	
	)

	setpixels img [counter+i-(rc_thickness/2),j] old_array


	if rc_opacity == 100 then
	(
	old_array = #(rc_color)
	)
	else
	(
	old_array = getpixels img [img.width-counter-i+(rc_thickness/2),j] 1
	)
	if old_array[1] != undefined then
	(	
	old_array[1] *= (100.0-rc_opacity)/100.0
	old_array[1] += rc_opacity*pixel_array[1]/100.0
	)

	setpixels img [img.width-counter-i+(rc_thickness/2),j] old_array
	
	)--end i loop
)	
)--end apply

)--end plugin