You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Messing with some pixel operations, scanning to eliminate blank pixels (naively), I want to filter out
[255.0 255.0 255.0 255.0] and record [x y] coords that are non-blank...
Input pixels is a result of to-pixels from an image. I believe a vector4 buffer.
The problem is, = between the vec4 that's stored in pixels and the literal 4-element vector I denoted is not considered structurally equal. So, every pixel is returned. I'm guessing the simple way out is to to use vec4 explicitly instead of clojure's vector. Is this intentional?
The text was updated successfully, but these errors were encountered:
For your case you can convert blank to color (which is vec4): c/to-color [255.0 255.0 255.0 255.0]) or just set blank to white (c/color 255.0 255.0 255.0 255.0) or c/to-color :white.
Considering your example, from efficiency point of view, it's good to have the same types (color ie. vec4). But in fastmath I see that it's crucial to follow Clojure perception of identity vs equality. It should refactored for sure.
Can maybe mitigate perf hit with a specific instance check for vector. Or force callers to use vec4 equality somehow. Not a huge deal, just something counterintuitive I ran across. I would be okay if an exception was raised too, telling me to use vec4.
Messing with some pixel operations, scanning to eliminate blank pixels (naively), I want to filter out
[255.0 255.0 255.0 255.0] and record [x y] coords that are non-blank...
Input pixels is a result of
to-pixels
from an image. I believe a vector4 buffer.The problem is,
=
between the vec4 that's stored in pixels and the literal 4-element vector I denoted is not considered structurally equal. So, every pixel is returned. I'm guessing the simple way out is to to use vec4 explicitly instead of clojure's vector. Is this intentional?The text was updated successfully, but these errors were encountered: