using get() with set variables

Comments and discussions about 8bf plugins which can be use in various applications like Photoshop, Paint Shop Pro or Photo-Paint
g1fred
Plugin Novice
Plugin Novice
Posts: 2
Joined: Fri Apr 18, 2003 12:06 pm

using get() with set variables

Postby g1fred » Fri Apr 18, 2003 12:25 pm

r=put(c,i),
get(d)+(ctl(0)) g=get(i) b=get(i) a=a
I have been working on a filter and had been getting results from the code
that I could not understand. The filter is using multiple put and get statements, and I guess as a carryover from other work I was using i as the
holder for a put statement. Somehwere along the line as I was backspacing to change code, the error message went away when it seemed it shouldn't, or so I think,and happily, I liked the result. What I found was that the get statement when used with one of the built in variables,and some functions as well, was producing a value directly with no put statement before. The code above is one example I got to in trying to isolate the "problem" What is the story with this, using get() with built in variables, a bug, something I've missed in the documentation...?

HaraldHeim
Plugin Guru
Plugin Guru
Posts: 3333
Joined: Fri Mar 08, 2002 1:00 am
Location: The Plugin Site
Contact:

Postby HaraldHeim » Sat Apr 19, 2003 12:41 pm

From the code I can see that you seem to be programming a FilterFactory plugin. Here's your code again in a more readable manner:

Code: Select all

r=put(c,i), get(d)+(ctl(0))
g=get(i)
b=get(i)
a=a


put(c,i) places various color values from the red channel in the 256 storage cells according to the grayscale value of the current pixel. The more pixels are processed, the more cells get filled with values.

get(d)+(ctl(0)) reads from these cells according to an angular pattern. This pattern is visible in the preview box of Filter Factory. The pattern is also influenced by the first slider.

get(i) simply reads the values that have been placed in the storage cells by put(c,i) and writes them to the green and blue channel.

So this filter doesn't produce a very desirable effect at all. I hope these explanations helped you with your problem.

For more information about the Filter Factory programming language see:
http://thepluginsite.com/knowhow/ffpg/ffpg.htm

glfred

Postby glfred » Sat Apr 19, 2003 1:33 pm

My point was that since I have not created a storage cell for d, using get() with it should have no effect, and ctl(0) also should do nothing, as it is being added to nothing, but in fact get(d) does play, and changing the slider value
draws a gradient sweep 180 degrees from the bottom center of the image t o the top. Substituting m, or x or y.... for d also create different effects.
I would not expect this to happen, and I am wondering if any rules for using
this are documented_thanks for your help
http://www.brilliantanimals.com/odd3.afs

HaraldHeim
Plugin Guru
Plugin Guru
Posts: 3333
Joined: Fri Mar 08, 2002 1:00 am
Location: The Plugin Site
Contact:

Postby HaraldHeim » Sat Apr 19, 2003 6:08 pm

The 256 storage cells are created by default by FilterFactory. If you don't fill them with put(), they return zero for every get(). But put(c,i) fills them with values, so you get these values back when you use get(d) or get(i).


Return to “Photoshop-compatible Plugins”

Who is online

Users browsing this forum: No registered users and 9 guests