Package gov.nasa.worldwind.render
Class PatternFactory
- java.lang.Object
-
- gov.nasa.worldwind.render.PatternFactory
-
public class PatternFactory extends java.lang.ObjectStatic class to creates tilable patterns.The
createPattern()method draws a shape inside a usually square bitmap, so that it will match if tiled.Each pattern supports a
scalefactor betweenzeroandone- default is .5. With a scale ofzerono pattern will be produced. With a scale ofonethe pattern will cover all the background.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGRADIENT_HLINEARstatic java.lang.StringGRADIENT_VLINEARstatic java.lang.StringPATTERN_CIRCLEstatic java.lang.StringPATTERN_CIRCLESstatic java.lang.StringPATTERN_DIAGONAL_DOWNstatic java.lang.StringPATTERN_DIAGONAL_UPstatic java.lang.StringPATTERN_HLINEstatic java.lang.StringPATTERN_HVLINEstatic java.lang.StringPATTERN_SQUAREstatic java.lang.StringPATTERN_SQUARESstatic java.lang.StringPATTERN_TRIANGLE_UPstatic java.lang.StringPATTERN_VLINE
-
Constructor Summary
Constructors Constructor Description PatternFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.image.BufferedImageblur(java.awt.image.BufferedImage sourceImage)Blurs an image.static java.awt.image.BufferedImageblur(java.awt.image.BufferedImage sourceImage, int kernelSize)Blurs an image with a specified convolution matrix size.static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern)Draws a pattern using the default scale (.5), bitmap dimensions (32x32) and colors (light grey over a transparent background).static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern, float scale)Draws a pattern with a givenscaleusing the default bitmap dimensions (32x32) and colors (light grey over a transparent background).static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern, float scale, java.awt.Color lineColor)Draws a pattern with a givenscaleandColorusing the default bitmap dimensions (32x32) and backgound color (transparent).static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern, float scale, java.awt.Color lineColor, java.awt.Color backColor)Draws a pattern with a givenscaleandColors using the default bitmap dimensions (32x32).static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern, java.awt.Color lineColor)Draws a pattern with a givenColorusing the default scale (.5), bitmap dimensions (32x32) and backgound color (transparent).static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern, java.awt.Dimension size, float scale, java.awt.Color lineColor)Draws a pattern with a givenscale,Colorand bitmap dimensions, using the default backgound color (transparent).static java.awt.image.BufferedImagecreatePattern(java.lang.String pattern, java.awt.Dimension size, float scale, java.awt.Color lineColor, java.awt.Color backColor)Draws a pattern with the givenscale,Colors and bitmap dimensions.
-
-
-
Field Detail
-
PATTERN_CIRCLE
public static final java.lang.String PATTERN_CIRCLE
- See Also:
- Constant Field Values
-
PATTERN_CIRCLES
public static final java.lang.String PATTERN_CIRCLES
- See Also:
- Constant Field Values
-
PATTERN_SQUARE
public static final java.lang.String PATTERN_SQUARE
- See Also:
- Constant Field Values
-
PATTERN_SQUARES
public static final java.lang.String PATTERN_SQUARES
- See Also:
- Constant Field Values
-
PATTERN_TRIANGLE_UP
public static final java.lang.String PATTERN_TRIANGLE_UP
- See Also:
- Constant Field Values
-
PATTERN_HLINE
public static final java.lang.String PATTERN_HLINE
- See Also:
- Constant Field Values
-
PATTERN_VLINE
public static final java.lang.String PATTERN_VLINE
- See Also:
- Constant Field Values
-
PATTERN_HVLINE
public static final java.lang.String PATTERN_HVLINE
- See Also:
- Constant Field Values
-
PATTERN_DIAGONAL_UP
public static final java.lang.String PATTERN_DIAGONAL_UP
- See Also:
- Constant Field Values
-
PATTERN_DIAGONAL_DOWN
public static final java.lang.String PATTERN_DIAGONAL_DOWN
- See Also:
- Constant Field Values
-
GRADIENT_HLINEAR
public static final java.lang.String GRADIENT_HLINEAR
- See Also:
- Constant Field Values
-
GRADIENT_VLINEAR
public static final java.lang.String GRADIENT_VLINEAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern)
Draws a pattern using the default scale (.5), bitmap dimensions (32x32) and colors (light grey over a transparent background).- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.- Returns:
- the corresponding
BufferedImage.
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern, java.awt.Color lineColor)Draws a pattern with a givenColorusing the default scale (.5), bitmap dimensions (32x32) and backgound color (transparent).- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.lineColor- the patternColor.- Returns:
- the corresponding
BufferedImage.
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern, float scale)Draws a pattern with a givenscaleusing the default bitmap dimensions (32x32) and colors (light grey over a transparent background).- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.scale- the scale at which the pattern should be drawn (0 to 1).- Returns:
- the corresponding
BufferedImage.
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern, float scale, java.awt.Color lineColor)Draws a pattern with a givenscaleandColorusing the default bitmap dimensions (32x32) and backgound color (transparent).- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.scale- the scale at which the pattern should be drawn (0 to 1).lineColor- the patternColor.- Returns:
- the corresponding
BufferedImage.
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern, float scale, java.awt.Color lineColor, java.awt.Color backColor)Draws a pattern with a givenscaleandColors using the default bitmap dimensions (32x32).- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.scale- the scale at which the pattern should be drawn (0 to 1).lineColor- the patternColor.backColor- the pattern backgroundColor.- Returns:
- the corresponding
BufferedImage.
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern, java.awt.Dimension size, float scale, java.awt.Color lineColor)Draws a pattern with a givenscale,Colorand bitmap dimensions, using the default backgound color (transparent).- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.size- theDimensionof theBufferedImageproduced.scale- the scale at which the pattern should be drawn (0 to 1).lineColor- the patternColor.- Returns:
- the corresponding
BufferedImage.
-
createPattern
public static java.awt.image.BufferedImage createPattern(java.lang.String pattern, java.awt.Dimension size, float scale, java.awt.Color lineColor, java.awt.Color backColor)Draws a pattern with the givenscale,Colors and bitmap dimensions.- Parameters:
pattern- the pattern to draw. SeePatternFactorystatic constants.size- theDimensionof theBufferedImageproduced.scale- the scale at which the pattern should be drawn (0 to 1).lineColor- the patternColor.backColor- the pattern backgroundColor.- Returns:
- the corresponding
BufferedImage.
-
blur
public static java.awt.image.BufferedImage blur(java.awt.image.BufferedImage sourceImage)
Blurs an image.- Parameters:
sourceImage- the image to blur.- Returns:
- the blurred image.
-
blur
public static java.awt.image.BufferedImage blur(java.awt.image.BufferedImage sourceImage, int kernelSize)Blurs an image with a specified convolution matrix size.- Parameters:
sourceImage- the image to blur.kernelSize- the convolution matrix size.- Returns:
- the blurred image.
-
-