The HOLE filter.  Can I place an image behind the hole created in another image?

The HOLE filter.  Can I place an image behind the hole created in another image?

Here's an example of the hole filter composited against a background image. This filter will run in the Pixel Bender Toolkit.
<languageVersion : 1.0;>
kernel HoleCompositedAgainstBackground
<
  namespace: "pb::forums";
     vendor: "spotted chicken";
    version: 1;
description: "Hole filter composited against a background image. The original 'Hole' filter was written by Jerrynet. See the Pixel Bender Exchange, <http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1550519#> for more information.";
>
//< namespace : "net.Jerry.PixelBender";
// vendor : "[email protected]";
// version : 4;
// description : "A Hole Distortion Effect.";
//>
parameter float radius
<
     minValue:    float(0.0);
     maxValue: float(1000.0);
defaultValue:  float(100.0);
aeDisplayName: "Radius";
>;
parameter float2 center
<
     minValue:   float2(-800,-800.0);
     maxValue: float2(1600.0,1600.0);
defaultValue:   float2(120.0,120.0);
aeDisplayName: "Center";
>;
parameter float EdgeSmooth
<
     minValue: float(0.0);
     maxValue: float(3.0);
defaultValue: float(1.0);
aeDisplayName: "Edge smoothing";
>;
input  image4 src;
input  image4 background;
output pixel4 dst;
void
evaluatePixel()
float2 Pos_from_cen = outCoord() - center;
float p_length = length(Pos_from_cen);
float fun = (radius*radius)/abs(p_length);
float m = fun/sqrt(Pos_from_cen[0]*Pos_from_cen[0] + Pos_from_cen[1]*Pos_from_cen[1]);
float2 pp = -float2(m*Pos_from_cen[0], m*Pos_from_cen[1]) + outCoord();
pixel4 final = sampleLinear(src,pp);
if (p_length <= (radius+EdgeSmooth/2.0))
//smooth the circle edge
if (p_length >= (radius-EdgeSmooth/2.0))
final *= (p_length-radius+EdgeSmooth/2.0)/EdgeSmooth;
else
final = sampleNearest(background, center + Pos_from_cen);
dst = final;

Similar Messages

Maybe you are looking for

  • How can I print out my album list from ITunes?

    When I open up Itunes, I have over 400 albums and I would like to print out just the names of all my albums but I cant seem to figure out how. When I try to export my song list, it gives out way too much like every song on each album and it goes to w

  • Imovie 10.1 not responding

    I was creating a new event when imovie crashed and it has stopped responding on my 13" macbook pro with mountain lion recently upgraded to maverick

  • SAP WM: Mixed pallet with putaway strategy "P"

    Dear Experts, I am using putaway strategy P for a storage type and I have given X for Mixed storage field. I am not able to put multiple batches of same material in one bin, is it possible with putaway strategy P I am not using SU management. Thanks

  • Function Module to find Reference Employee Number (PERNR)

    Hi All, Is there a FM to get employee's reference PERNR (employee number) in case employee was assigned a new employee number due to inter-company transfer or anyother reason. Thanks

  • Multiple (parallel) RFC Calls through  one connection?

    Hi SAP gurus, Is there a possibility for parallel RFC calls through one open connection via one SAP system user? As I know when calling RFCs it opens a new session and the dialog users have only 6 sessions permitted. Do you know any possible solution