org.ogre4j
Class ImageCodec

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.ImageCodec
All Implemented Interfaces:
IAllocatedObject<IGeneralAllocPolicy>, ICodec, IGeneralAllocatedObject, IImageCodec, INativeObject

public class ImageCodec
extends NativeObject
implements IImageCodec


Nested Class Summary
static class ImageCodec.ImageData
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IImageCodec
IImageCodec.IImageData
 
Nested classes/interfaces inherited from interface org.ogre4j.ICodec
ICodec.ICodecData, ICodec.ICodecDataPtr, ICodec.ICodecIterator, ICodec.ICodecList, ICodec.IDecodeResult
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  ImageCodec(InstancePointer p)
          This constructor is public for internal useage only!
protected ImageCodec(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  ImageCodec(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void code(IDataStreamPtr returnValue, IMemoryDataStreamPtr input, ICodec.ICodecDataPtr pData)
          Codes the data in the input stream and saves the result in the output stream.
 void codeToFile(IMemoryDataStreamPtr input, java.lang.String outFileName, ICodec.ICodecDataPtr pData)
          Codes the data in the input chunk and saves the result in the output filename provided.
 void decode(ICodec.IDecodeResult returnValue, IDataStreamPtr input)
          Codes the data from the input chunk into the output chunk.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
static ICodec getCodec(BytePointer magicNumberPtr, int maxbytes)
          Gets the codec that can handle the given 'magic' identifier.
static ICodec getCodec(java.lang.String extension)
          Gets the codec registered for the passed in file extension.
static void getCodecIterator(ICodec.ICodecIterator returnValue)
          Gets the iterator for the registered codecs.
 java.lang.String getDataType()
          Returns the type of the data that supported by this codec as a String
static void getExtensions(IStringVector returnValue)
          Gets the file extension list for the registered codecs.
 java.lang.String getType()
          Returns the type of the codec as a String
 boolean magicNumberMatch(java.lang.String magicNumberPtr, int maxbytes)
          Returns whether a magic number header matches this codec.
 java.lang.String magicNumberToFileExt(java.lang.String magicNumberPtr, int maxbytes)
          Maps a magic number header to a file extension, if this codec recognises it.
static void registerCodec(ICodec pCodec)
          Registers a new codec in the database.
static void unRegisterCodec(ICodec pCodec)
          Unregisters a codec from the database.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

ImageCodec

public ImageCodec(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


ImageCodec

protected ImageCodec(InstancePointer p,
                     boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


ImageCodec

public ImageCodec(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

getDataType

public java.lang.String getDataType()
Description copied from interface: ICodec
Returns the type of the data that supported by this codec as a String

Specified by:
getDataType in interface ICodec
Specified by:
getDataType in interface IImageCodec

code

public void code(IDataStreamPtr returnValue,
                 IMemoryDataStreamPtr input,
                 ICodec.ICodecDataPtr pData)
Codes the data in the input stream and saves the result in the output stream.

Specified by:
code in interface ICodec

codeToFile

public void codeToFile(IMemoryDataStreamPtr input,
                       java.lang.String outFileName,
                       ICodec.ICodecDataPtr pData)
Codes the data in the input chunk and saves the result in the output filename provided. Provided for efficiency since coding to memory is progressive therefore memory required is unknown leading to reallocations.

Specified by:
codeToFile in interface ICodec

decode

public void decode(ICodec.IDecodeResult returnValue,
                   IDataStreamPtr input)
Codes the data from the input chunk into the output chunk.

Specified by:
decode in interface ICodec

getType

public java.lang.String getType()
Returns the type of the codec as a String

Specified by:
getType in interface ICodec

magicNumberMatch

public boolean magicNumberMatch(java.lang.String magicNumberPtr,
                                int maxbytes)
Returns whether a magic number header matches this codec.

Specified by:
magicNumberMatch in interface ICodec

magicNumberToFileExt

public java.lang.String magicNumberToFileExt(java.lang.String magicNumberPtr,
                                             int maxbytes)
Maps a magic number header to a file extension, if this codec recognises it.

Specified by:
magicNumberToFileExt in interface ICodec

registerCodec

public static void registerCodec(ICodec pCodec)
Registers a new codec in the database.


unRegisterCodec

public static void unRegisterCodec(ICodec pCodec)
Unregisters a codec from the database.


getCodecIterator

public static void getCodecIterator(ICodec.ICodecIterator returnValue)
Gets the iterator for the registered codecs.


getExtensions

public static void getExtensions(IStringVector returnValue)
Gets the file extension list for the registered codecs.


getCodec

public static ICodec getCodec(java.lang.String extension)
Gets the codec registered for the passed in file extension.


getCodec

public static ICodec getCodec(BytePointer magicNumberPtr,
                              int maxbytes)
Gets the codec that can handle the given 'magic' identifier.



Copyright © 2007 netAllied GmbH. All Rights Reserved.