Create colours module with colour definitions
This commit is contained in:
1 parent
7f29c5abbb
commit
f25e9a00a8
4 files changed
+25
-23
No files matched your search
+1
-8
@@ -2,20 +2,13 @@ mod common;
|
||||
|
||||
use ccvl::*;
|
||||
|
||||
const LINE: image::SRGBA = image::SRGBA {
|
||||
r: 1.0,
|
||||
g: 0.0,
|
||||
b: 0.0,
|
||||
a: 1.0,
|
||||
};
|
||||
|
||||
fn main() -> std::process::ExitCode {
|
||||
common::process_image(|mut img| {
|
||||
let greyscale = img.map(|p| image::Luminance::from(p));
|
||||
let edges = filter::canny(greyscale);
|
||||
for line in hough::lines(10.0, edges) {
|
||||
let ((x0, y0), (x1, y1)) = endpoints(line, img.extent);
|
||||
draw::line(x0, y0, x1, y1, &mut img, LINE);
|
||||
draw::line(x0, y0, x1, y1, &mut img, colours::RED);
|
||||
}
|
||||
img
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user