Doug Boutwell the occasional odd thought or image

Hard at work on new goodies…

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);

14 Responses Subscribe to comments


  1. 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


  2. 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


  3. Heather Cole

    Umm…that’s why we love you. :)

    Can’t wait!!

    Apr 01, 2008 @ 11:29 am


  4. 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


  5. gabriel.ryan.

    serious. thanks for being the ‘ass-kicking’ tech-head.

    Apr 01, 2008 @ 3:02 pm


  6. 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


  7. Ivan

    You had me at adjacent pixels……..

    Good to know you’re alive

    Apr 01, 2008 @ 7:22 pm


  8. Michelle

    I can’t wait to see what you’ll come up with.

    Apr 02, 2008 @ 9:43 am


  9. Marlin Munoz

    The only thing I understand is “// start kicking some ass”!

    Apr 02, 2008 @ 10:45 am


  10. TonyaPeterson

    Holy crap.

    Apr 02, 2008 @ 12:47 pm


  11. 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


  12. 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


  13. mindy

    and this is why we love you…

    May 29, 2008 @ 8:58 am


  14. 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


Archives
April 2008
M T W T F S S
« Mar   May »
 123456
78910111213
14151617181920
21222324252627
282930