53 bool can_create =
true;
70 wheel =
new FastColorWheel(Type::OKHSL, Type::OKHSL, luminocity, hue, sat,
true);
87 wheel =
new FastColorWheel(Type::RGB, Type::HSV, hue, sat, val,
false);
99 ColorWheel* w1 =
new FastColorWheel(Type::OKHSL, Type::OKHSL, 0, 1, 2,
true);
102 auto s = Cairo::ImageSurface::create(Cairo::Surface::Format::ARGB32, 1024, 1024);
103 auto ctx = Cairo::Context::create(s);
104 for (
auto w : {w1, w2}) {
105 w->get_widget().size_allocate(Gtk::Allocation(0,0,500,500), 0);
107 auto old_time = std::chrono::high_resolution_clock::now();
109 for (
int i = 0; i < 100; ++i) {
110 color.
set(0, i / 100.0);
114 auto current_time = std::chrono::high_resolution_clock::now();
115 auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(current_time - old_time);
116 g_message(
"render time for test wheel: %d ms",
static_cast<int>(elapsed.count()));
123 return std::make_pair(wheel, can_create);