PageRenderTime 335ms CodeModel.GetById 69ms app.highlight 221ms RepoModel.GetById 32ms app.codeStats 1ms

/Source/System/Image/ES/OSGImageBase.cpp

https://github.com/msteners/OpenSGDevMaster_Toolbox
C++ | 2002 lines | 1490 code | 369 blank | 143 comment | 133 complexity | cdadd54ab83aa8d7551f8eb5a1057bf8 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/*---------------------------------------------------------------------------*\
   2 *                                OpenSG                                     *
   3 *                                                                           *
   4 *                                                                           *
   5 *               Copyright (C) 2000-2006 by the OpenSG Forum                 *
   6 *                                                                           *
   7 *                            www.opensg.org                                 *
   8 *                                                                           *
   9 *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
  10 *                                                                           *
  11\*---------------------------------------------------------------------------*/
  12/*---------------------------------------------------------------------------*\
  13 *                                License                                    *
  14 *                                                                           *
  15 * This library is free software; you can redistribute it and/or modify it   *
  16 * under the terms of the GNU Library General Public License as published    *
  17 * by the Free Software Foundation, version 2.                               *
  18 *                                                                           *
  19 * This library is distributed in the hope that it will be useful, but       *
  20 * WITHOUT ANY WARRANTY; without even the implied warranty of                *
  21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
  22 * Library General Public License for more details.                          *
  23 *                                                                           *
  24 * You should have received a copy of the GNU Library General Public         *
  25 * License along with this library; if not, write to the Free Software       *
  26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
  27 *                                                                           *
  28\*---------------------------------------------------------------------------*/
  29/*---------------------------------------------------------------------------*\
  30 *                                Changes                                    *
  31 *                                                                           *
  32 *                                                                           *
  33 *                                                                           *
  34 *                                                                           *
  35 *                                                                           *
  36 *                                                                           *
  37\*---------------------------------------------------------------------------*/
  38
  39/*****************************************************************************\
  40 *****************************************************************************
  41 **                                                                         **
  42 **                  This file is automatically generated.                  **
  43 **                                                                         **
  44 **          Any changes made to this file WILL be lost when it is          **
  45 **           regenerated, which can become necessary at any time.          **
  46 **                                                                         **
  47 **     Do not change this file, changes should be done in the derived      **
  48 **     class Image!
  49 **                                                                         **
  50 *****************************************************************************
  51\*****************************************************************************/
  52
  53#include <cstdlib>
  54#include <cstdio>
  55#include <boost/assign/list_of.hpp>
  56
  57#include "OSGConfig.h"
  58
  59
  60#include "OSGGL.h"                        // DataType default header
  61
  62#include "OSGFieldContainer.h"          // Parents Class
  63
  64#include "OSGImageBase.h"
  65#include "OSGImage.h"
  66
  67#include <boost/bind.hpp>
  68
  69#ifdef WIN32 // turn off 'this' : used in base member initializer list warning
  70#pragma warning(disable:4355)
  71#endif
  72
  73OSG_BEGIN_NAMESPACE
  74
  75/***************************************************************************\
  76 *                            Description                                  *
  77\***************************************************************************/
  78
  79/*! \class OSG::Image
  80    1D/2D/3D Image with various pixel types data, optionally also can hold
  81    mipMap and simple multi-frame data.
  82 */
  83
  84/***************************************************************************\
  85 *                        Field Documentation                              *
  86\***************************************************************************/
  87
  88/*! \var ParentFieldContainer * ImageBase::_mfParents
  89    
  90*/
  91
  92/*! \var Int32           ImageBase::_sfDimension
  93    Image dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.
  94*/
  95
  96/*! \var Int32           ImageBase::_sfWidth
  97    
  98*/
  99
 100/*! \var Int32           ImageBase::_sfHeight
 101    
 102*/
 103
 104/*! \var Int32           ImageBase::_sfDepth
 105    
 106*/
 107
 108/*! \var Int32           ImageBase::_sfBpp
 109    
 110*/
 111
 112/*! \var Int32           ImageBase::_sfMipMapCount
 113    
 114*/
 115
 116/*! \var Int32           ImageBase::_sfFrameCount
 117    
 118*/
 119
 120/*! \var Time            ImageBase::_sfFrameDelay
 121    
 122*/
 123
 124/*! \var UInt32          ImageBase::_sfPixelFormat
 125    
 126*/
 127
 128/*! \var UInt8           ImageBase::_mfPixel
 129    
 130*/
 131
 132/*! \var Int32           ImageBase::_sfFrameSize
 133    
 134*/
 135
 136/*! \var std::string     ImageBase::_sfName
 137    Texture file path.
 138*/
 139
 140/*! \var Int32           ImageBase::_sfDataType
 141    Type of image data.
 142*/
 143
 144/*! \var Int32           ImageBase::_sfComponentSize
 145    Size (in byte) of a single component of the image. Necessary
 146    for High Dynamic Range and other higher-level image types.
 147*/
 148
 149/*! \var Int32           ImageBase::_sfSideCount
 150    
 151*/
 152
 153/*! \var Int32           ImageBase::_sfSideSize
 154    
 155*/
 156
 157/*! \var bool            ImageBase::_sfForceCompressedData
 158    Set to true if using the image to keep unknown data for textures.
 159    Generally used in conjunction with TextureChunk::externalFormat.
 160*/
 161
 162/*! \var bool            ImageBase::_sfForceAlphaChannel
 163    Set to true if using the image to keep unknown data for textures.
 164    Generally used in conjunction with TextureChunk::externalFormat.
 165*/
 166
 167/*! \var bool            ImageBase::_sfForceColorChannel
 168    Set to true if using the image to keep unknown data for textures.
 169    Generally used in conjunction with TextureChunk::externalFormat.
 170*/
 171
 172/*! \var bool            ImageBase::_sfForceAlphaBinary
 173    Set to true if using the image to prevent depth sorting for 
 174    SimpleTexturedMaterials using this Image.
 175*/
 176
 177
 178/***************************************************************************\
 179 *                      FieldType/FieldTrait Instantiation                 *
 180\***************************************************************************/
 181
 182#if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
 183DataType FieldTraits<Image *>::_type("ImagePtr", "AttachmentContainerPtr");
 184#endif
 185
 186OSG_FIELDTRAITS_GETTYPE(Image *)
 187
 188OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
 189                           Image *,
 190                           0);
 191
 192OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
 193                           Image *,
 194                           0);
 195
 196/***************************************************************************\
 197 *                         Field Description                               *
 198\***************************************************************************/
 199
 200void ImageBase::classDescInserter(TypeObject &oType)
 201{
 202    FieldDescriptionBase *pDesc = NULL;
 203
 204
 205    pDesc = new MFUnrecParentFieldContainerPtr::Description(
 206        MFUnrecParentFieldContainerPtr::getClassType(),
 207        "parents",
 208        "",
 209        ParentsFieldId, ParentsFieldMask,
 210        false,
 211        (Field::MFDefaultFlags | Field::FStdAccess),
 212        static_cast     <FieldEditMethodSig>(&Image::invalidEditField),
 213        static_cast     <FieldGetMethodSig >(&Image::invalidGetField));
 214
 215    oType.addInitialDesc(pDesc);
 216
 217    pDesc = new SFInt32::Description(
 218        SFInt32::getClassType(),
 219        "dimension",
 220        "Image dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.\n",
 221        DimensionFieldId, DimensionFieldMask,
 222        false,
 223        (Field::SFDefaultFlags | Field::FStdAccess),
 224        static_cast<FieldEditMethodSig>(&Image::editHandleDimension),
 225        static_cast<FieldGetMethodSig >(&Image::getHandleDimension));
 226
 227    oType.addInitialDesc(pDesc);
 228
 229    pDesc = new SFInt32::Description(
 230        SFInt32::getClassType(),
 231        "width",
 232        "",
 233        WidthFieldId, WidthFieldMask,
 234        false,
 235        (Field::SFDefaultFlags | Field::FStdAccess),
 236        static_cast<FieldEditMethodSig>(&Image::editHandleWidth),
 237        static_cast<FieldGetMethodSig >(&Image::getHandleWidth));
 238
 239    oType.addInitialDesc(pDesc);
 240
 241    pDesc = new SFInt32::Description(
 242        SFInt32::getClassType(),
 243        "height",
 244        "",
 245        HeightFieldId, HeightFieldMask,
 246        false,
 247        (Field::SFDefaultFlags | Field::FStdAccess),
 248        static_cast<FieldEditMethodSig>(&Image::editHandleHeight),
 249        static_cast<FieldGetMethodSig >(&Image::getHandleHeight));
 250
 251    oType.addInitialDesc(pDesc);
 252
 253    pDesc = new SFInt32::Description(
 254        SFInt32::getClassType(),
 255        "depth",
 256        "",
 257        DepthFieldId, DepthFieldMask,
 258        false,
 259        (Field::SFDefaultFlags | Field::FStdAccess),
 260        static_cast<FieldEditMethodSig>(&Image::editHandleDepth),
 261        static_cast<FieldGetMethodSig >(&Image::getHandleDepth));
 262
 263    oType.addInitialDesc(pDesc);
 264
 265    pDesc = new SFInt32::Description(
 266        SFInt32::getClassType(),
 267        "bpp",
 268        "",
 269        BppFieldId, BppFieldMask,
 270        false,
 271        (Field::SFDefaultFlags | Field::FStdAccess),
 272        static_cast<FieldEditMethodSig>(&Image::editHandleBpp),
 273        static_cast<FieldGetMethodSig >(&Image::getHandleBpp));
 274
 275    oType.addInitialDesc(pDesc);
 276
 277    pDesc = new SFInt32::Description(
 278        SFInt32::getClassType(),
 279        "mipMapCount",
 280        "",
 281        MipMapCountFieldId, MipMapCountFieldMask,
 282        false,
 283        (Field::SFDefaultFlags | Field::FStdAccess),
 284        static_cast<FieldEditMethodSig>(&Image::editHandleMipMapCount),
 285        static_cast<FieldGetMethodSig >(&Image::getHandleMipMapCount));
 286
 287    oType.addInitialDesc(pDesc);
 288
 289    pDesc = new SFInt32::Description(
 290        SFInt32::getClassType(),
 291        "frameCount",
 292        "",
 293        FrameCountFieldId, FrameCountFieldMask,
 294        false,
 295        (Field::SFDefaultFlags | Field::FStdAccess),
 296        static_cast<FieldEditMethodSig>(&Image::editHandleFrameCount),
 297        static_cast<FieldGetMethodSig >(&Image::getHandleFrameCount));
 298
 299    oType.addInitialDesc(pDesc);
 300
 301    pDesc = new SFTime::Description(
 302        SFTime::getClassType(),
 303        "frameDelay",
 304        "",
 305        FrameDelayFieldId, FrameDelayFieldMask,
 306        false,
 307        (Field::SFDefaultFlags | Field::FStdAccess),
 308        static_cast<FieldEditMethodSig>(&Image::editHandleFrameDelay),
 309        static_cast<FieldGetMethodSig >(&Image::getHandleFrameDelay));
 310
 311    oType.addInitialDesc(pDesc);
 312
 313    pDesc = new SFUInt32::Description(
 314        SFUInt32::getClassType(),
 315        "pixelFormat",
 316        "",
 317        PixelFormatFieldId, PixelFormatFieldMask,
 318        false,
 319        (Field::SFDefaultFlags | Field::FStdAccess),
 320        static_cast<FieldEditMethodSig>(&Image::editHandlePixelFormat),
 321        static_cast<FieldGetMethodSig >(&Image::getHandlePixelFormat));
 322
 323    oType.addInitialDesc(pDesc);
 324
 325    pDesc = new MFUInt8::Description(
 326        MFUInt8::getClassType(),
 327        "pixel",
 328        "",
 329        PixelFieldId, PixelFieldMask,
 330        false,
 331        (Field::MFDefaultFlags | Field::FStdAccess),
 332        static_cast<FieldEditMethodSig>(&Image::editHandlePixel),
 333        static_cast<FieldGetMethodSig >(&Image::getHandlePixel));
 334
 335    oType.addInitialDesc(pDesc);
 336
 337    pDesc = new SFInt32::Description(
 338        SFInt32::getClassType(),
 339        "frameSize",
 340        "",
 341        FrameSizeFieldId, FrameSizeFieldMask,
 342        true,
 343        (Field::SFDefaultFlags | Field::FStdAccess),
 344        static_cast<FieldEditMethodSig>(&Image::editHandleFrameSize),
 345        static_cast<FieldGetMethodSig >(&Image::getHandleFrameSize));
 346
 347    oType.addInitialDesc(pDesc);
 348
 349    pDesc = new SFString::Description(
 350        SFString::getClassType(),
 351        "name",
 352        "Texture file path.\n",
 353        NameFieldId, NameFieldMask,
 354        false,
 355        (Field::SFDefaultFlags | Field::FStdAccess),
 356        static_cast<FieldEditMethodSig>(&Image::editHandleName),
 357        static_cast<FieldGetMethodSig >(&Image::getHandleName));
 358
 359    oType.addInitialDesc(pDesc);
 360
 361    pDesc = new SFInt32::Description(
 362        SFInt32::getClassType(),
 363        "dataType",
 364        "Type of image data.\n",
 365        DataTypeFieldId, DataTypeFieldMask,
 366        false,
 367        (Field::SFDefaultFlags | Field::FStdAccess),
 368        static_cast<FieldEditMethodSig>(&Image::editHandleDataType),
 369        static_cast<FieldGetMethodSig >(&Image::getHandleDataType));
 370
 371    oType.addInitialDesc(pDesc);
 372
 373    pDesc = new SFInt32::Description(
 374        SFInt32::getClassType(),
 375        "componentSize",
 376        "Size (in byte) of a single component of the image. Necessary\n"
 377        "for High Dynamic Range and other higher-level image types.\n",
 378        ComponentSizeFieldId, ComponentSizeFieldMask,
 379        true,
 380        (Field::SFDefaultFlags | Field::FStdAccess),
 381        static_cast<FieldEditMethodSig>(&Image::editHandleComponentSize),
 382        static_cast<FieldGetMethodSig >(&Image::getHandleComponentSize));
 383
 384    oType.addInitialDesc(pDesc);
 385
 386    pDesc = new SFInt32::Description(
 387        SFInt32::getClassType(),
 388        "sideCount",
 389        "",
 390        SideCountFieldId, SideCountFieldMask,
 391        false,
 392        (Field::SFDefaultFlags | Field::FStdAccess),
 393        static_cast<FieldEditMethodSig>(&Image::editHandleSideCount),
 394        static_cast<FieldGetMethodSig >(&Image::getHandleSideCount));
 395
 396    oType.addInitialDesc(pDesc);
 397
 398    pDesc = new SFInt32::Description(
 399        SFInt32::getClassType(),
 400        "sideSize",
 401        "",
 402        SideSizeFieldId, SideSizeFieldMask,
 403        true,
 404        (Field::SFDefaultFlags | Field::FStdAccess),
 405        static_cast<FieldEditMethodSig>(&Image::editHandleSideSize),
 406        static_cast<FieldGetMethodSig >(&Image::getHandleSideSize));
 407
 408    oType.addInitialDesc(pDesc);
 409
 410    pDesc = new SFBool::Description(
 411        SFBool::getClassType(),
 412        "forceCompressedData",
 413        "Set to true if using the image to keep unknown data for textures.\n"
 414        "Generally used in conjunction with TextureChunk::externalFormat.\n",
 415        ForceCompressedDataFieldId, ForceCompressedDataFieldMask,
 416        false,
 417        (Field::SFDefaultFlags | Field::FStdAccess),
 418        static_cast<FieldEditMethodSig>(&Image::editHandleForceCompressedData),
 419        static_cast<FieldGetMethodSig >(&Image::getHandleForceCompressedData));
 420
 421    oType.addInitialDesc(pDesc);
 422
 423    pDesc = new SFBool::Description(
 424        SFBool::getClassType(),
 425        "forceAlphaChannel",
 426        "Set to true if using the image to keep unknown data for textures.\n"
 427        "Generally used in conjunction with TextureChunk::externalFormat.\n",
 428        ForceAlphaChannelFieldId, ForceAlphaChannelFieldMask,
 429        false,
 430        (Field::SFDefaultFlags | Field::FStdAccess),
 431        static_cast<FieldEditMethodSig>(&Image::editHandleForceAlphaChannel),
 432        static_cast<FieldGetMethodSig >(&Image::getHandleForceAlphaChannel));
 433
 434    oType.addInitialDesc(pDesc);
 435
 436    pDesc = new SFBool::Description(
 437        SFBool::getClassType(),
 438        "forceColorChannel",
 439        "Set to true if using the image to keep unknown data for textures.\n"
 440        "Generally used in conjunction with TextureChunk::externalFormat.\n",
 441        ForceColorChannelFieldId, ForceColorChannelFieldMask,
 442        false,
 443        (Field::SFDefaultFlags | Field::FStdAccess),
 444        static_cast<FieldEditMethodSig>(&Image::editHandleForceColorChannel),
 445        static_cast<FieldGetMethodSig >(&Image::getHandleForceColorChannel));
 446
 447    oType.addInitialDesc(pDesc);
 448
 449    pDesc = new SFBool::Description(
 450        SFBool::getClassType(),
 451        "forceAlphaBinary",
 452        "Set to true if using the image to prevent depth sorting for \n"
 453        "SimpleTexturedMaterials using this Image.\n",
 454        ForceAlphaBinaryFieldId, ForceAlphaBinaryFieldMask,
 455        false,
 456        (Field::SFDefaultFlags | Field::FStdAccess),
 457        static_cast<FieldEditMethodSig>(&Image::editHandleForceAlphaBinary),
 458        static_cast<FieldGetMethodSig >(&Image::getHandleForceAlphaBinary));
 459
 460    oType.addInitialDesc(pDesc);
 461}
 462
 463
 464ImageBase::TypeObject ImageBase::_type(
 465    ImageBase::getClassname(),
 466    Inherited::getClassname(),
 467    "NULL",
 468    0,
 469    reinterpret_cast<PrototypeCreateF>(&ImageBase::createEmptyLocal),
 470    Image::initMethod,
 471    Image::exitMethod,
 472    reinterpret_cast<InitalInsertDescFunc>(&Image::classDescInserter),
 473    false,
 474    (ComponentSizeFieldMask | SideSizeFieldMask | FrameSizeFieldMask),
 475    "<?xml version=\"1.0\"?>\n"
 476    "\n"
 477    "<FieldContainer\n"
 478    "\tname=\"Image\"\n"
 479    "\tparent=\"AttachmentContainer\"\n"
 480    "\tlibrary=\"System\"\n"
 481    "\tpointerfieldtypes=\"both\"\n"
 482    "\tstructure=\"concrete\"\n"
 483    "\tsystemcomponent=\"true\"\n"
 484    "\tparentsystemcomponent=\"true\"\n"
 485    "\tdecoratable=\"false\"\n"
 486    "\tuseLocalIncludes=\"false\"\n"
 487    "    fieldsUnmarkedOnCreate=\"(ComponentSizeFieldMask | SideSizeFieldMask | FrameSizeFieldMask)\"\n"
 488    ">\n"
 489    "1D/2D/3D Image with various pixel types data, optionally also can hold\n"
 490    "mipMap and simple multi-frame data.\n"
 491    "\t<Field\n"
 492    "\t\tname=\"parents\"\n"
 493    "\t\ttype=\"ParentFieldContainerPtr\"\n"
 494    "\t\tcardinality=\"multi\"\n"
 495    "\t\tvisibility=\"external\"\n"
 496    "\t\taccess=\"none\"\n"
 497    "\t>\n"
 498    "\t</Field>\n"
 499    "\t<Field\n"
 500    "\t\tname=\"dimension\"\n"
 501    "\t\ttype=\"Int32\"\n"
 502    "\t\tcardinality=\"single\"\n"
 503    "\t\tvisibility=\"external\"\n"
 504    "\t\tdefaultValue=\"0\"\n"
 505    "\t\taccess=\"public\"\n"
 506    "\t>\n"
 507    "\tImage dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.\n"
 508    "\t</Field>\n"
 509    "\t<Field\n"
 510    "\t\tname=\"width\"\n"
 511    "\t\ttype=\"Int32\"\n"
 512    "\t\tcardinality=\"single\"\n"
 513    "\t\tvisibility=\"external\"\n"
 514    "\t\tdefaultValue=\"0\"\n"
 515    "\t\taccess=\"public\"\n"
 516    "\t>\n"
 517    "\t</Field>\n"
 518    "\t<Field\n"
 519    "\t\tname=\"height\"\n"
 520    "\t\ttype=\"Int32\"\n"
 521    "\t\tcardinality=\"single\"\n"
 522    "\t\tvisibility=\"external\"\n"
 523    "\t\tdefaultValue=\"1\"\n"
 524    "\t\taccess=\"public\"\n"
 525    "\t>\n"
 526    "\t</Field>\n"
 527    "\t<Field\n"
 528    "\t\tname=\"depth\"\n"
 529    "\t\ttype=\"Int32\"\n"
 530    "\t\tcardinality=\"single\"\n"
 531    "\t\tvisibility=\"external\"\n"
 532    "\t\tdefaultValue=\"1\"\n"
 533    "\t\taccess=\"public\"\n"
 534    "\t>\n"
 535    "\t</Field>\n"
 536    "\t<Field\n"
 537    "\t\tname=\"bpp\"\n"
 538    "\t\ttype=\"Int32\"\n"
 539    "\t\tcardinality=\"single\"\n"
 540    "\t\tvisibility=\"external\"\n"
 541    "\t\tdefaultValue=\"1\"\n"
 542    "\t\taccess=\"public\"\n"
 543    "\t>\n"
 544    "\t</Field>\n"
 545    "\t<Field\n"
 546    "\t\tname=\"mipMapCount\"\n"
 547    "\t\ttype=\"Int32\"\n"
 548    "\t\tcardinality=\"single\"\n"
 549    "\t\tvisibility=\"external\"\n"
 550    "\t\tdefaultValue=\"1\"\n"
 551    "\t\taccess=\"public\"\n"
 552    "\t>\n"
 553    "\t</Field>\n"
 554    "\t<Field\n"
 555    "\t\tname=\"frameCount\"\n"
 556    "\t\ttype=\"Int32\"\n"
 557    "\t\tcardinality=\"single\"\n"
 558    "\t\tvisibility=\"external\"\n"
 559    "\t\tdefaultValue=\"1\"\n"
 560    "\t\taccess=\"public\"\n"
 561    "\t>\n"
 562    "\t</Field>\n"
 563    "\t<Field\n"
 564    "\t\tname=\"frameDelay\"\n"
 565    "\t\ttype=\"Time\"\n"
 566    "\t\tcardinality=\"single\"\n"
 567    "\t\tvisibility=\"external\"\n"
 568    "\t\tdefaultValue=\"0\"\n"
 569    "\t\taccess=\"public\"\n"
 570    "\t>\n"
 571    "\t</Field>\n"
 572    "\t<Field\n"
 573    "\t\tname=\"pixelFormat\"\n"
 574    "\t\ttype=\"UInt32\"\n"
 575    "\t\tcardinality=\"single\"\n"
 576    "\t\tvisibility=\"external\"\n"
 577    "\t\tdefaultValue=\"Image::OSG_INVALID_PF\"\n"
 578    "\t\taccess=\"public\"\n"
 579    "\t>\n"
 580    "\t</Field>\n"
 581    "\t<Field\n"
 582    "\t\tname=\"pixel\"\n"
 583    "\t\ttype=\"UInt8\"\n"
 584    "\t\tcardinality=\"multi\"\n"
 585    "\t\tvisibility=\"external\"\n"
 586    "\t\taccess=\"public\"\n"
 587    "\t>\n"
 588    "\t</Field>\n"
 589    "\t<Field\n"
 590    "\t\tname=\"frameSize\"\n"
 591    "\t\ttype=\"Int32\"\n"
 592    "\t\tcardinality=\"single\"\n"
 593    "\t\tvisibility=\"internal\"\n"
 594    "\t\tdefaultValue=\"0\"\n"
 595    "\t\taccess=\"public\"\n"
 596    "\t>\n"
 597    "\t</Field>\n"
 598    "\t<Field\n"
 599    "\t\tname=\"name\"\n"
 600    "\t\ttype=\"std::string\"\n"
 601    "\t\tcardinality=\"single\"\n"
 602    "\t\tvisibility=\"external\"\n"
 603    "\t\taccess=\"public\"\n"
 604    "\t>\n"
 605    "\tTexture file path.\n"
 606    "\t</Field>\n"
 607    "\t<Field\n"
 608    "\t\tname=\"dataType\"\n"
 609    "\t\ttype=\"Int32\"\n"
 610    "\t\tcardinality=\"single\"\n"
 611    "\t\tvisibility=\"external\"\n"
 612    "\t\tdefaultValue=\"GL_UNSIGNED_BYTE\"\n"
 613    "\t\tdefaultHeader=\"&quot;OSGGL.h&quot;\"\n"
 614    "\t\taccess=\"public\"\n"
 615    "\t>\n"
 616    "\tType of image data.\n"
 617    "\t</Field>\n"
 618    "\t<Field\n"
 619    "\t\tname=\"componentSize\"\n"
 620    "\t\ttype=\"Int32\"\n"
 621    "\t\tcardinality=\"single\"\n"
 622    "\t\tvisibility=\"internal\"\n"
 623    "\t\tdefaultValue=\"1\"\n"
 624    "\t\taccess=\"protected\"\n"
 625    "\t>\n"
 626    "\tSize (in byte) of a single component of the image. Necessary\n"
 627    "        for High Dynamic Range and other higher-level image types.\n"
 628    "\t</Field>\n"
 629    "\t<Field\n"
 630    "\t\tname=\"sideCount\"\n"
 631    "\t\ttype=\"Int32\"\n"
 632    "\t\tcardinality=\"single\"\n"
 633    "\t\tvisibility=\"external\"\n"
 634    "\t\tdefaultValue=\"1\"\n"
 635    "\t\taccess=\"public\"\n"
 636    "\t>\n"
 637    "\t</Field>\n"
 638    "\t<Field\n"
 639    "\t\tname=\"sideSize\"\n"
 640    "\t\ttype=\"Int32\"\n"
 641    "\t\tcardinality=\"single\"\n"
 642    "\t\tvisibility=\"internal\"\n"
 643    "\t\tdefaultValue=\"0\"\n"
 644    "\t\taccess=\"public\"\n"
 645    "\t>\n"
 646    "\t</Field>\n"
 647    "\t<Field\n"
 648    "\t\tname=\"forceCompressedData\"\n"
 649    "\t\ttype=\"bool\"\n"
 650    "\t\tcardinality=\"single\"\n"
 651    "\t\tvisibility=\"external\"\n"
 652    "\t\tdefaultValue=\"false\"\n"
 653    "\t\taccess=\"public\"\n"
 654    "\t>\n"
 655    "        Set to true if using the image to keep unknown data for textures.\n"
 656    "        Generally used in conjunction with TextureChunk::externalFormat.\n"
 657    "\t</Field>\n"
 658    "\t<Field\n"
 659    "\t\tname=\"forceAlphaChannel\"\n"
 660    "\t\ttype=\"bool\"\n"
 661    "\t\tcardinality=\"single\"\n"
 662    "\t\tvisibility=\"external\"\n"
 663    "\t\tdefaultValue=\"false\"\n"
 664    "\t\taccess=\"public\"\n"
 665    "\t>\n"
 666    "        Set to true if using the image to keep unknown data for textures.\n"
 667    "        Generally used in conjunction with TextureChunk::externalFormat.\n"
 668    "\t</Field>\n"
 669    "\t<Field\n"
 670    "\t\tname=\"forceColorChannel\"\n"
 671    "\t\ttype=\"bool\"\n"
 672    "\t\tcardinality=\"single\"\n"
 673    "\t\tvisibility=\"external\"\n"
 674    "\t\tdefaultValue=\"false\"\n"
 675    "\t\taccess=\"public\"\n"
 676    "\t>\n"
 677    "        Set to true if using the image to keep unknown data for textures.\n"
 678    "        Generally used in conjunction with TextureChunk::externalFormat.\n"
 679    "\t</Field>\n"
 680    "\t<Field\n"
 681    "\t\tname=\"forceAlphaBinary\"\n"
 682    "\t\ttype=\"bool\"\n"
 683    "\t\tcardinality=\"single\"\n"
 684    "\t\tvisibility=\"external\"\n"
 685    "\t\tdefaultValue=\"false\"\n"
 686    "\t\taccess=\"public\"\n"
 687    "\t>\n"
 688    "        Set to true if using the image to prevent depth sorting for \n"
 689    "        SimpleTexturedMaterials using this Image.\n"
 690    "\t</Field>\n"
 691    "</FieldContainer>\n",
 692    "1D/2D/3D Image with various pixel types data, optionally also can hold\n"
 693    "mipMap and simple multi-frame data.\n"
 694    );
 695
 696/*------------------------------ get -----------------------------------*/
 697
 698FieldContainerType &ImageBase::getType(void)
 699{
 700    return _type;
 701}
 702
 703const FieldContainerType &ImageBase::getType(void) const
 704{
 705    return _type;
 706}
 707
 708UInt32 ImageBase::getContainerSize(void) const
 709{
 710    return sizeof(Image);
 711}
 712
 713/*------------------------- decorator get ------------------------------*/
 714
 715
 716
 717SFInt32 *ImageBase::editSFDimension(void)
 718{
 719    editSField(DimensionFieldMask);
 720
 721    return &_sfDimension;
 722}
 723
 724const SFInt32 *ImageBase::getSFDimension(void) const
 725{
 726    return &_sfDimension;
 727}
 728
 729
 730SFInt32 *ImageBase::editSFWidth(void)
 731{
 732    editSField(WidthFieldMask);
 733
 734    return &_sfWidth;
 735}
 736
 737const SFInt32 *ImageBase::getSFWidth(void) const
 738{
 739    return &_sfWidth;
 740}
 741
 742
 743SFInt32 *ImageBase::editSFHeight(void)
 744{
 745    editSField(HeightFieldMask);
 746
 747    return &_sfHeight;
 748}
 749
 750const SFInt32 *ImageBase::getSFHeight(void) const
 751{
 752    return &_sfHeight;
 753}
 754
 755
 756SFInt32 *ImageBase::editSFDepth(void)
 757{
 758    editSField(DepthFieldMask);
 759
 760    return &_sfDepth;
 761}
 762
 763const SFInt32 *ImageBase::getSFDepth(void) const
 764{
 765    return &_sfDepth;
 766}
 767
 768
 769SFInt32 *ImageBase::editSFBpp(void)
 770{
 771    editSField(BppFieldMask);
 772
 773    return &_sfBpp;
 774}
 775
 776const SFInt32 *ImageBase::getSFBpp(void) const
 777{
 778    return &_sfBpp;
 779}
 780
 781
 782SFInt32 *ImageBase::editSFMipMapCount(void)
 783{
 784    editSField(MipMapCountFieldMask);
 785
 786    return &_sfMipMapCount;
 787}
 788
 789const SFInt32 *ImageBase::getSFMipMapCount(void) const
 790{
 791    return &_sfMipMapCount;
 792}
 793
 794
 795SFInt32 *ImageBase::editSFFrameCount(void)
 796{
 797    editSField(FrameCountFieldMask);
 798
 799    return &_sfFrameCount;
 800}
 801
 802const SFInt32 *ImageBase::getSFFrameCount(void) const
 803{
 804    return &_sfFrameCount;
 805}
 806
 807
 808SFTime *ImageBase::editSFFrameDelay(void)
 809{
 810    editSField(FrameDelayFieldMask);
 811
 812    return &_sfFrameDelay;
 813}
 814
 815const SFTime *ImageBase::getSFFrameDelay(void) const
 816{
 817    return &_sfFrameDelay;
 818}
 819
 820
 821SFUInt32 *ImageBase::editSFPixelFormat(void)
 822{
 823    editSField(PixelFormatFieldMask);
 824
 825    return &_sfPixelFormat;
 826}
 827
 828const SFUInt32 *ImageBase::getSFPixelFormat(void) const
 829{
 830    return &_sfPixelFormat;
 831}
 832
 833
 834MFUInt8 *ImageBase::editMFPixel(void)
 835{
 836    editMField(PixelFieldMask, _mfPixel);
 837
 838    return &_mfPixel;
 839}
 840
 841const MFUInt8 *ImageBase::getMFPixel(void) const
 842{
 843    return &_mfPixel;
 844}
 845
 846
 847SFInt32 *ImageBase::editSFFrameSize(void)
 848{
 849    editSField(FrameSizeFieldMask);
 850
 851    return &_sfFrameSize;
 852}
 853
 854const SFInt32 *ImageBase::getSFFrameSize(void) const
 855{
 856    return &_sfFrameSize;
 857}
 858
 859
 860SFString *ImageBase::editSFName(void)
 861{
 862    editSField(NameFieldMask);
 863
 864    return &_sfName;
 865}
 866
 867const SFString *ImageBase::getSFName(void) const
 868{
 869    return &_sfName;
 870}
 871
 872
 873SFInt32 *ImageBase::editSFDataType(void)
 874{
 875    editSField(DataTypeFieldMask);
 876
 877    return &_sfDataType;
 878}
 879
 880const SFInt32 *ImageBase::getSFDataType(void) const
 881{
 882    return &_sfDataType;
 883}
 884
 885
 886SFInt32 *ImageBase::editSFComponentSize(void)
 887{
 888    editSField(ComponentSizeFieldMask);
 889
 890    return &_sfComponentSize;
 891}
 892
 893const SFInt32 *ImageBase::getSFComponentSize(void) const
 894{
 895    return &_sfComponentSize;
 896}
 897
 898
 899SFInt32 *ImageBase::editSFSideCount(void)
 900{
 901    editSField(SideCountFieldMask);
 902
 903    return &_sfSideCount;
 904}
 905
 906const SFInt32 *ImageBase::getSFSideCount(void) const
 907{
 908    return &_sfSideCount;
 909}
 910
 911
 912SFInt32 *ImageBase::editSFSideSize(void)
 913{
 914    editSField(SideSizeFieldMask);
 915
 916    return &_sfSideSize;
 917}
 918
 919const SFInt32 *ImageBase::getSFSideSize(void) const
 920{
 921    return &_sfSideSize;
 922}
 923
 924
 925SFBool *ImageBase::editSFForceCompressedData(void)
 926{
 927    editSField(ForceCompressedDataFieldMask);
 928
 929    return &_sfForceCompressedData;
 930}
 931
 932const SFBool *ImageBase::getSFForceCompressedData(void) const
 933{
 934    return &_sfForceCompressedData;
 935}
 936
 937
 938SFBool *ImageBase::editSFForceAlphaChannel(void)
 939{
 940    editSField(ForceAlphaChannelFieldMask);
 941
 942    return &_sfForceAlphaChannel;
 943}
 944
 945const SFBool *ImageBase::getSFForceAlphaChannel(void) const
 946{
 947    return &_sfForceAlphaChannel;
 948}
 949
 950
 951SFBool *ImageBase::editSFForceColorChannel(void)
 952{
 953    editSField(ForceColorChannelFieldMask);
 954
 955    return &_sfForceColorChannel;
 956}
 957
 958const SFBool *ImageBase::getSFForceColorChannel(void) const
 959{
 960    return &_sfForceColorChannel;
 961}
 962
 963
 964SFBool *ImageBase::editSFForceAlphaBinary(void)
 965{
 966    editSField(ForceAlphaBinaryFieldMask);
 967
 968    return &_sfForceAlphaBinary;
 969}
 970
 971const SFBool *ImageBase::getSFForceAlphaBinary(void) const
 972{
 973    return &_sfForceAlphaBinary;
 974}
 975
 976
 977
 978
 979
 980
 981/*------------------------------ access -----------------------------------*/
 982
 983UInt32 ImageBase::getBinSize(ConstFieldMaskArg whichField)
 984{
 985    UInt32 returnValue = Inherited::getBinSize(whichField);
 986
 987    if(FieldBits::NoField != (ParentsFieldMask & whichField))
 988    {
 989        returnValue += _mfParents.getBinSize();
 990    }
 991    if(FieldBits::NoField != (DimensionFieldMask & whichField))
 992    {
 993        returnValue += _sfDimension.getBinSize();
 994    }
 995    if(FieldBits::NoField != (WidthFieldMask & whichField))
 996    {
 997        returnValue += _sfWidth.getBinSize();
 998    }
 999    if(FieldBits::NoField != (HeightFieldMask & whichField))
1000    {
1001        returnValue += _sfHeight.getBinSize();
1002    }
1003    if(FieldBits::NoField != (DepthFieldMask & whichField))
1004    {
1005        returnValue += _sfDepth.getBinSize();
1006    }
1007    if(FieldBits::NoField != (BppFieldMask & whichField))
1008    {
1009        returnValue += _sfBpp.getBinSize();
1010    }
1011    if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1012    {
1013        returnValue += _sfMipMapCount.getBinSize();
1014    }
1015    if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1016    {
1017        returnValue += _sfFrameCount.getBinSize();
1018    }
1019    if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1020    {
1021        returnValue += _sfFrameDelay.getBinSize();
1022    }
1023    if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1024    {
1025        returnValue += _sfPixelFormat.getBinSize();
1026    }
1027    if(FieldBits::NoField != (PixelFieldMask & whichField))
1028    {
1029        returnValue += _mfPixel.getBinSize();
1030    }
1031    if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1032    {
1033        returnValue += _sfFrameSize.getBinSize();
1034    }
1035    if(FieldBits::NoField != (NameFieldMask & whichField))
1036    {
1037        returnValue += _sfName.getBinSize();
1038    }
1039    if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1040    {
1041        returnValue += _sfDataType.getBinSize();
1042    }
1043    if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1044    {
1045        returnValue += _sfComponentSize.getBinSize();
1046    }
1047    if(FieldBits::NoField != (SideCountFieldMask & whichField))
1048    {
1049        returnValue += _sfSideCount.getBinSize();
1050    }
1051    if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1052    {
1053        returnValue += _sfSideSize.getBinSize();
1054    }
1055    if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1056    {
1057        returnValue += _sfForceCompressedData.getBinSize();
1058    }
1059    if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1060    {
1061        returnValue += _sfForceAlphaChannel.getBinSize();
1062    }
1063    if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1064    {
1065        returnValue += _sfForceColorChannel.getBinSize();
1066    }
1067    if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1068    {
1069        returnValue += _sfForceAlphaBinary.getBinSize();
1070    }
1071
1072    return returnValue;
1073}
1074
1075void ImageBase::copyToBin(BinaryDataHandler &pMem,
1076                                  ConstFieldMaskArg  whichField)
1077{
1078    Inherited::copyToBin(pMem, whichField);
1079
1080    if(FieldBits::NoField != (ParentsFieldMask & whichField))
1081    {
1082        _mfParents.copyToBin(pMem);
1083    }
1084    if(FieldBits::NoField != (DimensionFieldMask & whichField))
1085    {
1086        _sfDimension.copyToBin(pMem);
1087    }
1088    if(FieldBits::NoField != (WidthFieldMask & whichField))
1089    {
1090        _sfWidth.copyToBin(pMem);
1091    }
1092    if(FieldBits::NoField != (HeightFieldMask & whichField))
1093    {
1094        _sfHeight.copyToBin(pMem);
1095    }
1096    if(FieldBits::NoField != (DepthFieldMask & whichField))
1097    {
1098        _sfDepth.copyToBin(pMem);
1099    }
1100    if(FieldBits::NoField != (BppFieldMask & whichField))
1101    {
1102        _sfBpp.copyToBin(pMem);
1103    }
1104    if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1105    {
1106        _sfMipMapCount.copyToBin(pMem);
1107    }
1108    if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1109    {
1110        _sfFrameCount.copyToBin(pMem);
1111    }
1112    if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1113    {
1114        _sfFrameDelay.copyToBin(pMem);
1115    }
1116    if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1117    {
1118        _sfPixelFormat.copyToBin(pMem);
1119    }
1120    if(FieldBits::NoField != (PixelFieldMask & whichField))
1121    {
1122        _mfPixel.copyToBin(pMem);
1123    }
1124    if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1125    {
1126        _sfFrameSize.copyToBin(pMem);
1127    }
1128    if(FieldBits::NoField != (NameFieldMask & whichField))
1129    {
1130        _sfName.copyToBin(pMem);
1131    }
1132    if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1133    {
1134        _sfDataType.copyToBin(pMem);
1135    }
1136    if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1137    {
1138        _sfComponentSize.copyToBin(pMem);
1139    }
1140    if(FieldBits::NoField != (SideCountFieldMask & whichField))
1141    {
1142        _sfSideCount.copyToBin(pMem);
1143    }
1144    if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1145    {
1146        _sfSideSize.copyToBin(pMem);
1147    }
1148    if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1149    {
1150        _sfForceCompressedData.copyToBin(pMem);
1151    }
1152    if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1153    {
1154        _sfForceAlphaChannel.copyToBin(pMem);
1155    }
1156    if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1157    {
1158        _sfForceColorChannel.copyToBin(pMem);
1159    }
1160    if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1161    {
1162        _sfForceAlphaBinary.copyToBin(pMem);
1163    }
1164}
1165
1166void ImageBase::copyFromBin(BinaryDataHandler &pMem,
1167                                    ConstFieldMaskArg  whichField)
1168{
1169    Inherited::copyFromBin(pMem, whichField);
1170
1171    if(FieldBits::NoField != (ParentsFieldMask & whichField))
1172    {
1173        _mfParents.copyFromBin(pMem);
1174    }
1175    if(FieldBits::NoField != (DimensionFieldMask & whichField))
1176    {
1177        _sfDimension.copyFromBin(pMem);
1178    }
1179    if(FieldBits::NoField != (WidthFieldMask & whichField))
1180    {
1181        _sfWidth.copyFromBin(pMem);
1182    }
1183    if(FieldBits::NoField != (HeightFieldMask & whichField))
1184    {
1185        _sfHeight.copyFromBin(pMem);
1186    }
1187    if(FieldBits::NoField != (DepthFieldMask & whichField))
1188    {
1189        _sfDepth.copyFromBin(pMem);
1190    }
1191    if(FieldBits::NoField != (BppFieldMask & whichField))
1192    {
1193        _sfBpp.copyFromBin(pMem);
1194    }
1195    if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1196    {
1197        _sfMipMapCount.copyFromBin(pMem);
1198    }
1199    if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1200    {
1201        _sfFrameCount.copyFromBin(pMem);
1202    }
1203    if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1204    {
1205        _sfFrameDelay.copyFromBin(pMem);
1206    }
1207    if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1208    {
1209        _sfPixelFormat.copyFromBin(pMem);
1210    }
1211    if(FieldBits::NoField != (PixelFieldMask & whichField))
1212    {
1213        _mfPixel.copyFromBin(pMem);
1214    }
1215    if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1216    {
1217        _sfFrameSize.copyFromBin(pMem);
1218    }
1219    if(FieldBits::NoField != (NameFieldMask & whichField))
1220    {
1221        _sfName.copyFromBin(pMem);
1222    }
1223    if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1224    {
1225        _sfDataType.copyFromBin(pMem);
1226    }
1227    if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1228    {
1229        _sfComponentSize.copyFromBin(pMem);
1230    }
1231    if(FieldBits::NoField != (SideCountFieldMask & whichField))
1232    {
1233        _sfSideCount.copyFromBin(pMem);
1234    }
1235    if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1236    {
1237        _sfSideSize.copyFromBin(pMem);
1238    }
1239    if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1240    {
1241        _sfForceCompressedData.copyFromBin(pMem);
1242    }
1243    if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1244    {
1245        _sfForceAlphaChannel.copyFromBin(pMem);
1246    }
1247    if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1248    {
1249        _sfForceColorChannel.copyFromBin(pMem);
1250    }
1251    if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1252    {
1253        _sfForceAlphaBinary.copyFromBin(pMem);
1254    }
1255}
1256
1257//! create a new instance of the class
1258ImageTransitPtr ImageBase::createLocal(BitVector bFlags)
1259{
1260    ImageTransitPtr fc;
1261
1262    if(getClassType().getPrototype() != NULL)
1263    {
1264        FieldContainerTransitPtr tmpPtr =
1265            getClassType().getPrototype()-> shallowCopyLocal(bFlags);
1266
1267        fc = dynamic_pointer_cast<Image>(tmpPtr);
1268    }
1269
1270    return fc;
1271}
1272
1273//! create a new instance of the class, copy the container flags
1274ImageTransitPtr ImageBase::createDependent(BitVector bFlags)
1275{
1276    ImageTransitPtr fc;
1277
1278    if(getClassType().getPrototype() != NULL)
1279    {
1280        FieldContainerTransitPtr tmpPtr =
1281            getClassType().getPrototype()-> shallowCopyDependent(bFlags);
1282
1283        fc = dynamic_pointer_cast<Image>(tmpPtr);
1284    }
1285
1286    return fc;
1287}
1288
1289//! create a new instance of the class
1290ImageTransitPtr ImageBase::create(void)
1291{
1292    ImageTransitPtr fc;
1293
1294    if(getClassType().getPrototype() != NULL)
1295    {
1296        FieldContainerTransitPtr tmpPtr =
1297            getClassType().getPrototype()-> shallowCopy();
1298
1299        fc = dynamic_pointer_cast<Image>(tmpPtr);
1300    }
1301
1302    return fc;
1303}
1304
1305Image *ImageBase::createEmptyLocal(BitVector bFlags)
1306{
1307    Image *returnValue;
1308
1309    newPtr<Image>(returnValue, bFlags);
1310
1311    returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1312
1313    return returnValue;
1314}
1315
1316//! create an empty new instance of the class, do not copy the prototype
1317Image *ImageBase::createEmpty(void)
1318{
1319    Image *returnValue;
1320
1321    newPtr<Image>(returnValue, Thread::getCurrentLocalFlags());
1322
1323    returnValue->_pFieldFlags->_bNamespaceMask &=
1324        ~Thread::getCurrentLocalFlags();
1325
1326    return returnValue;
1327}
1328
1329
1330FieldContainerTransitPtr ImageBase::shallowCopyLocal(
1331    BitVector bFlags) const
1332{
1333    Image *tmpPtr;
1334
1335    newPtr(tmpPtr, dynamic_cast<const Image *>(this), bFlags);
1336
1337    FieldContainerTransitPtr returnValue(tmpPtr);
1338
1339    tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1340
1341    return returnValue;
1342}
1343
1344FieldContainerTransitPtr ImageBase::shallowCopyDependent(
1345    BitVector bFlags) const
1346{
1347    Image *tmpPtr;
1348
1349    newPtr(tmpPtr, dynamic_cast<const Image *>(this), ~bFlags);
1350
1351    FieldContainerTransitPtr returnValue(tmpPtr);
1352
1353    tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1354
1355    return returnValue;
1356}
1357
1358FieldContainerTransitPtr ImageBase::shallowCopy(void) const
1359{
1360    Image *tmpPtr;
1361
1362    newPtr(tmpPtr,
1363           dynamic_cast<const Image *>(this),
1364           Thread::getCurrentLocalFlags());
1365
1366    tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1367
1368    FieldContainerTransitPtr returnValue(tmpPtr);
1369
1370    return returnValue;
1371}
1372
1373
1374
1375
1376/*------------------------- constructors ----------------------------------*/
1377
1378ImageBase::ImageBase(void) :
1379    Inherited(),
1380    _mfParents                (),
1381    _sfDimension              (Int32(0)),
1382    _sfWidth                  (Int32(0)),
1383    _sfHeight                 (Int32(1)),
1384    _sfDepth                  (Int32(1)),
1385    _sfBpp                    (Int32(1)),
1386    _sfMipMapCount            (Int32(1)),
1387    _sfFrameCount             (Int32(1)),
1388    _sfFrameDelay             (Time(0)),
1389    _sfPixelFormat            (UInt32(Image::OSG_INVALID_PF)),
1390    _mfPixel                  (),
1391    _sfFrameSize              (Int32(0)),
1392    _sfName                   (),
1393    _sfDataType               (Int32(GL_UNSIGNED_BYTE)),
1394    _sfComponentSize          (Int32(1)),
1395    _sfSideCount              (Int32(1)),
1396    _sfSideSize               (Int32(0)),
1397    _sfForceCompressedData    (bool(false)),
1398    _sfForceAlphaChannel      (bool(false)),
1399    _sfForceColorChannel      (bool(false)),
1400    _sfForceAlphaBinary       (bool(false))
1401{
1402}
1403
1404ImageBase::ImageBase(const ImageBase &source) :
1405    Inherited(source),
1406    _mfParents                (),
1407    _sfDimension              (source._sfDimension              ),
1408    _sfWidth                  (source._sfWidth                  ),
1409    _sfHeight                 (source._sfHeight                 ),
1410    _sfDepth                  (source._sfDepth                  ),
1411    _sfBpp                    (source._sfBpp                    ),
1412    _sfMipMapCount            (source._sfMipMapCount            ),
1413    _sfFrameCount             (source._sfFrameCount             ),
1414    _sfFrameDelay             (source._sfFrameDelay             ),
1415    _sfPixelFormat            (source._sfPixelFormat            ),
1416    _mfPixel                  (source._mfPixel                  ),
1417    _sfFrameSize              (source._sfFrameSize              ),
1418    _sfName                   (source._sfName                   ),
1419    _sfDataType               (source._sfDataType               ),
1420    _sfComponentSize          (source._sfComponentSize          ),
1421    _sfSideCount              (source._sfSideCount              ),
1422    _sfSideSize               (source._sfSideSize               ),
1423    _sfForceCompressedData    (source._sfForceCompressedData    ),
1424    _sfForceAlphaChannel      (source._sfForceAlphaChannel      ),
1425    _sfForceColorChannel      (source._sfForceColorChannel      ),
1426    _sfForceAlphaBinary       (source._sfForceAlphaBinary       )
1427{
1428}
1429
1430
1431/*-------------------------- destructors ----------------------------------*/
1432
1433ImageBase::~ImageBase(void)
1434{
1435}
1436
1437
1438GetFieldHandlePtr ImageBase::getHandleParents         (void) const
1439{
1440    MFUnrecParentFieldContainerPtr::GetHandlePtr returnValue;
1441
1442    return returnValue;
1443}
1444
1445EditFieldHandlePtr ImageBase::editHandleParents        (void)
1446{
1447    EditFieldHandlePtr returnValue;
1448
1449    return returnValue;
1450}
1451
1452GetFieldHandlePtr ImageBase::getHandleDimension       (void) const
1453{
1454    SFInt32::GetHandlePtr returnValue(
1455        new  SFInt32::GetHandle(
1456             &_sfDimension,
1457             this->getType().getFieldDesc(DimensionFieldId),
1458             const_cast<ImageBase *>(this)));
1459
1460    return returnValue;
1461}
1462
1463EditFieldHandlePtr ImageBase::editHandleDimension      (void)
1464{
1465    SFInt32::EditHandlePtr returnValue(
1466        new  SFInt32::EditHandle(
1467             &_sfDimension,
1468             this->getType().getFieldDesc(DimensionFieldId),
1469             this));
1470
1471
1472    editSField(DimensionFieldMask);
1473
1474    return returnValue;
1475}
1476
1477GetFieldHandlePtr ImageBase::getHandleWidth           (void) const
1478{
1479    SFInt32::GetHandlePtr returnValue(
1480        new  SFInt32::GetHandle(
1481             &_sfWidth,
1482             this->getType().getFieldDesc(WidthFieldId),
1483             const_cast<ImageBase *>(this)));
1484
1485    return returnValue;
1486}
1487
1488EditFieldHandlePtr ImageBase::editHandleWidth          (void)
1489{
1490    SFInt32::EditHandlePtr returnValue(
1491        new  SFInt32::EditHandle(
1492             &_sfWidth,
1493             this->getType().getFieldDesc(WidthFieldId),
1494             this));
1495
1496
1497    editSField(WidthFieldMask);
1498
1499    return returnValue;
1500}
1501
1502GetFieldHandlePtr ImageBase::getHandleHeight          (void) const
1503{
1504    SFInt32::GetHandlePtr returnValue(
1505        new  SFInt32::GetHandle(
1506             &_sfHeight,
1507             this->getType().getFieldDesc(HeightFieldId),
1508             const_cast<ImageBase *>(this)));
1509
1510    return returnValue;
1511}
1512
1513EditFieldHandlePtr ImageBase::editHandleHeight         (void)
1514{
1515    SFInt32::EditHandlePtr returnValue(
1516        new  SFInt32::EditHandle(
1517             &_sfHeight,
1518             this->getType().getFieldDesc(HeightFieldId),
1519             this));
1520
1521
1522    editSField(HeightFieldMask);
1523
1524    return returnValue;
1525}
1526
1527GetFieldHandlePtr ImageBase::getHandleDepth           (void) const
1528{
1529    SFInt32::GetHandlePtr returnValue(
1530        new  SFInt32::GetHandle(
1531             &_sfDepth,
1532             this->getType().getFieldDesc(DepthFieldId),
1533             const_cast<ImageBase *>(this)));
1534
1535    return returnValue;
1536}
1537
1538EditFieldHandlePtr ImageBase::editHandleDepth          (void)
1539{
1540    SFInt32::EditHandlePtr returnValue(
1541        new  SFInt32::EditHandle(
1542             &_sfDepth,
1543             this->getType().getFieldDesc(DepthFieldId),
1544             this));
1545
1546
1547    editSField(DepthFieldMask);
1548
1549    return returnValue;
1550}
1551
1552GetFieldHandlePtr ImageBase::getHandleBpp             (void) const
1553{
1554    SFInt32::GetHandlePtr returnValue(
1555        new  SFInt32::GetHandle(
1556             &_sfBpp,
1557             this->getType().getFieldDesc(BppFieldId),
1558             const_cast<ImageBase *>(this)));
1559
1560    return returnValue;
1561}
1562
1563EditFieldHandlePtr ImageBase::editHandleBpp            (void)
1564{
1565    SFInt32::EditHandlePtr returnValue(
1566        new  SFInt32::EditHandle(
1567             &_sfBpp,
1568             this->getType().getFieldDesc(BppFieldId),
1569             this));
1570
1571
1572    editSField(BppFieldMask);
1573
1574    return returnValue;
1575}
1576
1577GetFieldHandlePtr ImageBase::getHandleMipMapCount     (void) const
1578{
1579    SFInt32::GetHandlePtr returnValue(
1580        new  SFInt32::GetHandle(
1581             &_sfMipMapCount,
1582             this->getType().getFieldDesc(MipMapCountFieldId),
1583             const_cast<ImageBase *>(this)));
1584
1585    return returnValue;
1586}
1587
1588EditFieldHandlePtr ImageBase::editHandleMipMapCount    (void)
1589{
1590    SFInt32::EditHandlePtr returnValue(
1591        new  SFInt32::EditHandle(
1592             &_sfMipMapCount,
1593             this->getType().getFieldDesc(MipMapCountFieldId),
1594             this));
1595
1596
1597    editSField(MipMapCountFieldMask);
1598
1599    return returnValue;
1600}
1601
1602GetFieldHandlePtr ImageBase::getHandleFrameCount      (void) const
1603{
1604    SFInt32::GetHandlePtr returnValue(
1605        new  SFInt32::GetHandle(
1606             &_sfFrameCount,
1607             this->getType().getFieldDesc(FrameCountFieldId),
1608             const_cast<ImageBase *>(this)));
1609
1610    return returnValue;
1611}
1612
1613EditFieldHandlePtr ImageBase::editHandleFrameCount     (void)
1614{
1615    SFInt32::EditHandlePtr returnValue(
1616        new  SFInt32::EditHandle(
1617             &_sfFrameCount,
1618             this->getType().getFieldDesc(FrameCountFieldId),
1619             this));
1620
1621
1622    editSField(FrameCountFieldMask);
1623
1624    return returnValue;
1625}
1626
1627GetFieldHandlePtr ImageBase::getHandleFrameDelay      (void) const
1628{
1629    SFTime::GetHandlePtr returnValue(
1630        new  SFTime::GetHandle(
1631             &_sfFrameDelay,
1632             this->getType().getFieldDesc(FrameDelayFieldId),
1633             const_cast<ImageBase *>(this)));
1634
1635    return returnValue;
1636}
1637
1638EditFieldHandlePtr ImageBase::editHandleFrameDelay     (void)
1639{
1640    SFTime::EditHandlePtr returnValue(
1641        new  SFTime::EditHandle(
1642             &_sfFrameDelay,
1643             this->getType().getFieldDesc(FrameDelayFieldId),
1644             this));
1645
1646
1647    editSField(FrameDelayFieldMask);
1648
1649    return returnValue;
1650}
1651
1652GetFieldHandlePtr ImageBase::getHandlePixelFormat     (void) const
1653{
1654    SFUInt32::GetHandlePtr returnValue(
1655        new  SFUInt32::GetHandle(
1656             &_sfPixelFormat,
1657             this->getType().getFieldDesc(PixelFormatFieldId),
1658             const_cast<ImageBase *>(this)));
1659
1660    return returnValue;
1661}
1662
1663EditFieldHandlePtr ImageBase::editHandlePixelFormat    (void)
1664{
1665    SFUInt32::EditHandlePtr returnValue(
1666        new  SFUInt32::EditHandle(
1667             &_sfPixelFormat,
1668             this->getType().getFieldDesc(PixelFormatFieldId),
1669             this));
1670
1671
1672    editSField(PixelFormatFieldMask);
1673
1674    return returnValue;
1675}
1676
1677GetFieldHandlePtr ImageBase::getHandlePixel           (void) const
1678{
1679    MFUInt8::GetHandlePtr returnValue(
1680        new  MFUInt8::GetHandle(
1681             &_mfPixel,
1682             this->getType().getFieldDesc(PixelFieldId),
1683             const_cast<ImageBase *>(this)));
1684
1685    return returnValue;
1686}
1687
1688EditFieldHandlePtr ImageBase::editHandlePixel          (void)
1689{
1690    MFUInt8::EditHandlePtr returnValue(
1691        new  MFUInt8::EditHandle(
1692             &_mfPixel,
1693             this->getType().getFieldDesc(PixelFieldId),
1694             this));
1695
1696
1697    editMField(PixelFieldMask, _mfPixel);
1698
1699    return returnValue;
1700}
1701
1702GetFieldHandlePtr ImageBase::getHandleFrameSize       (void) const
1703{
1704    SFInt32::GetHandlePtr returnValue(
1705        new  SFInt32::GetHandle(
1706             &_sfFrameSize,
1707             this->getType().getFieldDesc(FrameSizeFieldId),
1708             const_cast<ImageBase *>(this)));
1709
1710    return returnValue;
1711}
1712
1713EditFieldHandlePtr ImageBase::editHandleFrameSize      (void)
1714{
1715    SFInt32::EditHandlePtr returnValue(
1716        new  SFInt32::EditHandle(
1717             &_sfFrameSize,
1718             this->getType().getFieldDesc(FrameSizeFieldId),
1719             this));
1720
1721
1722    editSField(FrameSizeFieldMask);
1723
1724    return returnValue;
1725}
1726
1727GetFieldHandlePtr ImageBase::getHandleName            (void) const
1728{
1729    SFString::GetHandlePtr returnValue(
1730        new  SFString::GetHandle(
1731             &_sfName,
1732             this->getType().getFieldDesc(NameFieldId),
1733             const_cast<ImageBase *>(this)));
1734
1735    return returnValue;
1736}
1737
1738EditFieldHandlePtr ImageBase::editHandleName           (void)
1739{
1740    SFString::EditHandlePtr returnValue(
1741        new  SFString::EditHandle(
1742             &_sfName,
1743             this->getType().getFieldDesc(NameFieldId),
1744             this));
1745
1746
1747    editSField(NameFieldMask);
1748
1749    return returnValue;
1750}
1751
1752GetFieldHandlePtr ImageBase::getHandleDataType        (void) const
1753{
1754    SFInt32::GetHandlePtr returnValue(
1755        new  SFInt32::GetHandle(
1756             &_sfDataType,
1757             this->getType().getFieldDesc(DataTypeFieldId),
1758             const_cast<ImageBase *>(this)));
1759
1760    return returnValue;
1761}
1762
1763EditFieldHandlePtr ImageBase::editHandleDataType       (void)
1764{
1765    SFInt32::EditHandlePtr returnValue(
1766        new  SFInt32::EditHandle(
1767             &_sfDataType,
1768             this->getType().getFieldDesc(DataTypeFieldId),
1769             this));
1770
1771
1772    editSField(DataType

Large files files are truncated, but you can click here to view the full file