public class JHelpImage extends java.lang.Object implements ConstantsGUI
startDrawMode()
, endDrawMode()
and
isDrawMode()
.JHelpSprite
, that are small image that can be easy animated.endDrawMode()
or call update()
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<java.awt.Component> |
componentsListeners
List of registered components to alert if image update
|
private boolean |
drawMode
Actaul draw mode
|
private int |
height
Image height
|
private java.awt.Image |
image
Image for draw in a swing component
|
private java.awt.image.MemoryImageSource |
memoryImageSource
Image source
|
private java.lang.String |
name
Image name
|
private static int[] |
PALETTE
Palette to use
|
static int |
PALETTE_SIZE
Pallete size
|
private int[] |
pixels
Image pixels
|
private java.util.concurrent.locks.ReentrantLock |
reentrantLock
For synchronize
|
private java.util.ArrayList<JHelpSprite> |
sprites
List of sprite
|
private boolean[] |
visibilities
Last sprite visibility information collected on
startDrawMode() to resitute sprite in good state when
endDrawMode() is call |
private int |
width
Image width
|
AFFINE_TRANSFORM, FLATNESS, FONT_RENDER_CONTEXT
Constructor and Description |
---|
JHelpImage(int width,
int height)
Create a new instance of JHelpImage empty
|
JHelpImage(int width,
int height,
int color)
Create a new instance of JHelpImage full of one color
|
JHelpImage(int width,
int height,
int[] pixels)
Create a new instance of JHelpImage
|
Modifier and Type | Method and Description |
---|---|
void |
addition(JHelpImage image)
Add an other image
This image and the given one MUST have same dimension Note : if this image or given one not in draw mode, all visible sprites (of the image) are consider like a part of the image |
void |
applyPalette(int precision)
Fill with the pallete different area
MUST be in draw mode |
void |
brighter(int factor)
Put the image brighter
MUST be in draw mode |
void |
brightness(double factor)
Change image brightness
MUST be in draw mode |
void |
categorizeByColor(int precision)
Colorize all near color with same color
MUST be in draw mode |
void |
categorizeByY(int colorLow,
int colorMiddle,
int colorHigh,
double precision)
Colorize with 3 colors, one used for "dark" colors, one for "gray" colors and last for "white" colors
MUST be in draw mode |
(package private) void |
changeSpriteVisibiliy(int index,
boolean visible,
boolean forced)
Change a sprite visibility
|
void |
clear(int color)
Fill the entire image with same color
MUST be in draw mode |
int |
colorizeWithPalette(int precision)
Colorize with automatic palette
MUST be in draw mode |
private static int |
computeBlue(double y,
double u,
double v)
Compute blue part of color from YUV
B = Y + 1.7790 * (U - 128) |
private static int |
computeGreen(double y,
double u,
double v)
Compute green part of color from YUV
G = Y - 0.3455 * (U - 128) - (0.7169 * (V - 128)) |
private static int |
computeRed(double y,
double u,
double v)
Compute red part of color from YUV
R = Y + 1.4075 * (V - 128) |
private static double |
computeU(int red,
int green,
int blue)
Compute U of a color
U = R * -.168736 + G * -.331264 + B * .500000 + 128 |
private static double |
computeV(int red,
int green,
int blue)
Compute V of a color
V = R * .500000 + G * -.418688 + B * -.081312 + 128 |
private static double |
computeY(int red,
int green,
int blue)
Compute Y of a color
Y = R * .299000 + G * .587000 + B * .114000 |
void |
contrast(double factor)
Change image contrast by using the middle of the minmum and maximum
MUST be in draw mode |
void |
contrastAvreage(double factor)
Change image contrast by using the average of all values
MUST be in draw mode |
void |
copy(JHelpImage image)
Copy the image is this one
This image and the given one MUST have same dimension Note : if this image or given one not in draw mode, all visible sprites (of the image) are consider like a part of the image |
Pair<JHelpSprite,JHelpAnimatedImage> |
createAnimatedSprite(int x,
int y,
int width,
int height,
JHelpAnimatedImage.AnimationMode animationMode)
Create a couple of sprite and associated animated image
MUSN'T be in draw mode |
static JHelpImage |
createBumpedImage(JHelpImage source,
JHelpImage bump)
Create a bump image with 0.75 contrast, 12 dark, 1 shift X and 1 shift Y
Note : If one of image is not in draw mode, all visible sprite (of this image) will be consider as a part of the image |
static JHelpImage |
createBumpedImage(JHelpImage source,
JHelpImage bump,
double contrast,
int dark,
int shiftX,
int shiftY)
Create a bump image
Note : If one of image is not in draw mode, all visible sprite (of this image) will be consider as a part of the image |
static JHelpImage |
createBumpedImage2(JHelpImage source,
JHelpImage bump)
Create a bump image with 0.75 contrast, 12 dark, -1 shift X and -1 shift Y
Note : If one of image is not in draw mode, all visible sprite (of this image) will be consider as a part of the image |
JHelpImage |
createCopy()
Create an image copy
Note : if this image is not in draw mode, al visible sprites will be consider like a part of this image |
static JHelpImage |
createImage(java.awt.image.BufferedImage bufferedImage)
Create an image from a buffered image
|
JHelpSprite |
createSprite(int x,
int y,
int width,
int height)
Create a sprite
MUSN'T be in draw mode |
JHelpSprite |
createSprite(int x,
int y,
JHelpImage source)
Create sprite with initial image inside
MUSN'T be in draw mode |
static JHelpImage |
createThumbImage(java.awt.image.BufferedImage bufferedImage,
int width,
int height)
Create an image resized to specify size from a buffered image
|
void |
darker(int factor)
Make image darker
MUST be in draw mode |
void |
divide(JHelpImage image)
Divide an other image
This image and the given one MUST have same dimension Note : if this image or given one not in draw mode, all visible sprites (of the image) are consider like a part of the image |
static boolean |
doesImagesLookSamePerBorder(JHelpImage image1,
JHelpImage image2,
int precision,
int percentDifferenceAccepted)
Compare 2 images and compute if they "look" the same in compare the image border.
|
static boolean |
doesImagesLookSamePerLuminosity(JHelpImage image1,
JHelpImage image2,
int precision,
int percentDifferenceAccepted)
Compare 2 images and compute if they "look" the same in compare the image luminosity
The precision is to determine the accepted distance in luminosity part, and percent to know the percent of accepted pixels doesn't match to precision. |
static boolean |
doesImagesLookSamePerPixel(JHelpImage image1,
JHelpImage image2,
int colorPartPrecision,
int percentDifferenceAccepted)
Compare 2 images and compute if they "look" the same in compare the image pixels.
|
void |
drawEllipse(int x,
int y,
int width,
int height,
int color)
Draw an ellipse
MUST be in draw mode |
void |
drawEllipse(int x,
int y,
int width,
int height,
int color,
boolean doAlphaMix)
Draw an ellipse
MUST be in draw mode |
void |
drawHorizontalLine(int x1,
int x2,
int y,
int color)
Draw an horizontal line
MUST be in draw mode |
void |
drawHorizontalLine(int x1,
int x2,
int y,
int color,
boolean doAlphaMix)
Draw horizontal line
MUST be in draw mode |
void |
drawImage(int x,
int y,
JHelpImage image)
Draw an image
MUST be in draw mode |
void |
drawImage(int x,
int y,
JHelpImage image,
boolean doAlphaMix)
Draw an image
MUST be in draw mode |
void |
drawImage(int x,
int y,
JHelpImage image,
int alpha)
Draw an image over this image with specific alpha
MUST be in draw mode |
void |
drawImage(int x,
int y,
JHelpImage image,
int xImage,
int yImage,
int width,
int height)
Draw a part off image
MUST be in draw mode |
void |
drawImage(int x,
int y,
JHelpImage image,
int xImage,
int yImage,
int width,
int height,
boolean doAlphaMix)
Draw a part off image
MUST be in draw mode |
void |
drawImage(int x,
int y,
JHelpImage image,
int xImage,
int yImage,
int width,
int height,
int alpha)
Draw a part of image with a specific alpha
MUST be in draw mode |
(package private) void |
drawImageInternal(int x,
int y,
JHelpImage image,
int xImage,
int yImage,
int width,
int height,
boolean doAlphaMix)
Draw a part of an image on this image
MUST be in draw mode |
(package private) void |
drawImageInternal(int x,
int y,
JHelpImage image,
int xImage,
int yImage,
int width,
int height,
int alpha)
Draw a part of image on using a specific alpha value
MUST be in draw mode |
(package private) void |
drawImageOver(int x,
int y,
JHelpImage image,
int xImage,
int yImage,
int width,
int height)
Draw apart of image over this image 'just override)
MUST be in draw mode |
void |
drawLine(int x1,
int y1,
int x2,
int y2,
int color)
Draw a line
MUST be in draw mode |
void |
drawLine(int x1,
int y1,
int x2,
int y2,
int color,
boolean doAlphaMix)
Draw a line
MUST be in draw mode |
void |
drawPolygon(int[] xs,
int[] ys,
int color)
Draw a polygon
MUST be in draw mode |
void |
drawPolygon(int[] xs,
int[] ys,
int color,
boolean doAlphaMix)
Draw a polygon
MUST be in draw mode |
void |
drawPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
int color)
Draw a polygon
MUST be in draw mode |
void |
drawPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
int color,
boolean doAlphaMix)
Draw a polygon
MUST be in draw mode |
void |
drawRectangle(int x,
int y,
int width,
int height,
int color)
Draw an empty rectangle
MUST be in draw mode |
void |
drawRectangle(int x,
int y,
int width,
int height,
int color,
boolean doAlphaMix)
Draw an empty rectangle
MUST be in draw mode |
void |
drawRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
int color)
Draw round corner rectangle
MUST be in draw mode |
void |
drawRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
int color,
boolean doAlphaMix)
Draw round corner rectangle
MUST be in draw mode |
void |
drawShape(java.awt.Shape shape,
int color)
Draw an empty shape
MUST be in draw mode |
void |
drawShape(java.awt.Shape shape,
int color,
boolean doAlphaMix)
Draw an empty shape
MUST be in draw mode |
private void |
drawShapeCenter(java.awt.Shape shape,
int color,
boolean doAlphaMix)
Draw a shape on center it
MUST be in draw mode |
void |
drawString(int x,
int y,
java.lang.String string,
JHelpFont font,
int color)
Draw a string
MUST be in draw mode |
void |
drawString(int x,
int y,
java.lang.String string,
JHelpFont font,
int color,
boolean doAlphaMix)
Draw a string
MUST be in draw mode |
void |
drawStringCenter(int x,
int y,
java.lang.String string,
JHelpFont font,
int color)
Draw a string center on given point
MUST be in draw mode |
void |
drawStringCenter(int x,
int y,
java.lang.String string,
JHelpFont font,
int color,
boolean doAlphaMix)
Draw a string center on given point
MUST be in draw mode |
void |
drawVerticalLine(int x,
int y1,
int y2,
int color)
Draw a vertical line
MUST be in draw mode |
void |
drawVerticalLine(int x,
int y1,
int y2,
int color,
boolean doAlphaMix)
Draw a vertical line
MUST be in draw mode |
void |
endDrawMode()
Stop the draw mode and refresh the image
|
static JHelpImage |
extractBorder(JHelpImage source)
Extract the border of the objects inside the image.
|
static JHelpImage |
extractBorder(JHelpImage source,
int width)
Extract the border of the objects inside the image.
|
static JHelpImage |
extractBorder(JHelpImage source,
int width,
int step)
Extract the border of the objects inside the image.
|
static JHelpImage |
extractBorder2(JHelpImage source)
Extract the border of the objects inside the image.
|
JHelpImage |
extractSubImage(int x,
int y,
int width,
int height)
Extract a sub image from the image
Note : If one of image is not in draw mode, all visible sprite (of this image) will be consider as a part of the image |
void |
fillEllipse(int x,
int y,
int width,
int height,
int color)
Fill an ellipse
MUST be in draw mode |
void |
fillEllipse(int x,
int y,
int width,
int height,
int color,
boolean doAlphaMix)
Fill an ellipse
MUST be in draw mode |
void |
fillEllipse(int x,
int y,
int width,
int height,
JHelpImage texture)
Fill ellipse with a texture
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillEllipse(int x,
int y,
int width,
int height,
JHelpImage texture,
boolean doAlphaMix)
Fill ellipse with a texture
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillEllipse(int x,
int y,
int width,
int height,
JHelpPaint paint)
Fill an ellipse
MUST be in draw mode |
void |
fillEllipse(int x,
int y,
int width,
int height,
JHelpPaint paint,
boolean doAlphaMix)
Fill an ellipse
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int[] ys,
int color)
Fill a polygon
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int[] ys,
int color,
boolean doAlphaMix)
Fill a polygon
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int[] ys,
JHelpImage texture)
Fill a polygon
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillPolygon(int[] xs,
int[] ys,
JHelpImage texture,
boolean doAlphaMix)
Fill a polygon
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillPolygon(int[] xs,
int[] ys,
JHelpPaint paint)
Fill a polygon
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int[] ys,
JHelpPaint paint,
boolean doAlphaMix)
Fill a polygon
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
int color)
Fill a polygon
|
void |
fillPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
int color,
boolean doAlphaMix)
Fill a polygon
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
JHelpImage texture)
Fill a polygon
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
JHelpImage texture,
boolean doAlphaMix)
Fill a polygon
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
JHelpPaint paint)
Fill a polygon
MUST be in draw mode |
void |
fillPolygon(int[] xs,
int offsetX,
int[] ys,
int offsetY,
int length,
JHelpPaint paint,
boolean doAlphaMix)
Fill a polygon
MUST be in draw mode |
void |
fillRectangle(int x,
int y,
int width,
int height,
int color)
Fill a rectangle
MUST be in draw mode |
void |
fillRectangle(int x,
int y,
int width,
int height,
int color,
boolean doAlphaMix)
Fill a rectangle
MUST be in draw mode |
void |
fillRectangle(int x,
int y,
int width,
int height,
JHelpImage texture)
Fill a rectangle
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillRectangle(int x,
int y,
int width,
int height,
JHelpImage texture,
boolean doAlphaMix)
Fill a rectangle
Note : if the texture is not in draw moe, all of it's visible sprte will be condider like a part of he texture MUST be in draw mode |
void |
fillRectangle(int x,
int y,
int width,
int height,
JHelpPaint paint)
Fill a rectangle
MUST be in draw mode |
void |
fillRectangle(int x,
int y,
int width,
int height,
JHelpPaint paint,
boolean doAlphaMix)
Fill a rectangle
MUST be in draw mode |
void |
fillRectangleScale(int x,
int y,
int width,
int height,
JHelpImage texture)
Fill a rectangle with an image.
|
void |
fillRectangleScale(int x,
int y,
int width,
int height,
JHelpImage texture,
boolean doAlphaMix)
Fill a rectangle with an image.
|
void |
fillRectangleScaleBetter(int x,
int y,
int width,
int height,
JHelpImage texture)
Fill a rectangle with an image.
|
void |
fillRectangleScaleBetter(int x,
int y,
int width,
int height,
JHelpImage texture,
boolean doAlphaMix)
Fill a rectangle with an image.
|
void |
fillRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
int color)
Fill a round rectangle
MUST be in draw mode |
void |
fillRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
int color,
boolean doAlphaMix)
Fill a round rectangle
MUST be in draw mode |
void |
fillRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
JHelpImage texture)
Fill a round rectangle
Note : if the texture is not in draw mode, all of it's visible sprite will be consider like a part of he texture MUST be in draw mode |
void |
fillRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
JHelpImage texture,
boolean doAlphaMix)
Fill a round rectangle
Note : if the texture is not in draw mode, all of it's visible sprite will be consider like a part of he texture MUST be in draw mode |
void |
fillRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
JHelpPaint paint)
Fill a round rectangle
MUST be in draw mode |
void |
fillRoundRectangle(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
JHelpPaint paint,
boolean doAlphaMix)
Fill a round rectangle
MUST be in draw mode |
void |
fillShape(java.awt.Shape shape,
int color)
Fill a shape
MUST be in draw mode |
void |
fillShape(java.awt.Shape shape,
int color,
boolean doAlphaMix)
Fill a shape
MUST be in draw mode |
void |
fillShape(java.awt.Shape shape,
JHelpImage texture)
Fill a shape
Note : if the texture is not in draw mode, all of it's visible sprite will be consider like a part of he texture MUST be in draw mode |
void |
fillShape(java.awt.Shape shape,
JHelpImage texture,
boolean doAlphaMix)
Fill a shape
Note : if the texture is not in draw mode, all of it's visible sprite will be consider like a part of he texture MUST be in draw mode |
void |
fillShape(java.awt.Shape shape,
JHelpPaint paint)
Fill a shape
MUST be in draw mode |
void |
fillShape(java.awt.Shape shape,
JHelpPaint paint,
boolean doAlphaMix)
Fill a shape
MUST be in draw mode |
void |
fillString(int x,
int y,
java.lang.String string,
JHelpFont font,
int color)
Fill a string
MUST be in draw mode |
void |
fillString(int x,
int y,
java.lang.String string,
JHelpFont font,
int color,
boolean doAlphaMix)
Fill a string
MUST be in draw mode |
void |
fillString(int x,
int y,
java.lang.String string,
JHelpFont font,
JHelpImage texture,
int color)
Fill a string
Note : if the texture is not in draw mode, all of it's visible sprite will be consider like a part of he texture MUST be in draw mode |
void |
fillString(int x,
int y,
java.lang.String string,
JHelpFont font,
JHelpImage texture,
int color,
boolean doAlphaMix)
Fill a string
Note : if the texture is not in draw mode, all of it's visible sprite will be consider like a part of he texture MUST be in draw mode |
void |
fillString(int x,
int y,
java.lang.String string,
JHelpFont font,
JHelpPaint paint,
int color)
Fill a string
MUST be on draw mode |
void |
fillString(int x,
int y,
java.lang.String string,
JHelpFont font,
JHelpPaint paint,
int color,
boolean doAlphaMix)
Fill a string
MUST be on draw mode |
void |
filterBlue()
Filter image on blue channel
MUST be on draw mode |
void |
filterGreen()
Filter image on green channel
MUST be on draw mode |
void |
filterOn(int color,
int colorOK,
int colorKO)
Filter image on a specific color
MUST be on draw mode |
void |
filterOn(int color,
int precision,
int colorOK,
int colorKO)
filter image on a specific color
MUST be on draw mode |
void |
filterPalette(int index,
int colorOK,
int colorKO)
Filter on using a palette color
MUST be on draw mode |
void |
filterRed()
Filter image on red channel
MUST be on draw mode |
void |
filterU()
Filter image on U part
MUST be on draw mode |
void |
filterV()
Filter image on V part
MUST be on draw mode |
void |
filterY()
Filter image on Y part
MUST be on draw mode |
protected void |
finalize()
Call by garbage collector to free some memory
Parent documentation: |
void |
flipBoth()
Flip the image horizontally and vertically in same time.
|
void |
flipHorizontal()
Flip the image horizontally
MUST be on draw mode |
void |
flipVertical()
Flip the image vertically
MUST be on draw mode |
int |
getHeight()
Image height
|
java.awt.Image |
getImage()
Image for draw in graphics environment
|
java.lang.String |
getName()
Image name
|
int |
getWidth()
Image width
|
void |
gray()
Convert image in gray version
MUST be on draw mode |
void |
grayInvert()
Convert image in gray invert version
MUST be on draw mode |
void |
invertColors()
Invert image colors
MUST be on draw mode |
void |
invertUV()
Invert U and V parts
MUST be on draw mode |
boolean |
isDrawMode()
Indicates if we are in draw mode
|
private static java.awt.image.BufferedImage |
loadBufferedImage(java.io.File image)
Load a buffered image
|
static JHelpImage |
loadImage(java.io.File image)
Load an image from file
|
static JHelpImage |
loadImage(java.io.InputStream inputStream)
Load an image from a stream
|
static JHelpImage |
loadImageThumb(java.io.File image,
int width,
int height)
Load an image and resize it to have specific dimension
|
static JHelpImage |
loadImageThumb(java.io.InputStream inputStream,
int width,
int height)
Load an image and resize it to have specific dimension
|
void |
maximum(JHelpImage image)
Take the maximum between this image and given one
Note : if the given image is not in draw mode, all of it's visible sprite will be consider like a part of the given image Given image MUST have same dimension of this MUST be in draw mode |
void |
middle(JHelpImage image)
Take the middle between this image and given one
Note : if the given image is not in draw mode, all of it's visible sprite will be consider like a part of the given image Given image MUST have same dimension of this MUST be in draw mode |
void |
minimum(JHelpImage image)
Take the minimum between this image and given one
Note : if the given image is not in draw mode, all of it's visible sprite will be consider like a part of the given image Given image MUST have same dimension of this MUST be in draw mode |
void |
multiply(JHelpImage image)
Multiply the image with an other one
Note : if the given image is not in draw mode, all of it's visible sprite will be consider like a part of the given image Given image MUST have same dimension of this MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
int foreground,
int background,
boolean doAlphaMix)
Paint a mask
MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
int foreground,
JHelpImage background,
int backgroundX,
int backgroundY,
boolean doAlphaMix)
Paint a mask with unify foreground color and part of image in background
Note : if the background is not in draw mode, all of it's visible sprite will be consider like a part of the background MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
int foreground,
JHelpPaint background,
boolean doAlphaMix)
Paint a mask with unify color as foreground and paint as background
MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
JHelpImage foreground,
int foregroundX,
int foregroundY,
int background,
boolean doAlphaMix)
Paint a mask with part of image as foreground and unify color as background
Note : if the foreground is not in draw mode, all of it's visible sprite will be consider like a part of the foreground MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
JHelpImage foreground,
int foregroundX,
int foregroundY,
JHelpImage background,
int backgroundX,
int backgroundY,
boolean doAlphaMix)
Paint a mask with 2 images, one for "foreground" pixels, one for "background" ones
Note : if the foreground or background is not in draw mode, all of it's visible sprite will be consider like a part of the foreground or background MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
JHelpImage foreground,
int foregroundX,
int foregroundY,
JHelpPaint background,
boolean doAlphaMix)
Paint a mask with image in foreground and paint in background
Note : if the foreground is not in draw mode, all of it's visible sprite will be consider like a part of the foreground MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
JHelpPaint foreground,
int background,
boolean doAlphaMix)
Paint mask with paint in foreground and color in background
MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
JHelpPaint foreground,
JHelpImage background,
int backgroundX,
int backgroundY,
boolean doAlphaMix)
Paint a mask with paint in foreground and image in background
Note : if the background is not in draw mode, all of it's visible sprite will be consider like a part of the background MUST be in draw mode |
void |
paintMask(int x,
int y,
JHelpMask mask,
JHelpPaint foreground,
JHelpPaint background,
boolean doAlphaMix)
Paint mask with paint in foreground and background
MUST be in draw mode |
int |
pickColor(int x,
int y)
Pick a color inside the image
Note : if the image is not in draw mode, all visible sprite are consider as a part of image, so may obtain a sprite pixel |
(package private) void |
refresh()
Refresh the image
|
void |
register(java.awt.Component component)
Register a component to update on image change
|
void |
removeSprite(JHelpSprite sprite)
Remove a sprite from linked sprites.
|
void |
replaceColor(int colorToReplace,
int newColor,
int near)
Replace all pixels near a color by an other color
MUST be in draw mode |
JHelpImage |
rotate180()
Compute the image rotated from 180 degree
If the image is not in draw mode, visible sprites are consider like a part of image |
JHelpImage |
rotate270()
Compute the image rotated from 270 degree
If the image is not in draw mode, visible sprites are consider like a part of image |
JHelpImage |
rotate90()
Compute the image rotated from 90 degree
If the image is not in draw mode, visible sprites are consider like a part of image |
JHelpImage |
rotatedPart180(int x,
int y,
int width,
int height)
Extract a sub image and then rotate it from 180 degree
If the image is not in draw mode, visible sprites are consider like a part of image |
JHelpImage |
rotatedPart270(int x,
int y,
int width,
int height)
Extract a sub image and then rotate it from 270 degree
If the image is not in draw mode, visible sprites are consider like a part of image |
JHelpImage |
rotatedPart90(int x,
int y,
int width,
int height)
Extract a sub image and then rotate it from 90 degree
If the image is not in draw mode, visible sprites are consider like a part of image |
static void |
saveImage(java.io.OutputStream outputStream,
JHelpImage image)
Save an image to a stream
Note : If the image is not in draw mode, all visible sprite will be consider as a part of the image |
void |
setName(java.lang.String name)
Change image name
|
void |
shift(int x,
int y)
Shift (translate) the image
MUST be in draw mode |
void |
startDrawMode()
Start the draw mode
|
void |
subtract(JHelpImage image)
Subtract the image by an other one
Note : if the given image is not in draw mode, all of it's visible sprite will be consider like a part of the given image Given image MUST have same dimension of this MUST be in draw mode |
void |
transfertSpritesTo(JHelpImage image)
Give all sprites of this image to an other image
|
void |
unregister(java.awt.Component component)
Unregister a component
|
void |
update()
Update the image, to see last changes
|
private static final int[] PALETTE
public static final int PALETTE_SIZE
private java.util.ArrayList<java.awt.Component> componentsListeners
private boolean drawMode
private final int height
private java.awt.Image image
private java.awt.image.MemoryImageSource memoryImageSource
private java.lang.String name
private int[] pixels
private final java.util.concurrent.locks.ReentrantLock reentrantLock
private java.util.ArrayList<JHelpSprite> sprites
private boolean[] visibilities
startDrawMode()
to resitute sprite in good state when
endDrawMode()
is callprivate final int width
public JHelpImage(int width, int height)
width
- Widthheight
- Heightpublic JHelpImage(int width, int height, int color)
width
- Widthheight
- Heightcolor
- Background color to usepublic JHelpImage(int width, int height, int[] pixels)
width
- Widthheight
- Heightpixels
- Image pixelsprivate static int computeBlue(double y, double u, double v)
y
- Yu
- Uv
- Vprivate static int computeGreen(double y, double u, double v)
y
- Yu
- Uv
- Vprivate static int computeRed(double y, double u, double v)
y
- Yu
- Uv
- Vprivate static double computeU(int red, int green, int blue)
red
- Red partgreen
- Green partblue
- Blue partprivate static double computeV(int red, int green, int blue)
red
- Red partgreen
- Green partblue
- Blue partprivate static double computeY(int red, int green, int blue)
red
- Red partgreen
- Green partblue
- Blue partprivate static java.awt.image.BufferedImage loadBufferedImage(java.io.File image) throws java.io.IOException
image
- Image filejava.io.IOException
- On reading file issuepublic static JHelpImage createBumpedImage(JHelpImage source, JHelpImage bump)
source
- Image sourcebump
- Image used for bumppublic static JHelpImage createBumpedImage(JHelpImage source, JHelpImage bump, double contrast, int dark, int shiftX, int shiftY)
source
- Image sourcebump
- Image used for bumpcontrast
- Contrast to use in [0, 1].dark
- Dark to use. in [0, 255].shiftX
- Shift X [-3, 3].shiftY
- Shift Y [-3, 3].public static JHelpImage createBumpedImage2(JHelpImage source, JHelpImage bump)
source
- Image sourcebump
- Image used for bumppublic static JHelpImage createImage(java.awt.image.BufferedImage bufferedImage)
bufferedImage
- Buffered image sourcepublic static JHelpImage createThumbImage(java.awt.image.BufferedImage bufferedImage, int width, int height)
bufferedImage
- Buffered image sourcewidth
- Result image widthheight
- Result image heightpublic static boolean doesImagesLookSamePerBorder(JHelpImage image1, JHelpImage image2, int precision, int percentDifferenceAccepted)
image1
- First imageimage2
- Second imageprecision
- Difference accepted in border limitpercentDifferenceAccepted
- Percent of accepted different pixels (Pixels doesn't match to the precision)true
if images "look" the samepublic static boolean doesImagesLookSamePerLuminosity(JHelpImage image1, JHelpImage image2, int precision, int percentDifferenceAccepted)
image1
- First imageimage2
- Second imageprecision
- Difference accepted in luminositypercentDifferenceAccepted
- Percent of accepted different pixels (Pixels doesn't match to the precision)true
if images "look" the samepublic static boolean doesImagesLookSamePerPixel(JHelpImage image1, JHelpImage image2, int colorPartPrecision, int percentDifferenceAccepted)
image1
- First imageimage2
- Second imagecolorPartPrecision
- Difference accepted in pixel partspercentDifferenceAccepted
- Percent of accepted different pixels (Pixels doesn't match to the precision)true
if images "look" the samepublic static JHelpImage extractBorder(JHelpImage source)
source
- Image sourcepublic static JHelpImage extractBorder(JHelpImage source, int width)
source
- Image sourcewidth
- Line widthpublic static JHelpImage extractBorder(JHelpImage source, int width, int step)
source
- Image sourcewidth
- Line widthstep
- Step to jump between width : [1, width]public static JHelpImage extractBorder2(JHelpImage source)
source
- Image sourcepublic static JHelpImage loadImage(java.io.File image) throws java.io.IOException
image
- Image filejava.io.IOException
- On file reading issuepublic static JHelpImage loadImage(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- Stream to readjava.io.IOException
- On reading issuepublic static JHelpImage loadImageThumb(java.io.File image, int width, int height) throws java.io.IOException
image
- Image filewidth
- Final widthheight
- Final heightjava.io.IOException
- On reading file issuepublic static JHelpImage loadImageThumb(java.io.InputStream inputStream, int width, int height) throws java.io.IOException
inputStream
- Stream where lies the imagewidth
- Final widthheight
- Final heightjava.io.IOException
- On reading stream issuepublic static void saveImage(java.io.OutputStream outputStream, JHelpImage image) throws java.io.IOException
outputStream
- Stream where writeimage
- Image to savejava.io.IOException
- On writing issueprivate void drawShapeCenter(java.awt.Shape shape, int color, boolean doAlphaMix)
shape
- Shape to drawcolor
- Color to usedoAlphaMix
- Indicates if alpha mix is onvoid changeSpriteVisibiliy(int index, boolean visible, boolean forced)
index
- Sprite indexvisible
- New visibility stateforced
- Indicated that the changes is forcedvoid drawImageInternal(int x, int y, JHelpImage image, int xImage, int yImage, int width, int height, boolean doAlphaMix)
x
- X on this imagey
- Y on this imageimage
- Image to drawxImage
- X on given imageyImage
- Y on given imagewidth
- Part widthheight
- Part heightdoAlphaMix
- Indicates if we do the mixing true
, or we just override false
void drawImageInternal(int x, int y, JHelpImage image, int xImage, int yImage, int width, int height, int alpha)
x
- X to draw imagey
- Y to draw imageimage
- Image to drawxImage
- Start X of image partyImage
- Start Y of image partwidth
- Width of image partheight
- Height of image partalpha
- Alpha to usevoid drawImageOver(int x, int y, JHelpImage image, int xImage, int yImage, int width, int height)
x
- X on this imagey
- Y on this imageimage
- Image to drawxImage
- X on imageyImage
- Y on imagewidth
- Part widthheight
- Part heightvoid refresh()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- On issueObject.finalize()
public void addition(JHelpImage image)
image
- Image to addpublic void applyPalette(int precision)
precision
- Precision to use for distinguish 2 areapublic void brighter(int factor)
factor
- Factor of brightpublic void brightness(double factor)
factor
- Brightness factorpublic void categorizeByColor(int precision)
precision
- Precision to usepublic void categorizeByY(int colorLow, int colorMiddle, int colorHigh, double precision)
colorLow
- Color for darkcolorMiddle
- Color for graycolorHigh
- Color for whteprecision
- Precision for decide witch are graypublic void clear(int color)
color
- Color to usepublic int colorizeWithPalette(int precision)
precision
- Precision to usepublic void contrast(double factor)
factor
- Factor to apply to the contrastpublic void contrastAvreage(double factor)
factor
- Factor to apply to the contrastpublic void copy(JHelpImage image)
image
- Image to copypublic Pair<JHelpSprite,JHelpAnimatedImage> createAnimatedSprite(int x, int y, int width, int height, JHelpAnimatedImage.AnimationMode animationMode)
x
- X positiony
- Y positionwidth
- Sprite widthheight
- Sprite heightanimationMode
- Animation mode to usepublic JHelpImage createCopy()
public JHelpSprite createSprite(int x, int y, int width, int height)
x
- Start X of spritey
- Start Y of spritewidth
- Sprite widthheight
- Sprite heightpublic JHelpSprite createSprite(int x, int y, JHelpImage source)
x
- Xy
- Ysource
- Initial imagepublic void darker(int factor)
factor
- Darker factor in [0, 255]public void divide(JHelpImage image)
image
- Image to divide withpublic void drawEllipse(int x, int y, int width, int height, int color)
x
- X of upper left cornery
- Y of upper left cornerwidth
- Widthheight
- Heightcolor
- Color to usepublic void drawEllipse(int x, int y, int width, int height, int color, boolean doAlphaMix)
x
- X of upper left cornery
- Y of upper left cornerwidth
- Widthheight
- Heightcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawHorizontalLine(int x1, int x2, int y, int color)
x1
- Start Xx2
- End Xy
- Ycolor
- Color to usepublic void drawHorizontalLine(int x1, int x2, int y, int color, boolean doAlphaMix)
x1
- X startx2
- End Xy
- Ycolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawImage(int x, int y, JHelpImage image)
x
- Xy
- Yimage
- image to drawpublic void drawImage(int x, int y, JHelpImage image, boolean doAlphaMix)
x
- Xy
- Yimage
- Image to drawdoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawImage(int x, int y, JHelpImage image, int alpha)
x
- X positiony
- Y positionimage
- Image to drawalpha
- Alpha to usepublic void drawImage(int x, int y, JHelpImage image, int xImage, int yImage, int width, int height)
x
- X on thisy
- Y on thisimage
- Image to drawxImage
- X on imageyImage
- Y on imagewidth
- Part widthheight
- Part heightpublic void drawImage(int x, int y, JHelpImage image, int xImage, int yImage, int width, int height, boolean doAlphaMix)
x
- X on thisy
- Y on thisimage
- Image to drawxImage
- X on imageyImage
- Y on imagewidth
- Part widthheight
- Part heightdoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawImage(int x, int y, JHelpImage image, int xImage, int yImage, int width, int height, int alpha)
x
- X positiony
- Y positionimage
- Image to drawxImage
- X of image partyImage
- Y of image partwidth
- Image part widthheight
- Image part heightalpha
- Alpha to usepublic void drawLine(int x1, int y1, int x2, int y2, int color)
x1
- X of first pointy1
- Y first pointx2
- X second pointy2
- Y second pointcolor
- Color to usepublic void drawLine(int x1, int y1, int x2, int y2, int color, boolean doAlphaMix)
x1
- X of first pointy1
- Y first pointx2
- X second pointy2
- Y second pointcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, int color)
xs
- Polygon X listoffsetX
- Where start read the X listys
- Polygon Y listoffsetY
- Where start read the Y listlength
- Number of pointcolor
- Color to usepublic void drawPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, int color, boolean doAlphaMix)
xs
- Polygon X listoffsetX
- Where start read the X listys
- Polygon Y listoffsetY
- Where start read the Y listlength
- Number of pointcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawPolygon(int[] xs, int[] ys, int color)
xs
- X listys
- Y listcolor
- Color to usepublic void drawPolygon(int[] xs, int[] ys, int color, boolean doAlphaMix)
xs
- X listys
- Y listcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawRectangle(int x, int y, int width, int height, int color)
x
- X of top-lefty
- Y of top-leftwidth
- Rectangle widthheight
- Rectangle heightcolor
- Color to usepublic void drawRectangle(int x, int y, int width, int height, int color, boolean doAlphaMix)
x
- X of top-lefty
- Y of top-leftwidth
- Rectangle widthheight
- Rectangle heightcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, int color)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heightcolor
- Color to usepublic void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, int color, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heightcolor
- Color to usedoAlphaMix
- Indicates if do alpha mixing or just overwritepublic void drawShape(java.awt.Shape shape, int color)
shape
- Shape to drawcolor
- Color to usepublic void drawShape(java.awt.Shape shape, int color, boolean doAlphaMix)
shape
- Shape to drawcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawString(int x, int y, java.lang.String string, JHelpFont font, int color)
x
- X of top-lefty
- Y of top-leftstring
- String to drawfont
- Font to usecolor
- Color to usepublic void drawString(int x, int y, java.lang.String string, JHelpFont font, int color, boolean doAlphaMix)
x
- X of top-lefty
- Y of top-leftstring
- String to drawfont
- Font to usecolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void drawStringCenter(int x, int y, java.lang.String string, JHelpFont font, int color)
x
- String center Xy
- String center Ystring
- String to drawfont
- Font to usecolor
- Color to usepublic void drawStringCenter(int x, int y, java.lang.String string, JHelpFont font, int color, boolean doAlphaMix)
x
- String center Xy
- String center Ystring
- String to drawfont
- Font to usecolor
- Color to usedoAlphaMix
- Indicates if use alpha mixpublic void drawVerticalLine(int x, int y1, int y2, int color)
x
- Xy1
- Start Yy2
- End Ycolor
- Color to usepublic void drawVerticalLine(int x, int y1, int y2, int color, boolean doAlphaMix)
x
- Xy1
- Start Yy2
- End Ycolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void endDrawMode()
public JHelpImage extractSubImage(int x, int y, int width, int height)
x
- X of upper left corner of the area to extracty
- Y of upper left corner of the area to extractwidth
- Area to extract widthheight
- Area to extract heightpublic void fillEllipse(int x, int y, int width, int height, int color)
x
- X of bounds top-lefty
- Y of bounds top-leftwidth
- Ellipse widthheight
- Ellipse heightcolor
- Color to usepublic void fillEllipse(int x, int y, int width, int height, int color, boolean doAlphaMix)
x
- X of bounds top-lefty
- Y of bounds top-leftwidth
- Ellipse widthheight
- Ellipse heightcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillEllipse(int x, int y, int width, int height, JHelpImage texture)
x
- X of bounds top-lefty
- Y of bounds top-leftwidth
- Ellipse widthheight
- Ellipse heighttexture
- Texture to usepublic void fillEllipse(int x, int y, int width, int height, JHelpImage texture, boolean doAlphaMix)
x
- X of bounds top-lefty
- Y of bounds top-leftwidth
- Ellipse widthheight
- Ellipse heighttexture
- Texture to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillEllipse(int x, int y, int width, int height, JHelpPaint paint)
x
- Xy
- Ywidth
- Widthheight
- Heightpaint
- Paint to usepublic void fillEllipse(int x, int y, int width, int height, JHelpPaint paint, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- Heightpaint
- Paint to usedoAlphaMix
- Indicates if do alpha mixing or just overwritepublic void fillPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, int color)
xs
- X listoffsetX
- X list start offsetys
- Y listoffsetY
- Y list start offsetlength
- Number of pointscolor
- Color to usepublic void fillPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, int color, boolean doAlphaMix)
xs
- X listoffsetX
- X list start offsetys
- Y listoffsetY
- Y list start offsetlength
- Number of pointscolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, JHelpImage texture)
xs
- X listoffsetX
- X list start offsetys
- Y listoffsetY
- Y list offsetlength
- Number of pointstexture
- Texture to usepublic void fillPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, JHelpImage texture, boolean doAlphaMix)
xs
- X listoffsetX
- X list start offsetys
- Y listoffsetY
- Y list offsetlength
- Number of pointstexture
- Texture to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, JHelpPaint paint)
xs
- X coordinatesoffsetX
- Start read offset of xsys
- Y coordinatesoffsetY
- Start read offset of yslength
- Number of pointpaint
- Paint to usepublic void fillPolygon(int[] xs, int offsetX, int[] ys, int offsetY, int length, JHelpPaint paint, boolean doAlphaMix)
xs
- X coordinatesoffsetX
- Start read offset of xsys
- Y coordinatesoffsetY
- Start read offset of yslength
- Number of pointpaint
- Paint to usedoAlphaMix
- Indicates if do alpha mixing or just overwritepublic void fillPolygon(int[] xs, int[] ys, int color)
xs
- X listys
- Y listcolor
- Color to usepublic void fillPolygon(int[] xs, int[] ys, int color, boolean doAlphaMix)
xs
- X listys
- Y listcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillPolygon(int[] xs, int[] ys, JHelpImage texture)
xs
- X listys
- Y listtexture
- Texture to usepublic void fillPolygon(int[] xs, int[] ys, JHelpImage texture, boolean doAlphaMix)
xs
- X listys
- Y listtexture
- Texture to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillPolygon(int[] xs, int[] ys, JHelpPaint paint)
xs
- X coordinatesys
- Y coordinatespaint
- Paint to usepublic void fillPolygon(int[] xs, int[] ys, JHelpPaint paint, boolean doAlphaMix)
xs
- X coordinatesys
- Y coordinatespaint
- Paint to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRectangle(int x, int y, int width, int height, int color)
x
- X top-lefty
- U top-leftwidth
- Rectangle widthheight
- Rectangle heightcolor
- Color to usepublic void fillRectangle(int x, int y, int width, int height, int color, boolean doAlphaMix)
x
- X top-lefty
- U top-leftwidth
- Rectangle widthheight
- Rectangle heightcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRectangle(int x, int y, int width, int height, JHelpImage texture)
x
- X top-lefty
- Y top-leftwidth
- Rectangle widthheight
- Rectangle heighttexture
- Texture to usepublic void fillRectangle(int x, int y, int width, int height, JHelpImage texture, boolean doAlphaMix)
x
- X top-lefty
- Y top-leftwidth
- Rectangle widthheight
- Rectangle heighttexture
- Texture to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRectangle(int x, int y, int width, int height, JHelpPaint paint)
x
- Xy
- Ywidth
- Widthheight
- Heightpaint
- Paint to usepublic void fillRectangle(int x, int y, int width, int height, JHelpPaint paint, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- Heightpaint
- Paint to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRectangleScale(int x, int y, int width, int height, JHelpImage texture)
x
- Xy
- Ywidth
- Widthheight
- Heighttexture
- Image to drawpublic void fillRectangleScale(int x, int y, int width, int height, JHelpImage texture, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- Heighttexture
- Image to drawdoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRectangleScaleBetter(int x, int y, int width, int height, JHelpImage texture)
fillRectangleScale(int, int, int, int, JHelpImage)
but it is slower and take temporary
more memoryx
- Xy
- Ywidth
- Widthheight
- Heighttexture
- Image to drawpublic void fillRectangleScaleBetter(int x, int y, int width, int height, JHelpImage texture, boolean doAlphaMix)
fillRectangleScale(int, int, int, int, JHelpImage, boolean)
but it is slower and take
temporary more memoryx
- Xy
- Ywidth
- Widthheight
- Heighttexture
- Image to drawdoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, int color)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heightcolor
- Color to usepublic void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, int color, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heightcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, JHelpImage texture)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heighttexture
- Texture to usepublic void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, JHelpImage texture, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heighttexture
- Texture to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, JHelpPaint paint)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heightpaint
- Paint to usepublic void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, JHelpPaint paint, boolean doAlphaMix)
x
- Xy
- Ywidth
- Widthheight
- HeightarcWidth
- Arc widtharcHeight
- Arc heightpaint
- Paint to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillShape(java.awt.Shape shape, int color)
shape
- Shape to fillcolor
- Color to usepublic void fillShape(java.awt.Shape shape, int color, boolean doAlphaMix)
shape
- Shape to fillcolor
- Color to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillShape(java.awt.Shape shape, JHelpImage texture)
shape
- Shape to filltexture
- Texture to usepublic void fillShape(java.awt.Shape shape, JHelpImage texture, boolean doAlphaMix)
shape
- Shape to filltexture
- Texture to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillShape(java.awt.Shape shape, JHelpPaint paint)
shape
- Shape to fillpaint
- Paint to usepublic void fillShape(java.awt.Shape shape, JHelpPaint paint, boolean doAlphaMix)
shape
- Shape to fillpaint
- Paint to usedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillString(int x, int y, java.lang.String string, JHelpFont font, int color)
x
- X top-lefty
- Y top-leftstring
- String to drawfont
- Font to usecolor
- Color for fillpublic void fillString(int x, int y, java.lang.String string, JHelpFont font, int color, boolean doAlphaMix)
x
- X top-lefty
- Y top-leftstring
- String to drawfont
- Font to usecolor
- Color for filldoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillString(int x, int y, java.lang.String string, JHelpFont font, JHelpImage texture, int color)
x
- X top-lefty
- Y top-leftstring
- String to fillfont
- Font to usetexture
- Texture to usecolor
- Color if underlinepublic void fillString(int x, int y, java.lang.String string, JHelpFont font, JHelpImage texture, int color, boolean doAlphaMix)
x
- X top-lefty
- Y top-leftstring
- String to fillfont
- Font to usetexture
- Texture to usecolor
- Color if underlinedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void fillString(int x, int y, java.lang.String string, JHelpFont font, JHelpPaint paint, int color)
x
- Xy
- Ystring
- String to fillfont
- Font to usepaint
- Paint to usecolor
- Color for underlinepublic void fillString(int x, int y, java.lang.String string, JHelpFont font, JHelpPaint paint, int color, boolean doAlphaMix)
x
- Xy
- Ystring
- String to fillfont
- Font to usepaint
- Paint to usecolor
- Color for underlinedoAlphaMix
- Indicates if we do the mixing true
, or we just override false
public void filterBlue()
public void filterGreen()
public void filterOn(int color, int colorOK, int colorKO)
color
- Color searchcolorOK
- Color to use if correspondscolorKO
- Colo to use if failedpublic void filterOn(int color, int precision, int colorOK, int colorKO)
color
- Color searchprecision
- Precision to usecolorOK
- Color if correspondscolorKO
- Color if not correspondspublic void filterPalette(int index, int colorOK, int colorKO)
index
- Palette color indescolorOK
- Color if matchcolorKO
- Color if not matchpublic void filterRed()
public void filterU()
public void filterV()
public void filterY()
public void flipBoth()
But its done fasterpublic void flipHorizontal()
public void flipVertical()
public int getHeight()
public java.awt.Image getImage()
public java.lang.String getName()
public int getWidth()
public void gray()
public void grayInvert()
public void invertColors()
public void invertUV()
public boolean isDrawMode()
public void maximum(JHelpImage image)
image
- Image referencepublic void middle(JHelpImage image)
image
- Image referencepublic void minimum(JHelpImage image)
image
- Image referencepublic void multiply(JHelpImage image)
image
- Image to multiplypublic void paintMask(int x, int y, JHelpMask mask, int foreground, int background, boolean doAlphaMix)
x
- Xy
- Ymask
- Mask to paintforeground
- Foreground colorbackground
- Background colordoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, int foreground, JHelpImage background, int backgroundX, int backgroundY, boolean doAlphaMix)
x
- Xy
- Ymask
- Mask to paintforeground
- Foreground colorbackground
- Background imagebackgroundX
- X start in background imagebackgroundY
- Y start in background imagedoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, int foreground, JHelpPaint background, boolean doAlphaMix)
x
- Xy
- Ymask
- Mask to paintforeground
- Foreground colorbackground
- Background paintdoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, JHelpImage foreground, int foregroundX, int foregroundY, int background, boolean doAlphaMix)
x
- Xy
- Ymask
- Mask to paintforeground
- Foreground imageforegroundX
- X start on foreground imageforegroundY
- Y start on foreground imagebackground
- Background colordoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, JHelpImage foreground, int foregroundX, int foregroundY, JHelpImage background, int backgroundX, int backgroundY, boolean doAlphaMix)
x
- X position for the masky
- Y position for the maskmask
- Mask to paintforeground
- Foreground imageforegroundX
- X start position in foreground imageforegroundY
- Y start position in foreground imagebackground
- Background imagebackgroundX
- X start position in background imagebackgroundY
- Y start position in background imagedoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, JHelpImage foreground, int foregroundX, int foregroundY, JHelpPaint background, boolean doAlphaMix)
x
- X where paint the masky
- Y where paint the maskmask
- Mask to paintforeground
- Image in foregroundforegroundX
- X start on foreground imageforegroundY
- Y start on foreground imagebackground
- Background paintdoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, JHelpPaint foreground, int background, boolean doAlphaMix)
x
- X where paint the masky
- Y where paint the maskmask
- Mask to paintforeground
- Foreground paintbackground
- Background colordoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, JHelpPaint foreground, JHelpImage background, int backgroundX, int backgroundY, boolean doAlphaMix)
x
- X position for masky
- Y position for maskmask
- Mask to paintforeground
- Foreground paintbackground
- Background imagebackgroundX
- X start in background imagebackgroundY
- Y start in background imagedoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public void paintMask(int x, int y, JHelpMask mask, JHelpPaint foreground, JHelpPaint background, boolean doAlphaMix)
x
- X position for masky
- Y position for maskmask
- Mask to paintforeground
- Foreground paintbackground
- Background paintdoAlphaMix
- Indicates if do alpha mixing (true
) or just overwrite (false
)public int pickColor(int x, int y)
x
- X positiony
- Y positionpublic void register(java.awt.Component component)
component
- Component to registerpublic void removeSprite(JHelpSprite sprite)
sprite
- Sprite to removepublic void replaceColor(int colorToReplace, int newColor, int near)
colorToReplace
- Color searchednewColor
- New colornear
- Distance maximum from color searched to consider to color is nearpublic JHelpImage rotate180()
public JHelpImage rotate270()
public JHelpImage rotate90()
public JHelpImage rotatedPart180(int x, int y, int width, int height)
x
- Upper left area corner Xy
- Upper left area corner Ywidth
- Area to extract widthheight
- Area to extract heightpublic JHelpImage rotatedPart270(int x, int y, int width, int height)
x
- Upper left area corner Xy
- Upper left area corner Ywidth
- Area to extract widthheight
- Area to extract heightpublic JHelpImage rotatedPart90(int x, int y, int width, int height)
x
- Upper left area corner Xy
- Upper left area corner Ywidth
- Area to extract widthheight
- Area to extract heightpublic void setName(java.lang.String name)
name
- New namepublic void shift(int x, int y)
x
- X shifty
- Y shiftpublic void startDrawMode()
public void subtract(JHelpImage image)
image
- Image to subtractpublic void transfertSpritesTo(JHelpImage image)
image
- Image will receive this image spritespublic void unregister(java.awt.Component component)
component
- Component to unregisterpublic void update()