com.anji.imaging
Class JMagickSurface

java.lang.Object
  extended by com.anji.imaging.JMagickSurface
All Implemented Interfaces:
Surface, Configurable

public class JMagickSurface
extends java.lang.Object
implements Surface

JMagickSurface


Field Summary
 
Fields inherited from interface com.anji.imaging.Surface
SURFACE_HEIGHT_KEY, SURFACE_WIDTH_KEY, TRANSFORMER_CLASS_KEY
 
Constructor Summary
JMagickSurface()
          default ctor
 
Method Summary
 int[] getData()
           
 int getHeight()
           
 int getValue(int x, int y)
           
 int getWidth()
           
 void init(Properties props)
           
 void setImage(java.io.File aFile)
          Set source data of image.
 int[] transform(TransformParameters parms)
          transform image via translate, rotate, scale, crop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMagickSurface

public JMagickSurface()
default ctor

Method Detail

setImage

public void setImage(java.io.File aFile)
              throws java.io.IOException
Description copied from interface: Surface
Set source data of image. The image file is scaled (using area averaging) to surface size.

Specified by:
setImage in interface Surface
Throws:
java.io.IOException
See Also:
Surface.setImage(java.io.File)

transform

public int[] transform(TransformParameters parms)
Description copied from interface: Surface
transform image via translate, rotate, scale, crop

Specified by:
transform in interface Surface
Returns:
transformed image flattened into 1D array
See Also:
Surface.transform(com.anji.imaging.TransformParameters)

getData

public int[] getData()
Specified by:
getData in interface Surface
Returns:
source image
See Also:
Surface.getData()

getWidth

public int getWidth()
Specified by:
getWidth in interface Surface
Returns:
width of source image
See Also:
Surface.getWidth()

getHeight

public int getHeight()
Specified by:
getHeight in interface Surface
Returns:
height of source image
See Also:
Surface.getHeight()

getValue

public int getValue(int x,
                    int y)
Specified by:
getValue in interface Surface
Returns:
value of pixel at location x,y
See Also:
Surface.getValue(int, int)

init

public void init(Properties props)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)