Logo Search packages:      
Sourcecode: javamorph version File versions  Download package

void javamorph::CPolygonDecorator::smoothCircle ( Point  p  )  [inline, private]

Perform actually smooth for one pixel

Parameters:
p The current pixel.

Definition at line 380 of file CPolygonDecorator.java.

References clip(), and image.

Referenced by smoothLine().

                                      {
        int r = CConfig.SMOOTH_RADIUS , dx, dy;
        double d;
        for(int x = p.x - r; x <= p.x + r; ++x){
            for(int y = p.y -r; y <= p.y +r; ++y){
                dx = p.x - x;
                dy = p.y - y;
                d = Math.sqrt(dx * dx + dy * dy);
                if(
                    x >= 0 &&
                    y >= 0 &&
                    x < image.getWidth() &&
                    y < image.getHeight() &&
                    r >= d
                ){
                    clip[x][y] = Math.max(clip[x][y], (r - d) / r);
                }
            }
        }
    }


Generated by  Doxygen 1.6.0   Back to index