fixed: gcc8 compile issues
[opensg.git] / Source / System / Image / OSGImageBase.cpp
blobaebbaebd85cb17acb56dd163352fd653f91f31c9
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 \*---------------------------------------------------------------------------*/
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 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
64 #include "OSGGL.h" // DataType default header
66 #include "OSGFieldContainer.h" // Parents Class
68 #include "OSGImageBase.h"
69 #include "OSGImage.h"
71 #include <boost/bind.hpp>
73 OSG_BEGIN_NAMESPACE
75 /***************************************************************************\
76 * Description *
77 \***************************************************************************/
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.
84 /***************************************************************************\
85 * Field Documentation *
86 \***************************************************************************/
88 /*! \var FieldContainer * ImageBase::_mfParents
92 /*! \var Int32 ImageBase::_sfDimension
93 Image dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.
96 /*! \var Int32 ImageBase::_sfWidth
100 /*! \var Int32 ImageBase::_sfHeight
104 /*! \var Int32 ImageBase::_sfDepth
108 /*! \var Int32 ImageBase::_sfBpp
109 Bytes of data per pixel.
112 /*! \var Int32 ImageBase::_sfMipMapCount
116 /*! \var Int32 ImageBase::_sfFrameCount
117 The number of frames in the data.
120 /*! \var Time ImageBase::_sfFrameDelay
121 Time between frames. Determines the frame rate.
124 /*! \var UInt32 ImageBase::_sfPixelFormat
128 /*! \var UInt8 ImageBase::_mfPixel
129 The pixel data buffer. This is where the data for the image is stored.
132 /*! \var Int32 ImageBase::_sfFrameSize
136 /*! \var std::string ImageBase::_sfName
137 Texture file path.
140 /*! \var Int32 ImageBase::_sfDataType
141 Type of image data.
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.
149 /*! \var Int32 ImageBase::_sfSideCount
153 /*! \var Int32 ImageBase::_sfSideSize
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.
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.
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.
172 /*! \var bool ImageBase::_sfForceAlphaBinary
173 Set to true if using the image to prevent depth sorting for
174 SimpleTexturedMaterials using this Image.
177 /*! \var Real32 ImageBase::_sfResX
181 /*! \var Real32 ImageBase::_sfResY
185 /*! \var UInt16 ImageBase::_sfResUnit
186 resolution unit (invalid=0, none=1, inch=2)
189 /*! \var bool ImageBase::_sfClearOnLoad
190 Set to true if the image data should be cleared after it has been uploaded to the graphics
191 card and is no longer needed in main memory.
195 /***************************************************************************\
196 * FieldType/FieldTrait Instantiation *
197 \***************************************************************************/
199 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
200 PointerType FieldTraits<Image *, nsOSG>::_type(
201 "ImagePtr",
202 "AttachmentContainerPtr",
203 Image::getClassType(),
204 nsOSG);
205 #endif
207 OSG_FIELDTRAITS_GETTYPE_NS(Image *, nsOSG)
209 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
210 Image *,
211 nsOSG)
213 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
214 Image *,
215 nsOSG)
217 DataType &FieldTraits< Image *, nsOSG + 1 >::getType(void)
219 return FieldTraits<Image *, nsOSG>::getType();
223 OSG_EXPORT_PTR_SFIELD(ChildPointerSField,
224 Image *,
225 UnrecordedRefCountPolicy,
226 nsOSG + 1)
229 /***************************************************************************\
230 * Field Description *
231 \***************************************************************************/
233 void ImageBase::classDescInserter(TypeObject &oType)
235 FieldDescriptionBase *pDesc = NULL;
238 pDesc = new MFParentFieldContainerPtr::Description(
239 MFParentFieldContainerPtr::getClassType(),
240 "parents",
242 ParentsFieldId, ParentsFieldMask,
243 true,
244 (Field::MFDefaultFlags | Field::FStdAccess),
245 static_cast <FieldEditMethodSig>(&Image::invalidEditField),
246 static_cast <FieldGetMethodSig >(&Image::invalidGetField));
248 oType.addInitialDesc(pDesc);
250 pDesc = new SFInt32::Description(
251 SFInt32::getClassType(),
252 "dimension",
253 "Image dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.\n",
254 DimensionFieldId, DimensionFieldMask,
255 false,
256 (Field::SFDefaultFlags | Field::FStdAccess),
257 static_cast<FieldEditMethodSig>(&Image::editHandleDimension),
258 static_cast<FieldGetMethodSig >(&Image::getHandleDimension));
260 oType.addInitialDesc(pDesc);
262 pDesc = new SFInt32::Description(
263 SFInt32::getClassType(),
264 "width",
266 WidthFieldId, WidthFieldMask,
267 false,
268 (Field::SFDefaultFlags | Field::FStdAccess),
269 static_cast<FieldEditMethodSig>(&Image::editHandleWidth),
270 static_cast<FieldGetMethodSig >(&Image::getHandleWidth));
272 oType.addInitialDesc(pDesc);
274 pDesc = new SFInt32::Description(
275 SFInt32::getClassType(),
276 "height",
278 HeightFieldId, HeightFieldMask,
279 false,
280 (Field::SFDefaultFlags | Field::FStdAccess),
281 static_cast<FieldEditMethodSig>(&Image::editHandleHeight),
282 static_cast<FieldGetMethodSig >(&Image::getHandleHeight));
284 oType.addInitialDesc(pDesc);
286 pDesc = new SFInt32::Description(
287 SFInt32::getClassType(),
288 "depth",
290 DepthFieldId, DepthFieldMask,
291 false,
292 (Field::SFDefaultFlags | Field::FStdAccess),
293 static_cast<FieldEditMethodSig>(&Image::editHandleDepth),
294 static_cast<FieldGetMethodSig >(&Image::getHandleDepth));
296 oType.addInitialDesc(pDesc);
298 pDesc = new SFInt32::Description(
299 SFInt32::getClassType(),
300 "bpp",
301 "Bytes of data per pixel.\n",
302 BppFieldId, BppFieldMask,
303 false,
304 (Field::SFDefaultFlags | Field::FStdAccess),
305 static_cast<FieldEditMethodSig>(&Image::editHandleBpp),
306 static_cast<FieldGetMethodSig >(&Image::getHandleBpp));
308 oType.addInitialDesc(pDesc);
310 pDesc = new SFInt32::Description(
311 SFInt32::getClassType(),
312 "mipMapCount",
314 MipMapCountFieldId, MipMapCountFieldMask,
315 false,
316 (Field::SFDefaultFlags | Field::FStdAccess),
317 static_cast<FieldEditMethodSig>(&Image::editHandleMipMapCount),
318 static_cast<FieldGetMethodSig >(&Image::getHandleMipMapCount));
320 oType.addInitialDesc(pDesc);
322 pDesc = new SFInt32::Description(
323 SFInt32::getClassType(),
324 "frameCount",
325 "The number of frames in the data.\n",
326 FrameCountFieldId, FrameCountFieldMask,
327 false,
328 (Field::SFDefaultFlags | Field::FStdAccess),
329 static_cast<FieldEditMethodSig>(&Image::editHandleFrameCount),
330 static_cast<FieldGetMethodSig >(&Image::getHandleFrameCount));
332 oType.addInitialDesc(pDesc);
334 pDesc = new SFTime::Description(
335 SFTime::getClassType(),
336 "frameDelay",
337 "Time between frames. Determines the frame rate.\n",
338 FrameDelayFieldId, FrameDelayFieldMask,
339 false,
340 (Field::SFDefaultFlags | Field::FStdAccess),
341 static_cast<FieldEditMethodSig>(&Image::editHandleFrameDelay),
342 static_cast<FieldGetMethodSig >(&Image::getHandleFrameDelay));
344 oType.addInitialDesc(pDesc);
346 pDesc = new SFUInt32::Description(
347 SFUInt32::getClassType(),
348 "pixelFormat",
350 PixelFormatFieldId, PixelFormatFieldMask,
351 false,
352 (Field::SFDefaultFlags | Field::FStdAccess),
353 static_cast<FieldEditMethodSig>(&Image::editHandlePixelFormat),
354 static_cast<FieldGetMethodSig >(&Image::getHandlePixelFormat));
356 oType.addInitialDesc(pDesc);
358 pDesc = new MFUInt8::Description(
359 MFUInt8::getClassType(),
360 "pixel",
361 "The pixel data buffer. This is where the data for the image is stored.\n",
362 PixelFieldId, PixelFieldMask,
363 false,
364 (Field::MFDefaultFlags | Field::FStdAccess),
365 static_cast<FieldEditMethodSig>(&Image::editHandlePixel),
366 static_cast<FieldGetMethodSig >(&Image::getHandlePixel));
368 oType.addInitialDesc(pDesc);
370 pDesc = new SFInt32::Description(
371 SFInt32::getClassType(),
372 "frameSize",
374 FrameSizeFieldId, FrameSizeFieldMask,
375 true,
376 (Field::SFDefaultFlags | Field::FStdAccess),
377 static_cast<FieldEditMethodSig>(&Image::editHandleFrameSize),
378 static_cast<FieldGetMethodSig >(&Image::getHandleFrameSize));
380 oType.addInitialDesc(pDesc);
382 pDesc = new SFString::Description(
383 SFString::getClassType(),
384 "name",
385 "Texture file path.\n",
386 NameFieldId, NameFieldMask,
387 false,
388 (Field::SFDefaultFlags | Field::FStdAccess),
389 static_cast<FieldEditMethodSig>(&Image::editHandleName),
390 static_cast<FieldGetMethodSig >(&Image::getHandleName));
392 oType.addInitialDesc(pDesc);
394 pDesc = new SFInt32::Description(
395 SFInt32::getClassType(),
396 "dataType",
397 "Type of image data.\n",
398 DataTypeFieldId, DataTypeFieldMask,
399 false,
400 (Field::SFDefaultFlags | Field::FStdAccess),
401 static_cast<FieldEditMethodSig>(&Image::editHandleDataType),
402 static_cast<FieldGetMethodSig >(&Image::getHandleDataType));
404 oType.addInitialDesc(pDesc);
406 pDesc = new SFInt32::Description(
407 SFInt32::getClassType(),
408 "componentSize",
409 "Size (in byte) of a single component of the image. Necessary\n"
410 "for High Dynamic Range and other higher-level image types.\n",
411 ComponentSizeFieldId, ComponentSizeFieldMask,
412 true,
413 (Field::SFDefaultFlags | Field::FStdAccess),
414 static_cast<FieldEditMethodSig>(&Image::editHandleComponentSize),
415 static_cast<FieldGetMethodSig >(&Image::getHandleComponentSize));
417 oType.addInitialDesc(pDesc);
419 pDesc = new SFInt32::Description(
420 SFInt32::getClassType(),
421 "sideCount",
423 SideCountFieldId, SideCountFieldMask,
424 false,
425 (Field::SFDefaultFlags | Field::FStdAccess),
426 static_cast<FieldEditMethodSig>(&Image::editHandleSideCount),
427 static_cast<FieldGetMethodSig >(&Image::getHandleSideCount));
429 oType.addInitialDesc(pDesc);
431 pDesc = new SFInt32::Description(
432 SFInt32::getClassType(),
433 "sideSize",
435 SideSizeFieldId, SideSizeFieldMask,
436 true,
437 (Field::SFDefaultFlags | Field::FStdAccess),
438 static_cast<FieldEditMethodSig>(&Image::editHandleSideSize),
439 static_cast<FieldGetMethodSig >(&Image::getHandleSideSize));
441 oType.addInitialDesc(pDesc);
443 pDesc = new SFBool::Description(
444 SFBool::getClassType(),
445 "forceCompressedData",
446 "Set to true if using the image to keep unknown data for textures.\n"
447 "Generally used in conjunction with TextureChunk::externalFormat.\n",
448 ForceCompressedDataFieldId, ForceCompressedDataFieldMask,
449 false,
450 (Field::SFDefaultFlags | Field::FStdAccess),
451 static_cast<FieldEditMethodSig>(&Image::editHandleForceCompressedData),
452 static_cast<FieldGetMethodSig >(&Image::getHandleForceCompressedData));
454 oType.addInitialDesc(pDesc);
456 pDesc = new SFBool::Description(
457 SFBool::getClassType(),
458 "forceAlphaChannel",
459 "Set to true if using the image to keep unknown data for textures.\n"
460 "Generally used in conjunction with TextureChunk::externalFormat.\n",
461 ForceAlphaChannelFieldId, ForceAlphaChannelFieldMask,
462 false,
463 (Field::SFDefaultFlags | Field::FStdAccess),
464 static_cast<FieldEditMethodSig>(&Image::editHandleForceAlphaChannel),
465 static_cast<FieldGetMethodSig >(&Image::getHandleForceAlphaChannel));
467 oType.addInitialDesc(pDesc);
469 pDesc = new SFBool::Description(
470 SFBool::getClassType(),
471 "forceColorChannel",
472 "Set to true if using the image to keep unknown data for textures.\n"
473 "Generally used in conjunction with TextureChunk::externalFormat.\n",
474 ForceColorChannelFieldId, ForceColorChannelFieldMask,
475 false,
476 (Field::SFDefaultFlags | Field::FStdAccess),
477 static_cast<FieldEditMethodSig>(&Image::editHandleForceColorChannel),
478 static_cast<FieldGetMethodSig >(&Image::getHandleForceColorChannel));
480 oType.addInitialDesc(pDesc);
482 pDesc = new SFBool::Description(
483 SFBool::getClassType(),
484 "forceAlphaBinary",
485 "Set to true if using the image to prevent depth sorting for \n"
486 "SimpleTexturedMaterials using this Image.\n",
487 ForceAlphaBinaryFieldId, ForceAlphaBinaryFieldMask,
488 false,
489 (Field::SFDefaultFlags | Field::FStdAccess),
490 static_cast<FieldEditMethodSig>(&Image::editHandleForceAlphaBinary),
491 static_cast<FieldGetMethodSig >(&Image::getHandleForceAlphaBinary));
493 oType.addInitialDesc(pDesc);
495 pDesc = new SFReal32::Description(
496 SFReal32::getClassType(),
497 "resX",
499 ResXFieldId, ResXFieldMask,
500 false,
501 (Field::SFDefaultFlags | Field::FStdAccess),
502 static_cast<FieldEditMethodSig>(&Image::editHandleResX),
503 static_cast<FieldGetMethodSig >(&Image::getHandleResX));
505 oType.addInitialDesc(pDesc);
507 pDesc = new SFReal32::Description(
508 SFReal32::getClassType(),
509 "resY",
511 ResYFieldId, ResYFieldMask,
512 false,
513 (Field::SFDefaultFlags | Field::FStdAccess),
514 static_cast<FieldEditMethodSig>(&Image::editHandleResY),
515 static_cast<FieldGetMethodSig >(&Image::getHandleResY));
517 oType.addInitialDesc(pDesc);
519 pDesc = new SFUInt16::Description(
520 SFUInt16::getClassType(),
521 "resUnit",
522 "resolution unit (invalid=0, none=1, inch=2)\n",
523 ResUnitFieldId, ResUnitFieldMask,
524 false,
525 (Field::SFDefaultFlags | Field::FStdAccess),
526 static_cast<FieldEditMethodSig>(&Image::editHandleResUnit),
527 static_cast<FieldGetMethodSig >(&Image::getHandleResUnit));
529 oType.addInitialDesc(pDesc);
531 pDesc = new SFBool::Description(
532 SFBool::getClassType(),
533 "clearOnLoad",
534 "Set to true if the image data should be cleared after it has been uploaded to the graphics\n"
535 "card and is no longer needed in main memory.\n",
536 ClearOnLoadFieldId, ClearOnLoadFieldMask,
537 false,
538 (Field::SFDefaultFlags | Field::FStdAccess),
539 static_cast<FieldEditMethodSig>(&Image::editHandleClearOnLoad),
540 static_cast<FieldGetMethodSig >(&Image::getHandleClearOnLoad));
542 oType.addInitialDesc(pDesc);
546 ImageBase::TypeObject ImageBase::_type(
547 ImageBase::getClassname(),
548 Inherited::getClassname(),
549 "NULL",
550 nsOSG, //Namespace
551 reinterpret_cast<PrototypeCreateF>(&ImageBase::createEmptyLocal),
552 reinterpret_cast<InitContainerF>(&Image::initMethod),
553 reinterpret_cast<ExitContainerF>(&Image::exitMethod),
554 reinterpret_cast<InitalInsertDescFunc>(&Image::classDescInserter),
555 false,
556 (ComponentSizeFieldMask | SideSizeFieldMask | FrameSizeFieldMask),
557 "<?xml version=\"1.0\"?>\n"
558 "\n"
559 "<FieldContainer\n"
560 " name=\"Image\"\n"
561 " parent=\"AttachmentContainer\"\n"
562 " library=\"System\"\n"
563 " pointerfieldtypes=\"both\"\n"
564 " structure=\"concrete\"\n"
565 " systemcomponent=\"true\"\n"
566 " parentsystemcomponent=\"true\"\n"
567 " decoratable=\"false\"\n"
568 " useLocalIncludes=\"false\"\n"
569 " fieldsUnmarkedOnCreate=\"(ComponentSizeFieldMask | SideSizeFieldMask | FrameSizeFieldMask)\"\n"
570 " childFields=\"single\"\n"
571 " docGroupBase=\"GrpSystemImage\"\n"
572 " >\n"
573 "\n"
574 " 1D/2D/3D Image with various pixel types data, optionally also can hold\n"
575 " mipMap and simple multi-frame data.\n"
576 "\n"
577 " <Field\n"
578 "\t name=\"parents\"\n"
579 "\t type=\"FieldContainer\"\n"
580 "\t cardinality=\"multi\"\n"
581 "\t visibility=\"internal\"\n"
582 "\t access=\"none\"\n"
583 " category=\"parentpointer\"\n"
584 "\t >\n"
585 " </Field>\n"
586 " <Field\n"
587 "\t name=\"dimension\"\n"
588 "\t type=\"Int32\"\n"
589 "\t cardinality=\"single\"\n"
590 "\t visibility=\"external\"\n"
591 "\t defaultValue=\"0\"\n"
592 "\t access=\"public\"\n"
593 "\t >\n"
594 "\tImage dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.\n"
595 " </Field>\n"
596 " <Field\n"
597 "\t name=\"width\"\n"
598 "\t type=\"Int32\"\n"
599 "\t cardinality=\"single\"\n"
600 "\t visibility=\"external\"\n"
601 "\t defaultValue=\"0\"\n"
602 "\t access=\"public\"\n"
603 "\t >\n"
604 " </Field>\n"
605 " <Field\n"
606 "\t name=\"height\"\n"
607 "\t type=\"Int32\"\n"
608 "\t cardinality=\"single\"\n"
609 "\t visibility=\"external\"\n"
610 "\t defaultValue=\"1\"\n"
611 "\t access=\"public\"\n"
612 "\t >\n"
613 " </Field>\n"
614 " <Field\n"
615 "\t name=\"depth\"\n"
616 "\t type=\"Int32\"\n"
617 "\t cardinality=\"single\"\n"
618 "\t visibility=\"external\"\n"
619 "\t defaultValue=\"1\"\n"
620 "\t access=\"public\"\n"
621 "\t >\n"
622 " </Field>\n"
623 " <Field\n"
624 "\t name=\"bpp\"\n"
625 "\t type=\"Int32\"\n"
626 "\t cardinality=\"single\"\n"
627 "\t visibility=\"external\"\n"
628 "\t defaultValue=\"1\"\n"
629 "\t access=\"public\"\n"
630 "\t >\n"
631 " Bytes of data per pixel.\n"
632 " </Field>\n"
633 " <Field\n"
634 "\t name=\"mipMapCount\"\n"
635 "\t type=\"Int32\"\n"
636 "\t cardinality=\"single\"\n"
637 "\t visibility=\"external\"\n"
638 "\t defaultValue=\"1\"\n"
639 "\t access=\"public\"\n"
640 "\t >\n"
641 " </Field>\n"
642 " <Field\n"
643 "\t name=\"frameCount\"\n"
644 "\t type=\"Int32\"\n"
645 "\t cardinality=\"single\"\n"
646 "\t visibility=\"external\"\n"
647 "\t defaultValue=\"1\"\n"
648 "\t access=\"public\"\n"
649 "\t >\n"
650 " The number of frames in the data.\n"
651 " </Field>\n"
652 " <Field\n"
653 "\t name=\"frameDelay\"\n"
654 "\t type=\"Time\"\n"
655 "\t cardinality=\"single\"\n"
656 "\t visibility=\"external\"\n"
657 "\t defaultValue=\"0\"\n"
658 "\t access=\"public\"\n"
659 "\t >\n"
660 " Time between frames. Determines the frame rate.\n"
661 " </Field>\n"
662 " <Field\n"
663 "\t name=\"pixelFormat\"\n"
664 "\t type=\"UInt32\"\n"
665 "\t cardinality=\"single\"\n"
666 "\t visibility=\"external\"\n"
667 "\t defaultValue=\"Image::OSG_INVALID_PF\"\n"
668 "\t access=\"public\"\n"
669 "\t >\n"
670 " </Field>\n"
671 " <Field\n"
672 "\t name=\"pixel\"\n"
673 "\t type=\"UInt8\"\n"
674 "\t cardinality=\"multi\"\n"
675 "\t visibility=\"external\"\n"
676 "\t access=\"public\"\n"
677 "\t >\n"
678 " The pixel data buffer. This is where the data for the image is stored.\n"
679 " </Field>\n"
680 " <Field\n"
681 "\t name=\"frameSize\"\n"
682 "\t type=\"Int32\"\n"
683 "\t cardinality=\"single\"\n"
684 "\t visibility=\"internal\"\n"
685 "\t defaultValue=\"0\"\n"
686 "\t access=\"public\"\n"
687 "\t >\n"
688 " </Field>\n"
689 " <Field\n"
690 "\t name=\"name\"\n"
691 "\t type=\"std::string\"\n"
692 "\t cardinality=\"single\"\n"
693 "\t visibility=\"external\"\n"
694 "\t access=\"public\"\n"
695 "\t >\n"
696 "\tTexture file path.\n"
697 " </Field>\n"
698 " <Field\n"
699 "\t name=\"dataType\"\n"
700 "\t type=\"Int32\"\n"
701 "\t cardinality=\"single\"\n"
702 "\t visibility=\"external\"\n"
703 "\t defaultValue=\"GL_UNSIGNED_BYTE\"\n"
704 "\t defaultHeader=\"&quot;OSGGL.h&quot;\"\n"
705 "\t access=\"public\"\n"
706 "\t >\n"
707 "\tType of image data.\n"
708 " </Field>\n"
709 " <Field\n"
710 "\t name=\"componentSize\"\n"
711 "\t type=\"Int32\"\n"
712 "\t cardinality=\"single\"\n"
713 "\t visibility=\"internal\"\n"
714 "\t defaultValue=\"1\"\n"
715 "\t access=\"protected\"\n"
716 "\t >\n"
717 "\tSize (in byte) of a single component of the image. Necessary\n"
718 " for High Dynamic Range and other higher-level image types.\n"
719 " </Field>\n"
720 " <Field\n"
721 "\t name=\"sideCount\"\n"
722 "\t type=\"Int32\"\n"
723 "\t cardinality=\"single\"\n"
724 "\t visibility=\"external\"\n"
725 "\t defaultValue=\"1\"\n"
726 "\t access=\"public\"\n"
727 "\t >\n"
728 " </Field>\n"
729 " <Field\n"
730 "\t name=\"sideSize\"\n"
731 "\t type=\"Int32\"\n"
732 "\t cardinality=\"single\"\n"
733 "\t visibility=\"internal\"\n"
734 "\t defaultValue=\"0\"\n"
735 "\t access=\"public\"\n"
736 "\t >\n"
737 " </Field>\n"
738 " <Field\n"
739 "\t name=\"forceCompressedData\"\n"
740 "\t type=\"bool\"\n"
741 "\t cardinality=\"single\"\n"
742 "\t visibility=\"external\"\n"
743 "\t defaultValue=\"false\"\n"
744 "\t access=\"public\"\n"
745 "\t >\n"
746 " Set to true if using the image to keep unknown data for textures.\n"
747 " Generally used in conjunction with TextureChunk::externalFormat.\n"
748 " </Field>\n"
749 " <Field\n"
750 "\t name=\"forceAlphaChannel\"\n"
751 "\t type=\"bool\"\n"
752 "\t cardinality=\"single\"\n"
753 "\t visibility=\"external\"\n"
754 "\t defaultValue=\"false\"\n"
755 "\t access=\"public\"\n"
756 "\t >\n"
757 " Set to true if using the image to keep unknown data for textures.\n"
758 " Generally used in conjunction with TextureChunk::externalFormat.\n"
759 " </Field>\n"
760 " <Field\n"
761 "\t name=\"forceColorChannel\"\n"
762 "\t type=\"bool\"\n"
763 "\t cardinality=\"single\"\n"
764 "\t visibility=\"external\"\n"
765 "\t defaultValue=\"false\"\n"
766 "\t access=\"public\"\n"
767 "\t >\n"
768 " Set to true if using the image to keep unknown data for textures.\n"
769 " Generally used in conjunction with TextureChunk::externalFormat.\n"
770 " </Field>\n"
771 " <Field\n"
772 "\t name=\"forceAlphaBinary\"\n"
773 "\t type=\"bool\"\n"
774 "\t cardinality=\"single\"\n"
775 "\t visibility=\"external\"\n"
776 "\t defaultValue=\"false\"\n"
777 "\t access=\"public\"\n"
778 "\t >\n"
779 " Set to true if using the image to prevent depth sorting for \n"
780 " SimpleTexturedMaterials using this Image.\n"
781 " </Field>\n"
782 " <Field\n"
783 "\t name=\"resX\"\n"
784 "\t type=\"Real32\"\n"
785 "\t cardinality=\"single\"\n"
786 "\t visibility=\"external\"\n"
787 "\t defaultValue=\"72.0f\"\n"
788 "\t access=\"public\"\n"
789 "\t >\n"
790 " </Field>\n"
791 " <Field\n"
792 "\t name=\"resY\"\n"
793 "\t type=\"Real32\"\n"
794 "\t cardinality=\"single\"\n"
795 "\t visibility=\"external\"\n"
796 "\t defaultValue=\"72.0f\"\n"
797 "\t access=\"public\"\n"
798 "\t >\n"
799 " </Field>\n"
800 " <Field\n"
801 "\t name=\"resUnit\"\n"
802 "\t type=\"UInt16\"\n"
803 "\t cardinality=\"single\"\n"
804 "\t visibility=\"external\"\n"
805 "\t defaultValue=\"2\"\n"
806 "\t access=\"public\"\n"
807 "\t >\n"
808 "\tresolution unit (invalid=0, none=1, inch=2)\n"
809 " </Field>\t\n"
810 " <Field\n"
811 "\t name=\"clearOnLoad\"\n"
812 "\t type=\"bool\"\n"
813 "\t cardinality=\"single\"\n"
814 "\t visibility=\"external\"\n"
815 "\t defaultValue=\"false\"\n"
816 "\t access=\"public\"\n"
817 "\t >\n"
818 " Set to true if the image data should be cleared after it has been uploaded to the graphics\n"
819 " card and is no longer needed in main memory.\n"
820 " </Field>\n"
821 "</FieldContainer>\n",
822 "1D/2D/3D Image with various pixel types data, optionally also can hold\n"
823 "mipMap and simple multi-frame data.\n"
826 /*------------------------------ get -----------------------------------*/
828 FieldContainerType &ImageBase::getType(void)
830 return _type;
833 const FieldContainerType &ImageBase::getType(void) const
835 return _type;
838 UInt32 ImageBase::getContainerSize(void) const
840 return sizeof(Image);
843 /*------------------------- decorator get ------------------------------*/
847 SFInt32 *ImageBase::editSFDimension(void)
849 editSField(DimensionFieldMask);
851 return &_sfDimension;
854 const SFInt32 *ImageBase::getSFDimension(void) const
856 return &_sfDimension;
860 SFInt32 *ImageBase::editSFWidth(void)
862 editSField(WidthFieldMask);
864 return &_sfWidth;
867 const SFInt32 *ImageBase::getSFWidth(void) const
869 return &_sfWidth;
873 SFInt32 *ImageBase::editSFHeight(void)
875 editSField(HeightFieldMask);
877 return &_sfHeight;
880 const SFInt32 *ImageBase::getSFHeight(void) const
882 return &_sfHeight;
886 SFInt32 *ImageBase::editSFDepth(void)
888 editSField(DepthFieldMask);
890 return &_sfDepth;
893 const SFInt32 *ImageBase::getSFDepth(void) const
895 return &_sfDepth;
899 SFInt32 *ImageBase::editSFBpp(void)
901 editSField(BppFieldMask);
903 return &_sfBpp;
906 const SFInt32 *ImageBase::getSFBpp(void) const
908 return &_sfBpp;
912 SFInt32 *ImageBase::editSFMipMapCount(void)
914 editSField(MipMapCountFieldMask);
916 return &_sfMipMapCount;
919 const SFInt32 *ImageBase::getSFMipMapCount(void) const
921 return &_sfMipMapCount;
925 SFInt32 *ImageBase::editSFFrameCount(void)
927 editSField(FrameCountFieldMask);
929 return &_sfFrameCount;
932 const SFInt32 *ImageBase::getSFFrameCount(void) const
934 return &_sfFrameCount;
938 SFTime *ImageBase::editSFFrameDelay(void)
940 editSField(FrameDelayFieldMask);
942 return &_sfFrameDelay;
945 const SFTime *ImageBase::getSFFrameDelay(void) const
947 return &_sfFrameDelay;
951 SFUInt32 *ImageBase::editSFPixelFormat(void)
953 editSField(PixelFormatFieldMask);
955 return &_sfPixelFormat;
958 const SFUInt32 *ImageBase::getSFPixelFormat(void) const
960 return &_sfPixelFormat;
964 MFUInt8 *ImageBase::editMFPixel(void)
966 editMField(PixelFieldMask, _mfPixel);
968 return &_mfPixel;
971 const MFUInt8 *ImageBase::getMFPixel(void) const
973 return &_mfPixel;
977 SFInt32 *ImageBase::editSFFrameSize(void)
979 editSField(FrameSizeFieldMask);
981 return &_sfFrameSize;
984 const SFInt32 *ImageBase::getSFFrameSize(void) const
986 return &_sfFrameSize;
990 SFString *ImageBase::editSFName(void)
992 editSField(NameFieldMask);
994 return &_sfName;
997 const SFString *ImageBase::getSFName(void) const
999 return &_sfName;
1003 SFInt32 *ImageBase::editSFDataType(void)
1005 editSField(DataTypeFieldMask);
1007 return &_sfDataType;
1010 const SFInt32 *ImageBase::getSFDataType(void) const
1012 return &_sfDataType;
1016 SFInt32 *ImageBase::editSFComponentSize(void)
1018 editSField(ComponentSizeFieldMask);
1020 return &_sfComponentSize;
1023 const SFInt32 *ImageBase::getSFComponentSize(void) const
1025 return &_sfComponentSize;
1029 SFInt32 *ImageBase::editSFSideCount(void)
1031 editSField(SideCountFieldMask);
1033 return &_sfSideCount;
1036 const SFInt32 *ImageBase::getSFSideCount(void) const
1038 return &_sfSideCount;
1042 SFInt32 *ImageBase::editSFSideSize(void)
1044 editSField(SideSizeFieldMask);
1046 return &_sfSideSize;
1049 const SFInt32 *ImageBase::getSFSideSize(void) const
1051 return &_sfSideSize;
1055 SFBool *ImageBase::editSFForceCompressedData(void)
1057 editSField(ForceCompressedDataFieldMask);
1059 return &_sfForceCompressedData;
1062 const SFBool *ImageBase::getSFForceCompressedData(void) const
1064 return &_sfForceCompressedData;
1068 SFBool *ImageBase::editSFForceAlphaChannel(void)
1070 editSField(ForceAlphaChannelFieldMask);
1072 return &_sfForceAlphaChannel;
1075 const SFBool *ImageBase::getSFForceAlphaChannel(void) const
1077 return &_sfForceAlphaChannel;
1081 SFBool *ImageBase::editSFForceColorChannel(void)
1083 editSField(ForceColorChannelFieldMask);
1085 return &_sfForceColorChannel;
1088 const SFBool *ImageBase::getSFForceColorChannel(void) const
1090 return &_sfForceColorChannel;
1094 SFBool *ImageBase::editSFForceAlphaBinary(void)
1096 editSField(ForceAlphaBinaryFieldMask);
1098 return &_sfForceAlphaBinary;
1101 const SFBool *ImageBase::getSFForceAlphaBinary(void) const
1103 return &_sfForceAlphaBinary;
1107 SFReal32 *ImageBase::editSFResX(void)
1109 editSField(ResXFieldMask);
1111 return &_sfResX;
1114 const SFReal32 *ImageBase::getSFResX(void) const
1116 return &_sfResX;
1120 SFReal32 *ImageBase::editSFResY(void)
1122 editSField(ResYFieldMask);
1124 return &_sfResY;
1127 const SFReal32 *ImageBase::getSFResY(void) const
1129 return &_sfResY;
1133 SFUInt16 *ImageBase::editSFResUnit(void)
1135 editSField(ResUnitFieldMask);
1137 return &_sfResUnit;
1140 const SFUInt16 *ImageBase::getSFResUnit(void) const
1142 return &_sfResUnit;
1146 SFBool *ImageBase::editSFClearOnLoad(void)
1148 editSField(ClearOnLoadFieldMask);
1150 return &_sfClearOnLoad;
1153 const SFBool *ImageBase::getSFClearOnLoad(void) const
1155 return &_sfClearOnLoad;
1163 /*------------------------------ access -----------------------------------*/
1165 SizeT ImageBase::getBinSize(ConstFieldMaskArg whichField)
1167 SizeT returnValue = Inherited::getBinSize(whichField);
1169 if(FieldBits::NoField != (ParentsFieldMask & whichField))
1171 returnValue += _mfParents.getBinSize();
1173 if(FieldBits::NoField != (DimensionFieldMask & whichField))
1175 returnValue += _sfDimension.getBinSize();
1177 if(FieldBits::NoField != (WidthFieldMask & whichField))
1179 returnValue += _sfWidth.getBinSize();
1181 if(FieldBits::NoField != (HeightFieldMask & whichField))
1183 returnValue += _sfHeight.getBinSize();
1185 if(FieldBits::NoField != (DepthFieldMask & whichField))
1187 returnValue += _sfDepth.getBinSize();
1189 if(FieldBits::NoField != (BppFieldMask & whichField))
1191 returnValue += _sfBpp.getBinSize();
1193 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1195 returnValue += _sfMipMapCount.getBinSize();
1197 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1199 returnValue += _sfFrameCount.getBinSize();
1201 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1203 returnValue += _sfFrameDelay.getBinSize();
1205 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1207 returnValue += _sfPixelFormat.getBinSize();
1209 if(FieldBits::NoField != (PixelFieldMask & whichField))
1211 returnValue += _mfPixel.getBinSize();
1213 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1215 returnValue += _sfFrameSize.getBinSize();
1217 if(FieldBits::NoField != (NameFieldMask & whichField))
1219 returnValue += _sfName.getBinSize();
1221 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1223 returnValue += _sfDataType.getBinSize();
1225 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1227 returnValue += _sfComponentSize.getBinSize();
1229 if(FieldBits::NoField != (SideCountFieldMask & whichField))
1231 returnValue += _sfSideCount.getBinSize();
1233 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1235 returnValue += _sfSideSize.getBinSize();
1237 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1239 returnValue += _sfForceCompressedData.getBinSize();
1241 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1243 returnValue += _sfForceAlphaChannel.getBinSize();
1245 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1247 returnValue += _sfForceColorChannel.getBinSize();
1249 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1251 returnValue += _sfForceAlphaBinary.getBinSize();
1253 if(FieldBits::NoField != (ResXFieldMask & whichField))
1255 returnValue += _sfResX.getBinSize();
1257 if(FieldBits::NoField != (ResYFieldMask & whichField))
1259 returnValue += _sfResY.getBinSize();
1261 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
1263 returnValue += _sfResUnit.getBinSize();
1265 if(FieldBits::NoField != (ClearOnLoadFieldMask & whichField))
1267 returnValue += _sfClearOnLoad.getBinSize();
1270 return returnValue;
1273 void ImageBase::copyToBin(BinaryDataHandler &pMem,
1274 ConstFieldMaskArg whichField)
1276 Inherited::copyToBin(pMem, whichField);
1278 if(FieldBits::NoField != (ParentsFieldMask & whichField))
1280 _mfParents.copyToBin(pMem);
1282 if(FieldBits::NoField != (DimensionFieldMask & whichField))
1284 _sfDimension.copyToBin(pMem);
1286 if(FieldBits::NoField != (WidthFieldMask & whichField))
1288 _sfWidth.copyToBin(pMem);
1290 if(FieldBits::NoField != (HeightFieldMask & whichField))
1292 _sfHeight.copyToBin(pMem);
1294 if(FieldBits::NoField != (DepthFieldMask & whichField))
1296 _sfDepth.copyToBin(pMem);
1298 if(FieldBits::NoField != (BppFieldMask & whichField))
1300 _sfBpp.copyToBin(pMem);
1302 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1304 _sfMipMapCount.copyToBin(pMem);
1306 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1308 _sfFrameCount.copyToBin(pMem);
1310 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1312 _sfFrameDelay.copyToBin(pMem);
1314 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1316 _sfPixelFormat.copyToBin(pMem);
1318 if(FieldBits::NoField != (PixelFieldMask & whichField))
1320 _mfPixel.copyToBin(pMem);
1322 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1324 _sfFrameSize.copyToBin(pMem);
1326 if(FieldBits::NoField != (NameFieldMask & whichField))
1328 _sfName.copyToBin(pMem);
1330 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1332 _sfDataType.copyToBin(pMem);
1334 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1336 _sfComponentSize.copyToBin(pMem);
1338 if(FieldBits::NoField != (SideCountFieldMask & whichField))
1340 _sfSideCount.copyToBin(pMem);
1342 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1344 _sfSideSize.copyToBin(pMem);
1346 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1348 _sfForceCompressedData.copyToBin(pMem);
1350 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1352 _sfForceAlphaChannel.copyToBin(pMem);
1354 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1356 _sfForceColorChannel.copyToBin(pMem);
1358 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1360 _sfForceAlphaBinary.copyToBin(pMem);
1362 if(FieldBits::NoField != (ResXFieldMask & whichField))
1364 _sfResX.copyToBin(pMem);
1366 if(FieldBits::NoField != (ResYFieldMask & whichField))
1368 _sfResY.copyToBin(pMem);
1370 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
1372 _sfResUnit.copyToBin(pMem);
1374 if(FieldBits::NoField != (ClearOnLoadFieldMask & whichField))
1376 _sfClearOnLoad.copyToBin(pMem);
1380 void ImageBase::copyFromBin(BinaryDataHandler &pMem,
1381 ConstFieldMaskArg whichField)
1383 Inherited::copyFromBin(pMem, whichField);
1385 if(FieldBits::NoField != (ParentsFieldMask & whichField))
1387 editMField(ParentsFieldMask, _mfParents);
1388 _mfParents.copyFromBin(pMem);
1390 if(FieldBits::NoField != (DimensionFieldMask & whichField))
1392 editSField(DimensionFieldMask);
1393 _sfDimension.copyFromBin(pMem);
1395 if(FieldBits::NoField != (WidthFieldMask & whichField))
1397 editSField(WidthFieldMask);
1398 _sfWidth.copyFromBin(pMem);
1400 if(FieldBits::NoField != (HeightFieldMask & whichField))
1402 editSField(HeightFieldMask);
1403 _sfHeight.copyFromBin(pMem);
1405 if(FieldBits::NoField != (DepthFieldMask & whichField))
1407 editSField(DepthFieldMask);
1408 _sfDepth.copyFromBin(pMem);
1410 if(FieldBits::NoField != (BppFieldMask & whichField))
1412 editSField(BppFieldMask);
1413 _sfBpp.copyFromBin(pMem);
1415 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1417 editSField(MipMapCountFieldMask);
1418 _sfMipMapCount.copyFromBin(pMem);
1420 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1422 editSField(FrameCountFieldMask);
1423 _sfFrameCount.copyFromBin(pMem);
1425 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1427 editSField(FrameDelayFieldMask);
1428 _sfFrameDelay.copyFromBin(pMem);
1430 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1432 editSField(PixelFormatFieldMask);
1433 _sfPixelFormat.copyFromBin(pMem);
1435 if(FieldBits::NoField != (PixelFieldMask & whichField))
1437 editMField(PixelFieldMask, _mfPixel);
1438 _mfPixel.copyFromBin(pMem);
1440 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1442 editSField(FrameSizeFieldMask);
1443 _sfFrameSize.copyFromBin(pMem);
1445 if(FieldBits::NoField != (NameFieldMask & whichField))
1447 editSField(NameFieldMask);
1448 _sfName.copyFromBin(pMem);
1450 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1452 editSField(DataTypeFieldMask);
1453 _sfDataType.copyFromBin(pMem);
1455 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1457 editSField(ComponentSizeFieldMask);
1458 _sfComponentSize.copyFromBin(pMem);
1460 if(FieldBits::NoField != (SideCountFieldMask & whichField))
1462 editSField(SideCountFieldMask);
1463 _sfSideCount.copyFromBin(pMem);
1465 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1467 editSField(SideSizeFieldMask);
1468 _sfSideSize.copyFromBin(pMem);
1470 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1472 editSField(ForceCompressedDataFieldMask);
1473 _sfForceCompressedData.copyFromBin(pMem);
1475 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1477 editSField(ForceAlphaChannelFieldMask);
1478 _sfForceAlphaChannel.copyFromBin(pMem);
1480 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1482 editSField(ForceColorChannelFieldMask);
1483 _sfForceColorChannel.copyFromBin(pMem);
1485 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1487 editSField(ForceAlphaBinaryFieldMask);
1488 _sfForceAlphaBinary.copyFromBin(pMem);
1490 if(FieldBits::NoField != (ResXFieldMask & whichField))
1492 editSField(ResXFieldMask);
1493 _sfResX.copyFromBin(pMem);
1495 if(FieldBits::NoField != (ResYFieldMask & whichField))
1497 editSField(ResYFieldMask);
1498 _sfResY.copyFromBin(pMem);
1500 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
1502 editSField(ResUnitFieldMask);
1503 _sfResUnit.copyFromBin(pMem);
1505 if(FieldBits::NoField != (ClearOnLoadFieldMask & whichField))
1507 editSField(ClearOnLoadFieldMask);
1508 _sfClearOnLoad.copyFromBin(pMem);
1512 //! create a new instance of the class
1513 ImageTransitPtr ImageBase::createLocal(BitVector bFlags)
1515 ImageTransitPtr fc;
1517 if(getClassType().getPrototype() != NULL)
1519 FieldContainerTransitPtr tmpPtr =
1520 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
1522 fc = dynamic_pointer_cast<Image>(tmpPtr);
1525 return fc;
1528 //! create a new instance of the class, copy the container flags
1529 ImageTransitPtr ImageBase::createDependent(BitVector bFlags)
1531 ImageTransitPtr fc;
1533 if(getClassType().getPrototype() != NULL)
1535 FieldContainerTransitPtr tmpPtr =
1536 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
1538 fc = dynamic_pointer_cast<Image>(tmpPtr);
1541 return fc;
1544 //! create a new instance of the class
1545 ImageTransitPtr ImageBase::create(void)
1547 ImageTransitPtr fc;
1549 if(getClassType().getPrototype() != NULL)
1551 FieldContainerTransitPtr tmpPtr =
1552 getClassType().getPrototype()-> shallowCopy();
1554 fc = dynamic_pointer_cast<Image>(tmpPtr);
1557 return fc;
1560 Image *ImageBase::createEmptyLocal(BitVector bFlags)
1562 Image *returnValue;
1564 newPtr<Image>(returnValue, bFlags);
1566 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1568 return returnValue;
1571 //! create an empty new instance of the class, do not copy the prototype
1572 Image *ImageBase::createEmpty(void)
1574 Image *returnValue;
1576 newPtr<Image>(returnValue, Thread::getCurrentLocalFlags());
1578 returnValue->_pFieldFlags->_bNamespaceMask &=
1579 ~Thread::getCurrentLocalFlags();
1581 return returnValue;
1585 FieldContainerTransitPtr ImageBase::shallowCopyLocal(
1586 BitVector bFlags) const
1588 Image *tmpPtr;
1590 newPtr(tmpPtr, dynamic_cast<const Image *>(this), bFlags);
1592 FieldContainerTransitPtr returnValue(tmpPtr);
1594 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1596 return returnValue;
1599 FieldContainerTransitPtr ImageBase::shallowCopyDependent(
1600 BitVector bFlags) const
1602 Image *tmpPtr;
1604 newPtr(tmpPtr, dynamic_cast<const Image *>(this), ~bFlags);
1606 FieldContainerTransitPtr returnValue(tmpPtr);
1608 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1610 return returnValue;
1613 FieldContainerTransitPtr ImageBase::shallowCopy(void) const
1615 Image *tmpPtr;
1617 newPtr(tmpPtr,
1618 dynamic_cast<const Image *>(this),
1619 Thread::getCurrentLocalFlags());
1621 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1623 FieldContainerTransitPtr returnValue(tmpPtr);
1625 return returnValue;
1631 /*------------------------- constructors ----------------------------------*/
1633 ImageBase::ImageBase(void) :
1634 Inherited(),
1635 _mfParents (),
1636 _sfDimension (Int32(0)),
1637 _sfWidth (Int32(0)),
1638 _sfHeight (Int32(1)),
1639 _sfDepth (Int32(1)),
1640 _sfBpp (Int32(1)),
1641 _sfMipMapCount (Int32(1)),
1642 _sfFrameCount (Int32(1)),
1643 _sfFrameDelay (Time(0)),
1644 _sfPixelFormat (UInt32(Image::OSG_INVALID_PF)),
1645 _mfPixel (),
1646 _sfFrameSize (Int32(0)),
1647 _sfName (),
1648 _sfDataType (Int32(GL_UNSIGNED_BYTE)),
1649 _sfComponentSize (Int32(1)),
1650 _sfSideCount (Int32(1)),
1651 _sfSideSize (Int32(0)),
1652 _sfForceCompressedData (bool(false)),
1653 _sfForceAlphaChannel (bool(false)),
1654 _sfForceColorChannel (bool(false)),
1655 _sfForceAlphaBinary (bool(false)),
1656 _sfResX (Real32(72.0f)),
1657 _sfResY (Real32(72.0f)),
1658 _sfResUnit (UInt16(2)),
1659 _sfClearOnLoad (bool(false))
1663 ImageBase::ImageBase(const ImageBase &source) :
1664 Inherited(source),
1665 _mfParents (),
1666 _sfDimension (source._sfDimension ),
1667 _sfWidth (source._sfWidth ),
1668 _sfHeight (source._sfHeight ),
1669 _sfDepth (source._sfDepth ),
1670 _sfBpp (source._sfBpp ),
1671 _sfMipMapCount (source._sfMipMapCount ),
1672 _sfFrameCount (source._sfFrameCount ),
1673 _sfFrameDelay (source._sfFrameDelay ),
1674 _sfPixelFormat (source._sfPixelFormat ),
1675 _mfPixel (source._mfPixel ),
1676 _sfFrameSize (source._sfFrameSize ),
1677 _sfName (source._sfName ),
1678 _sfDataType (source._sfDataType ),
1679 _sfComponentSize (source._sfComponentSize ),
1680 _sfSideCount (source._sfSideCount ),
1681 _sfSideSize (source._sfSideSize ),
1682 _sfForceCompressedData (source._sfForceCompressedData ),
1683 _sfForceAlphaChannel (source._sfForceAlphaChannel ),
1684 _sfForceColorChannel (source._sfForceColorChannel ),
1685 _sfForceAlphaBinary (source._sfForceAlphaBinary ),
1686 _sfResX (source._sfResX ),
1687 _sfResY (source._sfResY ),
1688 _sfResUnit (source._sfResUnit ),
1689 _sfClearOnLoad (source._sfClearOnLoad )
1694 /*-------------------------- destructors ----------------------------------*/
1696 ImageBase::~ImageBase(void)
1699 /*-------------------------------------------------------------------------*/
1700 /* Parent linking */
1702 bool ImageBase::linkParent(
1703 FieldContainer * const pParent,
1704 UInt16 const childFieldId,
1705 UInt16 const parentFieldId )
1707 if(parentFieldId == ParentsFieldId)
1709 FieldContainer * pTypedParent =
1710 dynamic_cast< FieldContainer * >(pParent);
1712 if(pTypedParent != NULL)
1714 editMField(ParentsFieldMask, _mfParents);
1716 _mfParents.push_back(pTypedParent, childFieldId);
1718 return true;
1721 return false;
1724 return Inherited::linkParent(pParent, childFieldId, parentFieldId);
1727 bool ImageBase::unlinkParent(
1728 FieldContainer * const pParent,
1729 UInt16 const parentFieldId)
1731 if(parentFieldId == ParentsFieldId)
1733 FieldContainer * pTypedParent =
1734 dynamic_cast< FieldContainer * >(pParent);
1736 if(pTypedParent != NULL)
1738 Int32 iParentIdx = _mfParents.findIndex(pTypedParent);
1740 if(iParentIdx != -1)
1742 editMField(ParentsFieldMask, _mfParents);
1744 _mfParents.erase(iParentIdx);
1746 return true;
1749 SWARNING << "Child ([" << this
1750 << "] id [" << this->getId()
1751 << "] type [" << this->getType().getCName()
1752 << "] parentFieldId [" << parentFieldId
1753 << "]) - Parent ([" << pParent
1754 << "] id [" << pParent->getId()
1755 << "] type [" << pParent->getType().getCName()
1756 << "]): link inconsistent!"
1757 << std::endl;
1759 return false;
1762 return false;
1765 return Inherited::unlinkParent(pParent, parentFieldId);
1770 GetFieldHandlePtr ImageBase::getHandleParents (void) const
1772 MFParentFieldContainerPtr::GetHandlePtr returnValue;
1774 return returnValue;
1777 EditFieldHandlePtr ImageBase::editHandleParents (void)
1779 EditFieldHandlePtr returnValue;
1781 return returnValue;
1784 GetFieldHandlePtr ImageBase::getHandleDimension (void) const
1786 SFInt32::GetHandlePtr returnValue(
1787 new SFInt32::GetHandle(
1788 &_sfDimension,
1789 this->getType().getFieldDesc(DimensionFieldId),
1790 const_cast<ImageBase *>(this)));
1792 return returnValue;
1795 EditFieldHandlePtr ImageBase::editHandleDimension (void)
1797 SFInt32::EditHandlePtr returnValue(
1798 new SFInt32::EditHandle(
1799 &_sfDimension,
1800 this->getType().getFieldDesc(DimensionFieldId),
1801 this));
1804 editSField(DimensionFieldMask);
1806 return returnValue;
1809 GetFieldHandlePtr ImageBase::getHandleWidth (void) const
1811 SFInt32::GetHandlePtr returnValue(
1812 new SFInt32::GetHandle(
1813 &_sfWidth,
1814 this->getType().getFieldDesc(WidthFieldId),
1815 const_cast<ImageBase *>(this)));
1817 return returnValue;
1820 EditFieldHandlePtr ImageBase::editHandleWidth (void)
1822 SFInt32::EditHandlePtr returnValue(
1823 new SFInt32::EditHandle(
1824 &_sfWidth,
1825 this->getType().getFieldDesc(WidthFieldId),
1826 this));
1829 editSField(WidthFieldMask);
1831 return returnValue;
1834 GetFieldHandlePtr ImageBase::getHandleHeight (void) const
1836 SFInt32::GetHandlePtr returnValue(
1837 new SFInt32::GetHandle(
1838 &_sfHeight,
1839 this->getType().getFieldDesc(HeightFieldId),
1840 const_cast<ImageBase *>(this)));
1842 return returnValue;
1845 EditFieldHandlePtr ImageBase::editHandleHeight (void)
1847 SFInt32::EditHandlePtr returnValue(
1848 new SFInt32::EditHandle(
1849 &_sfHeight,
1850 this->getType().getFieldDesc(HeightFieldId),
1851 this));
1854 editSField(HeightFieldMask);
1856 return returnValue;
1859 GetFieldHandlePtr ImageBase::getHandleDepth (void) const
1861 SFInt32::GetHandlePtr returnValue(
1862 new SFInt32::GetHandle(
1863 &_sfDepth,
1864 this->getType().getFieldDesc(DepthFieldId),
1865 const_cast<ImageBase *>(this)));
1867 return returnValue;
1870 EditFieldHandlePtr ImageBase::editHandleDepth (void)
1872 SFInt32::EditHandlePtr returnValue(
1873 new SFInt32::EditHandle(
1874 &_sfDepth,
1875 this->getType().getFieldDesc(DepthFieldId),
1876 this));
1879 editSField(DepthFieldMask);
1881 return returnValue;
1884 GetFieldHandlePtr ImageBase::getHandleBpp (void) const
1886 SFInt32::GetHandlePtr returnValue(
1887 new SFInt32::GetHandle(
1888 &_sfBpp,
1889 this->getType().getFieldDesc(BppFieldId),
1890 const_cast<ImageBase *>(this)));
1892 return returnValue;
1895 EditFieldHandlePtr ImageBase::editHandleBpp (void)
1897 SFInt32::EditHandlePtr returnValue(
1898 new SFInt32::EditHandle(
1899 &_sfBpp,
1900 this->getType().getFieldDesc(BppFieldId),
1901 this));
1904 editSField(BppFieldMask);
1906 return returnValue;
1909 GetFieldHandlePtr ImageBase::getHandleMipMapCount (void) const
1911 SFInt32::GetHandlePtr returnValue(
1912 new SFInt32::GetHandle(
1913 &_sfMipMapCount,
1914 this->getType().getFieldDesc(MipMapCountFieldId),
1915 const_cast<ImageBase *>(this)));
1917 return returnValue;
1920 EditFieldHandlePtr ImageBase::editHandleMipMapCount (void)
1922 SFInt32::EditHandlePtr returnValue(
1923 new SFInt32::EditHandle(
1924 &_sfMipMapCount,
1925 this->getType().getFieldDesc(MipMapCountFieldId),
1926 this));
1929 editSField(MipMapCountFieldMask);
1931 return returnValue;
1934 GetFieldHandlePtr ImageBase::getHandleFrameCount (void) const
1936 SFInt32::GetHandlePtr returnValue(
1937 new SFInt32::GetHandle(
1938 &_sfFrameCount,
1939 this->getType().getFieldDesc(FrameCountFieldId),
1940 const_cast<ImageBase *>(this)));
1942 return returnValue;
1945 EditFieldHandlePtr ImageBase::editHandleFrameCount (void)
1947 SFInt32::EditHandlePtr returnValue(
1948 new SFInt32::EditHandle(
1949 &_sfFrameCount,
1950 this->getType().getFieldDesc(FrameCountFieldId),
1951 this));
1954 editSField(FrameCountFieldMask);
1956 return returnValue;
1959 GetFieldHandlePtr ImageBase::getHandleFrameDelay (void) const
1961 SFTime::GetHandlePtr returnValue(
1962 new SFTime::GetHandle(
1963 &_sfFrameDelay,
1964 this->getType().getFieldDesc(FrameDelayFieldId),
1965 const_cast<ImageBase *>(this)));
1967 return returnValue;
1970 EditFieldHandlePtr ImageBase::editHandleFrameDelay (void)
1972 SFTime::EditHandlePtr returnValue(
1973 new SFTime::EditHandle(
1974 &_sfFrameDelay,
1975 this->getType().getFieldDesc(FrameDelayFieldId),
1976 this));
1979 editSField(FrameDelayFieldMask);
1981 return returnValue;
1984 GetFieldHandlePtr ImageBase::getHandlePixelFormat (void) const
1986 SFUInt32::GetHandlePtr returnValue(
1987 new SFUInt32::GetHandle(
1988 &_sfPixelFormat,
1989 this->getType().getFieldDesc(PixelFormatFieldId),
1990 const_cast<ImageBase *>(this)));
1992 return returnValue;
1995 EditFieldHandlePtr ImageBase::editHandlePixelFormat (void)
1997 SFUInt32::EditHandlePtr returnValue(
1998 new SFUInt32::EditHandle(
1999 &_sfPixelFormat,
2000 this->getType().getFieldDesc(PixelFormatFieldId),
2001 this));
2004 editSField(PixelFormatFieldMask);
2006 return returnValue;
2009 GetFieldHandlePtr ImageBase::getHandlePixel (void) const
2011 MFUInt8::GetHandlePtr returnValue(
2012 new MFUInt8::GetHandle(
2013 &_mfPixel,
2014 this->getType().getFieldDesc(PixelFieldId),
2015 const_cast<ImageBase *>(this)));
2017 return returnValue;
2020 EditFieldHandlePtr ImageBase::editHandlePixel (void)
2022 MFUInt8::EditHandlePtr returnValue(
2023 new MFUInt8::EditHandle(
2024 &_mfPixel,
2025 this->getType().getFieldDesc(PixelFieldId),
2026 this));
2029 editMField(PixelFieldMask, _mfPixel);
2031 return returnValue;
2034 GetFieldHandlePtr ImageBase::getHandleFrameSize (void) const
2036 SFInt32::GetHandlePtr returnValue(
2037 new SFInt32::GetHandle(
2038 &_sfFrameSize,
2039 this->getType().getFieldDesc(FrameSizeFieldId),
2040 const_cast<ImageBase *>(this)));
2042 return returnValue;
2045 EditFieldHandlePtr ImageBase::editHandleFrameSize (void)
2047 SFInt32::EditHandlePtr returnValue(
2048 new SFInt32::EditHandle(
2049 &_sfFrameSize,
2050 this->getType().getFieldDesc(FrameSizeFieldId),
2051 this));
2054 editSField(FrameSizeFieldMask);
2056 return returnValue;
2059 GetFieldHandlePtr ImageBase::getHandleName (void) const
2061 SFString::GetHandlePtr returnValue(
2062 new SFString::GetHandle(
2063 &_sfName,
2064 this->getType().getFieldDesc(NameFieldId),
2065 const_cast<ImageBase *>(this)));
2067 return returnValue;
2070 EditFieldHandlePtr ImageBase::editHandleName (void)
2072 SFString::EditHandlePtr returnValue(
2073 new SFString::EditHandle(
2074 &_sfName,
2075 this->getType().getFieldDesc(NameFieldId),
2076 this));
2079 editSField(NameFieldMask);
2081 return returnValue;
2084 GetFieldHandlePtr ImageBase::getHandleDataType (void) const
2086 SFInt32::GetHandlePtr returnValue(
2087 new SFInt32::GetHandle(
2088 &_sfDataType,
2089 this->getType().getFieldDesc(DataTypeFieldId),
2090 const_cast<ImageBase *>(this)));
2092 return returnValue;
2095 EditFieldHandlePtr ImageBase::editHandleDataType (void)
2097 SFInt32::EditHandlePtr returnValue(
2098 new SFInt32::EditHandle(
2099 &_sfDataType,
2100 this->getType().getFieldDesc(DataTypeFieldId),
2101 this));
2104 editSField(DataTypeFieldMask);
2106 return returnValue;
2109 GetFieldHandlePtr ImageBase::getHandleComponentSize (void) const
2111 SFInt32::GetHandlePtr returnValue(
2112 new SFInt32::GetHandle(
2113 &_sfComponentSize,
2114 this->getType().getFieldDesc(ComponentSizeFieldId),
2115 const_cast<ImageBase *>(this)));
2117 return returnValue;
2120 EditFieldHandlePtr ImageBase::editHandleComponentSize (void)
2122 SFInt32::EditHandlePtr returnValue(
2123 new SFInt32::EditHandle(
2124 &_sfComponentSize,
2125 this->getType().getFieldDesc(ComponentSizeFieldId),
2126 this));
2129 editSField(ComponentSizeFieldMask);
2131 return returnValue;
2134 GetFieldHandlePtr ImageBase::getHandleSideCount (void) const
2136 SFInt32::GetHandlePtr returnValue(
2137 new SFInt32::GetHandle(
2138 &_sfSideCount,
2139 this->getType().getFieldDesc(SideCountFieldId),
2140 const_cast<ImageBase *>(this)));
2142 return returnValue;
2145 EditFieldHandlePtr ImageBase::editHandleSideCount (void)
2147 SFInt32::EditHandlePtr returnValue(
2148 new SFInt32::EditHandle(
2149 &_sfSideCount,
2150 this->getType().getFieldDesc(SideCountFieldId),
2151 this));
2154 editSField(SideCountFieldMask);
2156 return returnValue;
2159 GetFieldHandlePtr ImageBase::getHandleSideSize (void) const
2161 SFInt32::GetHandlePtr returnValue(
2162 new SFInt32::GetHandle(
2163 &_sfSideSize,
2164 this->getType().getFieldDesc(SideSizeFieldId),
2165 const_cast<ImageBase *>(this)));
2167 return returnValue;
2170 EditFieldHandlePtr ImageBase::editHandleSideSize (void)
2172 SFInt32::EditHandlePtr returnValue(
2173 new SFInt32::EditHandle(
2174 &_sfSideSize,
2175 this->getType().getFieldDesc(SideSizeFieldId),
2176 this));
2179 editSField(SideSizeFieldMask);
2181 return returnValue;
2184 GetFieldHandlePtr ImageBase::getHandleForceCompressedData (void) const
2186 SFBool::GetHandlePtr returnValue(
2187 new SFBool::GetHandle(
2188 &_sfForceCompressedData,
2189 this->getType().getFieldDesc(ForceCompressedDataFieldId),
2190 const_cast<ImageBase *>(this)));
2192 return returnValue;
2195 EditFieldHandlePtr ImageBase::editHandleForceCompressedData(void)
2197 SFBool::EditHandlePtr returnValue(
2198 new SFBool::EditHandle(
2199 &_sfForceCompressedData,
2200 this->getType().getFieldDesc(ForceCompressedDataFieldId),
2201 this));
2204 editSField(ForceCompressedDataFieldMask);
2206 return returnValue;
2209 GetFieldHandlePtr ImageBase::getHandleForceAlphaChannel (void) const
2211 SFBool::GetHandlePtr returnValue(
2212 new SFBool::GetHandle(
2213 &_sfForceAlphaChannel,
2214 this->getType().getFieldDesc(ForceAlphaChannelFieldId),
2215 const_cast<ImageBase *>(this)));
2217 return returnValue;
2220 EditFieldHandlePtr ImageBase::editHandleForceAlphaChannel(void)
2222 SFBool::EditHandlePtr returnValue(
2223 new SFBool::EditHandle(
2224 &_sfForceAlphaChannel,
2225 this->getType().getFieldDesc(ForceAlphaChannelFieldId),
2226 this));
2229 editSField(ForceAlphaChannelFieldMask);
2231 return returnValue;
2234 GetFieldHandlePtr ImageBase::getHandleForceColorChannel (void) const
2236 SFBool::GetHandlePtr returnValue(
2237 new SFBool::GetHandle(
2238 &_sfForceColorChannel,
2239 this->getType().getFieldDesc(ForceColorChannelFieldId),
2240 const_cast<ImageBase *>(this)));
2242 return returnValue;
2245 EditFieldHandlePtr ImageBase::editHandleForceColorChannel(void)
2247 SFBool::EditHandlePtr returnValue(
2248 new SFBool::EditHandle(
2249 &_sfForceColorChannel,
2250 this->getType().getFieldDesc(ForceColorChannelFieldId),
2251 this));
2254 editSField(ForceColorChannelFieldMask);
2256 return returnValue;
2259 GetFieldHandlePtr ImageBase::getHandleForceAlphaBinary (void) const
2261 SFBool::GetHandlePtr returnValue(
2262 new SFBool::GetHandle(
2263 &_sfForceAlphaBinary,
2264 this->getType().getFieldDesc(ForceAlphaBinaryFieldId),
2265 const_cast<ImageBase *>(this)));
2267 return returnValue;
2270 EditFieldHandlePtr ImageBase::editHandleForceAlphaBinary(void)
2272 SFBool::EditHandlePtr returnValue(
2273 new SFBool::EditHandle(
2274 &_sfForceAlphaBinary,
2275 this->getType().getFieldDesc(ForceAlphaBinaryFieldId),
2276 this));
2279 editSField(ForceAlphaBinaryFieldMask);
2281 return returnValue;
2284 GetFieldHandlePtr ImageBase::getHandleResX (void) const
2286 SFReal32::GetHandlePtr returnValue(
2287 new SFReal32::GetHandle(
2288 &_sfResX,
2289 this->getType().getFieldDesc(ResXFieldId),
2290 const_cast<ImageBase *>(this)));
2292 return returnValue;
2295 EditFieldHandlePtr ImageBase::editHandleResX (void)
2297 SFReal32::EditHandlePtr returnValue(
2298 new SFReal32::EditHandle(
2299 &_sfResX,
2300 this->getType().getFieldDesc(ResXFieldId),
2301 this));
2304 editSField(ResXFieldMask);
2306 return returnValue;
2309 GetFieldHandlePtr ImageBase::getHandleResY (void) const
2311 SFReal32::GetHandlePtr returnValue(
2312 new SFReal32::GetHandle(
2313 &_sfResY,
2314 this->getType().getFieldDesc(ResYFieldId),
2315 const_cast<ImageBase *>(this)));
2317 return returnValue;
2320 EditFieldHandlePtr ImageBase::editHandleResY (void)
2322 SFReal32::EditHandlePtr returnValue(
2323 new SFReal32::EditHandle(
2324 &_sfResY,
2325 this->getType().getFieldDesc(ResYFieldId),
2326 this));
2329 editSField(ResYFieldMask);
2331 return returnValue;
2334 GetFieldHandlePtr ImageBase::getHandleResUnit (void) const
2336 SFUInt16::GetHandlePtr returnValue(
2337 new SFUInt16::GetHandle(
2338 &_sfResUnit,
2339 this->getType().getFieldDesc(ResUnitFieldId),
2340 const_cast<ImageBase *>(this)));
2342 return returnValue;
2345 EditFieldHandlePtr ImageBase::editHandleResUnit (void)
2347 SFUInt16::EditHandlePtr returnValue(
2348 new SFUInt16::EditHandle(
2349 &_sfResUnit,
2350 this->getType().getFieldDesc(ResUnitFieldId),
2351 this));
2354 editSField(ResUnitFieldMask);
2356 return returnValue;
2359 GetFieldHandlePtr ImageBase::getHandleClearOnLoad (void) const
2361 SFBool::GetHandlePtr returnValue(
2362 new SFBool::GetHandle(
2363 &_sfClearOnLoad,
2364 this->getType().getFieldDesc(ClearOnLoadFieldId),
2365 const_cast<ImageBase *>(this)));
2367 return returnValue;
2370 EditFieldHandlePtr ImageBase::editHandleClearOnLoad (void)
2372 SFBool::EditHandlePtr returnValue(
2373 new SFBool::EditHandle(
2374 &_sfClearOnLoad,
2375 this->getType().getFieldDesc(ClearOnLoadFieldId),
2376 this));
2379 editSField(ClearOnLoadFieldMask);
2381 return returnValue;
2385 #ifdef OSG_MT_CPTR_ASPECT
2386 void ImageBase::execSyncV( FieldContainer &oFrom,
2387 ConstFieldMaskArg whichField,
2388 AspectOffsetStore &oOffsets,
2389 ConstFieldMaskArg syncMode,
2390 const UInt32 uiSyncInfo)
2392 Image *pThis = static_cast<Image *>(this);
2394 pThis->execSync(static_cast<Image *>(&oFrom),
2395 whichField,
2396 oOffsets,
2397 syncMode,
2398 uiSyncInfo);
2400 #endif
2403 #ifdef OSG_MT_CPTR_ASPECT
2404 FieldContainer *ImageBase::createAspectCopy(
2405 const FieldContainer *pRefAspect) const
2407 Image *returnValue;
2409 newAspectCopy(returnValue,
2410 dynamic_cast<const Image *>(pRefAspect),
2411 dynamic_cast<const Image *>(this));
2413 return returnValue;
2415 #endif
2417 void ImageBase::resolveLinks(void)
2419 Inherited::resolveLinks();
2421 #ifdef OSG_MT_CPTR_ASPECT
2422 AspectOffsetStore oOffsets;
2424 _pAspectStore->fillOffsetArray(oOffsets, this);
2425 #endif
2427 #ifdef OSG_MT_CPTR_ASPECT
2428 _mfPixel.terminateShare(Thread::getCurrentAspect(),
2429 oOffsets);
2430 #endif
2434 OSG_END_NAMESPACE