|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gif4j.Watermark
An instance of this class is used to prepare and apply (paint with the specified transparency) images as watermarks to GifFrame
(s).
Absolute and layout positioning are supported.
GifImage
,
BufferedImage
Field Summary | |
static int |
LAYOUT_BOTTOM_CENTER
The bottom-center layout constraint. |
static int |
LAYOUT_BOTTOM_LEFT
The bottom-left layout constraint. |
static int |
LAYOUT_BOTTOM_RIGHT
The bottom-right layout constraint. |
static int |
LAYOUT_COVER_CONSECUTIVELY
By providing this layout constraint an image will be covered by the watermark consecutively. |
static int |
LAYOUT_MIDDLE_CENTER
The middle-center layout constraint. |
static int |
LAYOUT_MIDDLE_LEFT
The middle-left layout constraint. |
static int |
LAYOUT_MIDDLE_RIGHT
The middle-right layout constraint. |
static int |
LAYOUT_TOP_CENTER
The top-center layout constraint |
static int |
LAYOUT_TOP_LEFT
The top-left layout constraint. |
static int |
LAYOUT_TOP_RIGHT
The top-right layout constraint. |
Constructor Summary | |
Watermark(java.awt.image.BufferedImage watermarkImage,
int layoutConstraint)
Constructs Watermark from the specified BufferedImage
with the specified layout position (final position is calculated according to the specified
layout constraint before the applying process to the exact GifFrame starts), and 0.5 transparency (half-transparent). |
|
Watermark(java.awt.image.BufferedImage watermarkImage,
int layoutConstraint,
float transparency)
Constructs Watermark from the specified BufferedImage
with the specified layout position (final position is calculated according to the specified
layout constraint before the applying process to the exact GifFrame starts), and the specified transparency. |
|
Watermark(java.awt.image.BufferedImage watermarkImage,
java.awt.Point position)
Constructs Watermark from the specified BufferedImage
with the specified absolute position, and 0.5 transparency (half-transparent). |
|
Watermark(java.awt.image.BufferedImage watermarkImage,
java.awt.Point position,
float transparency)
Constructs Watermark from the specified BufferedImage
with the specified absolute position and transparency parameter. |
Method Summary | |
java.awt.image.BufferedImage |
apply(java.awt.image.BufferedImage image)
Apply (render the specified watermark image with the specified transparency at the specified position) this watermark to the specified image |
void |
setLayoutConstraint(int layoutConstraint)
Set the relative position where this instance should paint itself (final position is calculated according to the specified layout constraint before the applying process to the exact GifFrame starts) |
void |
setPosition(java.awt.Point position)
set absolute position where this instance should paint itself |
void |
setTransparency(float transparency)
Set watermark transparency |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LAYOUT_TOP_LEFT
public static final int LAYOUT_TOP_CENTER
public static final int LAYOUT_TOP_RIGHT
public static final int LAYOUT_MIDDLE_LEFT
public static final int LAYOUT_MIDDLE_CENTER
public static final int LAYOUT_MIDDLE_RIGHT
public static final int LAYOUT_BOTTOM_LEFT
public static final int LAYOUT_BOTTOM_CENTER
public static final int LAYOUT_BOTTOM_RIGHT
public static final int LAYOUT_COVER_CONSECUTIVELY
Constructor Detail |
public Watermark(java.awt.image.BufferedImage watermarkImage, java.awt.Point position)
Watermark
from the specified BufferedImage
with the specified absolute position, and 0.5 transparency (half-transparent).
watermarkImage
- the specified watermark imageposition
- absolute position where this watermark should be painted at
java.lang.NullPointerException
- watermarkImage is nullpublic Watermark(java.awt.image.BufferedImage watermarkImage, java.awt.Point position, float transparency)
Watermark
from the specified BufferedImage
with the specified absolute position and transparency parameter.
watermarkImage
- the specified watermark imageposition
- absolute position where this watermark should be painted attransparency
- the specified transparency, must be between 0 (absolutely transparent) and 1 (absolutely opaque).
java.lang.NullPointerException
- watermarkImage is nullpublic Watermark(java.awt.image.BufferedImage watermarkImage, int layoutConstraint)
Watermark
from the specified BufferedImage
with the specified layout position (final position is calculated according to the specified
layout constraint before the applying process to the exact GifFrame
starts), and 0.5 transparency (half-transparent).
watermarkImage
- the specified watermark imagelayoutConstraint
- one of the next:
LAYOUT_TOP_LEFT
,
LAYOUT_TOP_CENTER
,
LAYOUT_TOP_RIGHT
,
LAYOUT_MIDDLE_LEFT
,
LAYOUT_MIDDLE_CENTER
,
LAYOUT_MIDDLE_RIGHT
,
LAYOUT_BOTTOM_LEFT
,
LAYOUT_BOTTOM_CENTER
,
LAYOUT_BOTTOM_RIGHT
java.lang.NullPointerException
- watermarkImage is null
java.lang.IllegalArgumentException
- unknown layout constraintpublic Watermark(java.awt.image.BufferedImage watermarkImage, int layoutConstraint, float transparency)
Watermark
from the specified BufferedImage
with the specified layout position (final position is calculated according to the specified
layout constraint before the applying process to the exact GifFrame
starts), and the specified transparency.
watermarkImage
- the specified watermark imagelayoutConstraint
- one of the next:
LAYOUT_TOP_LEFT
,
LAYOUT_TOP_CENTER
,
LAYOUT_TOP_RIGHT
,
LAYOUT_MIDDLE_LEFT
,
LAYOUT_MIDDLE_CENTER
,
LAYOUT_MIDDLE_RIGHT
,
LAYOUT_BOTTOM_LEFT
,
LAYOUT_BOTTOM_CENTER
,
LAYOUT_BOTTOM_RIGHT
transparency
- transparency parameter, must be between 0 (absolutely transparent) and 1 (absolutely opaque).
java.lang.NullPointerException
- watermarkImage is null
java.lang.IllegalArgumentException
- unknown layout constraintMethod Detail |
public void setPosition(java.awt.Point position)
position
- point instance with positive coordinatespublic void setLayoutConstraint(int layoutConstraint)
GifFrame
starts)
layoutConstraint
- one of the next:
LAYOUT_TOP_LEFT
,
LAYOUT_TOP_CENTER
,
LAYOUT_TOP_RIGHT
,
LAYOUT_MIDDLE_LEFT
,
LAYOUT_MIDDLE_CENTER
,
LAYOUT_MIDDLE_RIGHT
,
LAYOUT_BOTTOM_LEFT
,
LAYOUT_BOTTOM_CENTER
,
LAYOUT_BOTTOM_RIGHT
java.lang.IllegalArgumentException
- unknown layout constraintpublic void setTransparency(float transparency)
transparency
- transparency parameter, must be between 0 (absolutely transparent) and 1 (absolutely opaque).public java.awt.image.BufferedImage apply(java.awt.image.BufferedImage image)
image
- to apply watermark for
BufferedImage
instance with rendered watermark
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |