001    package railo.runtime.functions.image;
002    
003    
004    import railo.runtime.PageContext;
005    import railo.runtime.exp.PageException;
006    import railo.runtime.ext.function.Function;
007    import railo.runtime.img.Image;
008    import railo.runtime.op.Caster;
009    
010    public class ImageRotateDrawingAxis implements Function {
011    
012            public static String call(PageContext pc, Object name, double angle) throws PageException {
013                    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
014                    Image img = Image.toImage(name);
015                    
016                    img.rotateAxis(angle);
017                    return null;
018                    
019            }
020    
021            public static String call(PageContext pc, Object name, double angle, double x) throws PageException {
022                    return call(pc, name, angle, x, 0);
023            }
024    
025            public static String call(PageContext pc, Object name, double angle, double x, double y) throws PageException {
026                    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
027                    Image img = Image.toImage(name);
028                    
029                    img.rotateAxis(angle, x, y);
030                    return null;
031                    
032            }
033    }