@huukhanhnguyen/model / lanes/textures/raster
lanes/textures/raster
opImage()
opImage(
pixels,channel,width,height):ImageBuffer
Resample pre-loaded bitmap pixels onto the stream buffer — bilinear, clamp-to-edge (a photo is not toroidal; make it seamless downstream). channel 'luma' = Rec. 709 grayscale scalar; 'rgba' = 4-channel color.
Parameters
pixels
channel
string
width
number
height
number
Returns
rasterizeData()
rasterizeData(
dataList,options):ImageBuffer
Rasterize flat component data documents into a scalar tile: faces scanline-filled (evenodd, holes work), curves stroked as stamped discs along the polyline, points as dots — intensity 1 on a 0 background. The window rect maps edge-to-edge onto the square buffer (the window IS the repeat cell; a non-square window stretches, strokes approximate with the mean axis scale). Row 0 = window BOTTOM, so the component reads upright when the tile lands on a face's mm-plane UV. No anti-aliasing by design — follow with blur for soft edges. ponytail: per-row full edge scan + per-pixel disc stamps, O(size × edges); build an edge table per face if components ever get huge.
Parameters
dataList
options
height
number
strokeWidth
number
width
number
window
number[]