public class Sprite extends java.lang.Object implements Debugger, CompositeCapable, java.io.Externalizable, java.lang.Cloneable, Resource, Threaded, RenderingSceneComponent, Sf3Renderable
boolean complete = _drawOrAnyotherCommand(thatReturnBoolean); complete = complete && _drawOrAnyotherCommand()is UNSAFE : the boolean agregators
&& or ||may return without processing the second member command. USE INSTEAD :
complete = _drawOrAnyotherCommand(thatReturnBoolean) && complete;
Modifier and Type | Field and Description |
---|---|
static java.awt.datatransfer.DataFlavor |
_dataFlavor
the DataFlavor used for identifying sp Sprite instance, as follows
new DataFlavor(Sprite.class, "sf3jswing Sprite")
|
static java.awt.datatransfer.DataFlavor[] |
_dataFlavors
supported DataFlavor's.
|
static float |
_DEF_CPR_QUALITY
Defines the default storage compression quality for
Serialized/Externalized instances, if compression is available for the
current
mime-type decimal between 0f and 1f. |
static GLObjectHandler<SpriteGLHandler> |
_GLHandlers
Sprites, Animations and Models handlers are gathered here
|
static java.lang.String[] |
_MIME_EXT
the file extensions supported by this Sprite class
|
static java.lang.String |
_MIME_TYPE
the DataFlavor used for the mime-type by this Sprite class
|
static int |
_MIN_THUMBNAILS_SIZE
minimal pixels size of thumbnails cannot be greater than
_WRITE_TILES_DIMENSION |
static SfMediaTracker |
_mt |
static boolean |
_paintStatus
paint bounds switch
|
static java.lang.String |
_TILES_PREFIX
temporary files prefix
|
int |
_type
buffered type
DEFAULT_TYPE |
static boolean |
_useTIFF_EXIF
* EXIF 2.2 output for all TIFF images.
|
static boolean |
_useTIFF_NOHead_NOFoot
this system property is read at first static time and defines the
TIFFImageWriter IIOMetadata
ReferenceBlackWhite
with no Head/Footroom if set to true (
|
static boolean |
_useTIFF_UnforcedRGB
* Unforced TIFF RGB PhotometricInterpretation (slower and buggy if
enabled)
|
static java.awt.Dimension |
_WRITE_TILES_DIMENSION
its recommended to use power-of-two sizes
|
protected java.security.AccessControlContext |
acc |
protected java.util.HashMap<java.lang.String,java.io.Serializable> |
attributes
the serialized attributes for this Sprite
|
protected java.net.URI |
base
base URI link
|
static boolean |
bigBuffer
use
JXAenvUtils._BIGBUFFER_SIZE large bufferedinput/outputstreams |
static int |
BUFFERED
Buffered buffer
|
protected int |
cache
cache type
|
protected java.awt.Color |
clr
the Color instance for effect
|
protected boolean |
compositeEnabled
dis/enables the Composite effect
|
protected java.awt.Composite |
cps
the Composite instance for effect
|
protected java.awt.geom.AffineTransform |
currentPreMirroring
the currrent applied AffineTransform mirroring effect
|
protected javax.media.jai.PerspectiveTransform |
currentPrePerspectiveTransforming
the current applied AffineTransform
|
protected java.awt.geom.AffineTransform |
currentPreScaling
the current applied AfinneTransform scaling effect
|
protected java.awt.geom.AffineTransform |
currentPreTransforming
the current applied AffineTransform
|
static Level |
DBUG_RENDER_LOW
low level debugging
|
static int |
DEFAULT_TYPE
default type
Sf3Texture#DEFAULT_TYPE |
protected boolean |
diskCached
Deprecated.
not used
|
protected static java.util.Map<java.lang.Integer,java.awt.GradientPaint> |
FX_gradients
Java2D gradients
|
static int |
HORIZONTAL
axial symetrics HORIZONTAL
|
protected static java.lang.String |
image_dir
the image file cache directory to use
|
protected boolean |
innerResource
innerResource mode (inner(true)/outer(false) .jar)
|
static java.lang.String |
JXA_ECLRES
ExtensionsClassloader enforces loading Sprite resource when in resource
mode (a classloader issue)
|
protected double |
lastFPS
last mesured FPS (frames per second)
|
protected long |
lastFrameTime
last drawn frametime in millisec
|
protected int |
MAX_SIZE
Deprecated.
|
protected java.lang.String |
mime
image mime type
|
protected int |
mirror
actual mirror orientation
|
protected java.awt.geom.AffineTransform |
mirroring
the AffineTransform instance for mirroring effect to apply
|
protected java.awt.MediaTracker |
mt
the current MediaTracker that is used with this Sprite
|
static int |
NONE
none constant
|
protected java.awt.Component |
obs
ImageObserver to avoid Garbage flushing protected Component obs;
|
protected boolean |
painting
the paint monitor switch
|
protected javax.media.jai.PerspectiveTransform |
perspectiveTransforming
the AffineTransform instance to apply
|
protected java.awt.Paint |
pnt
the Paint instance for effect
|
protected Sf3RenderableImpl |
renderableImpl |
static java.awt.RenderingHints |
renderingHints
current backend rendering optimizations
|
protected int |
rMode |
protected java.util.Set<javax.imageio.event.IIOReadProgressListener> |
rProgList
the set of IIOReadProgressListener's
|
protected java.util.Set<javax.imageio.event.IIOReadProgressListener> |
rTileProgList
the set of IIOReadProgressListener's
|
protected java.util.Set<javax.imageio.event.IIOReadWarningListener> |
rWarnList
the set of IIOReadWarningListener's
|
protected java.awt.geom.AffineTransform |
scaling
the AffineTransform isntance for scaling effect to apply
|
protected java.lang.Object |
src
src
|
protected java.lang.Object |
tileSrc
tile temporary src
|
protected int |
trackerPty |
protected java.awt.geom.AffineTransform |
transforming
the AffineTransform instance to apply
|
protected boolean |
validating
the validate monitor switch
|
static int |
VERTICAL
axial symetrics VERTICAL
|
static int |
VOLATILE
Volatile buffer
|
protected java.util.Set<javax.imageio.event.IIOWriteProgressListener> |
wProgList
the set of IIOWriteProgressListener's
|
protected java.util.Set<javax.imageio.event.IIOWriteProgressListener> |
wTileProgList
the set of IIOWriteProgressListener's
|
protected java.util.Set<javax.imageio.event.IIOWriteWarningListener> |
wWarnList
the set of IIOWriteWarningListener's
|
protected double |
zoom
actual zoom
|
MODE_JAVA2D, MODE_TEXTURE, MODE_TILE
Constructor and Description |
---|
Sprite()
no arg constructor (Java-bean)
|
Sprite(boolean load,
java.io.File file,
java.lang.String format,
java.awt.Dimension size,
boolean buf)
Instances sp volatile image as the data of this sprite.
|
Sprite(boolean load,
java.awt.Image data,
java.lang.String format,
java.awt.Dimension size)
Sets image data of this sprite.
|
Sprite(boolean load,
java.io.InputStream stream,
java.lang.String format,
java.awt.Dimension size,
boolean buf)
Instances sp volatile image as the data of this sprite.
|
Sprite(boolean load,
java.lang.String filename,
boolean rsrcMode,
java.lang.String format,
java.awt.Dimension size,
boolean buf)
Instances sp volatile image as the data of this sprite.
|
Sprite(java.io.File file,
java.lang.String format,
java.awt.Dimension size,
boolean buf)
Instances sp volatile image as the data of this sprite
|
Sprite(java.awt.Image data,
java.lang.String format,
java.awt.Dimension size)
Sets image data of this sprite.
|
Sprite(java.io.InputStream stream,
java.lang.String format,
java.awt.Dimension size,
boolean buf)
Instances sp volatile image as the data of this sprite.
|
Sprite(java.lang.String filename,
boolean rsrcMode,
java.lang.String format,
java.awt.Dimension size,
boolean buf)
Instances sp volatile image as the data of this sprite.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
__clone()
clones the Sprite instance (please use the original {
|
static void |
_addIIOController(java.lang.String mime,
javax.imageio.IIOParamController iioc)
adds an IIOController as defined in JAI/JIIO (this is currently not used)
|
static java.awt.Graphics |
_createImageGraphics(java.awt.Image image)
creates the image Graphics
|
static int |
_getBufferedType(java.lang.String outputMime) |
static javax.imageio.IIOParamController |
_getIIOController(java.lang.String mime)
returns the current associated IIOController for the specified mime-type
(not used)
|
static javax.imageio.metadata.IIOMetadata |
_getIIOMforDefaultImage(javax.imageio.ImageWriter w,
javax.imageio.ImageTypeSpecifier its,
javax.imageio.ImageWriteParam iwp)
TIFFImageWriter will create and return a TIFFDirectory metadata (IFD)
prepareTileWrite(boolean) |
static javax.imageio.metadata.IIOMetadata |
_getIIOMforImageType(javax.imageio.ImageWriter w,
javax.imageio.metadata.IIOMetadata pmetadata,
javax.imageio.ImageTypeSpecifier its,
javax.imageio.ImageWriteParam iwp)
TIFFImageWriter will create and return a TIFFDirectory metadata (IFD)
prepareTileWrite(boolean) |
static javax.imageio.metadata.IIOMetadata |
_getIIOMforStream(javax.imageio.ImageWriter w,
javax.imageio.metadata.IIOMetadata pmetadata,
javax.imageio.ImageWriteParam iwp)
|
static javax.imageio.ImageTypeSpecifier |
_getITS(int type)
|
static javax.imageio.ImageTypeSpecifier |
_getITS(java.awt.image.RenderedImage data)
|
static java.awt.RenderingHints |
_getRenderingHints()
returns sp new RenderingHints with the HashMap instance that contains the
default rendering hints as
renderingHints |
static int |
_getTransparency(int bufferedImageType) |
static int |
_GLgetSpriteHash(int texHash)
returns the Sprite (hash) that originated the texture (hash)
|
static int |
_GLgetTexHash(int spHash)
returns the current texture hashCode for use with RenderingSceneGL
HashMap's.
|
static boolean |
_GLIsLoaded(java.lang.Object sp) |
static void |
_GLRenderSprite(RenderingSceneGL gld,
boolean keepBinding,
SpriteGLHandler sp,
java.awt.Rectangle texBounds,
double z)
renders the Sprite within an OpenGL context
|
static void |
_GLRenderSprite(RenderingSceneGL gld,
boolean keepBinding,
SpriteGLHandler sp,
java.awt.Rectangle texBounds,
double z,
int fx,
java.awt.Point fx_loc,
java.awt.Color fx_color,
int transform,
java.nio.DoubleBuffer scale,
java.nio.DoubleBuffer rotate,
java.nio.DoubleBuffer translate)
renders the Sprite within an openGL context
|
static void |
_GLRenderSprite(RenderingSceneGL gld,
SpriteGLHandler sp,
java.awt.Rectangle texBounds,
double z)
render the Sprite within an OpenGL context
|
static void |
_GLRenderSprite(RenderingSceneGL gld,
SpriteGLHandler sp,
java.awt.Rectangle texBounds,
double z,
int fx,
java.awt.Point fx_loc,
java.awt.Color fx_color,
int transform,
java.nio.DoubleBuffer scale,
java.nio.DoubleBuffer rotate,
java.nio.DoubleBuffer translate)
this method must be called between sp GLFX#_GLBeginFX() call
and sp GLFX#_GLEndFX() call.
|
static boolean |
_isAccelerated()
returns true or false, whether the Sprite backend is accelerated by the
LocalGraphicsEnvironment or not
|
static boolean |
_isTrueVolatile()
returns true or false, whether the LocalGraphicsEnvironment can put the
Image into VRAM or not, resp. using VolatileImage instances
|
static Sprite |
_load(java.lang.Object s) |
static Sprite |
_load(java.lang.Object s,
boolean useCache) |
static java.util.Map<java.lang.String,java.lang.Object> |
_loadImage(java.lang.Object src,
boolean innerResource,
javax.imageio.ImageReader r,
int renderMode,
int bufferedType)
sp FileCacheImageInputStream is used to read the specified
source.
|
static java.util.Map<java.lang.String,java.lang.Object> |
_loadImage(java.lang.Object src,
boolean innerResource,
javax.imageio.ImageReader r,
int renderMode,
int bufferedType,
boolean useCache)
sp FileCacheImageInputStream is used to read the specified
source.
|
static java.util.Map<java.lang.String,java.lang.Object> |
_loadImage(java.lang.Object src,
boolean innerResource,
java.lang.String mime,
int renderMode,
int bufferedType)
sp FileCacheImageInputStream is used to read the specified
source.
|
static java.util.Map<java.lang.String,java.lang.Object> |
_loadImage(java.lang.Object src,
boolean innerResource,
java.lang.String mime,
int renderMode,
int bufferedType,
boolean useCache)
sp FileCacheImageInputStream is used to read the specified
source.
|
static javax.swing.JComponent |
_makeSpriteJComponent(Sprite sp) |
static SpriteTransferHandler |
_newTransferHandler()
returns sp new SpriteTransferHandler instance
|
protected static java.awt.Dimension |
_nextTransformSize(Sprite sp,
java.awt.Dimension size) |
static void |
_printAllMimeTypes()
prints all supported mime-types on the System std output
|
static void |
_quickPaintImmediately(javax.swing.JComponent comp)
Immediately paints any component,
JComponent.paintImmediately(Rectangle) is called with
Jcomponent#getVisibleRect() This methdo is useful to repaint
while being in the EDT (e.g. |
static void |
_removeIIOController(java.lang.String mime)
removes an IIOController (not used)
|
void |
addIIOReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
adds an IIOReadProgressListener to this Sprite instance
|
void |
addIIOReadWarningListener(javax.imageio.event.IIOReadWarningListener l)
adds an IIOReadWarninListener to this Sprite instance
|
void |
addIIOTileReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
adds an IIOReadProgressListener to this Sprite instance
|
void |
addIIOTileWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
adds an IIOWriteProgressListener to this Sprite instance
|
void |
addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
adds an IIOWriteProgressListener to this Sprite instance
|
void |
addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener l)
adds an IIOWriteWarningListener to this Sprite instance
|
static boolean |
checkState(java.awt.Image i,
java.awt.MediaTracker mt)
performs usual checks from an Image instance.
|
void |
clearImageGraphics()
erase all contents on the curent image data for this Sprite.
|
java.lang.Object |
clearResource()
Clears out the image tracking, and removes the memory allocations.
|
void |
clearTexData()
clears used texture heap memory.
|
java.lang.Object |
clone()
clones this Sprite instance. the clone is first invalidated.
|
protected java.util.HashMap<java.lang.String,java.io.Serializable> |
cloneAttributes()
clones the attributes in sp new map
|
java.awt.image.BufferedImage |
convertToBuffered(java.awt.Image data,
java.awt.Component pobs,
boolean flush)
converts the specified image data to sp BufferedImage instance using the
specified Component that will receive the data.
|
java.awt.image.BufferedImage |
convertToBuffered(java.awt.image.RenderedImage data,
java.awt.Component pobs,
boolean flush)
converts the specified image data to sp BufferedImage instance using the
specified Component that will receive the data.
|
java.awt.image.VolatileImage |
convertToVolatile(java.awt.Image data,
java.awt.Component pobs,
boolean flush)
converts the specified image data to sp VolatileImage instance using the
specified Component that will receive the data CAUTION : avoid this
method if in tile mode, it may overflow
the memory if the image is too big.
|
java.awt.image.VolatileImage |
convertToVolatile(java.awt.image.RenderedImage data,
java.awt.Component pobs,
boolean flush)
converts the specified image data to sp VolatileImage instance using the
specified Component that will receive the data CAUTION : avoid this
method if in tile mode, it may overflow
the memory if the image is too big.
|
static java.awt.image.BufferedImage |
createBufferedImage(java.awt.Dimension size,
int type)
Instances sp new BufferedImage from an image object.
|
static java.awt.image.VolatileImage |
createVolatileImage(java.awt.Dimension size,
int type)
Instances sp new VolatileImage from an image object.
|
boolean |
draw(java.awt.Component obs,
java.awt.Graphics2D g2)
draws the current data on component
|
boolean |
draw(java.awt.Component pobs,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform tx,
javax.media.jai.PerspectiveTransform ptx)
draws with Transforms concatenated as follows : ptx X tx X dataPixels.
|
boolean |
draw(java.awt.Component pobs,
java.awt.Graphics2D g,
int fx,
java.awt.Point fx_loc,
java.awt.Color fx_color)
draws with Transforms concatenated as follows : ptx X tx X dataPixels.
|
void |
endTileWrite(javax.imageio.ImageWriter w)
|
boolean |
equals(java.lang.Object o)
checks for equality of hash codes
|
void |
finalize()
Called by the GC when the instance is about to be destructed. it is
overriden to immediately
clear the resources
used by this Sprite. |
java.net.URI |
getBase()
returns base URI to this sprite if it references sp file
|
java.awt.Rectangle |
getBounds()
current bounds (those are valid AFTER a (run)validate() call).
|
java.awt.Rectangle |
getBounds(java.awt.Rectangle rv)
current bounds (those are valid AFTER a (run)validate() call).
|
int |
getBufferedType()
returns the current buffered type used for the BufferedImage
|
java.awt.Color |
getColor()
returns the currently associated Color instance
|
java.awt.Composite |
getComposite()
returns the Composite instance used by this Sprite
|
javax.imageio.ImageTypeSpecifier |
getFeatures() |
java.awt.Image |
getFlip(int orientation,
java.awt.Component pobs)
Returns sp transformed image by the givsn symetrical-axis orientation
|
java.lang.String |
getFPS()
return the last mesured frame-per-second (aka FPS). the framerate is
mesured each time the drawing process completes for this Sprite instance.
|
long |
getFramerate()
returns the last mesured frame rate in milliseconds.
|
Monitor[] |
getGroupMonitor() |
int |
getHeight()
Returns height of sprite.
|
java.awt.Image |
getImage(java.awt.Component obs)
Returns data field or the complete Image instance if tile mode is enabled
(!
|
java.awt.Point |
getLocation() |
java.lang.String |
getMime()
mime-type (for use with ImageReader and ImageWriter) mime can change to
getStoreMime() if the sprite is serialized
tile mode
|
int |
getMirrorValue()
returns the current mirror orientation for this Sprite instance
|
java.awt.MediaTracker |
getMt()
returns the current MediaTracker instance used as the loader of the image
data buffer
|
int |
getNumTileX()
DOES NOT WORK WITH IMAGEPRODUCER AS SOURCE
|
int |
getNumTileY()
DOES NOT WORK WITH IMAGEPRODUCER AS SOURCE
|
java.awt.Component |
getObs()
component that is set as ImageObserver for this Sprite
|
java.awt.Paint |
getPaint()
returns the Paint instance currently associated to this Sprite.
|
javax.media.jai.PerspectiveTransform |
getPTX()
returns the current associated AffineTransform instance
|
RenderingScene |
getRenderingScene()
returns the current observer as if set up as sp RenderingScene instance,
this RenderingScene instance is returned back.
|
java.awt.Image |
getScaled(double zoomX,
double zoomY,
java.awt.Component obs)
Returns the image sprite scaled to the given factors.
|
java.awt.Dimension |
getSize() |
java.lang.Object |
getSource()
Returns source of image. usually it is a File instance.
|
java.lang.String |
getStoreMime() |
int |
getStoreMode() |
java.util.SortedMap<java.lang.Integer,Sf3Texture> |
getTexData()
the current texture associated to this Sprite if store or render mode is
0, the map contains all tiles ordered from top-left to bottom-right,
starting at key 1. the key 0 is reserved for the texture in non-tile mode
and for an empty texture that has the same values of the whole texture.
|
float |
getTexPty() |
int |
getTexTilesX() |
int |
getTexTilesY() |
protected java.util.List<java.awt.image.BufferedImage> |
getThumbnails(javax.imageio.ImageReader r,
int minSize,
int bufferedType)
attempt to retrieve thumbnails, or create one with the reader data
|
java.lang.String |
getTileMime()
current tile source mime type (will change over sprite operations, e.g.
|
javax.imageio.ImageReader |
getTileReader()
DOES NOT WORK WITH IMAGEPRODUCER AS SOURCE and
it will have
ImageReader.getInput() == null . |
javax.imageio.ImageReader |
getTileReader(boolean useCache)
DOES NOT WORK WITH IMAGEPRODUCER AS SOURCE and
it will have
ImageReader.getInput() == null . |
javax.imageio.ImageReadParam |
getTileReaderParams(javax.imageio.ImageReader r)
an ImageReadParam instance is created for it with compression and tiling
enabled if available, as well as the destination type
|
javax.imageio.ImageWriteParam |
getTileWriterParams(javax.imageio.ImageWriter w)
an ImageWriteParam instance is created for it with compression and tiling
enabled if available, as well as the destination type.
|
javax.imageio.ImageWriteParam |
getTileWriterParams(javax.imageio.ImageWriter w,
float compressionQuality)
Deprecated.
should be ignored and not available for TIFF-tiling.
|
int |
getTrackerPty()
returns the tracking priority for this Sprite instance
|
java.awt.geom.AffineTransform |
getTX()
returns the current associated AffineTransform instance
|
int |
getWidth()
Returns width of sprite.
|
double |
getZoomValue()
returns the current zoom value
|
int |
hashCode()
returns the hash code for this Sprite
|
void |
invalidate()
invalidates this Sprite instance
|
boolean |
isBufferedImageEnabled()
Tells whether buffer is enabled with sp BufferedImage instance for this
Sprite
|
boolean |
isComposited()
returns true or false whether the Composite effect has been applied or
not, resp.
|
boolean |
isCompositeEnabled()
returns true or false whether the Composite effect is enabled or not,
resp.
|
boolean |
isDebugEnabled() |
boolean |
isDiskCached()
Deprecated.
use isStoreImageEnabled() instead
|
boolean |
isFlipEnabled()
returns true or false whether sp mirror transform has been enabled or
not, resp.
|
boolean |
isHardwareAccel()
returns true or false, whether the VRAM (VolatileImage cache) is enabled
or not, resp.
|
boolean |
isIIOcontrollerEnabled()
returns true or false, whether the IIOController is enabled or not, resp.
|
boolean |
isInnerResourceModeEnabled()
returns true or false whether the inner-resource mode is enabled or not,
resp.
|
boolean |
isJava2DModeEnabled()
returns true or false, whether the Java2D mode is enabled or not, resp.
|
boolean |
isMultiThreadingEnabled()
returns true or false whether multi-threading has been statically
activated for the Sprite class or not, resp.
|
boolean |
isOpaque()
returns the opaque value as VolatileImage is enabled or not
|
boolean |
isResourceLoaded()
returns true or false whether the tracked image data is loaded, that is
if the render mode (java2d-tile-texture combination) will be able to
display the corresponding contents.
|
boolean |
isTexTilesAvailable()
are tiles available to load from a texture tile cache
getTexData()
|
boolean |
isTextureModeEnabled()
returns true or false, whether the texturing mode is enabled or not, resp.
|
boolean |
isTileModeEnabled()
NOTICE : tile mode is more stable with the image/tiff mime type
|
boolean |
isTilesAvailable()
are tiles available to getTileReader() /** DOES NOT WORK
WITH IMAGEPRODUCER AS SOURCE
|
boolean |
isUseIIOCacheEnabled() |
boolean |
isValid()
returns true or false, whether it can be displayed or not, resp.
|
boolean |
isZoomEnabled()
returns true or false whether sp zoom has been enabled or not, resp.
|
protected void |
loadDefaultAttributes()
loads the default attributes values
|
java.lang.Object |
loadResource()
loads Image from the currently specified source or file cache
|
void |
loadTexData()
loads the texture for this Sprite to be used in an openGL rendering
context (it's still not loaded in VRAM until the Sprite is rendered) This
method is called each time loadResource() is invoked.
|
void |
loadTexData(int texRenderFormat,
boolean force)
loads the texture for this Sprite to be used in an openGL rendering
context (it's still not loaded in VRAM until the Sprite is rendered) This
method is called each time loadResource() is invoked.
|
protected double |
markFPS()
mark for FPS calculation
|
static void |
notifyIIOReadListenersAborted(java.util.Set<javax.imageio.event.IIOReadProgressListener> l,
javax.imageio.ImageReader source) |
static void |
notifyIIOReadListenersComplete(java.util.Set<javax.imageio.event.IIOReadProgressListener> l,
javax.imageio.ImageReader source) |
static void |
notifyIIOReadListenersProgress(java.util.Set<javax.imageio.event.IIOReadProgressListener> l,
javax.imageio.ImageReader source,
float percentageDone) |
static void |
notifyIIOReadListenersStarted(java.util.Set<javax.imageio.event.IIOReadProgressListener> l,
javax.imageio.ImageReader source,
int index) |
static void |
notifyIIOWriteListenersAborted(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l,
javax.imageio.ImageWriter source) |
static void |
notifyIIOWriteListenersComplete(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l,
javax.imageio.ImageWriter source) |
static void |
notifyIIOWriteListenersProgress(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l,
javax.imageio.ImageWriter source,
float percentageDone) |
static void |
notifyIIOWriteListenersStarted(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l,
javax.imageio.ImageWriter source,
int index) |
void |
paintComponentImpl(java.awt.Graphics g1,
javax.swing.JComponent comp)
repaints the component with the Sprite data. used by Swing EDT when
called
|
javax.imageio.ImageWriter |
prepareTileWrite(boolean useCache)
!!
|
void |
readExternal(java.io.ObjectInput in) |
java.util.List<java.awt.image.BufferedImage> |
readThumbnails()
attempt to retrieve thumbnails, or create one with the reader data
|
void |
removeIIOReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
removes an IIOReadProgressListener from this Sprite instance
|
void |
removeIIOReadWarningListener(javax.imageio.event.IIOReadWarningListener l)
removes an IIOReadWarningListener from this Sprite instance
|
void |
removeIIOTileReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
removes an IIOReadProgressListener from this Sprite instance
|
void |
removeIIOTileWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
removes an IIOWriteProgressListener from this Sprite instance
|
void |
removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
removes an IIOWriteProgressListener from this Sprite instance
|
void |
removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener l)
removes an IIOWriteWarningListener from this Sprite instance
|
protected void |
resetAttributes()
resets the attributes to the stored values
|
void |
resetPTX()
resets the transform matrix to apply to this Sprite
|
void |
resetTX()
resets the transform matrix to apply to this Sprite
|
java.awt.Image |
resizeData(java.awt.Image data,
java.awt.Dimension size,
java.awt.geom.AffineTransform tx,
java.awt.geom.AffineTransform mirroring,
java.awt.geom.AffineTransform scaling,
javax.media.jai.PerspectiveTransform ptx,
java.awt.Component pobs)
CAUTION : DO NOT use this method externally, it's for private internal
callbacks ONLY. resizes image data and returns it to given size and adds
transforms previously set with
setTX(AffineTransform) setZoomEnabled(boolean, double),....
|
java.lang.Object |
resizeData(javax.imageio.ImageReader data,
java.awt.Dimension size,
java.awt.geom.AffineTransform tx,
java.awt.geom.AffineTransform mirroring,
java.awt.geom.AffineTransform scaling,
javax.media.jai.PerspectiveTransform ptx,
java.awt.Component pobs)
CAUTION : DO NOT use this method externally, it's for private internal
callbacks ONLY. resizes image data and returns it to given size and adds
transforms previously set with
setTX(AffineTransform) setZoomEnabled(boolean, double),....
|
Sprite |
runValidate()
validates the Sprite against the recent changes (mime type, buffered
type, cache, texture update, transform,...)
|
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setBounds(java.awt.Rectangle r) |
void |
setBufferedImageEnabled(boolean b)
dis/enables using the BufferedImage for this Sprite instance; enabled by
default or disabled if sp VolatileImage was used to construct the sprite
|
void |
setBufferedType(int type)
sets up the buffered type to use for the BufferedImage (VERY important if
you change the mime-type)
|
void |
setColor(java.awt.Color clr)
sets up the Color instance to add effect to this Sprite
|
void |
setComposite(java.awt.Composite cps)
sets up the Composite instance to add effect to the Sprite.
|
void |
setComposited(boolean b)
sets the "Composite effect has been applied" to off or on whether it has
to be applied again or not, resp.
|
void |
setCompositeEnabled(boolean b)
dis/enables the Composite effect
|
void |
setDebugEnabled(boolean b) |
void |
setFlipEnabled(boolean b,
int mirror)
activates flip Transform (mirroring) on the next
runValidate() call
|
void |
setGroupMonitor(Monitor... tg) |
void |
setHardwareAccel(boolean b)
Deprecated.
not recommended to enable : 1° unstable ; 2° bufferedImage's
already use accelerated capabilities
|
void |
setIIOcontrollerEnabled(boolean IIOcontrollerEnabled)
dis/enables the IIOController for this Sprite instance (this is currently
not used)
|
void |
setInnerResourceModeEnabled(boolean b)
Deprecated.
SHOULDN'T BE USED
|
void |
setJava2DModeEnabled(boolean b)
sets on/off the Java2D mode, which is usually used for rendering with Swing classic mode (not LWJGL for instance).
|
void |
setLocation(int x,
int y) |
void |
setLocation(java.awt.Point p) |
void |
setMirror(int orientation)
sets up the mirror orientation for this Sprite instance
|
void |
setMt(java.awt.MediaTracker mt,
java.awt.Component pobs)
sets the MediaTracker instance to use as loader and the Component that
will receive the image data
|
void |
setMultiThreadingEnabled(boolean b)
sets up the static multi-threading switch to dis/enabled.
|
void |
setObs(java.awt.Component obs) |
void |
setOpaque(boolean b)
sets up the opaque value as VolatileImage must be enabled or not
|
void |
setPaint(java.awt.Paint pnt)
sets up the Paint instance to use and add effect to the Sprite
|
void |
setPTX(javax.media.jai.PerspectiveTransform ptx)
sets up the transform to apply to this Sprite
|
void |
setRenderingScene(RenderingScene rsc)
associates this Sprite instance to an exisiting RenderingScene instance
where this Sprite instance is gonna be rendered.
|
void |
setSize(java.awt.Dimension size) |
void |
setSize(int width,
int height) |
void |
setSPM(SpritesCacheManager spm)
sets up sp SpritesCacheManager instance where call-backs can be made to
save memory usage.
|
java.lang.String |
setStoreMime(java.lang.String storeMime)
this method will try the specified MIME type to encode with the current
buffered type , if it fails, then an appropriate mime is
used. |
void |
setStoreMode(int mode)
this changes the default status of the storing bits. it modifies how the cache will store the Sprite data.
|
void |
setTexPty(float texPty) |
void |
setTextureModeEnabled(boolean b)
if the texturing mode is enabled, the cache will store the image as a new texture ready for output to OpenGL.
|
void |
setTileModeEnabled(boolean b)
if #isTilesAvailable() returns false, then tiling may be enabled but the cache is not tiled.
|
void |
setTrackerPty(int trackerPty)
sets the tracking priority to use in the MediaTracker
|
void |
setTX(java.awt.geom.AffineTransform tx)
sets up the transform to apply to this Sprite
|
void |
setUseIIOCacheEnabled(boolean b)
may use temporary folders.
|
void |
setZoomEnabled(boolean b,
double zoom)
dis/enables sp zoom transform
|
int |
statusImage()
Deprecated.
since the sprite never let living Image data in the
Mediatracker. It loads, waits, and it removes at once from the tracker
array.
|
protected void |
storeCurrentAttributes()
stores the current attributes in the serializable map instance
|
java.awt.image.BufferedImage |
toBuffered()
converts the Sprite to sp BufferedImage (Java2D mode must be enabled, if
not, use
convertToBuffered(Image, Component, boolean) ) |
java.lang.String |
toString()
converts the source into sp String
|
java.awt.image.VolatileImage |
toVolatile()
converts the Sprite to VolatileImage (Java2D mode must be enabled, if
not, use
convertToVolatile(Image, Component, boolean) ) |
void |
updateTexData()
refreshes the texture contents.
|
void |
updateTexData(int texRenderFormat)
refreshes the texture contents.
|
void |
waitForData()
Waits for current by the Sprite loaded data instance to load completely.
|
static java.awt.Graphics2D |
wrapRendering(java.awt.Graphics g)
adds rendering hints and casts to Graphics2D.
|
void |
writeExternal(java.io.ObjectOutput out) |
void |
writeImageToFile(java.io.RandomAccessFile raf,
float compressionQuality)
writes the image data to sp file that can be randomly accessed
|
void |
writeImageToIOStream(javax.imageio.stream.ImageOutputStream output,
float compressionQuality)
writes the image data to sp stream that supports Image data.
|
void |
writeImageToIOStream(java.io.OutputStream output,
float compressionQuality)
writes the image data to sp stream that supports Image data.
|
void |
zoom(java.awt.Component obs,
double zoom)
Zooms the sprite to the given factor
|
public static final Level DBUG_RENDER_LOW
protected transient java.security.AccessControlContext acc
public static final java.lang.String _MIME_TYPE
public static final java.lang.String[] _MIME_EXT
public static final java.awt.datatransfer.DataFlavor _dataFlavor
new DataFlavor(Sprite.class, "sf3jswing Sprite")
public static final java.awt.datatransfer.DataFlavor[] _dataFlavors
imageFlavor
,
javaFileListFlavor
, stringFlavor
, Sprite DataFlavor
.protected transient java.awt.Component obs
protected java.net.URI base
protected transient java.lang.Object src
protected transient java.lang.Object tileSrc
protected int trackerPty
protected transient java.awt.MediaTracker mt
public static final int VOLATILE
public static final int BUFFERED
protected transient Sf3RenderableImpl renderableImpl
public static GLObjectHandler<SpriteGLHandler> _GLHandlers
GLHandler#sTex
public static int DEFAULT_TYPE
Sf3Texture#DEFAULT_TYPE
public int _type
DEFAULT_TYPE
public static final int HORIZONTAL
public static final int VERTICAL
public static final int NONE
protected double zoom
protected int mirror
protected boolean diskCached
protected java.lang.String mime
protected transient java.awt.geom.AffineTransform currentPreTransforming
protected transient javax.media.jai.PerspectiveTransform currentPrePerspectiveTransforming
protected transient java.awt.geom.AffineTransform currentPreMirroring
protected transient java.awt.geom.AffineTransform currentPreScaling
protected java.awt.geom.AffineTransform transforming
protected javax.media.jai.PerspectiveTransform perspectiveTransforming
protected java.awt.geom.AffineTransform mirroring
protected java.awt.geom.AffineTransform scaling
protected boolean innerResource
protected transient java.util.Set<javax.imageio.event.IIOReadProgressListener> rTileProgList
protected transient java.util.Set<javax.imageio.event.IIOWriteProgressListener> wTileProgList
protected transient java.util.Set<javax.imageio.event.IIOReadProgressListener> rProgList
protected transient java.util.Set<javax.imageio.event.IIOWriteProgressListener> wProgList
protected transient java.util.Set<javax.imageio.event.IIOReadWarningListener> rWarnList
protected transient java.util.Set<javax.imageio.event.IIOWriteWarningListener> wWarnList
protected int MAX_SIZE
protected static java.lang.String image_dir
protected boolean compositeEnabled
protected transient java.awt.Paint pnt
protected transient java.awt.Color clr
protected transient java.awt.Composite cps
protected transient boolean painting
protected transient boolean validating
protected java.util.HashMap<java.lang.String,java.io.Serializable> attributes
public static boolean bigBuffer
JXAenvUtils._BIGBUFFER_SIZE
large bufferedinput/outputstreamspublic static final java.lang.String JXA_ECLRES
protected static final java.util.Map<java.lang.Integer,java.awt.GradientPaint> FX_gradients
protected transient int rMode
public static SfMediaTracker _mt
public static java.awt.Dimension _WRITE_TILES_DIMENSION
public static int _MIN_THUMBNAILS_SIZE
_WRITE_TILES_DIMENSION
public static float _DEF_CPR_QUALITY
mime-type
public static boolean _useTIFF_NOHead_NOFoot
TIFF 6.0 spec document}
public static boolean _useTIFF_EXIF
public static boolean _useTIFF_UnforcedRGB
public static final java.lang.String _TILES_PREFIX
public static final java.awt.RenderingHints renderingHints
public static boolean _paintStatus
protected double lastFPS
protected long lastFrameTime
public Sprite()
public Sprite(java.lang.String filename, boolean rsrcMode, java.lang.String format, java.awt.Dimension size, boolean buf) throws java.net.URISyntaxException
filename
- path to image (relative to CWD), if rsrcMode is true,
then only the reachable resources paths are available.size
- dimension of the spritersrcMode
- innerResource mode en/disabled (inn/outer .jar filepath)format
- image mime type (e.g. image/png)buf
- whether to use buffered images or notjava.net.URISyntaxException
public Sprite(boolean load, java.lang.String filename, boolean rsrcMode, java.lang.String format, java.awt.Dimension size, boolean buf) throws java.net.URISyntaxException
load
- dis/enables the very loading of the image data (true is the
usual state of this property)filename
- path to image (relative to CWD), if rsrcMode is true,
then only the reachable resources paths are available.size
- dimension of the spritersrcMode
- innerResource mode en/disabled (inn/outer .jar filepath)format
- image mime type (e.g. image/png)buf
- whether to use buffered images or notjava.net.URISyntaxException
public Sprite(java.io.File file, java.lang.String format, java.awt.Dimension size, boolean buf) throws java.net.URISyntaxException
file
- path to image (relative to CWD).size
- dimension of the spriteformat
- image mime type (e.g. image/png)buf
- whether to use buffered images or notjava.net.URISyntaxException
public Sprite(boolean load, java.io.File file, java.lang.String format, java.awt.Dimension size, boolean buf)
load
- dis/enables the very loading of the image data (true is the
usual state of this property)file
- path to image (relative to CWD).size
- dimension of the spriteformat
- image mime type (e.g. image/png)buf
- whether to use buffered images or notjava.net.URISyntaxException
public Sprite(java.io.InputStream stream, java.lang.String format, java.awt.Dimension size, boolean buf)
stream
- input stream to imageformat
- image mime typebuf
- whether to set the Image BufferedImage or not (VolatileImage
instead)size
- dimension of the spriteInputStream
,
Image
public Sprite(boolean load, java.io.InputStream stream, java.lang.String format, java.awt.Dimension size, boolean buf)
load
- dis/enables the very loading of the image data (true is the
usual state of this property)stream
- input stream to imageformat
- image mime typebuf
- whether to set the Image BufferedImage or not (VolatileImage
instead)size
- dimension of the spriteInputStream
,
Image
public Sprite(java.awt.Image data, java.lang.String format, java.awt.Dimension size)
data
- Imagesize
- dimension of the spriteformat
- image mime typepublic Sprite(boolean load, java.awt.Image data, java.lang.String format, java.awt.Dimension size)
load
- dis/enables the very loading of the image data (true is the
usual state of this property)data
- Imagesize
- dimension of the spriteformat
- image mime typepublic static boolean _isAccelerated()
public static boolean _isTrueVolatile()
public static SpriteTransferHandler _newTransferHandler()
SpriteTransferHandler
public int getTexTilesX()
public int getTexTilesY()
public void updateTexData()
#clearTextData()
,
loadTexData()
public void updateTexData(int texRenderFormat)
texRenderFormat
- VRAM loading and rendering is done with the
specified
pixel internal render format; 0
disables this setting.#clearTextData()
,
loadTexData()
public void setRenderingScene(RenderingScene rsc)
MediaTracker is updated, the Component observer
,
the FB-Hardware acceleration
, and
further options, too.setRenderingScene
in interface RenderingSceneComponent
renderingScene
- the RenderingScene instance to associate with this
Sprite instance or null to disable the link, which is invoked EVERY call
to runValidate() or any another validation method.getRenderingScene()
,
setDebugEnabled(boolean)
,
setMultiThreadingEnabled(boolean)
,
setMt(MediaTracker, Component)
,
setHardwareAccel(boolean)
,
setTextureModeEnabled(boolean)
,
setJava2DModeEnabled(boolean)
public RenderingScene getRenderingScene()
getRenderingScene
in interface RenderingSceneComponent
setRenderingScene(RenderingScene)
public void setMt(java.awt.MediaTracker mt, java.awt.Component pobs)
mt
- the MediaTracker instance to use as loader for the image datapobs
- the Component instance that will receive the image datapublic java.awt.MediaTracker getMt()
SfMediaTracker
public void setTrackerPty(int trackerPty)
trackerPty
- the priority value, must be >= 0SfMediaTracker
public int getTrackerPty()
SfMediaTracker
protected void loadDefaultAttributes()
attributes
- the serializable attributes for this Spriteprotected void resetAttributes()
protected void storeCurrentAttributes()
protected java.util.HashMap<java.lang.String,java.io.Serializable> cloneAttributes()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object instance to compare againstpublic static java.util.Map<java.lang.String,java.lang.Object> _loadImage(java.lang.Object src, boolean innerResource, java.lang.String mime, int renderMode, int bufferedType)
src
- InputStream, File, or StringinnerResource
- dis/enables classpath loading (false/true resp.)mime
- the mimetype of the sourcerenderMode
- JAVA2D_MODE (+ TILE_MODE)bufferedType
- java.io.IOException
public static java.util.Map<java.lang.String,java.lang.Object> _loadImage(java.lang.Object src, boolean innerResource, java.lang.String mime, int renderMode, int bufferedType, boolean useCache)
src
- InputStream, File, or StringinnerResource
- dis/enables classpath loading (false/true resp.)mime
- the mimetype of the sourcerenderMode
- JAVA2D_MODE (+ TILE_MODE)bufferedType
- useCache
- instance a FileCacheImageInputStream if possiblejava.io.IOException
public static java.util.Map<java.lang.String,java.lang.Object> _loadImage(java.lang.Object src, boolean innerResource, javax.imageio.ImageReader r, int renderMode, int bufferedType)
src
- InputStream, File or StringinnerResource
- dis/enables classpath loading (false/true resp.)r
- sp suitable ImageReader instancebufferedType
- ignoredrenderMode
- JAVA2D_MODE (+ TILE_MODE)java.io.IOException
public static java.util.Map<java.lang.String,java.lang.Object> _loadImage(java.lang.Object src, boolean innerResource, javax.imageio.ImageReader r, int renderMode, int bufferedType, boolean useCache)
src
- InputStream, File or StringinnerResource
- dis/enables classpath loading (false/true resp.)r
- sp suitable ImageReader instancebufferedType
- ignoredrenderMode
- JAVA2D_MODE (+ TILE_MODE)useCache
- instance a FileCacheImageInputStream if possiblejava.io.IOException
public java.lang.String getTileMime()
public javax.imageio.ImageWriteParam getTileWriterParams(javax.imageio.ImageWriter w)
w
- an ImageWriter e.g. prepareTileWrite(boolean)
for custom tiling dimensions
public javax.imageio.ImageWriteParam getTileWriterParams(javax.imageio.ImageWriter w, float compressionQuality)
compressionQuality
- decimal between 0f and 1fpublic javax.imageio.ImageReader getTileReader()
ImageReader.getInput()
== null . CAUTION : the
output must be flushed and closed as needed, because it is file cachedgetTileMime()
public javax.imageio.ImageReader getTileReader(boolean useCache)
ImageReader.getInput()
== null . CAUTION : the
output must be flushed and closed as needed, if cacheduseCache
- getTileMime()
public javax.imageio.ImageReadParam getTileReaderParams(javax.imageio.ImageReader r)
r
- give a getTileReader()
returned reader ONLYpublic java.lang.String getMime()
public java.lang.Object loadResource()
loadResource
in interface Resource
src
public java.util.SortedMap<java.lang.Integer,Sf3Texture> getTexData()
public void loadTexData() throws java.io.IOException
java.io.IOException
RenderingScene#_GLLoadVRAM2D(Sf3Texture)
public void loadTexData(int texRenderFormat, boolean force)
texRenderFormat
- VRAM loading and rendering is done with the
specified
pixel internal render format;force
- forces the texture data to be reloaded from the image cache
(use it in case the image contents have changed) 0 disables this setting.java.io.IOException
RenderingScene#_GLLoadVRAM2D(Sf3Texture)
public int getNumTileX()
public int getNumTileY()
public static void notifyIIOWriteListenersStarted(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l, javax.imageio.ImageWriter source, int index)
l
- source
- index
- public static void notifyIIOWriteListenersProgress(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l, javax.imageio.ImageWriter source, float percentageDone)
l
- source
- percentageDone
- public static void notifyIIOWriteListenersComplete(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l, javax.imageio.ImageWriter source)
l
- source
- public static void notifyIIOWriteListenersAborted(java.util.Set<javax.imageio.event.IIOWriteProgressListener> l, javax.imageio.ImageWriter source)
l
- source
- public static void notifyIIOReadListenersStarted(java.util.Set<javax.imageio.event.IIOReadProgressListener> l, javax.imageio.ImageReader source, int index)
l
- source
- index
- public static void notifyIIOReadListenersProgress(java.util.Set<javax.imageio.event.IIOReadProgressListener> l, javax.imageio.ImageReader source, float percentageDone)
l
- source
- percentageDone
- public static void notifyIIOReadListenersComplete(java.util.Set<javax.imageio.event.IIOReadProgressListener> l, javax.imageio.ImageReader source)
l
- source
- public static void notifyIIOReadListenersAborted(java.util.Set<javax.imageio.event.IIOReadProgressListener> l, javax.imageio.ImageReader source)
l
- source
- protected static java.awt.Dimension _nextTransformSize(Sprite sp, java.awt.Dimension size) throws java.awt.geom.NoninvertibleTransformException
sp
- size
- java.awt.geom.NoninvertibleTransformException
public java.awt.Image resizeData(java.awt.Image data, java.awt.Dimension size, java.awt.geom.AffineTransform tx, java.awt.geom.AffineTransform mirroring, java.awt.geom.AffineTransform scaling, javax.media.jai.PerspectiveTransform ptx, java.awt.Component pobs) throws java.lang.NullPointerException
data
- the Image to resizesize
- dimension to resize to, if the transforms affects the size,
the latter is updated Dimension.setSize(Dimension). Query
size.getSize() to quickly obtain the correct dim's after this method has
returned !pobs
- observer to usetx
- the AffineTransform matrix to use for applying it to the imagemirroring
- the AffineTransform mirroring matrix to use for applying
it to the imageptx
- the PerspectiveTransform to applyscaling
- the AffineTransform scaling matrix to use for applying it
to rhe imagejava.lang.NullPointerException
public java.lang.Object resizeData(javax.imageio.ImageReader data, java.awt.Dimension size, java.awt.geom.AffineTransform tx, java.awt.geom.AffineTransform mirroring, java.awt.geom.AffineTransform scaling, javax.media.jai.PerspectiveTransform ptx, java.awt.Component pobs) throws java.lang.NullPointerException
data
- the reader sourcesize
- dimension to resize to, if the transforms affects the size,
the latter is updated Dimension.setSize(Dimension). Query
size.getSize() to quickly obtain the correct dim's after this method has
returned !pobs
- observer to usetx
- the AffineTransform matrix to use for applying it to the imagemirroring
- the AffineTransform mirroring matrix to use for applying
it to the imageptx
- the PerspectiveTransform to applyscaling
- the AffineTransform scaling matrix to use for applying it
to rhe imagejava.lang.NullPointerException
public int getStoreMode()
getStoreMode
in interface Sf3Renderable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public static void _addIIOController(java.lang.String mime, javax.imageio.IIOParamController iioc)
mime
- the mime-type to controliioc
- the parameters controller to usepublic static void _removeIIOController(java.lang.String mime)
mime
- the controlled mime-timepublic static javax.imageio.IIOParamController _getIIOController(java.lang.String mime)
mime
- the specified mime-typepublic void setIIOcontrollerEnabled(boolean IIOcontrollerEnabled)
IIOcontrollerEnabled
- dis/enables the IIOControllerpublic boolean isIIOcontrollerEnabled()
public boolean isTilesAvailable()
public boolean isTexTilesAvailable()
public static void _printAllMimeTypes()
ImageIO.getReaderMIMETypes()
,
ImageIO.getUseCache()
public static javax.imageio.ImageTypeSpecifier _getITS(int type)
type
- public static javax.imageio.ImageTypeSpecifier _getITS(java.awt.image.RenderedImage data)
data
- public static int _getTransparency(int bufferedImageType)
bufferedImageType
- Transparency.OPAQUE
, Transparency.BITMASK
or
Transparency.TRANSLUCENT
public static javax.imageio.metadata.IIOMetadata _getIIOMforStream(javax.imageio.ImageWriter w, javax.imageio.metadata.IIOMetadata pmetadata, javax.imageio.ImageWriteParam iwp)
w
- pmetadata
- iwp
- public static javax.imageio.metadata.IIOMetadata _getIIOMforImageType(javax.imageio.ImageWriter w, javax.imageio.metadata.IIOMetadata pmetadata, javax.imageio.ImageTypeSpecifier its, javax.imageio.ImageWriteParam iwp)
prepareTileWrite(boolean)
public static javax.imageio.metadata.IIOMetadata _getIIOMforDefaultImage(javax.imageio.ImageWriter w, javax.imageio.ImageTypeSpecifier its, javax.imageio.ImageWriteParam iwp)
prepareTileWrite(boolean)
public java.util.List<java.awt.image.BufferedImage> readThumbnails()
protected java.util.List<java.awt.image.BufferedImage> getThumbnails(javax.imageio.ImageReader r, int minSize, int bufferedType) throws java.io.IOException, java.lang.InterruptedException
r
- minSize
- min size for thumbnails, if it appears that the source
picture is smaller or equal to that size, no thumbnail should be
returned.bufferedType
- target typejava.io.IOException
java.lang.InterruptedException
public static Sprite _load(java.lang.Object s) throws java.io.IOException
s
- a source object : File, InputStream or filename as Stringjava.io.IOException
public static Sprite _load(java.lang.Object s, boolean useCache) throws java.io.IOException
useCache
- instance a FileCacheImageInputStream if possibles
- a source object : File, InputStream or filename as Stringjava.io.IOException
public java.lang.String setStoreMime(java.lang.String storeMime)
buffered type
, if it fails, then an appropriate mime is
used. NOTICE : the specified mime type will be activated upon the next
write....() call (for best results, immediately serialize the Sprite w/o
running runValidate()).storeMime
- public java.lang.String getStoreMime()
public boolean isJava2DModeEnabled()
Sf3Renderable
isJava2DModeEnabled
in interface Sf3Renderable
public boolean isTextureModeEnabled()
Sf3Renderable
isTextureModeEnabled
in interface Sf3Renderable
public boolean isTileModeEnabled()
Sf3Renderable
isTileModeEnabled
in interface Sf3Renderable
#setTileModeEnabled()
public void setJava2DModeEnabled(boolean b)
Sf3Renderable
setJava2DModeEnabled
in interface Sf3Renderable
b
- dis/enables the Java2D Swing classic mode. (you can disable this when rendering openGL that can free up some memory)public void setStoreMode(int mode)
Sf3Renderable
Sf3Renderable.MODE_TILE
is not available for Sprite made from an Image instance source (ImageProducer).
NOTICE : tile mode is more stable with the image/tiff mime typesetStoreMode
in interface Sf3Renderable
mode
- the specified storage mode to useSf3Renderable.MODE_JAVA2D
,
Sf3Renderable.MODE_TEXTURE
,
Sf3Renderable.MODE_TILE
public void setTextureModeEnabled(boolean b)
Sf3Renderable
setTextureModeEnabled
in interface Sf3Renderable
b
- dis/enables the texturing modepublic void setTileModeEnabled(boolean b)
Sf3Renderable
setTileModeEnabled
in interface Sf3Renderable
Sf3Renderable.isJava2DModeEnabled()
,
Sf3Renderable.isTextureModeEnabled()
public void setUseIIOCacheEnabled(boolean b)
Sf3Renderable
setUseIIOCacheEnabled
in interface Sf3Renderable
JXAenvUtils._isImageIOCacheEnabled()
public boolean isUseIIOCacheEnabled()
isUseIIOCacheEnabled
in interface Sf3Renderable
public void writeImageToFile(java.io.RandomAccessFile raf, float compressionQuality) throws java.io.IOException, java.lang.NullPointerException, java.lang.InterruptedException
raf
- the file to write the image data intojava.io.IOException
java.lang.InterruptedException
java.lang.NullPointerException
#writeImageToIOStream(ImageOutputStream, int)
public void writeImageToIOStream(java.io.OutputStream output, float compressionQuality) throws java.io.IOException, java.lang.InterruptedException, java.lang.NullPointerException
output
- the stream to write intocompressionQuality
- decimal between 0f and 1f (ignored if not
available for the mime-typejava.io.IOException
java.lang.NullPointerException
java.lang.InterruptedException
#writeImageToFile(RandomAccessFile)
,
ImageCollection#_getCompressionType(java.lang.String, int)
public void writeImageToIOStream(javax.imageio.stream.ImageOutputStream output, float compressionQuality) throws java.io.IOException, java.lang.InterruptedException
output
- the stream to write intocompressionQuality
- decimal between 0f and 1f (ignored if not
available for the mime-typejava.io.IOException
java.lang.InterruptedException
java.lang.NullPointerException
#writeImageToFile(RandomAccessFile)
,
ImageCollection#_getCompressionType(java.lang.String, int)
public javax.imageio.ImageWriter prepareTileWrite(boolean useCache) throws java.io.IOException
ImageWriter w = prepareTileWrite(false); for (int y = 0; y < numTiles.height; y++) { for (int x = 0; x < numTiles.width; x++) { ImageReadParam irp = _getIRP(r, _type); Rectangle sroi = new Rectangle(x * tiles.width, y * tiles.height, tiles.width, tiles.height).intersection(new Rectangle(dim)); if (sroi.isEmpty()) { continue; } irp.setSourceRegion(sroi); BufferedImage b = r.read(0, irp); if (b.getType() != _type) { b = convertToBuffered((RenderedImage) b, obs, true); } trackImage(trackerPty, b); waitFor( trackerPty); untrackImage(trackerPty,b); // ! to clear the reference held by MediaTracker ! Rectangle replace = new Rectangle(x * tiles.width, y * tiles.height, tiles.width, tiles.height).intersection(new Rectangle(dim)); iwp.setDestinationOffset(replace.getLocation()); w.prepareReplacePixels(0, replace); w.replacePixels(b, iwp); w.endReplacePixels(); b.flush(); notifyIIOWriteListenersProgress( wTileProgList, w, (float) (y * numTiles.width + x) / (float) (numTiles.width * numTiles.height)); } } endTileWrite(w);
useCache
- java.io.IOException
java.lang.IllegalArgumentException
java.lang.UnsupportedOperationException
public void endTileWrite(javax.imageio.ImageWriter w) throws java.io.IOException
w
- java.io.IOException
public java.awt.image.BufferedImage convertToBuffered(java.awt.Image data, java.awt.Component pobs, boolean flush)
data
- the image data to specify as the source for the conversionpobs
- the Component to receive the image dataflush
- will flush the source data, after conversionpublic java.awt.image.BufferedImage convertToBuffered(java.awt.image.RenderedImage data, java.awt.Component pobs, boolean flush)
data
- the image data to specify as the source for the conversionpobs
- the Component to receive the image dataflush
- will flush the source data, after conversionpublic java.awt.image.VolatileImage convertToVolatile(java.awt.Image data, java.awt.Component pobs, boolean flush)
data
- the image data to specify as the source for the conversionpobs
- the Component to receive the image dataflush
- will flush the source data, after conversionpublic java.awt.image.VolatileImage convertToVolatile(java.awt.image.RenderedImage data, java.awt.Component pobs, boolean flush)
data
- the image data to specify as the source for the conversionpobs
- the Component to receive the image dataflush
- will flush the source data, after conversionpublic java.net.URI getBase()
src
public void paintComponentImpl(java.awt.Graphics g1, javax.swing.JComponent comp)
g1
- Graphics instanceComponent.repaint()
,
JComponent.update(Graphics)
public static java.awt.Graphics _createImageGraphics(java.awt.Image image)
image
- the specified to create Graphics ontopublic void clearImageGraphics()
public boolean isOpaque()
isOpaque
in interface OpaqueComponent
public void setOpaque(boolean b)
setOpaque
in interface OpaqueComponent
b
- dis/enables the opaque property, that modifies the cache
property significantlycache
public boolean draw(java.awt.Component obs, java.awt.Graphics2D g2)
draw
in interface Sf3Renderable
obs
- the Component that is to be painted ontog2
- Graphics2D instance to draw todraw(Component, Graphics2D, AffineTransform, PerspectiveTransform)
public static java.awt.RenderingHints _getRenderingHints()
renderingHints
wrapRendering(Graphics)
public boolean draw(java.awt.Component pobs, java.awt.Graphics2D g, java.awt.geom.AffineTransform tx, javax.media.jai.PerspectiveTransform ptx)
draw
in interface Sf3Renderable
pobs
- the Component that is to be painted ontog
- Graphics2D instance to draw totx
- transform to be applied to drawing (unstable with some image
types)ptx
- perspective Transform to be applied on drawingpublic boolean draw(java.awt.Component pobs, java.awt.Graphics2D g, int fx, java.awt.Point fx_loc, java.awt.Color fx_color)
draw
in interface Sf3Renderable
pobs
- the Component that is to be painted ontog
- the Graphics instance to paint ontofx
- the gfx to use or 0 for nonefx_loc
- the location of the gfx or Point(0,0)fx_color
- the color to use for the gfx or null#__draw(Component, Graphics2D, AffineTransform, PerspectiveTransform, int, Point, Color)
,
Sprite#draw(Component, Graphics2D, int, Point, Color)
public boolean isDiskCached()
public boolean isBufferedImageEnabled()
cache
public void setBufferedImageEnabled(boolean b)
b
- dis/enables using the BufferedImage for this Sprite instanceisBufferedImageEnabled()
public void setHardwareAccel(boolean b)
setHardwareAccel
in interface RenderingSceneComponent
b
- dis/enables VRAM for this Sprite instance.setBufferedImageEnabled(boolean)
public boolean isHardwareAccel()
isHardwareAccel
in interface RenderingSceneComponent
setHardwareAccel(boolean)
,
isBufferedImageEnabled()
public java.awt.image.BufferedImage toBuffered()
convertToBuffered(Image, Component, boolean)
)public java.awt.image.VolatileImage toVolatile()
convertToVolatile(Image, Component, boolean)
)public static java.awt.image.BufferedImage createBufferedImage(java.awt.Dimension size, int type)
size
- dimensionstype
- the BufferedImage type to createBufferedImage
public static boolean checkState(java.awt.Image i, java.awt.MediaTracker mt)
i
- a VolatileImage to check for validating (it's automatically
restored if neccessary).mt
- to check for the loading state of another Image, not useable
for VolatileImage.public static java.awt.image.VolatileImage createVolatileImage(java.awt.Dimension size, int type)
size
- dimensionstype
- Transparency.OPAQUE
, Transparency.BITMASK
or Transparency.TRANSLUCENT
VolatileImage
,
_getTransparency(int)
public int getWidth()
getWidth
in interface Sf3Renderable
getBounds()
public int getHeight()
getHeight
in interface Sf3Renderable
getBounds()
public java.awt.Image getImage(java.awt.Component obs)
obs
- the Component where the image is or nullsetBounds(Rectangle)
was empty)public boolean isCompositeEnabled()
isCompositeEnabled
in interface CompositeCapable
public void setCompositeEnabled(boolean b)
setCompositeEnabled
in interface CompositeCapable
b
- dis/enables the Composite effect for this Spritepublic java.awt.Composite getComposite()
getComposite
in interface CompositeCapable
CompositeCapable.setComposite(Composite)
public boolean isComposited()
public void setComposited(boolean b)
b
- false to apply the Composite effect one more time (it will be
set to true automatically when applied by the validation method)#resizeData(Dimension, PerspectiveTransform, AffineTransform,
AffineTransform, AffineTransform, Component)
public void setComposite(java.awt.Composite cps)
setComposite
in interface CompositeCapable
cps
- the Composite instance to set uppublic java.awt.Paint getPaint()
getPaint
in interface CompositeCapable
CompositeCapable.setPaint(Paint)
public void setPaint(java.awt.Paint pnt)
setPaint
in interface CompositeCapable
pnt
- sp Paint instance to set uppublic java.awt.Color getColor()
getColor
in interface CompositeCapable
CompositeCapable.setColor(Color)
public void setColor(java.awt.Color clr)
setColor
in interface CompositeCapable
clr
- sp Color instancepublic java.awt.Image getScaled(double zoomX, double zoomY, java.awt.Component obs)
zoomX
- width scale factorzoomY
- height scale factorobs
- ImageObserver where further drawing will be donepublic void zoom(java.awt.Component obs, double zoom)
obs
- the Component that will receive this Spritezoom
- the scaling valuegetScaled(double, double, Component)
public double getZoomValue()
public boolean isZoomEnabled()
public void setZoomEnabled(boolean b, double zoom)
b
- en/disabledzoom
- zoom value to applypublic boolean isFlipEnabled()
public void setFlipEnabled(boolean b, int mirror)
b
- en/disabledmirror
- orientation of the mirrorNONE
,
VERTICAL
,
HORIZONTAL
public java.awt.Image getFlip(int orientation, java.awt.Component pobs)
orientation
- the mirror orientation to perform the flip-transformpobs
- the observerNONE
,
VERTICAL
,
HORIZONTAL
public int getMirrorValue()
NONE
,
VERTICAL
,
HORIZONTAL
public void setMirror(int orientation)
orientation
- public void setBounds(int x, int y, int width, int height)
setBounds
in interface Sf3Renderable
x
- y
- width
- height
- public void setBounds(java.awt.Rectangle r)
setBounds
in interface Sf3Renderable
r
- public java.awt.Rectangle getBounds(java.awt.Rectangle rv)
getBounds
in interface Sf3Renderable
rv
- setZoomEnabled(boolean, double)
public java.awt.Rectangle getBounds()
getBounds
in interface Sf3Renderable
setZoomEnabled(boolean, double)
public void setSize(int width, int height)
setSize
in interface Sf3Renderable
width
- height
- public void setSize(java.awt.Dimension size)
setSize
in interface Sf3Renderable
size
- public java.awt.Dimension getSize()
getSize
in interface Sf3Renderable
public java.awt.Point getLocation()
getLocation
in interface Sf3Renderable
public void setLocation(java.awt.Point p)
setLocation
in interface Sf3Renderable
p
- public void setLocation(int x, int y)
setLocation
in interface Sf3Renderable
x
- y
- public void resetTX()
setTX(AffineTransform)
public void setTX(java.awt.geom.AffineTransform tx)
tx
- the transform to applypublic java.awt.geom.AffineTransform getTX()
setTX(AffineTransform)
public void resetPTX()
setTX(AffineTransform)
public void setPTX(javax.media.jai.PerspectiveTransform ptx)
ptx
- the PerspectiveTransform to applypublic javax.media.jai.PerspectiveTransform getPTX()
setTX(AffineTransform)
public java.lang.Object getSource()
src
public int statusImage()
MediaTracker.statusID(int, boolean)
,
MediaTracker.LOADING
,
MediaTracker.ABORTED
,
MediaTracker.ERRORED
,
MediaTracker.COMPLETE
public java.lang.Object clearResource()
clearResource
in interface Resource
MediaTracker.removeImage(Image)
,
resetAttributes()
,
#_cleanup()
,
clearTexData()
public void clearTexData()
loadTexData()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.Object __clone()
public void finalize() throws java.lang.Throwable
clear the resources
used by this Sprite.finalize
in class java.lang.Object
java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Object
public void invalidate()
public boolean isValid()
#validate()
,
invalidate()
public void setBufferedType(int type)
type
- the buffered type to use for the BufferedImagepublic int getBufferedType()
public javax.imageio.ImageTypeSpecifier getFeatures()
public void setSPM(SpritesCacheManager spm)
spm
- the SpritesCacheManager instance to use for memory call-backsSpritesCacheManager.memorySensitiveCallback(String, Object,
Object[], Class[])
public Sprite runValidate()
runValidate
in interface Sf3Renderable
#spm
,
#setZoomEnabled(boolean, double)
,
#setFlipEnabled(boolean, int)
,
Sprite#runValidate()
public java.awt.Component getObs()
public void setObs(java.awt.Component obs)
obs
- public void addIIOTileReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
l
- the listener instance that will listen to each tile read
operation progress (tile mode must be enabled)public void addIIOReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
l
- the listener instance that will listen to each read operation
progresspublic void addIIOReadWarningListener(javax.imageio.event.IIOReadWarningListener l)
l
- the listener instance that will listen to each read operation
warningpublic void removeIIOTileReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
l
- the listener instance that will be removed from the listeners
setpublic void removeIIOReadProgressListener(javax.imageio.event.IIOReadProgressListener l)
l
- the listener instance that will be removed from the listeners
setpublic void removeIIOReadWarningListener(javax.imageio.event.IIOReadWarningListener l)
l
- the listener instance that will be removed from the listeners
setpublic void addIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
l
- the listener that will listen to each write operation progresspublic void addIIOTileWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
l
- the listener that will listen to each write operation progress
(tile mode muste be enabled and image/tiff must be the
store mime type
)public void addIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener l)
l
- the listener that will listen to each write oparation warningpublic void removeIIOWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
l
- the listener that will be removed from the listeners setpublic void removeIIOTileWriteProgressListener(javax.imageio.event.IIOWriteProgressListener l)
l
- the listener that will be removed from the listeners setpublic void removeIIOWriteWarningListener(javax.imageio.event.IIOWriteWarningListener l)
l
- the listener that will be removed from the listeners setpublic static java.awt.Graphics2D wrapRendering(java.awt.Graphics g)
g
- the Graphics instance to wrappublic boolean isInnerResourceModeEnabled()
isInnerResourceModeEnabled
in interface Resource
setInnerResourceModeEnabled(boolean)
public void setInnerResourceModeEnabled(boolean b)
setInnerResourceModeEnabled
in interface Resource
b
- dis/enables the inner-resource modepublic java.lang.String getFPS()
markFPS()
public long getFramerate()
protected double markFPS()
public boolean isMultiThreadingEnabled()
isMultiThreadingEnabled
in interface Threaded
#_multiThreading
,
setMultiThreadingEnabled(boolean)
public void setMultiThreadingEnabled(boolean b)
setMultiThreadingEnabled
in interface Threaded
b
- true or falsepublic boolean isResourceLoaded()
isResourceLoaded
in interface Resource
#setRenderMode(int)
public static boolean _GLIsLoaded(java.lang.Object sp)
sp
- a sprite or its hashcodepublic void setGroupMonitor(Monitor... tg)
setGroupMonitor
in interface Threaded
public Monitor[] getGroupMonitor()
getGroupMonitor
in interface Threaded
public boolean isDebugEnabled()
isDebugEnabled
in interface Debugger
public void setDebugEnabled(boolean b)
setDebugEnabled
in interface Debugger
b
- public static void _quickPaintImmediately(javax.swing.JComponent comp)
Jcomponent#getVisibleRect()
This methdo is useful to repaint
while being in the EDT (e.g.
SwingUtilities.invokeLater(Runnable))comp
- QUICKLY asap paints the JComponent with the Swing EDTpublic void waitForData() throws java.lang.InterruptedException
java.lang.InterruptedException
public static void _GLRenderSprite(RenderingSceneGL gld, SpriteGLHandler sp, java.awt.Rectangle texBounds, double z, int fx, java.awt.Point fx_loc, java.awt.Color fx_color, int transform, java.nio.DoubleBuffer scale, java.nio.DoubleBuffer rotate, java.nio.DoubleBuffer translate)
gld
- the RenderingSceneGL that is to be rendered ontosp
- the Sprite to rendertexBounds
- 2D Rectangle bounds to render atz
- z-depth to render atfx
- the gfx to apply, or 0 for nonefx_loc
- x,y Point location of the gfx, or Point(0,0)fx_color
- Color of the gfx, or nulltransform
- the transform bitwise-OR combination to apply or 0 for
none
RenderingSceneGL#_GL_TRANSFORM_ROTATE, RenderingSceneGL#_GL_TRANSFORM_SCALE, RenderingSceneGL#_GL_TRANSFORM_TRANSLATEscale
- rotate
- translate
- public static void _GLRenderSprite(RenderingSceneGL gld, boolean keepBinding, SpriteGLHandler sp, java.awt.Rectangle texBounds, double z, int fx, java.awt.Point fx_loc, java.awt.Color fx_color, int transform, java.nio.DoubleBuffer scale, java.nio.DoubleBuffer rotate, java.nio.DoubleBuffer translate)
gld
- the RenderingSceneGL that is to be rendered ontokeepBinding
- keeps the associated texture for further use or not,
resp.sp
- the Sprite to rendertexBounds
- 2D Rectangle to render atz
- z-depth to render atfx
- the gfx to apply or 0 for nonefx_loc
- x,y Point location of the gfx, or Point(0,0)fx_color
- Color for the gfx, or nulltransform
- the transform bitwise-OR combination to apply or 0 for
none
RenderingSceneGL#_GL_TRANSFORM_ROTATE, RenderingSceneGL#_GL_TRANSFORM_SCALE, RenderingSceneGL#_GL_TRANSFORM_TRANSLATEscale
- rotate
- translate
- public static int _GLgetTexHash(int spHash)
spHash
- public static int _GLgetSpriteHash(int texHash)
texHash
- the texture hashCode that belows to the Sprite to returnpublic static void _GLRenderSprite(RenderingSceneGL gld, SpriteGLHandler sp, java.awt.Rectangle texBounds, double z)
gld
- the RenderingSceneGL that is to be rendered ontosp
- the Sprite to rendertexBounds
- 2D Rectangle to render atz
- z-depth to render atpublic static void _GLRenderSprite(RenderingSceneGL gld, boolean keepBinding, SpriteGLHandler sp, java.awt.Rectangle texBounds, double z)
gld
- the RenderingSceneGL that is to be rendered ontokeepBinding
- keeps the associated texture in VRAM for further use
or not, resp.sp
- the Sprite to rendertexBounds
- 2D Rectangle bounds to render atz
- z-depth to render atpublic void setTexPty(float texPty)
texPty
- public float getTexPty()
public static javax.swing.JComponent _makeSpriteJComponent(Sprite sp)
sp
- public static int _getBufferedType(java.lang.String outputMime)
outputMime
- ImageCollection#_getBufferedType(String)
rev. 4.6.5 - Copyright © 2006 - 2014 b23:production GNU/GPL
All rights reserved under the Apache License v2 terms and conditions. Free your project !
This software includes the LightWeight Java Gaming Library API - LWJGL.org.