Frames { ; Similiar to Sylvie Gallet's Tryptich, ; makes it possible to frame the images ; Use it with a pixel ufm ; This is a modification from raf.ucl ; Credits to Ralph Feltens as the original author ; Jos Boogen May 2004 final: float w = #width/(1+@ncols) float h = #height/(1+@nrows) int cn = @colno int rn = @rowno int nc = @ncols int nr = @nrows if (abs(real(@shift))<1) ;values between -1 and 1 will not shift float xp = real(#screenpixel) else float xp = real(#screenpixel) - #width/real(@shift) endif if (abs(imag(@shift))<1) ;values between -1 and 1 will not shift float yp = imag(#screenpixel) else float yp = imag(#screenpixel) - #height/imag(@shift) endif if cn > nc ;so "column number" will not exceed "number of columns" cn = nc endif if rn > nr ;so "row number" will not exceed "number of rows" rn = nr endif if (round(xp/w - 0.5) != cn) || (round(yp/h - 0.5) != rn) #solid = true else float w2 = w/2 float h2 = h/2 float bw = #width * @borderw / 100 float bh = #width * @borderh / 100 xp = abs (xp - w * cn - w2) - w2 + bw yp = abs (yp - h * rn - h2) - h2 + bh float bhwxp = (@borderh / @borderw) * xp if (xp < 0) && (yp < 0) if @usesolid #solid = true else #index = (@color+1) / 400 - 0.0025 endif elseif (xp > 0) && (yp < bhwxp) #index = xp/bw - 0.01 else #index = yp/bh - 0.01 endif endif default: title = "Frames" param colno caption = "Column Number" enum = "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" endparam param ncols caption = "Number of Columns" enum = "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" default = 1 endparam param rowno caption = "Row Number" enum = "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" endparam param nrows caption = "Number of Rows" enum = "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" default = 1 endparam param borderw caption = "Border Width" default = 10.0 endparam param borderh caption = "Border Height" default = 10.0 endparam param @color caption = "Inside color" default = 0 min = 0 max = 399 endparam param usesolid caption = "Use solid color" default = false endparam param shift caption = "Shift right and down" hint = "shift this fraction of the image's size to the right and down;\ values between -1 and 1 will yield no shifting" endparam }