org.fcrepo.localservices.imagemanip
Class ImageManipulation

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.fcrepo.localservices.imagemanip.ImageManipulation
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ImageManipulation
extends javax.servlet.http.HttpServlet

ImageManipulation is a Java servlet that takes a URL of an image as a param and based on other given parameters, can perform a variety of image related manipulations on the object.

After the image is manipulated, it is then sent back as an image/type object to the calling parent, most often a browser or an HTML img tag.

Author:
Theodore Serbinski
See Also:
Serialized Form

Constructor Summary
ImageManipulation()
           
 
Method Summary
 ij.process.ImageProcessor crop(ij.process.ImageProcessor ip, String cropX, String cropY, String cropWidth, String cropHeight)
          Crops an image with supplied starting point and ending point.
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Method automatically called by browser to handle image manipulations.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageManipulation

public ImageManipulation()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  IOException
Method automatically called by browser to handle image manipulations.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
req - Browser request to servlet res Response sent back to browser after image manipulation
Throws:
IOException - If an input or output exception occurred ServletException If a servlet exception occurred
javax.servlet.ServletException

crop

public ij.process.ImageProcessor crop(ij.process.ImageProcessor ip,
                                      String cropX,
                                      String cropY,
                                      String cropWidth,
                                      String cropHeight)
Crops an image with supplied starting point and ending point.

Parameters:
ip - The image to crop cropX The starting x position; x=0 corresponds to left side of image cropY The starting y position; y=0 corresponds to top of image cropWidth The width of the crop, starting from the above x cropHeight The height of the crop, starting from the above y
Returns:
The image cropped


Copyright © 2012 DuraSpace. All Rights Reserved.