This is a snippet of what my world looks like right now… only took a day to get back in the saddle with the projects I had put off since last November, but now that conventions and workshops are behind me for a while, it’s time to make some better Photoshop tools. Believe it or not, I actually like this kinda stuff. Little chunk of code from a plugin I’m working on… And this, my friends, is what you have to muck around with if you aren’t getting far enough with just actions…
void DoFilter(void) {
// a, b coordinates, and the offset between adjacent pixels in the a and b dimensions
double _a, _b, aOffset, bOffset, burnFactor;
// only works for 8-bit images this way…
uint8 * pixel = static_cast<uint8 *>(fr->outData);
uint32 rectHeight = fr->filterRect.bottom – fr->filterRect.top;
uint32 rectWidth = fr->filterRect.right – fr->filterRect.left;
aOffset = (1 – (rectHeight * 0.5) / (rectHeight * 0.5));
bOffset = (1 – (rectWidth * 0.5) / (rectWidth * 0.5));fr->inRect = fr->outRect = fr->filterRect;
// fetch some data – moved this down to the processing loop
// *gResult = fr->advanceState();
// if (*gResult != noErr) return;// start kicking some ass
for (int16 plane = 0; plane < fr->planes; plane++) { //process planes
SelectPlane(plane);
*gResult = fr->advanceState();
if (*gResult != noErr) return;
pixel = static_cast<uint8 *>(fr->outData);…
…
…
Chris Harvey
Fun stuff. So do Photoshop use a variation of C? Most of the stuff looks identical except for the casting calls. So when are we going to get the hint about your new stuff?
Apr 01, 2008 @ 8:29 am
Josh Solar
I’m sure your new stuff is going to kick just as much ass as your actions
Apr 01, 2008 @ 8:35 am
Heather Cole
Umm…that’s why we love you. :)
Can’t wait!!
Apr 01, 2008 @ 11:29 am
Tony Bisson
I am working on PHP today. Not my idea of a good time but I have always had an ability to wrap my head around code.
Apr 01, 2008 @ 3:02 pm
gabriel.ryan.
serious. thanks for being the ‘ass-kicking’ tech-head.
Apr 01, 2008 @ 3:02 pm
Nathan Sawatzky
Dude, I am so stoked to see what your dreaming up. I’m positive it will have yet another huge impact on the industry. Keep it up!
Apr 01, 2008 @ 4:51 pm
Ivan
You had me at adjacent pixels……..
Good to know you’re alive
Apr 01, 2008 @ 7:22 pm
Michelle
I can’t wait to see what you’ll come up with.
Apr 02, 2008 @ 9:43 am
Marlin Munoz
The only thing I understand is “// start kicking some ass”!
Apr 02, 2008 @ 10:45 am
TonyaPeterson
Holy crap.
Apr 02, 2008 @ 12:47 pm
sandra p
i think i saw you walking into mon ami gabi whilst in vegas for wppi! you are quite tall and good looking in person! :) that’s really cool you are a brain and you’re creative at the same time. i come from a technical background, so it’s really great to see someone bring a whole new side to something artistic and creative in photography!
Apr 03, 2008 @ 11:10 am
Ryel j
Because of you … I don’t have to understand what that means. Thanks a whole bunch. Like a bunch of bananas or grapes.
Apr 20, 2008 @ 6:50 pm
mindy
and this is why we love you…
May 29, 2008 @ 8:58 am
ed atrero
ahhhh nothing beats good ‘ol C. put some divide by 0 error checks in there, brotha. i always get hounded for those during code reviews. :)
oh yah… no globals too…
Jul 08, 2008 @ 4:45 pm