Mercurial > hg > gfx-test
view src/org/gfxtest/testsuites/ClippingCircleByRectangleShape.java @ 816:287a10068e05 draft
Five new tests added ClippingCircleByRectangleShape.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Wed, 06 Apr 2016 11:55:24 +0200 |
parents | ed8160c7efb3 |
children | daad166e397b |
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 rectangular shape (not rectangular area!). * * @author Pavel Tisnovsky */ @TestType(TestTypes.RENDER_TEST) @Transformation(Transformations.NONE) @GraphicsPrimitive(GraphicsPrimitives.CIRCLE) @Zoom(1) public class ClippingCircleByRectangleShape 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 shape which is constructed from rectangular shape CommonClippingOperations.createClipUsingRectangleShape(image, graphics2d); } /** * Draw empty circle clipped by rectangle shape. * * @param image * work image * @param graphics2d * graphics canvas */ private static void drawEmptyCircleClippedByRectangleShape(TestImage image, Graphics2D graphics2d) { // prepare canvas for the rendering basicSetupForRendering(image, graphics2d); // set stroke color CommonRenderingStyles.setStrokeColor(graphics2d); // draw the shape CommonShapesRenderer.drawCircle(image, graphics2d); } /** * Draw empty circle clipped by rectangle shape. * * @param image * work image * @param graphics2d * graphics canvas */ private static void drawFilledCircleClippedByRectangleShape(TestImage image, Graphics2D graphics2d) { // prepare canvas for the rendering basicSetupForRendering(image, graphics2d); // fill the shape CommonShapesRenderer.drawFilledCircle(image, graphics2d); } /** * Draw circle clipped by rectangle. 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 drawCircleClippedByRectangleAlphaPaintBlack(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.createClipUsingRectangleShape(image, graphics2d); // fill the shape CommonShapesRenderer.drawFilledCircle(image, graphics2d); } /** * Draw circle clipped by rectangle. 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 drawCircleClippedByRectangleAlphaPaintRed(TestImage image, Graphics2D graphics2d, int transparency) { // render clip rectangle CommonClippingOperations.renderClipRectangle(image, graphics2d); // set stroke color CommonRenderingStyles.setStrokeColor(graphics2d); // set fill color CommonRenderingStyles.setTransparentFillRedColor(graphics2d, transparency); // create clip area CommonClippingOperations.createClipUsingRectangleShape(image, graphics2d); // fill the shape CommonShapesRenderer.drawFilledCircle(image, graphics2d); } /** * Draw circle clipped by rectangle. 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 drawCircleClippedByRectangleAlphaPaintGreen(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.createClipUsingRectangleShape(image, graphics2d); // fill the shape CommonShapesRenderer.drawFilledCircle(image, graphics2d); } /** * Draw circle clipped by rectangle. 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 drawCircleClippedByRectangleAlphaPaintBlue(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.createClipUsingRectangleShape(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 drawCircleClippedByRectangleAlphaPaintMagenta(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.createClipUsingRectangleShape(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 drawCircleClippedByRectangleAlphaPaintCyan(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.createClipUsingRectangleShape(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 drawCircleClippedByRectangleAlphaPaintYellow(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.createClipUsingRectangleShape(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 drawCircleClippedByRectangleAlphaPaintWhite(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.createClipUsingRectangleShape(image, graphics2d); // fill the shape CommonShapesRenderer.drawFilledCircle(image, graphics2d); } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using stroke paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeStrokePaint(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 drawEmptyCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeWideStrokePaint(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 drawEmptyCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeExtraWideStrokePaint(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 drawEmptyCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeZeroWideStrokePaint(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 drawEmptyCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using color paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeColorPaint(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 shape CommonClippingOperations.createClipUsingRectangleShape(image, graphics2d); // fill the shape CommonShapesRenderer.drawFilledCircle(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlack000(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 0% // transparency drawCircleClippedByRectangleAlphaPaintBlack(image, graphics2d, 0); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlack025(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 25% // transparency drawCircleClippedByRectangleAlphaPaintBlack(image, graphics2d, 25); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlack050(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 50% // transparency drawCircleClippedByRectangleAlphaPaintBlack(image, graphics2d, 50); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlack075(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 75% // transparency drawCircleClippedByRectangleAlphaPaintBlack(image, graphics2d, 75); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlack100(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 100% // transparency drawCircleClippedByRectangleAlphaPaintBlack(image, graphics2d, 100); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintRed000(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 0% // transparency drawCircleClippedByRectangleAlphaPaintRed(image, graphics2d, 0); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintRed025(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 25% // transparency drawCircleClippedByRectangleAlphaPaintRed(image, graphics2d, 25); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintRed050(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 50% // transparency drawCircleClippedByRectangleAlphaPaintRed(image, graphics2d, 50); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintRed075(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 75% // transparency drawCircleClippedByRectangleAlphaPaintRed(image, graphics2d, 75); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintRed100(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 100% // transparency drawCircleClippedByRectangleAlphaPaintRed(image, graphics2d, 100); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintGreen000(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 0% // transparency drawCircleClippedByRectangleAlphaPaintGreen(image, graphics2d, 0); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintGreen025(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 25% // transparency drawCircleClippedByRectangleAlphaPaintGreen(image, graphics2d, 25); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintGreen050(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 50% // transparency drawCircleClippedByRectangleAlphaPaintGreen(image, graphics2d, 50); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintGreen075(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 75% // transparency drawCircleClippedByRectangleAlphaPaintGreen(image, graphics2d, 75); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintGreen100(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 100% // transparency drawCircleClippedByRectangleAlphaPaintGreen(image, graphics2d, 100); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlue000(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 0% // transparency drawCircleClippedByRectangleAlphaPaintBlue(image, graphics2d, 0); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlue025(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 25% // transparency drawCircleClippedByRectangleAlphaPaintBlue(image, graphics2d, 25); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlue050(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 50% // transparency drawCircleClippedByRectangleAlphaPaintBlue(image, graphics2d, 50); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlue075(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 75% // transparency drawCircleClippedByRectangleAlphaPaintBlue(image, graphics2d, 75); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. 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 testClipCircleByRectangleShapeAlphaPaintBlue100(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 100% // transparency drawCircleClippedByRectangleAlphaPaintBlue(image, graphics2d, 100); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with magenta color at 0% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintMagenta000(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 0% // transparency drawCircleClippedByRectangleAlphaPaintMagenta(image, graphics2d, 0); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with magenta color at 25% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintMagenta025(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 25% // transparency drawCircleClippedByRectangleAlphaPaintMagenta(image, graphics2d, 25); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with magenta color at 50% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintMagenta050(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 50% // transparency drawCircleClippedByRectangleAlphaPaintMagenta(image, graphics2d, 50); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with magenta color at 75% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintMagenta075(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 75% // transparency drawCircleClippedByRectangleAlphaPaintMagenta(image, graphics2d, 75); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with magenta color at 100% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintMagenta100(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 100% // transparency drawCircleClippedByRectangleAlphaPaintMagenta(image, graphics2d, 100); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with white color at 0% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintWhite000(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 0% // transparency drawCircleClippedByRectangleAlphaPaintWhite(image, graphics2d, 0); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with white color at 25% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintWhite025(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 25% // transparency drawCircleClippedByRectangleAlphaPaintWhite(image, graphics2d, 25); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with white color at 50% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintWhite050(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 50% // transparency drawCircleClippedByRectangleAlphaPaintWhite(image, graphics2d, 50); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with white color at 75% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintWhite075(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 75% // transparency drawCircleClippedByRectangleAlphaPaintWhite(image, graphics2d, 75); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangular shape. Circle is * rendered using alpha paint with white color at 100% transparency. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeAlphaPaintWhite100(TestImage image, Graphics2D graphics2d) { // draw circle clipped by rectangle using alpha paint with 100% // transparency drawCircleClippedByRectangleAlphaPaintWhite(image, graphics2d, 100); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeHorizontalGradientPaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeVerticalGradientPaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeDiagonalGradientPaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. 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 testClipCircleByRectangleShapeRadialGradientPaint(TestImage image, Graphics2D graphics2d) { // render clip rectangle CommonClippingOperations.renderClipRectangle(image, graphics2d); // set radial gradient paint CommonRenderingStyles.setRadialGradientFill(image, graphics2d); // set clip region and render filled circle drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeCheckerTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeDiagonalCheckerTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeGridTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeDiagonalGridTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeColorDotsTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeHorizontalStripesTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeVerticalStripesTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeDiagonalStripesTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeHorizontalColorStripesTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeVerticalColorStripesTexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeRGB1TexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeRGB2TexturePaint(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 drawFilledCircleClippedByRectangleShape(image, graphics2d); // test result return TestResult.PASSED; } /** * Check if circle shape could be clipped by a rectangle shape. Circle is * rendered using texture paint. * * @param image * work image * @param graphics2d * graphics canvas * @return test result status - PASSED, FAILED or ERROR */ public TestResult testClipCircleByRectangleShapeRGB3TexturePaint(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 drawFilledCircleClippedByRectangleShape(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 ClippingCircleByRectangleShape().runTestSuite(args); } }