Use static kmeans seed
This commit is contained in:
@ -36,5 +36,6 @@ TODO
|
|||||||
+ ~~add cache for album art colors~~
|
+ ~~add cache for album art colors~~
|
||||||
+ ~~add spotify link fetching~~
|
+ ~~add spotify link fetching~~
|
||||||
+ ~~add arbitrary spotify searching~~
|
+ ~~add arbitrary spotify searching~~
|
||||||
|
+ ~~use static seed for kmeans~~
|
||||||
+ make various parameters user-configurable
|
+ make various parameters user-configurable
|
||||||
+ use tiny-skia instead of magick-rust?
|
+ use tiny-skia instead of magick-rust?
|
||||||
|
|||||||
@ -14,6 +14,7 @@ extern crate magick_rust;
|
|||||||
use magick_rust::{
|
use magick_rust::{
|
||||||
ColorspaceType, CompositeOperator, FilterType, MagickWand, PixelWand, magick_wand_genesis,
|
ColorspaceType, CompositeOperator, FilterType, MagickWand, PixelWand, magick_wand_genesis,
|
||||||
};
|
};
|
||||||
|
use magick_rust::bindings::MagickSetSeed;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@ -266,6 +267,7 @@ async fn fmi(ctx: &Context, arg: Option<&str>, id: UserId, avatar: Option<String
|
|||||||
art_wand_cluster.set_image_colorspace(ColorspaceType::Lab),
|
art_wand_cluster.set_image_colorspace(ColorspaceType::Lab),
|
||||||
"Failed to set cluster colorspace"
|
"Failed to set cluster colorspace"
|
||||||
);
|
);
|
||||||
|
unsafe { MagickSetSeed(0x5F3759DF); }
|
||||||
handle_magick_result!(
|
handle_magick_result!(
|
||||||
art_wand_cluster.kmeans(10, 200, 0.001),
|
art_wand_cluster.kmeans(10, 200, 0.001),
|
||||||
"Failed to run kmeans"
|
"Failed to run kmeans"
|
||||||
|
|||||||
Reference in New Issue
Block a user