Package railo.runtime.img

Examples of railo.runtime.img.Image


    return _call(pc, name,Caster.toFloatValue(x),Caster.toFloatValue(y),Caster.toFloatValue(angle),strInterpolation);
  }

  private static String _call(PageContext pc, Object name, float x, float y, float angle, String strInterpolation) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
    strInterpolation=strInterpolation.trim().toLowerCase();
    int interpolation;
    if("nearest".equals(strInterpolation)) interpolation=railo.runtime.img.Image.INTERPOLATION_NEAREST;
    else if("bilinear".equals(strInterpolation)) interpolation=railo.runtime.img.Image.INTERPOLATION_BILINEAR;
    else if("bicubic".equals(strInterpolation)) interpolation=railo.runtime.img.Image.INTERPOLATION_BICUBIC;
    else if("none".equals(strInterpolation)) interpolation=railo.runtime.img.Image.INTERPOLATION_NONE;
    else throw new ExpressionException("invalid interpolation definition ["+strInterpolation+"]," +
        " valid values are [nearest,bilinear,bicubic]");
   
    img.rotate(x,y,angle,interpolation);
    return null;
   
  }
View Full Code Here


    return call(pc, name, xcoords, ycoords, isPolygon, false);
  }

  public static String call(PageContext pc, Object name, Array xcoords, Array ycoords, boolean isPolygon, boolean filled) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if(xcoords.size()!=ycoords.size())
      throw new ExpressionException("xcoords and ycoords has not the same size");
    img.drawLines(toIntArray(xcoords), toIntArray(ycoords), isPolygon, filled);
    return null;
  }
View Full Code Here

    return call(pc, name, x, y, width, height,arcWidth,arcHeight,false);
  }
  public static String call(PageContext pc, Object name, double x, double y, double width,double height,
      double arcWidth, double arcHeight, boolean filled) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if (width < 0)
        throw new FunctionException(pc,"ImageDrawRoundRect",3,"width","width must contain a none negative value");
    if (height < 0)
        throw new FunctionException(pc,"ImageDrawRoundRect",4,"height","width must contain a none negative value");
    if (arcWidth < 0)
        throw new FunctionException(pc,"ImageDrawRoundRect",5,"arcWidth","arcWidth must contain a none negative value");
    if (arcHeight < 0)
        throw new FunctionException(pc,"ImageDrawRoundRect",6,"arcHeight","arcHeight must contain a none negative value");
   
    img.drawRoundRect((int)x, (int)y, (int)width, (int)height,(int)arcWidth,(int)arcHeight, filled);
    return null;
  }
View Full Code Here

  public static String call(PageContext pc, Object name, double x, double y, double width,double height) throws PageException {
    return call(pc, name, x, y, width, height,false);
  }
  public static String call(PageContext pc, Object name, double x, double y, double width,double height, boolean filled) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if (width < 0)
        throw new FunctionException(pc,"ImageDrawOval",3,"width","width must contain a none negative value");
    if (height < 0)
        throw new FunctionException(pc,"ImageDrawOval",4,"height","width must contain a none negative value");
   
    img.drawOval((int)x, (int)y, (int)width, (int)height, filled);
    return null;
  }
View Full Code Here

public class ImageShearDrawingAxis {
 
  public static String call(PageContext pc, Object name, double shx, double shy) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
   
    img.shearAxis(shx, shy);
    return null;
  }
View Full Code Here

  public static String call(PageContext pc, Object name, double x, double y, double width,double height) throws PageException {
    return call(pc, name, x, y, width, height,false);
  }
  public static String call(PageContext pc, Object name, double x, double y, double width,double height, boolean filled) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if (width < 0)
        throw new FunctionException(pc,"ImageDrawRect",3,"width","width must contain a none negative value");
    if (height < 0)
        throw new FunctionException(pc,"ImageDrawRect",4,"height","width must contain a none negative value");
   
    img.drawRect((int)x, (int)y, (int)width, (int)height, filled);
    return null;
  }
View Full Code Here

  public static String call(PageContext pc, Object name) throws PageException {
    return call(pc, name,1.0);
  }
  public static String call(PageContext pc, Object name, double gain) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if (gain < -1.0 || gain > 2.0)
        throw new FunctionException(pc,"ImageSharpen",2,"gain","value must be between 1 and 2");
    img.sharpen((float)gain);
    return null;
  }
View Full Code Here

    return call(pc, name, x, y, width, height, startAngle, arcAngle, false);
  }
  public static String call(PageContext pc, Object name, double x, double y, double width, double height
      , double startAngle, double arcAngle , boolean filled) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if (width < 0)
        throw new FunctionException(pc,"ImageDrawArc",3,"width","width must contain a none negative value");
    if (height < 0)
        throw new FunctionException(pc,"ImageDrawArc",4,"height","width must contain a none negative value");
   
    img.drawArc((int)x, (int)y, (int)width, (int)height, (int)startAngle, (int)arcAngle, filled);
    return null;
  }
View Full Code Here

    return call(pc, name, x, y, width, height, raised, false);
  }

  public static String call(PageContext pc, Object name, double x, double y, double width, double height, boolean raised , boolean filled) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    if (width < 0)
        throw new FunctionException(pc,"ImageDrawBeveledRect",3,"width","width must contain a none negative value");
    if (height < 0)
        throw new FunctionException(pc,"ImageDrawBeveledRect",4,"height","width must contain a none negative value");
   
    img.draw3DRect((int)x, (int)y, (int)width, (int)height, raised, filled);
    return null;
  }
View Full Code Here

public class ImageXORDrawingMode {

  public static String call(PageContext pc, Object name, String color) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    img.setXorMode(ColorCaster.toColor(color));
    return null;
  }
View Full Code Here

TOP

Related Classes of railo.runtime.img.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.