net.coobird.thumbnailator.filters
Class Watermark

java.lang.Object
  extended by net.coobird.thumbnailator.filters.Watermark
All Implemented Interfaces:
ImageFilter

public class Watermark
extends Object
implements ImageFilter

This class applies a watermark to an image.

Author:
coobird

Constructor Summary
Watermark(Position position, BufferedImage watermarkImg, float opacity)
          Instantiates a filter which applies a watermark to an image.
 
Method Summary
 BufferedImage apply(BufferedImage img)
          Applies a image filtering operation on an image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Watermark

public Watermark(Position position,
                 BufferedImage watermarkImg,
                 float opacity)
Instantiates a filter which applies a watermark to an image.

Parameters:
position - The position of the watermark.
watermarkImg - The watermark image.
opacity - The opacity of the watermark.

The value should be between 0.0f and 1.0f, where 0.0f is completely transparent, and 1.0f is completely opaque.

Method Detail

apply

public BufferedImage apply(BufferedImage img)
Description copied from interface: ImageFilter
Applies a image filtering operation on an image.

Specified by:
apply in interface ImageFilter
Parameters:
img - The image to apply the filtering on.
Returns:
The resulting image after applying this filter.


Copyright © 2014. All rights reserved.