The main function inside a pixel bender kernel is a loop, and is called back for every single pixel being evaluated by the kernel. Here is a link to a tutorial on how do to exactly what you want (working with multiple inputs).
http://www.adobe.com/devnet/pixelbender/articles/creating_effects_pt09.html#articlecontentAdobe_numberedheader
Essentially it just comes down to defining two inputs:
<languageVersion : 1.0;>
kernel blendy
< namespace : "com.adobe.devnet.pixelbender";
vendor : "Kevin's Filters";
version : 1;
description : "mashes two inputs together";
>
{
input image4 src; //Input image 1 as image4 (RGBA)
input image4 src2; //Input image 2 as image4 (RGBA)
output pixel4 dst; //Single pixel data type/represents single pixel value (RGBA)
void evaluatePixel()
{
dst = sampleNearest(src,outCoord());
}
}
Note that the two parameters of sampleNearest are the source image, and the coordinates of the pixel to sample. outCoord() I believe is simply the current pixel within the loop. As mentioned, evaludatePixel (to my understanding) is called once per pixel that exists in the input. Here is a modified version of the above code (from the link) that is reading the value of both inputs at the same time:
<languageVersion : 1.0;>
kernel blendy
< namespace : "com.adobe.devnet.pixelbender";
vendor : "Kevin's Filters";
version : 1;
description : "mashes two inputs together";
>
{
input image4 src; //Input image 1 as image4 (RGBA)
input image4 src2; //Input image 2 as image4 (RGBA)
output pixel4 dst; //Output image
void evaluatePixel()
{
dst = sampleNearest(src2,outCoord()) + sampleNearest(src, outCoord());
}
}
Here are two video tutorials that will explain much more about how pixel works at length:
http://gotoandlearn.com/play.php?id=83
http://gotoandlearn.com/play.php?id=84
http://www.gotoandlearn.com/play.php?id=95