This seems like it might be a good job for Pixel Bender. Here's a simple one-pixel slice with a control to let you set the y position for the sample:
<languageVersion : 1.0;>
kernel BarCode
< displayname : "Bar Code";
category : "Pixel Bender Effects";
namespace : "AfterEffects";
vendor : "Dan Ebberts";
version : 1;
description : "Create bar code from image";
>
{
input image4 src;
output pixel4 dst;
parameter float2 center
<
aeDisplayName: "Center";
aePointRelativeDefaultValue: float2(0.5,0.5);
aeUIControl: "aePoint";
parameterType: "position";
defaultValue: float2(200.0,200.0);
>;
void
evaluatePixel()
{
float2 p = outCoord();
dst = sample(src,float2(p.x, center.y));
}
}
Just save it as a .pbk and drop it into AE's Plug-ins folder.
Dan