Search in sources :

Example 61 with ImageBuffer

use of com.b3dgs.lionengine.graphic.ImageBuffer in project lionengine by b3dgs.

the class GraphicsTest method testFlipVertical.

/**
 * Test flip vertical.
 */
@Test
public void testFlipVertical() {
    final ImageBuffer vertical = Graphics.flipVertical(image);
    Assert.assertNotEquals(image, vertical);
    Assert.assertEquals(image.getWidth(), vertical.getWidth());
    Assert.assertEquals(image.getHeight(), vertical.getHeight());
    vertical.dispose();
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) GraphicTest(com.b3dgs.lionengine.graphic.GraphicTest) Test(org.junit.Test)

Example 62 with ImageBuffer

use of com.b3dgs.lionengine.graphic.ImageBuffer in project lionengine by b3dgs.

the class GraphicsTest method testFlipHorizontal.

/**
 * Test flip horizontal.
 */
@Test
public void testFlipHorizontal() {
    final ImageBuffer horizontal = Graphics.flipHorizontal(image);
    Assert.assertNotEquals(image, horizontal);
    Assert.assertEquals(image.getWidth(), horizontal.getWidth());
    Assert.assertEquals(image.getHeight(), horizontal.getHeight());
    horizontal.dispose();
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) GraphicTest(com.b3dgs.lionengine.graphic.GraphicTest) Test(org.junit.Test)

Example 63 with ImageBuffer

use of com.b3dgs.lionengine.graphic.ImageBuffer in project lionengine by b3dgs.

the class GraphicsTest method testApplyMask.

/**
 * Test apply mask.
 */
@Test
public void testApplyMask() {
    final ImageBuffer mask = Graphics.applyMask(image, ColorRgba.BLACK);
    Assert.assertNotEquals(image, mask);
    Assert.assertEquals(image.getWidth(), mask.getWidth());
    Assert.assertEquals(image.getHeight(), mask.getHeight());
    mask.dispose();
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) GraphicTest(com.b3dgs.lionengine.graphic.GraphicTest) Test(org.junit.Test)

Example 64 with ImageBuffer

use of com.b3dgs.lionengine.graphic.ImageBuffer in project lionengine by b3dgs.

the class GraphicsTest method testRotate.

/**
 * Test rotate.
 */
@Test
public void testRotate() {
    final ImageBuffer rotate = Graphics.rotate(image, 90);
    Assert.assertNotEquals(image, rotate);
    Assert.assertEquals(image.getWidth(), rotate.getWidth());
    Assert.assertEquals(image.getHeight(), rotate.getHeight());
    rotate.dispose();
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) GraphicTest(com.b3dgs.lionengine.graphic.GraphicTest) Test(org.junit.Test)

Example 65 with ImageBuffer

use of com.b3dgs.lionengine.graphic.ImageBuffer in project lionengine by b3dgs.

the class GraphicsTest method testCreateImageBufferTransparentColor.

/**
 * Test create image buffer transparent color.
 */
@Test
public void testCreateImageBufferTransparentColor() {
    final ImageBuffer imageBuffer = Graphics.createImageBuffer(16, 32, ColorRgba.TRANSPARENT);
    Assert.assertEquals(16, imageBuffer.getWidth());
    Assert.assertEquals(32, imageBuffer.getHeight());
    Assert.assertEquals(Transparency.BITMASK, imageBuffer.getTransparency());
    imageBuffer.dispose();
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) GraphicTest(com.b3dgs.lionengine.graphic.GraphicTest) Test(org.junit.Test)

Aggregations

ImageBuffer (com.b3dgs.lionengine.graphic.ImageBuffer)110 Test (org.junit.Test)34 Test (org.junit.jupiter.api.Test)28 Media (com.b3dgs.lionengine.Media)16 Graphic (com.b3dgs.lionengine.graphic.Graphic)12 GraphicTest (com.b3dgs.lionengine.graphic.GraphicTest)12 FactoryGraphic (com.b3dgs.lionengine.graphic.FactoryGraphic)9 BufferedImage (java.awt.image.BufferedImage)9 SpriteTiled (com.b3dgs.lionengine.graphic.SpriteTiled)6 SpriteTiled (com.b3dgs.lionengine.graphic.drawable.SpriteTiled)5 ColorRgba (com.b3dgs.lionengine.graphic.ColorRgba)3 FactoryGraphicTest (com.b3dgs.lionengine.graphic.FactoryGraphicTest)3 Image (com.b3dgs.lionengine.graphic.Image)3 Sprite (com.b3dgs.lionengine.graphic.Sprite)3 SpriteAnimated (com.b3dgs.lionengine.graphic.SpriteAnimated)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 TilesExtractor (com.b3dgs.lionengine.game.feature.tile.TilesExtractor)2 ArrayList (java.util.ArrayList)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 Config (com.b3dgs.lionengine.Config)1