public class SpincastImageWatermarkerDefault extends Object implements SpincastImageWatermarker
| Constructor and Description |
|---|
SpincastImageWatermarkerDefault(String text,
Color textColor,
Color backgroundColor,
Font textFont,
String imageFilePath,
boolean imageFileOnClasspath,
SpincastWatermarkPosition position,
Integer margin,
Float opacity,
Integer percentageWidth,
Integer borderWidth,
Color borderColor,
SpincastUtils spincastUtils,
SpincastConfig spincastConfig) |
public SpincastImageWatermarkerDefault(@Nullable String text, @Nullable Color textColor, @Nullable Color backgroundColor, @Nullable Font textFont, @Nullable String imageFilePath, boolean imageFileOnClasspath, @Nullable SpincastWatermarkPosition position, @Nullable Integer margin, @Nullable Float opacity, @Nullable Integer percentageWidth, @Nullable Integer borderWidth, @Nullable Color borderColor, SpincastUtils spincastUtils, SpincastConfig spincastConfig)
protected String getWatermarkerId()
public String getText()
public Color getTextColor()
public Color getBackgroundColor()
public Font getTextFont()
public String getImageFilePath()
public boolean isImageFileOnClasspath()
public net.coobird.thumbnailator.geometry.Position getPosition()
public Integer getMargin()
public float getOpacity()
public int getPercentageWidth()
public Integer getBorderWidth()
public Color getBorderColor()
protected SpincastUtils getSpincastUtils()
protected SpincastConfig getSpincastConfig()
protected net.coobird.thumbnailator.geometry.Position toThumbnailatorPosition(SpincastWatermarkPosition position, Integer margin)
protected File getMainTempDir()
protected File getWatermarkImagesTempDir()
protected boolean isImageWatermark()
protected Font getDefaultFont()
protected BufferedImage createTextWatermarkBaseImage()
protected float getFontSizeToCreateTextWatermarkBaseImage()
protected BufferedImage getWatermarkOriginalImage()
protected BufferedImage getWatermarkImageForWidth(int width)
protected BufferedImage addBorder(BufferedImage watermarkImg)
protected int getTargetWatermarkImageWidth(BufferedImage originalImage)
public void watermark(String originalImagePath, File targetFile)
SpincastImageWatermarker
The format of the watermaked image is determined by
the extension of the targetFile (case-insensitive):
If the target file doesn't have any extension, PNG is used.
watermark in interface SpincastImageWatermarkertargetFile - The file where the watermarked version will
be saved. If this file already exists, it is overwritten.public void watermark(String originalImagePath, boolean onClasspath, File targetFile)
SpincastImageWatermarker
The format of the watermaked image is determined by
the extension of the targetFile (case-insensitive):
If the target file doesn't have any extension, PNG is used.
watermark in interface SpincastImageWatermarkeronClasspath - If true, the original image
will be taken from the classpath. Otherwise its path must
be a path on the file system.targetFile - The file where the watermarked version will
be saved. If this file already exists, it is overwritten.Copyright © 2019. All rights reserved.