flash - Turn off color ranges in Pixel Bender -
what best way turn turn off (using pixelbender) colors fall within range. example, turn off colors between 0x0000ff , 0x00ffff. help. has work in flash. thanks!
if mean per channel "between", here simple way it.
<languageversion : 1.0;> kernel untitled < namespace : "your namespace"; vendor : "your vendor"; version : 1; > { input image4 src; output pixel4 dst; parameter float rthreshold < minvalue: 0.0; maxvalue: 1.0; defaultvalue: 0.0; >; parameter float gthreshold < minvalue: 0.0; maxvalue: 1.0; defaultvalue: 0.0; >; parameter float bthreshold < minvalue: 0.0; maxvalue: 1.0; defaultvalue: 0.0; >; void evaluatepixel() { pixel4 sourcepixel = samplenearest(src,outcoord()); if(sourcepixel.r <= rthreshold) sourcepixel.r = 0.0; if(sourcepixel.g <= gthreshold) sourcepixel.g = 0.0; if(sourcepixel.b <= bthreshold) sourcepixel.b = 0.0; dst = sourcepixel; } }
Comments
Post a Comment