Package org.spincast.plugins.watermarker
Interface SpincastImageWatermarkerBuilder
- All Known Implementing Classes:
SpincastImageWatermarkerBuilderDefault
public interface SpincastImageWatermarkerBuilder
-
Method Summary
Modifier and TypeMethodDescriptionbackgroundColor
(Color color) The background color to use for the watermark.The border to add around the watermark.build()
Creates the actualSpincastImageWatermarker
.The image on the file system to use as the watermark.The image to use as the watermark.opacity
(float opacity) The opacity of the watermark.position
(SpincastWatermarkPosition position) The position where the watermark will be created on the image.position
(SpincastWatermarkPosition position, int margin) The position where the watermark will be created on the image.The text to use as the watermark.widthPercent
(int percentageWidth) The width of the watermark.
-
Method Details
-
text
The text to use as the watermark. Calling this will remove any image set using#image(File)
.By default, this text is the root URL of the application (for example: "https://www.example.com").
-
text
-
text
-
text
-
text
-
text
-
text
-
backgroundColor
The background color to use for the watermark. This is only useful when using atext
watermark.Default to white.
You can set this to
null
to get a transparent background! -
image
The image on the file system to use as the watermark.Calling this will remove any text set using {@link #text(String).
Empty by default.
- Throws:
an
- exception if the specified file doesn't exist or is not a valid image.
-
image
The image to use as the watermark.Calling this will remove any text set using {@link #text(String).
Empty by default.
- Parameters:
onClasspath
- iftrue
, theimageFilePath
will be considered as a classpath path. Otherwise, the image will be taken from the file system.- Throws:
an
- exception if the specified file doesn't exist or is not a valid image.
-
position
The position where the watermark will be created on the image. No margin.Defaults to .
-
position
The position where the watermark will be created on the image.Defaults to .
- Parameters:
The
- margin (in pixels) between the watermark and the edge of the image.
-
opacity
The opacity of the watermark.Between 0.0 and 1.0.
Defaults to 1.0, no transparency.
-
widthPercent
The width of the watermark. Must be an integer between 1 and 100.Defaults to 50.
-
border
The border to add around the watermark.Set the
widthInPixels
to 0 to prevent any border to be added.Default to a 5 pixels black border.
- Parameters:
color
- Can benull
: will be black then.
-
build
SpincastImageWatermarker build()Creates the actualSpincastImageWatermarker
.
-