-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
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...
(defn extract-outline [pixels]
(let [blank [255.0 255.0 255.0 255.0]
[w h] ((juxt c2d/width c2d/height) pixels)]
(->> (for [x (range w)
y (range h)]
(let [p (p/get-color pixels x y)]
(when (not= p blank)
[x y])))
(filter identity)
vec)))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?
Metadata
Metadata
Assignees
Labels
No labels