Package net.sf.freecol.tools
Class Texture2Tile
- java.lang.Object
-
- net.sf.freecol.tools.Texture2Tile
-
public class Texture2Tile extends java.lang.Object
Utility for making a seamless tilable 512x256 tile from a seamless tilable texture. Recommended texture size (the input image) is 256x128. Other sizes will be seamlessly rescaled with interpolation.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
RESULT_HEIGHT
private static int
RESULT_WIDTH
-
Constructor Summary
Constructors Constructor Description Texture2Tile()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static boolean
closerToCorrectAspectWithoutDoublingHorizontally(java.awt.image.BufferedImage inputImage)
private static java.awt.image.BufferedImage
combineQuarterTiles(java.awt.image.BufferedImage imageA, java.awt.image.BufferedImage imageB)
private static java.awt.image.BufferedImage
createImageWithTextureFill(java.awt.image.BufferedImage im, int width, int height)
private static java.awt.image.BufferedImage
extractQuarterTileA(java.awt.image.BufferedImage inputImage, int quarterTileWidth, int quarterTileHeight)
private static java.awt.image.BufferedImage
extractQuarterTileB(java.awt.image.BufferedImage inputImage, int quarterTileWidth, int quarterTileHeight)
private static java.awt.image.BufferedImage
imageWithMaskApplied(java.awt.image.BufferedImage image, java.lang.String variation)
static void
main(java.lang.String[] args)
private static java.awt.image.BufferedImage
seamlessRescaleTexture(java.awt.image.BufferedImage im, int width, int height)
private static java.awt.image.BufferedImage
seamlessRescaleTextureIfNeeded(java.awt.image.BufferedImage inputImage, int quarterTileWidth, int quarterTileHeight)
-
-
-
Field Detail
-
RESULT_WIDTH
private static final int RESULT_WIDTH
- See Also:
- Constant Field Values
-
RESULT_HEIGHT
private static final int RESULT_HEIGHT
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
seamlessRescaleTextureIfNeeded
private static java.awt.image.BufferedImage seamlessRescaleTextureIfNeeded(java.awt.image.BufferedImage inputImage, int quarterTileWidth, int quarterTileHeight)
-
closerToCorrectAspectWithoutDoublingHorizontally
private static boolean closerToCorrectAspectWithoutDoublingHorizontally(java.awt.image.BufferedImage inputImage)
-
combineQuarterTiles
private static java.awt.image.BufferedImage combineQuarterTiles(java.awt.image.BufferedImage imageA, java.awt.image.BufferedImage imageB)
-
seamlessRescaleTexture
private static java.awt.image.BufferedImage seamlessRescaleTexture(java.awt.image.BufferedImage im, int width, int height)
-
createImageWithTextureFill
private static java.awt.image.BufferedImage createImageWithTextureFill(java.awt.image.BufferedImage im, int width, int height)
-
extractQuarterTileA
private static java.awt.image.BufferedImage extractQuarterTileA(java.awt.image.BufferedImage inputImage, int quarterTileWidth, int quarterTileHeight) throws java.lang.Exception
- Throws:
java.lang.Exception
-
extractQuarterTileB
private static java.awt.image.BufferedImage extractQuarterTileB(java.awt.image.BufferedImage inputImage, int quarterTileWidth, int quarterTileHeight) throws java.lang.Exception
- Throws:
java.lang.Exception
-
imageWithMaskApplied
private static java.awt.image.BufferedImage imageWithMaskApplied(java.awt.image.BufferedImage image, java.lang.String variation) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-