Esempio n. 1
0
 void Coloring::show() {
     Picture::show();
     auto sd      = static_cast<Color *>(static_cast<void *>(cairo_image_surface_get_data(surface)));
     stage        = gsl::span<Color>(sd, int(stride) * pixel_h());
     eps          = real(z2 - z1) / pixel_w();
     pixel_detail = int(detail / eps);
     for (int i = 0; i < pixel_w(); ++i)
         for (int j = 0; j < pixel_h(); ++j) at({i, j}) = BLACK;
     run([&] { tessel({0, 0}, {pixel_w() - 1, pixel_h() - 1}); });
     if (aa) run([&]() { do_aa(); });
     update();
 }
Esempio n. 2
0
void VspSubGlWindow::draw()
{
    // Initialize Glew when context is created.
    _initGLEW();

    if ( !valid() )
    {
        m_GEngine->getDisplay()->resize( pixel_w(), pixel_h() );
    }
    m_GEngine->draw();
}
Esempio n. 3
0
 void Coloring::do_aa() {
     int pw = pixel_w(), ph = pixel_h();
     tbb::parallel_for(0, pw * ph, [=](int i) {
         auto [x, y] = std::div(i, ph);
         coo   c{x, y};
         Color cc = at(c);
         bool  u  = true;
         for (int d = 0; d < 4; ++d) {
             coo c2 = c + dz[d];
             if ((c2.x >= 0) && (c2.x < pw) && (c2.y >= 0) && (c2.y < ph) && (at(c2) != cc)) u = false;
         }
         if (!(u || die)) at(c) = aa_color(c, true);
     });