NOTES toward a LuminanceArrayScript
Preliminary Outline of an algorithm to array points on a curve, based upon the summation of the luminance of the underlying pixels.
Find the pseudoWidth of a pixel.
pWidth = pixelWidth; // For a horizontal curve.
// or pWidth = function of pixelWidth and pixelHeight.
Beginning with the curve startPt (left most point), Array the curve with many points, spaced by the pixelWidth.
var lumTotal = 0;
Outer For Loop to save desired final point(s) in an array.
Starting at the startPt of the curve.
Inner For loop. Add up the lumValues until lumMax is reached.
Process the next point.
get the lumValue of the underlying pixel. (Make some correction if on the boundary of pixels.)
CurrentPoint = ...
For lumTotal < lumMax;
lumTotal += lumValue;
End Inner For loop.
Add CurrentPoint to lumArray of the final desired points.
End Outer For Loop.
- Brian
I do not know the relation between the coordinates of a point on the curve, and the address of the underlying pixel.
It is probably in Wayne's script?
(This is a very rough draft.)
|