#include <OSGImage.h>
Inheritance diagram for osg::Image:

Public Types | |
| enum | PixelFormat { OSG_INVALID_PF = 0, OSG_I_PF = GL_INTENSITY, OSG_L_PF = GL_LUMINANCE, OSG_LA_PF = GL_LUMINANCE_ALPHA, OSG_BGR_PF = 0, OSG_BGRA_PF = 0, OSG_RGB_DXT1 = GL_COMPRESSED_RGB_S3TC_DXT1_EXT, OSG_RGBA_DXT1 = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, OSG_RGBA_DXT3 = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, OSG_RGBA_DXT5 = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, OSG_RGB_PF = GL_RGB, OSG_RGBA_PF = GL_RGBA } |
| enum | Type { OSG_INVALID_IMAGEDATATYPE = GL_NONE, OSG_UINT8_IMAGEDATA = GL_UNSIGNED_BYTE, OSG_UINT16_IMAGEDATA = GL_UNSIGNED_SHORT, OSG_UINT32_IMAGEDATA = GL_UNSIGNED_INT, OSG_FLOAT16_IMAGEDATA = GL_HALF_FLOAT_NV, OSG_FLOAT32_IMAGEDATA = GL_FLOAT } |
| typedef ImagePtr | Ptr |
| enum | { ParentsFieldId = Inherited::NextFieldId, DimensionFieldId = ParentsFieldId + 1, WidthFieldId = DimensionFieldId + 1, HeightFieldId = WidthFieldId + 1, DepthFieldId = HeightFieldId + 1, BppFieldId = DepthFieldId + 1, MipMapCountFieldId = BppFieldId + 1, FrameCountFieldId = MipMapCountFieldId + 1, FrameDelayFieldId = FrameCountFieldId + 1, PixelFormatFieldId = FrameDelayFieldId + 1, PixelFieldId = PixelFormatFieldId + 1, FrameSizeFieldId = PixelFieldId + 1, NameFieldId = FrameSizeFieldId + 1, DataTypeFieldId = NameFieldId + 1, ComponentSizeFieldId = DataTypeFieldId + 1, SideCountFieldId = ComponentSizeFieldId + 1, SideSizeFieldId = SideCountFieldId + 1, ForceCompressedDataFieldId = SideSizeFieldId + 1, ForceAlphaChannelFieldId = ForceCompressedDataFieldId + 1, ForceColorChannelFieldId = ForceAlphaChannelFieldId + 1, NextFieldId = ForceColorChannelFieldId + 1 } |
Public Member Functions | |
Sync | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
Set Object Data | |
| *bool | set (UInt32 pixelFormat, Int32 width, Int32 height=1, Int32 depth=1, Int32 mipmapCount=1, Int32 frameCount=1, Time frameDelay=0.0, const UInt8 *data=0, Int32 type=OSG_UINT8_IMAGEDATA, bool allocMem=true, Int32 sideCount=1) |
| bool | set (ImagePtr image) |
| bool | setData (const UInt8 *data=0) |
| void | clearData (void) |
| bool | setSubData (Int32 offX, Int32 offY, Int32 offZ, Int32 srcW, Int32 srcH, Int32 srcD, const UInt8 *data) |
| bool | flipDepthFrameData (void) |
Add Value | |
| *bool | addValue (const char *value) |
Reformate | |
| *bool | reformat (const PixelFormat pixelFormat, ImagePtr destination=NullFC) |
Convert dataType | |
| *void | swapDataEndian (void) |
| bool | convertDataTypeTo (Int32 destDataType=OSG_UINT8_IMAGEDATA) |
Scale | |
| *bool | scale (Int32 width, Int32 height=1, Int32 depth=1, ImagePtr destination=NullFC) |
| bool | scaleNextPower2 (ImagePtr destination=NullFC) |
SubImage | |
| *bool | subImage (Int32 offX, Int32 offY, Int32 offZ, Int32 destW, Int32 destH, Int32 destD, ImagePtr destination=NullFC) |
Slice | |
| *bool | slice (Int32 offX=-1, Int32 offY=-1, Int32 offZ=-1, ImagePtr destination=NullFC) |
Mipmap | |
| *bool | createMipmap (Int32 level=-1, ImagePtr destination=NullFC) |
Read/Write | |
| *bool | write (const Char8 *fileName) |
| bool | read (const Char8 *fileName) |
Storage/Restore | |
| *UInt64 | store (const Char8 *mimeType, UInt8 *mem, Int32 memSize=-1) |
| UInt64 | restore (const UInt8 *mem, Int32 memSize=-1) |
Comparison/Assign | |
| *Image & | operator= (const Image &image) |
| bool | operator< (const Image &image) |
| bool | operator== (const Image &image) |
| bool | operator!= (const Image &image) |
Get Methods | |
| *bool | isValid (void) const |
| bool | hasAlphaChannel (void) |
| bool | hasColorChannel (void) |
| bool | hasCompressedData (void) |
| UInt8 | getComponents (void) const |
Size | |
| *unsigned long | getSize (bool withMipmap=true, bool withFrames=true, bool withSides=true) const |
Get Methods | |
| *const UInt8 * | getData (UInt32 mipmapNum=0, UInt32 frameNum=0, UInt32 sideNum=0) const |
| UInt8 * | getData (UInt32 mipmapNum=0, UInt32 frameNum=0, UInt32 sideNum=0) |
| UInt8 * | getDataByTime (Time time, UInt32 mipmapNum=1) |
Calculate | |
| *void | calcMipmapGeometry (UInt32 mipmapNum, UInt32 &width, UInt32 &height, UInt32 &depth) const |
| UInt32 | calcMipmapLevelCount (void) const |
| UInt32 | calcFrameNum (Time time, bool loop=true) const |
Clear Image | |
| *virtual void | clear (UChar8 pixelValue=0) |
| virtual void | clearFloat (Real32 pixelValue=0.0) |
| virtual void | clearHalf (Real16 pixelValue=Real16(0.0)) |
attachment handling | |
| *bool | hasAttachment (void) const |
| UInt32 | attachmentCount (void) const |
| void | setAttachmentField (const std::string &key, const std::string &data) |
| const std::string * | findAttachmentField (const std::string &key) const |
Calculate Mipmap Size | |
| *UInt32 | calcMipmapLevelSize (UInt32 mipmapNum, UInt32 w, UInt32 h, UInt32 d) const |
| UInt32 | calcMipmapLevelSize (UInt32 mipmapNum) const |
| UInt32 | calcMipmapSumSize (UInt32 mipmapNum, UInt32 w, UInt32 h, UInt32 d) const |
| UInt32 | calcMipmapSumSize (UInt32 mipmapNum) const |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *MFFieldContainerPtr * | getMFParents (void) |
| Get the Image::_mfParents field. | |
| SFInt32 * | getSFDimension (void) |
| Get the Image::_sfDimension field. | |
| SFInt32 * | getSFWidth (void) |
| Get the Image::_sfWidth field. | |
| SFInt32 * | getSFHeight (void) |
| Get the Image::_sfHeight field. | |
| SFInt32 * | getSFDepth (void) |
| Get the Image::_sfDepth field. | |
| SFInt32 * | getSFBpp (void) |
| Get the Image::_sfBpp field. | |
| SFInt32 * | getSFMipMapCount (void) |
| Get the Image::_sfMipMapCount field. | |
| SFInt32 * | getSFFrameCount (void) |
| Get the Image::_sfFrameCount field. | |
| SFTime * | getSFFrameDelay (void) |
| Get the Image::_sfFrameDelay field. | |
| SFUInt32 * | getSFPixelFormat (void) |
| Get the Image::_sfPixelFormat field. | |
| MFUInt8 * | getMFPixel (void) |
| Get the Image::_mfPixel field. | |
| SFInt32 * | getSFFrameSize (void) |
| Get the Image::_sfFrameSize field. | |
| SFString * | getSFName (void) |
| Get the Image::_sfName field. | |
| SFInt32 * | getSFDataType (void) |
| Get the Image::_sfDataType field. | |
| SFInt32 * | getSFSideCount (void) |
| Get the Image::_sfSideCount field. | |
| SFInt32 * | getSFSideSize (void) |
| Get the Image::_sfSideSize field. | |
| SFBool * | getSFForceCompressedData (void) |
| Get the Image::_sfForceCompressedData field. | |
| SFBool * | getSFForceAlphaChannel (void) |
| Get the Image::_sfForceAlphaChannel field. | |
| SFBool * | getSFForceColorChannel (void) |
| Get the Image::_sfForceColorChannel field. | |
| Int32 & | getDimension (void) |
| Get the value of the Image::_sfDimension field. | |
| const Int32 & | getDimension (void) const |
| Get the value of the Image::_sfDimension field. | |
| Int32 & | getWidth (void) |
| Get the value of the Image::_sfWidth field. | |
| const Int32 & | getWidth (void) const |
| Get the value of the Image::_sfWidth field. | |
| Int32 & | getHeight (void) |
| Get the value of the Image::_sfHeight field. | |
| const Int32 & | getHeight (void) const |
| Get the value of the Image::_sfHeight field. | |
| Int32 & | getDepth (void) |
| Get the value of the Image::_sfDepth field. | |
| const Int32 & | getDepth (void) const |
| Get the value of the Image::_sfDepth field. | |
| Int32 & | getBpp (void) |
| Get the value of the Image::_sfBpp field. | |
| const Int32 & | getBpp (void) const |
| Get the value of the Image::_sfBpp field. | |
| Int32 & | getMipMapCount (void) |
| Get the value of the Image::_sfMipMapCount field. | |
| const Int32 & | getMipMapCount (void) const |
| Get the value of the Image::_sfMipMapCount field. | |
| Int32 & | getFrameCount (void) |
| Get the value of the Image::_sfFrameCount field. | |
| const Int32 & | getFrameCount (void) const |
| Get the value of the Image::_sfFrameCount field. | |
| Time & | getFrameDelay (void) |
| Get the value of the Image::_sfFrameDelay field. | |
| const Time & | getFrameDelay (void) const |
| Get the value of the Image::_sfFrameDelay field. | |
| UInt32 & | getPixelFormat (void) |
| Get the value of the Image::_sfPixelFormat field. | |
| const UInt32 & | getPixelFormat (void) const |
| Get the value of the Image::_sfPixelFormat field. | |
| Int32 & | getFrameSize (void) |
| Get the value of the Image::_sfFrameSize field. | |
| const Int32 & | getFrameSize (void) const |
| Get the value of the Image::_sfFrameSize field. | |
| std::string & | getName (void) |
| Get the value of the Image::_sfName field. | |
| const std::string & | getName (void) const |
| Get the value of the Image::_sfName field. | |
| Int32 & | getDataType (void) |
| Get the value of the Image::_sfDataType field. | |
| const Int32 & | getDataType (void) const |
| Get the value of the Image::_sfDataType field. | |
| Int32 & | getSideCount (void) |
| Get the value of the Image::_sfSideCount field. | |
| const Int32 & | getSideCount (void) const |
| Get the value of the Image::_sfSideCount field. | |
| Int32 & | getSideSize (void) |
| Get the value of the Image::_sfSideSize field. | |
| const Int32 & | getSideSize (void) const |
| Get the value of the Image::_sfSideSize field. | |
| bool & | getForceCompressedData (void) |
| Get the value of the Image::_sfForceCompressedData field. | |
| const bool & | getForceCompressedData (void) const |
| Get the value of the Image::_sfForceCompressedData field. | |
| bool & | getForceAlphaChannel (void) |
| Get the value of the Image::_sfForceAlphaChannel field. | |
| const bool & | getForceAlphaChannel (void) const |
| Get the value of the Image::_sfForceAlphaChannel field. | |
| bool & | getForceColorChannel (void) |
| Get the value of the Image::_sfForceColorChannel field. | |
| const bool & | getForceColorChannel (void) const |
| Get the value of the Image::_sfForceColorChannel field. | |
| FieldContainerPtr & | getParents (const UInt32 index) |
| Get the value of the index element the Image::_mfParents field. | |
| MFFieldContainerPtr & | getParents (void) |
| Get the Image::_mfParents field. | |
| const MFFieldContainerPtr & | getParents (void) const |
| Get the Image::_mfParents field. | |
| UInt8 & | getPixel (const UInt32 index) |
| Get the value of the index element the Image::_mfPixel field. | |
| MFUInt8 & | getPixel (void) |
| Get the Image::_mfPixel field. | |
| const MFUInt8 & | getPixel (void) const |
| Get the Image::_mfPixel field. | |
Field Set | |
| *void | setDimension (const Int32 &value) |
| Set the value of the Image::_sfDimension field. | |
| void | setWidth (const Int32 &value) |
| Set the value of the Image::_sfWidth field. | |
| void | setHeight (const Int32 &value) |
| Set the value of the Image::_sfHeight field. | |
| void | setDepth (const Int32 &value) |
| Set the value of the Image::_sfDepth field. | |
| void | setBpp (const Int32 &value) |
| Set the value of the Image::_sfBpp field. | |
| void | setMipMapCount (const Int32 &value) |
| Set the value of the Image::_sfMipMapCount field. | |
| void | setFrameCount (const Int32 &value) |
| Set the value of the Image::_sfFrameCount field. | |
| void | setFrameDelay (const Time &value) |
| Set the value of the Image::_sfFrameDelay field. | |
| void | setPixelFormat (const UInt32 &value) |
| Set the value of the Image::_sfPixelFormat field. | |
| void | setFrameSize (const Int32 &value) |
| Set the value of the Image::_sfFrameSize field. | |
| void | setName (const std::string &value) |
| Set the value of the Image::_sfName field. | |
| void | setDataType (const Int32 &value) |
| Set the value of the Image::_sfDataType field. | |
| void | setSideCount (const Int32 &value) |
| Set the value of the Image::_sfSideCount field. | |
| void | setSideSize (const Int32 &value) |
| Set the value of the Image::_sfSideSize field. | |
| void | setForceCompressedData (const bool &value) |
| Set the value of the Image::_sfForceCompressedData field. | |
| void | setForceAlphaChannel (const bool &value) |
| Set the value of the Image::_sfForceAlphaChannel field. | |
| void | setForceColorChannel (const bool &value) |
| Set the value of the Image::_sfForceColorChannel field. | |
Binary Access | |
| *virtual UInt32 | getBinSize (const BitVector &whichField) |
| virtual void | copyToBin (BinaryDataHandler &pMem, const BitVector &whichField) |
| virtual void | copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField) |
Copy | |
| *virtual FieldContainerPtr | shallowCopy (void) const |
Static Public Member Functions | |
Class Get | |
| *static FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Construction | |
| *static ImagePtr | create (void) |
| create a new instance of the class | |
| static ImagePtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Public Attributes | |
| static const osg::BitVector | ParentsFieldMask |
| static const osg::BitVector | DimensionFieldMask |
| static const osg::BitVector | WidthFieldMask |
| static const osg::BitVector | HeightFieldMask |
| static const osg::BitVector | DepthFieldMask |
| static const osg::BitVector | BppFieldMask |
| static const osg::BitVector | MipMapCountFieldMask |
| static const osg::BitVector | FrameCountFieldMask |
| static const osg::BitVector | FrameDelayFieldMask |
| static const osg::BitVector | PixelFormatFieldMask |
| static const osg::BitVector | PixelFieldMask |
| static const osg::BitVector | FrameSizeFieldMask |
| static const osg::BitVector | NameFieldMask |
| static const osg::BitVector | DataTypeFieldMask |
| static const osg::BitVector | ComponentSizeFieldMask |
| static const osg::BitVector | SideCountFieldMask |
| static const osg::BitVector | SideSizeFieldMask |
| static const osg::BitVector | ForceCompressedDataFieldMask |
| static const osg::BitVector | ForceAlphaChannelFieldMask |
| static const osg::BitVector | ForceColorChannelFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
Protected Member Functions | |
Constructors | |
| * | Image (void) |
| Image (const Image &source) | |
Destructors | |
| *virtual | ~Image (void) |
Field Get | |
| *SFInt32 * | getSFComponentSize (void) |
| Get the Image::_sfComponentSize field. | |
| Int32 & | getComponentSize (void) |
| Get the value of the Image::_sfComponentSize field. | |
| const Int32 & | getComponentSize (void) const |
| Get the value of the Image::_sfComponentSize field. | |
Field Set | |
| *void | setComponentSize (const Int32 &value) |
| Set the value of the Image::_sfComponentSize field. | |
Sync | |
| *void | executeSyncImpl (ImageBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Protected Attributes | |
Fields | |
| *MFFieldContainerPtr | _mfParents |
| SFInt32 | _sfDimension |
| SFInt32 | _sfWidth |
| SFInt32 | _sfHeight |
| SFInt32 | _sfDepth |
| SFInt32 | _sfBpp |
| SFInt32 | _sfMipMapCount |
| SFInt32 | _sfFrameCount |
| SFTime | _sfFrameDelay |
| SFUInt32 | _sfPixelFormat |
| MFUInt8 | _mfPixel |
| SFInt32 | _sfFrameSize |
| SFString | _sfName |
| SFInt32 | _sfDataType |
| SFInt32 | _sfComponentSize |
| SFInt32 | _sfSideCount |
| SFInt32 | _sfSideSize |
| SFBool | _sfForceCompressedData |
| SFBool | _sfForceAlphaChannel |
| SFBool | _sfForceColorChannel |
Static Protected Attributes | |
static element | |
| *static Int32 | _formatDic [][2] |
| static Int32 | _typeDic [][2] |
Private Types | |
| typedef ImageBase | Inherited |
Private Member Functions | |
Image Data | |
| *bool | createData (const UInt8 *data, bool allocMem=true) |
| bool | scaleData (UInt8 *srcData, Int32 srcW, Int32 srcH, Int32 srcD, UInt8 *destData, Int32 destW, Int32 destH, Int32 destD) |
Static Private Member Functions | |
| static void | initMethod (void) |
Friends | |
| class | FieldContainer |
| class | ImageBase |
Definition at line 56 of file OSGImage.h.
|
|
Reimplemented from osg::ImageBase. Definition at line 60 of file OSGImage.h. |
|
|
Definition at line 109 of file OSGImageBase.h. |
|
|
Definition at line 65 of file OSGImage.h. 00065 { OSG_INVALID_PF = 0, 00066 00067 OSG_I_PF = GL_INTENSITY, 00068 00069 OSG_L_PF = GL_LUMINANCE, 00070 OSG_LA_PF = GL_LUMINANCE_ALPHA, 00071 00072 /*** BGR ***/ 00073 #if defined(GL_BGR) 00074 OSG_BGR_PF = GL_BGR, 00075 #elif defined(GL_BGR_EXT) 00076 OSG_BGR_PF = GL_BGR_EXT, 00077 #else 00078 OSG_BGR_PF = 0, 00079 #endif 00080 00081 /*** BGRA ***/ 00082 #if defined(GL_BGRA) 00083 OSG_BGRA_PF = GL_BGRA, 00084 #elif defined(GL_BGRA_EXT) 00085 OSG_BGRA_PF = GL_BGRA_EXT, 00086 #else 00087 OSG_BGRA_PF = 0, 00088 #endif 00089 00090 /*** RGB_DXT1 ***/ 00091 #if defined(GL_COMPRESSED_RGB_S3TC_DXT1_EXT) 00092 OSG_RGB_DXT1 = GL_COMPRESSED_RGB_S3TC_DXT1_EXT, 00093 #else 00094 OSG_RGB_DXT1 = 0, 00095 #endif 00096 00097 /*** RGBA_DXT1 ***/ 00098 #if defined(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) 00099 OSG_RGBA_DXT1 = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 00100 #else 00101 OSG_RGBA_DXT1 = 0, 00102 #endif 00103 00104 /*** RGBA_DXT3 ***/ 00105 #if defined(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) 00106 OSG_RGBA_DXT3 = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 00107 #else 00108 OSG_RGBA_DXT3 = 0, 00109 #endif 00110 00111 /*** RGBA_DXT5 ***/ 00112 #if defined(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) 00113 OSG_RGBA_DXT5 = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 00114 #else 00115 OSG_RGBA_DXT5 = 0, 00116 #endif 00117 00118 OSG_RGB_PF = GL_RGB, 00119 OSG_RGBA_PF = GL_RGBA 00120 };
|
|
|
Definition at line 122 of file OSGImage.h. 00122 { 00123 OSG_INVALID_IMAGEDATATYPE = GL_NONE, 00124 OSG_UINT8_IMAGEDATA = GL_UNSIGNED_BYTE, 00125 OSG_UINT16_IMAGEDATA = GL_UNSIGNED_SHORT, 00126 OSG_UINT32_IMAGEDATA = GL_UNSIGNED_INT, 00127 OSG_FLOAT16_IMAGEDATA = GL_HALF_FLOAT_NV, 00128 OSG_FLOAT32_IMAGEDATA = GL_FLOAT 00129 };
|
|
|
Reimplemented from osg::AttachmentContainer. Definition at line 111 of file OSGImageBase.h. 00112 { 00113 ParentsFieldId = Inherited::NextFieldId, 00114 DimensionFieldId = ParentsFieldId + 1, 00115 WidthFieldId = DimensionFieldId + 1, 00116 HeightFieldId = WidthFieldId + 1, 00117 DepthFieldId = HeightFieldId + 1, 00118 BppFieldId = DepthFieldId + 1, 00119 MipMapCountFieldId = BppFieldId + 1, 00120 FrameCountFieldId = MipMapCountFieldId + 1, 00121 FrameDelayFieldId = FrameCountFieldId + 1, 00122 PixelFormatFieldId = FrameDelayFieldId + 1, 00123 PixelFieldId = PixelFormatFieldId + 1, 00124 FrameSizeFieldId = PixelFieldId + 1, 00125 NameFieldId = FrameSizeFieldId + 1, 00126 DataTypeFieldId = NameFieldId + 1, 00127 ComponentSizeFieldId = DataTypeFieldId + 1, 00128 SideCountFieldId = ComponentSizeFieldId + 1, 00129 SideSizeFieldId = SideCountFieldId + 1, 00130 ForceCompressedDataFieldId = SideSizeFieldId + 1, 00131 ForceAlphaChannelFieldId = ForceCompressedDataFieldId + 1, 00132 ForceColorChannelFieldId = ForceAlphaChannelFieldId + 1, 00133 NextFieldId = ForceColorChannelFieldId + 1 00134 };
|
|
|
Default Constructor. Creates a invalid Image of the size 0x0x0 Definition at line 2843 of file OSGImage.cpp. References OSG_INVALID_PF, and osg::ImageBase::setPixelFormat(). 02843 : 02844 Inherited() 02845 { 02846 setPixelFormat(OSG_INVALID_PF); 02847 return; 02848 }
|
|
|
Copy Constructor. Creates a copy of the given image Definition at line 2852 of file OSGImage.cpp. 02852 : 02853 Inherited(obj) 02854 { 02855 }
|
|
|
Destructor. Definition at line 2859 of file OSGImage.cpp.
|
|
||||||||||||
|