Groovy Documentation

src.groovy.pl.burningice.plugins.image.engines
Class Action

java.lang.Object
  src.groovy.pl.burningice.plugins.image.engines.Action

class Action

Object allows to build chains of action It instance is pass as a parameter to closure that user define and pass to execute method as parameter

author:
pawel.gdula@burningice.pl


Property Summary
def fileName

Name of output file It is always return as a result of action

ImageFile loadedImage

Image that is set to manipulate

 
Constructor Summary
Action()

 
Method Summary
def crop(def deltaX, def deltaY, def width, def height)

Method allows to crop specified region from image or delta is smaller than 0 or crop region dimension is smaller or equal zero or crop region is beyond the image

def scaleAccurate(def width, def height)

Method allows to scale image with accurate width and height Width and height will be always (almost ;)) equals to set parameters Image will no be deformed but first scaled and next cropped on the center (if it will necessary)

def scaleApproximate(def width, def height)

Method allows to scale image with approximate width and height Width and height of image will never be greater than parameters width and height but it could be lover (image could not be deformed)

def text(Color color, Font font, groovy.lang.Closure typist)

Method allows to type text on image

def text(Color color, groovy.lang.Closure typist)

Method allows to type text on image

def text(Font font, groovy.lang.Closure typist)

Method allows to type text on image

def text(groovy.lang.Closure typist)

Method allows to type text on image

def watermark(def watermarkPath, def position = [:], def alpha = 1f)

Method allows to add watermark to image

 
Methods inherited from class java.lang.Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Property Detail

fileName

def fileName
Name of output file It is always return as a result of action
var:
String


loadedImage

ImageFile loadedImage
Image that is set to manipulate
var:
ImageFile


 
Constructor Detail

Action

Action()


 
Method Detail

crop

public def crop(def deltaX, def deltaY, def width, def height)
Method allows to crop specified region from image
param:
deltaX Offset from left border of image
param:
deltaY Offset from top border of image
param:
width Size (horizontal) of crop region
param:
width Size (vertical) of crop region
throws:
IllegalArgumentException If any parameter is null, or delta is smaller than 0 or crop region dimension is smaller or equal zero or crop region is beyond the image
return:
String Name of output file


scaleAccurate

public def scaleAccurate(def width, def height)
Method allows to scale image with accurate width and height Width and height will be always (almost ;)) equals to set parameters Image will no be deformed but first scaled and next cropped on the center (if it will necessary)
param:
int width
param:
int height
throws:
IllegalArgumentException
return:
String Name of output file


scaleApproximate

public def scaleApproximate(def width, def height)
Method allows to scale image with approximate width and height Width and height of image will never be greater than parameters width and height but it could be lover (image could not be deformed)
param:
int width
param:
int height
throws:
IllegalArgumentException
return:
String Name of output file


text

public def text(Color color, Font font, groovy.lang.Closure typist)
Method allows to type text on image
param:
color Specified color of typed text
param:
font Specified font of typed text
param:
typist Type action
return:
String Name of output file


text

public def text(Color color, groovy.lang.Closure typist)
Method allows to type text on image
param:
color Specified color of typed text
param:
typist Type action
return:
String Name of output file


text

public def text(Font font, groovy.lang.Closure typist)
Method allows to type text on image
param:
font Specified font of typed text
param:
typist Type action
return:
String Name of output file


text

public def text(groovy.lang.Closure typist)
Method allows to type text on image
param:
typist Type action
return:
String Name of output file


watermark

public def watermark(def watermarkPath, def position = [:], def alpha = 1f)
Method allows to add watermark to image
param:
String watermarkPath Path to watermark image
param:
[:] position Position on image where watermark should be placed (default [:])
param:
float alpha Watermark alpha (default 1)
throw:
IllegalArgumentException
throw:
FileNotFoundException
return:
String Name of output file


 

Groovy Documentation