view src/org/gfxtest/testsuites/ClippingCircleByRectangleArea.java @ 774:3ab97f5765d3 draft

Added new tests into ClippingCircleByRectangleArea.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Mon, 02 Nov 2015 12:58:32 +0100
parents f9cf11fe37b7
children ac5a9624f24e
line wrap: on
line source

/*
  Java gfx-test framework

   Copyright (C) 2010, 2011, 2012  Red Hat

This file is part of IcedTea.

IcedTea is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

IcedTea is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with IcedTea; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
or based on this library.  If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so.  If you do not wish to do so, delete this
exception statement from your version.
 */

package org.gfxtest.testsuites;

import java.awt.Graphics2D;



import org.gfxtest.framework.CommonClippingOperations;
import org.gfxtest.framework.CommonRenderingStyles;
import org.gfxtest.framework.CommonShapesRenderer;
import org.gfxtest.framework.GfxTest;
import org.gfxtest.framework.TestImage;
import org.gfxtest.framework.TestResult;
import org.gfxtest.framework.annotations.GraphicsPrimitive;
import org.gfxtest.framework.annotations.GraphicsPrimitives;
import org.gfxtest.framework.annotations.TestType;
import org.gfxtest.framework.annotations.TestTypes;
import org.gfxtest.framework.annotations.Transformation;
import org.gfxtest.framework.annotations.Transformations;
import org.gfxtest.framework.annotations.Zoom;

/**
 * This test check if clipping is working correctly for an empty, filled
 * and textured circle which is clipped by a rectangle area.
 * 
 * @author Pavel Tisnovsky
 */
@TestType(TestTypes.RENDER_TEST)
@Transformation(Transformations.NONE)
@GraphicsPrimitive(GraphicsPrimitives.CIRCLE)
@Zoom(1)
public class ClippingCircleByRectangleArea extends GfxTest
{
    /**
     * Prepare canvas for the rendering.
     *
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     */
    private static void basicSetupForRendering(TestImage image, Graphics2D graphics2d)
    {
        // create clip area which is constructed from the rectangle area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
    }

    /**
     * Draw empty circle clipped by rectangle area.
     *
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     */
    private static void drawEmptyCircleClippedByRectangleArea(TestImage image, Graphics2D graphics2d)
    {
        // prepare canvas for the rendering
        basicSetupForRendering(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // draw the area
        CommonShapesRenderer.drawCircle(image, graphics2d);
    }

    /**
     * Draw empty circle clipped by rectangle area.
     *
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     */
    private static void drawFilledCircleClippedByRectangleArea(TestImage image, Graphics2D graphics2d)
    {
        // prepare canvas for the rendering
        basicSetupForRendering(image, graphics2d);
        // fill the area
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by rectangle area. Circle is drawn using alpha paint with
     * black color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintBlack(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillBlackColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by a rectangle area. Circle is drawn using alpha paint with
     * red color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintRed(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillRedColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by a rectangle area. Circle is drawn using alpha paint with
     * green color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintGreen(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillGreenColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by a rectangle area. Circle is drawn using alpha paint with
     * blue color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintBlue(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillBlueColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by rectangle. Circle is drawn using alpha paint with
     * magenta color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintMagenta(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillMagentaColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by rectangle. Circle is drawn using alpha paint with
     * cyan color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintCyan(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillCyanColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by rectangle. Circle is drawn using alpha paint with
     * yellow color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintYellow(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillYellowColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Draw circle clipped by rectangle. Circle is drawn using alpha paint with
     * white color and selected transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @param transparency
     *            selected transparency (0..100 percent)
     */
    private void drawCircleClippedByRectangleAreaAlphaPaintWhite(TestImage image, Graphics2D graphics2d, int transparency)
    {
        // render clip rectangle
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setTransparentFillWhiteColor(graphics2d, transparency);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the shape
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using stroke paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaStrokePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set clip region and draw the circle
        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using wide stroke paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaWideStrokePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke width
        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
        // set clip region and draw the circle
        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using extra wide stroke paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke width
        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
        // set clip region and draw the circle
        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using zero wide stroke paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByEllipseShapeZeroWideStrokePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke width
        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
        // set clip region and draw the circle
        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using color paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaColorPaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set stroke color
        CommonRenderingStyles.setStrokeColor(graphics2d);
        // set fill color
        CommonRenderingStyles.setFillColor(graphics2d);
        // create clip area
        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
        // fill the area
        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with black color at 0% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlack000(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 0% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlack(image, graphics2d, 0);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with black color at 25% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlack025(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 25% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlack(image, graphics2d, 25);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with black color at 50% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlack050(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 50% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlack(image, graphics2d, 50);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with black color at 75% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlack075(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 75% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlack(image, graphics2d, 75);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with black color at 100% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlack100(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 100% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlack(image, graphics2d, 100);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with red color at 0% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintRed000(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 0% transparency
        drawCircleClippedByRectangleAreaAlphaPaintRed(image, graphics2d, 0);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with red color at 25% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintRed025(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 25% transparency
        drawCircleClippedByRectangleAreaAlphaPaintRed(image, graphics2d, 25);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with red color at 50% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintRed050(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 50% transparency
        drawCircleClippedByRectangleAreaAlphaPaintRed(image, graphics2d, 50);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with red color at 75% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintRed075(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 75% transparency
        drawCircleClippedByRectangleAreaAlphaPaintRed(image, graphics2d, 75);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with red color at 100% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintRed100(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 100% transparency
        drawCircleClippedByRectangleAreaAlphaPaintRed(image, graphics2d, 100);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with green color at 0% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintGreen000(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 0% transparency
        drawCircleClippedByRectangleAreaAlphaPaintGreen(image, graphics2d, 0);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with green color at 25% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintGreen025(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 25% transparency
        drawCircleClippedByRectangleAreaAlphaPaintGreen(image, graphics2d, 25);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with green color at 50% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintGreen050(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 50% transparency
        drawCircleClippedByRectangleAreaAlphaPaintGreen(image, graphics2d, 50);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with green color at 75% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintGreen075(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 75% transparency
        drawCircleClippedByRectangleAreaAlphaPaintGreen(image, graphics2d, 75);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with green color at 100% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintGreen100(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 100% transparency
        drawCircleClippedByRectangleAreaAlphaPaintGreen(image, graphics2d, 100);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with blue color at 0% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlue000(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 0% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlue(image, graphics2d, 0);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with blue color at 25% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlue025(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 25% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlue(image, graphics2d, 25);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with blue color at 50% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlue050(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 50% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlue(image, graphics2d, 50);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with blue color at 75% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlue075(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 75% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlue(image, graphics2d, 75);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangular area. Circle is
     * rendered using alpha paint with blue color at 100% transparency.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaAlphaPaintBlue100(TestImage image, Graphics2D graphics2d)
    {
        // draw circle clipped by rectangle area using alpha paint with 100% transparency
        drawCircleClippedByRectangleAreaAlphaPaintBlue(image, graphics2d, 100);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using horizontal gradient paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaHorizontalGradientPaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set horizontal gradient paint
        CommonRenderingStyles.setHorizontalGradientFill(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using vertical gradient paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaVerticalGradientPaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set vertical gradient paint
        CommonRenderingStyles.setVerticalGradientFill(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using diagonal gradient paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaDiagonalGradientPaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set diagonal gradient paint
        CommonRenderingStyles.setDiagonalGradientFill(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using radial gradient paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaRadialGradientPaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set radial gradient paint
        CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaCheckerTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingCheckerTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaDiagonalCheckerTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingDiagonalCheckerTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaGridTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingGridTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaDiagonalGridTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingDiagonalGridTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaColorDotsTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingColorDotsTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaHorizontalStripesTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingHorizontalStripesTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaVerticalStripesTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingVerticalStripesTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaDiagonalStripesTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingDiagonalStripesTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaHorizontalColorStripesTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingHorizontalColorStripesTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaVerticalColorStripesTexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingVerticalColorStripesTexture(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaRGB1TexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingRGBTexture1(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaRGB2TexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingRGBTexture2(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Check if circle shape could be clipped by a rectangle area. Circle is
     * rendered using texture paint.
     * 
     * @param image
     *            work image
     * @param graphics2d
     *            graphics canvas
     * @return test result status - PASSED, FAILED or ERROR
     */
    public TestResult testClipCircleByRectangleAreaRGB3TexturePaint(TestImage image, Graphics2D graphics2d)
    {
        // render clip rectangle which is used as a base for clip shape
        CommonClippingOperations.renderClipRectangle(image, graphics2d);
        // set the texture
        CommonRenderingStyles.setTextureFillUsingRGBTexture3(image, graphics2d);
        // set clip region and render filled circle
        drawFilledCircleClippedByRectangleArea(image, graphics2d);
        // test result
        return TestResult.PASSED;
    }

    /**
     * Entry point to the test suite.
     * 
     * @param args
     *            graphics test configuration
     */
    public static void main(String[] args)
    {
        new ClippingCircleByRectangleArea().runTestSuite(args);
    }
}