public class Image extends StructSupport implements Cloneable, Struct
Collection.Key
Modifier and Type | Field and Description |
---|---|
static int |
BORDER_TYPE_CONSTANT |
static int |
INTERPOLATION_BICUBIC |
static int |
INTERPOLATION_BILINEAR |
static int |
INTERPOLATION_NEAREST |
static int |
INTERPOLATION_NONE |
static int |
IP_BESSEL |
static int |
IP_BLACKMAN |
static int |
IP_HAMMING |
static int |
IP_HANNING |
static int |
IP_HERMITE |
static int |
IP_HIGHESTPERFORMANCE |
static int |
IP_HIGHESTQUALITY |
static int |
IP_HIGHPERFORMANCE |
static int |
IP_HIGHQUALITY |
static int |
IP_LANCZOS |
static int |
IP_MEDIUMPERFORMANCE |
static int |
IP_MEDIUMQUALITY |
static int |
IP_MITCHELL |
static int |
IP_NONE |
static int |
IP_QUADRATIC |
static int |
IP_TRIANGLE |
static int |
IPC_BICUBIC |
static int |
IPC_BILINEAR |
static int |
IPC_MAX |
static int |
IPC_NEAREST |
TYPE_LINKED, TYPE_REGULAR, TYPE_SOFT, TYPE_SYNC, TYPE_WEAKED
Constructor and Description |
---|
Image() |
Image(BufferedImage image) |
Image(byte[] binary) |
Image(byte[] binary,
String format) |
Image(int width,
int height,
int imageType,
Color canvasColor) |
Image(Resource res) |
Image(Resource res,
String format) |
Image(String b64str) |
Image(String b64str,
String format) |
Modifier and Type | Method and Description |
---|---|
void |
_rotate(float x,
float y,
float angle,
String interpolation) |
void |
addBorder(int thickness,
Color color,
int borderType)
add a border to image
|
void |
blur(int blurFactor) |
Object |
call(PageContext pc,
Collection.Key methodName,
Object[] args)
calls a method of the object
|
Object |
callWithNamedValues(PageContext pc,
Collection.Key methodName,
Struct args)
call a method of the Object with named arguments
|
Boolean |
castToBoolean(Boolean defaultValue)
cast the castable value to a boolean value
|
boolean |
castToBooleanValue()
cast the castable value to a boolean value
|
DateTime |
castToDateTime()
cast the castable value to a date time object
|
DateTime |
castToDateTime(DateTime defaultValue)
cast the castable value to a date time object
|
double |
castToDoubleValue()
cast the castable value to a double value
|
double |
castToDoubleValue(double defaultValue)
cast the castable value to a double value
|
String |
castToString()
cast the castable value to a string, other than the Method toString, this Method can throw a Exception
|
String |
castToString(String defaultValue)
cast the castable value to a string, return the default value, when the method is not castable
|
void |
clear()
clears the collection
|
void |
clearRect(int x,
int y,
int width,
int height) |
int |
compareTo(boolean b) |
int |
compareTo(DateTime dt) |
int |
compareTo(double d) |
int |
compareTo(String str) |
boolean |
containsKey(Collection.Key key)
contains this key
|
boolean |
containsValue(Object value) |
void |
convert(String format) |
Image |
copy(float x,
float y,
float width,
float height) |
Image |
copy(float x,
float y,
float width,
float height,
float dx,
float dy) |
static Image |
createImage(PageContext pc,
Object obj,
boolean check4Var,
boolean clone,
boolean checkAccess,
String format) |
void |
crop(float x,
float y,
float width,
float height) |
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised,
boolean filled) |
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle,
boolean filled) |
void |
drawCubicCurve(double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double x1,
double y1,
double x2,
double y2) |
void |
drawImage(Image img,
int x,
int y) |
void |
drawImage(Image img,
int x,
int y,
int width,
int height) |
void |
drawLine(int x1,
int y1,
int x2,
int y2) |
void |
drawLines(int[] xcoords,
int[] ycoords,
boolean isPolygon,
boolean filled) |
void |
drawOval(int x,
int y,
int width,
int height,
boolean filled) |
void |
drawPoint(int x,
int y) |
void |
drawQuadraticCurve(double x1,
double y1,
double ctrlx,
double ctrly,
double x2,
double y2) |
void |
drawRect(int x,
int y,
int width,
int height,
boolean filled) |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
boolean filled) |
void |
drawString(String text,
int x,
int y,
Struct attr) |
Collection |
duplicate(boolean deepCopy) |
Iterator<Map.Entry<Collection.Key,Object>> |
entryIterator() |
void |
flip(javax.media.jai.operator.TransposeType transpose) |
Object |
get(Collection.Key key)
return a value from the collection
|
Object |
get(Collection.Key key,
Object defaultValue)
return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null
|
String |
getBase64String(String format) |
BufferedImage |
getBufferedImage() |
ColorModel |
getColorModel() |
String |
getFormat() |
int |
getHeight() |
byte[] |
getImageBytes(String format) |
byte[] |
getImageBytes(String format,
boolean noMeta) |
IIOMetadata |
getMetaData(Struct parent) |
Resource |
getSource() |
int |
getWidth() |
void |
grayscale() |
static boolean |
hasAlpha(Image image)
This method returns true if the specified image has transparent pixels
|
BufferedImage |
image() |
void |
image(BufferedImage image) |
Struct |
info() |
void |
invert() |
static boolean |
isCastableToImage(PageContext pc,
Object obj) |
static boolean |
isImage(Object obj) |
Iterator<Collection.Key> |
keyIterator() |
Collection.Key[] |
keys() |
Iterator<String> |
keysAsStringIterator() |
void |
overlay(Image topImage) |
void |
paste(Image topImage,
int x,
int y) |
Object |
remove(Collection.Key key)
removes value from collection and return it when it exists, otherwise throws a exception
|
Object |
removeEL(Collection.Key key)
removes value from collection and return it when it exists, otherwise returns null
|
void |
resize(int width,
int height,
int interpolation,
double blurFactor) |
void |
resize(int scale,
String interpolation,
double blurFactor) |
void |
resize(String strWidth,
String strHeight,
String interpolation,
double blurFactor) |
void |
resizeImage(int width,
int height,
int interpolation) |
void |
resizeImage2(int width,
int height) |
void |
rgb() |
void |
rotate(float x,
float y,
float angle,
int interpolation) |
void |
rotateAxis(double angle) |
void |
rotateAxis(double angle,
double x,
double y) |
void |
scaleToFit(String fitWidth,
String fitHeight,
String interpolation,
double blurFactor) |
Object |
set(Collection.Key key,
Object value)
sets a value to the collection
|
void |
setAlpha(float alpha) |
void |
setAntiAliasing(boolean antiAlias) |
void |
setBackground(Color color) |
void |
setColor(Color color) |
void |
setDrawingStroke(float width,
int endcaps,
int linejoins,
float miterlimit,
float[] dash,
float dash_phase) |
void |
setDrawingStroke(Stroke stroke) |
void |
setDrawingStroke(Struct attr) |
Object |
setEL(Collection.Key key,
Object value)
sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
|
void |
setTranparency(float percent) |
void |
setXorMode(Color color) |
void |
sharpen(float gain) |
void |
shear(float shear,
javax.media.jai.operator.ShearDir direction,
Object interpolation) |
void |
shearAxis(double shx,
double shy) |
int |
size() |
void |
threeBBger() |
static BufferedImage |
toBufferedImage(Image image) |
DumpData |
toDumpData(PageContext pageContext,
int maxlevel,
DumpProperties dp)
method to print out information to a object as HTML
|
static Image |
toImage(Object obj) |
static Image |
toImage(Object obj,
PageContext pc) |
static Image |
toImage(PageContext pc,
Object obj) |
static Image |
toImage(PageContext pc,
Object obj,
boolean checkForVariables) |
static Image |
toImage(PageContext pc,
Object obj,
boolean checkForVariables,
Image defaultValue) |
static int |
toInterpolation(String strInterpolation) |
void |
translate(int xtrans,
int ytrans,
Object interpolation) |
void |
translateAxis(int x,
int y) |
Iterator<Object> |
valueIterator() |
Collection |
values() |
String |
writeBase64(Resource destination,
String format,
boolean inHTMLFormat) |
void |
writeOut(OutputStream os,
String format,
float quality,
boolean closeStream) |
void |
writeOut(Resource destination,
boolean overwrite,
float quality) |
void |
writeOut(Resource destination,
String format,
boolean overwrite,
float quality) |
static void |
writeOutGif(BufferedImage src,
OutputStream os) |
clone, containsKey, containsKey, entrySet, equals, get, get, get, get, get, getIterator, invalidKey, isEmpty, keySet, put, putAll, remove, set, set, setEL, setEL, sizeOf, toString
getClass, hashCode, notify, notifyAll, wait, wait, wait
clone, containsKey, get, get, set, setEL
getIterator
public static final int BORDER_TYPE_CONSTANT
public static final int INTERPOLATION_NONE
public static final int INTERPOLATION_NEAREST
public static final int INTERPOLATION_BILINEAR
public static final int INTERPOLATION_BICUBIC
public static final int IP_NONE
public static final int IPC_NEAREST
public static final int IPC_BILINEAR
public static final int IPC_BICUBIC
public static final int IPC_MAX
public static final int IP_HIGHESTQUALITY
public static final int IP_HIGHQUALITY
public static final int IP_MEDIUMQUALITY
public static final int IP_HIGHESTPERFORMANCE
public static final int IP_HIGHPERFORMANCE
public static final int IP_MEDIUMPERFORMANCE
public static final int IP_BESSEL
public static final int IP_BLACKMAN
public static final int IP_HAMMING
public static final int IP_HANNING
public static final int IP_HERMITE
public static final int IP_LANCZOS
public static final int IP_MITCHELL
public static final int IP_QUADRATIC
public static final int IP_TRIANGLE
public Image(byte[] binary) throws IOException
IOException
public Image(byte[] binary, String format) throws IOException
IOException
public Image(Resource res) throws IOException
IOException
public Image(Resource res, String format) throws IOException
IOException
public Image(BufferedImage image)
public Image(String b64str) throws IOException
IOException
public Image(String b64str, String format) throws IOException
IOException
public Image(int width, int height, int imageType, Color canvasColor) throws ExpressionException
ExpressionException
public Image()
public void addBorder(int thickness, Color color, int borderType) throws ExpressionException
thickness
- color
- borderType
- ExpressionException
public void blur(int blurFactor) throws ExpressionException
ExpressionException
public void clearRect(int x, int y, int width, int height) throws ExpressionException
ExpressionException
public Struct info() throws ExpressionException
ExpressionException
public IIOMetadata getMetaData(Struct parent)
public void sharpen(float gain) throws ExpressionException
ExpressionException
public void setTranparency(float percent) throws ExpressionException
ExpressionException
public void invert() throws ExpressionException
ExpressionException
public Image copy(float x, float y, float width, float height) throws ExpressionException
ExpressionException
public Image copy(float x, float y, float width, float height, float dx, float dy) throws ExpressionException
ExpressionException
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle, boolean filled) throws ExpressionException
ExpressionException
public void draw3DRect(int x, int y, int width, int height, boolean raised, boolean filled) throws ExpressionException
ExpressionException
public void drawCubicCurve(double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x1, double y1, double x2, double y2) throws ExpressionException
ExpressionException
public void drawPoint(int x, int y) throws ExpressionException
ExpressionException
public void drawQuadraticCurve(double x1, double y1, double ctrlx, double ctrly, double x2, double y2) throws ExpressionException
ExpressionException
public void drawRect(int x, int y, int width, int height, boolean filled) throws ExpressionException
ExpressionException
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight, boolean filled) throws ExpressionException
ExpressionException
public void drawLine(int x1, int y1, int x2, int y2) throws ExpressionException
ExpressionException
public void drawImage(Image img, int x, int y) throws ExpressionException
ExpressionException
public void drawImage(Image img, int x, int y, int width, int height) throws ExpressionException
ExpressionException
public void drawLines(int[] xcoords, int[] ycoords, boolean isPolygon, boolean filled) throws ExpressionException
ExpressionException
public void drawOval(int x, int y, int width, int height, boolean filled) throws ExpressionException
ExpressionException
public void drawString(String text, int x, int y, Struct attr) throws PageException
PageException
public void setDrawingStroke(Struct attr) throws PageException
PageException
public void setDrawingStroke(float width, int endcaps, int linejoins, float miterlimit, float[] dash, float dash_phase) throws ExpressionException
ExpressionException
public void setDrawingStroke(Stroke stroke) throws ExpressionException
ExpressionException
public void flip(javax.media.jai.operator.TransposeType transpose) throws ExpressionException
ExpressionException
public void grayscale() throws ExpressionException
ExpressionException
public void rgb() throws ExpressionException
ExpressionException
public void threeBBger() throws ExpressionException
ExpressionException
public void overlay(Image topImage) throws ExpressionException
ExpressionException
public void paste(Image topImage, int x, int y) throws ExpressionException
ExpressionException
public void setXorMode(Color color) throws ExpressionException
ExpressionException
public void translate(int xtrans, int ytrans, Object interpolation) throws ExpressionException
ExpressionException
public void translateAxis(int x, int y) throws ExpressionException
ExpressionException
public void rotateAxis(double angle) throws ExpressionException
ExpressionException
public void rotateAxis(double angle, double x, double y) throws ExpressionException
ExpressionException
public void shearAxis(double shx, double shy) throws ExpressionException
ExpressionException
public void shear(float shear, javax.media.jai.operator.ShearDir direction, Object interpolation) throws ExpressionException
ExpressionException
public BufferedImage getBufferedImage() throws ExpressionException
ExpressionException
public BufferedImage image() throws ExpressionException
ExpressionException
public void image(BufferedImage image)
public String writeBase64(Resource destination, String format, boolean inHTMLFormat) throws PageException, IOException
PageException
IOException
public String getBase64String(String format) throws PageException
PageException
public void writeOut(Resource destination, boolean overwrite, float quality) throws IOException, ExpressionException
IOException
ExpressionException
public void writeOut(Resource destination, String format, boolean overwrite, float quality) throws IOException, ExpressionException
IOException
ExpressionException
public static void writeOutGif(BufferedImage src, OutputStream os) throws IOException
IOException
public void writeOut(OutputStream os, String format, float quality, boolean closeStream) throws IOException, ExpressionException
IOException
ExpressionException
public void scaleToFit(String fitWidth, String fitHeight, String interpolation, double blurFactor) throws PageException
PageException
public void resize(int scale, String interpolation, double blurFactor) throws PageException
PageException
public void resize(String strWidth, String strHeight, String interpolation, double blurFactor) throws PageException
PageException
public void resizeImage2(int width, int height) throws ExpressionException
ExpressionException
public void resizeImage(int width, int height, int interpolation) throws ExpressionException
ExpressionException
public void resize(int width, int height, int interpolation, double blurFactor) throws ExpressionException
ExpressionException
public void rotate(float x, float y, float angle, int interpolation) throws ExpressionException
ExpressionException
public void _rotate(float x, float y, float angle, String interpolation) throws ExpressionException
ExpressionException
public static Image toImage(Object obj) throws PageException
PageException
public static Image toImage(Object obj, PageContext pc) throws PageException
PageException
public static Image toImage(PageContext pc, Object obj) throws PageException
PageException
public static Image toImage(PageContext pc, Object obj, boolean checkForVariables) throws PageException
PageException
public static Image toImage(PageContext pc, Object obj, boolean checkForVariables, Image defaultValue)
public Object call(PageContext pc, Collection.Key methodName, Object[] args) throws PageException
Objects
call
in interface Objects
call
in class StructSupport
methodName
- name of the method to callargs
- arguments to call method withPageException
public Object callWithNamedValues(PageContext pc, Collection.Key methodName, Struct args) throws PageException
Objects
callWithNamedValues
in interface Objects
callWithNamedValues
in class StructSupport
pc
- PageContextmethodName
- name of the methodargs
- Named Arguments for the methodPageException
public static boolean isCastableToImage(PageContext pc, Object obj)
public static Image createImage(PageContext pc, Object obj, boolean check4Var, boolean clone, boolean checkAccess, String format) throws PageException
PageException
public Collection duplicate(boolean deepCopy)
duplicate
in interface Collection
public ColorModel getColorModel() throws ExpressionException
ExpressionException
public void crop(float x, float y, float width, float height) throws ExpressionException
ExpressionException
public int getWidth() throws ExpressionException
ExpressionException
public int getHeight() throws ExpressionException
ExpressionException
public byte[] getImageBytes(String format) throws PageException
PageException
public byte[] getImageBytes(String format, boolean noMeta) throws PageException
PageException
public void setColor(Color color) throws ExpressionException
ExpressionException
public void setAlpha(float alpha) throws ExpressionException
ExpressionException
public void setBackground(Color color) throws ExpressionException
ExpressionException
public void setAntiAliasing(boolean antiAlias) throws ExpressionException
ExpressionException
public void clear()
Collection
clear
in interface Map
clear
in interface Collection
public boolean containsKey(Collection.Key key)
Collection
containsKey
in interface Collection
public Object get(Collection.Key key) throws PageException
Collection
get
in interface Collection
key
- key of the value to get must be lower casePageException
public Object get(Collection.Key key, Object defaultValue)
Collection
get
in interface Collection
key
- key of the value to getpublic Collection.Key[] keys()
keys
in interface Collection
public Object remove(Collection.Key key) throws PageException
Collection
remove
in interface Collection
key
- key of the collectionPageException
public Object removeEL(Collection.Key key)
Collection
removeEL
in interface Collection
key
- key of the collectionpublic Object set(Collection.Key key, Object value) throws PageException
Collection
set
in interface Collection
key
- key of the new valuevalue
- value to setPageException
public Object setEL(Collection.Key key, Object value)
Collection
setEL
in interface Collection
key
- key of the value to getvalue
- value to setpublic int size()
size
in interface Map
size
in interface Collection
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
Dumpable
toDumpData
in interface Dumpable
toDumpData
in class StructSupport
public Iterator<Collection.Key> keyIterator()
keyIterator
in interface Iteratorable
public Iterator<String> keysAsStringIterator()
keysAsStringIterator
in interface Iteratorable
keysAsStringIterator
in class StructSupport
public Iterator<Map.Entry<Collection.Key,Object>> entryIterator()
entryIterator
in interface Iteratorable
public Iterator<Object> valueIterator()
valueIterator
in interface Iteratorable
public boolean castToBooleanValue() throws PageException
Castable
castToBooleanValue
in interface Castable
castToBooleanValue
in class StructSupport
PageException
public Boolean castToBoolean(Boolean defaultValue)
Castable
castToBoolean
in interface Castable
castToBoolean
in class StructSupport
public DateTime castToDateTime() throws PageException
Castable
castToDateTime
in interface Castable
castToDateTime
in class StructSupport
PageException
public DateTime castToDateTime(DateTime defaultValue)
Castable
castToDateTime
in interface Castable
castToDateTime
in class StructSupport
defaultValue
- returned when it is not possible to cast to a dateTime objectpublic double castToDoubleValue() throws PageException
Castable
castToDoubleValue
in interface Castable
castToDoubleValue
in class StructSupport
PageException
public double castToDoubleValue(double defaultValue)
Castable
castToDoubleValue
in interface Castable
castToDoubleValue
in class StructSupport
public String castToString() throws PageException
Castable
castToString
in interface Castable
castToString
in class StructSupport
PageException
public String castToString(String defaultValue)
Castable
castToString
in interface Castable
castToString
in class StructSupport
public int compareTo(String str) throws PageException
compareTo
in interface Castable
compareTo
in class StructSupport
PageException
public int compareTo(boolean b) throws PageException
compareTo
in interface Castable
compareTo
in class StructSupport
PageException
public int compareTo(double d) throws PageException
compareTo
in interface Castable
compareTo
in class StructSupport
PageException
public int compareTo(DateTime dt) throws PageException
compareTo
in interface Castable
compareTo
in class StructSupport
PageException
public static int toInterpolation(String strInterpolation) throws ExpressionException
ExpressionException
public boolean containsValue(Object value)
containsValue
in interface Map
containsValue
in class StructSupport
public Collection values()
values
in interface Map
values
in class StructSupport
public static boolean hasAlpha(Image image)
image
- public static BufferedImage toBufferedImage(Image image)
Copyright © 2015 Lucee