fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Image / OSGImageBase.cpp
blobacc6d44ac5cf584f86842dabca3412833f7d685e
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>(
555 reinterpret_cast<void *>(&Image::classDescInserter)),
556 false,
557 (ComponentSizeFieldMask | SideSizeFieldMask | FrameSizeFieldMask),
558 "<?xml version=\"1.0\"?>\n"
559 "\n"
560 "<FieldContainer\n"
561 " name=\"Image\"\n"
562 " parent=\"AttachmentContainer\"\n"
563 " library=\"System\"\n"
564 " pointerfieldtypes=\"both\"\n"
565 " structure=\"concrete\"\n"
566 " systemcomponent=\"true\"\n"
567 " parentsystemcomponent=\"true\"\n"
568 " decoratable=\"false\"\n"
569 " useLocalIncludes=\"false\"\n"
570 " fieldsUnmarkedOnCreate=\"(ComponentSizeFieldMask | SideSizeFieldMask | FrameSizeFieldMask)\"\n"
571 " childFields=\"single\"\n"
572 " docGroupBase=\"GrpSystemImage\"\n"
573 " >\n"
574 "\n"
575 " 1D/2D/3D Image with various pixel types data, optionally also can hold\n"
576 " mipMap and simple multi-frame data.\n"
577 "\n"
578 " <Field\n"
579 "\t name=\"parents\"\n"
580 "\t type=\"FieldContainer\"\n"
581 "\t cardinality=\"multi\"\n"
582 "\t visibility=\"internal\"\n"
583 "\t access=\"none\"\n"
584 " category=\"parentpointer\"\n"
585 "\t >\n"
586 " </Field>\n"
587 " <Field\n"
588 "\t name=\"dimension\"\n"
589 "\t type=\"Int32\"\n"
590 "\t cardinality=\"single\"\n"
591 "\t visibility=\"external\"\n"
592 "\t defaultValue=\"0\"\n"
593 "\t access=\"public\"\n"
594 "\t >\n"
595 "\tImage dimension, 0 for invalid, 1 for 1D, 2 for 2D and 3 for 3D data.\n"
596 " </Field>\n"
597 " <Field\n"
598 "\t name=\"width\"\n"
599 "\t type=\"Int32\"\n"
600 "\t cardinality=\"single\"\n"
601 "\t visibility=\"external\"\n"
602 "\t defaultValue=\"0\"\n"
603 "\t access=\"public\"\n"
604 "\t >\n"
605 " </Field>\n"
606 " <Field\n"
607 "\t name=\"height\"\n"
608 "\t type=\"Int32\"\n"
609 "\t cardinality=\"single\"\n"
610 "\t visibility=\"external\"\n"
611 "\t defaultValue=\"1\"\n"
612 "\t access=\"public\"\n"
613 "\t >\n"
614 " </Field>\n"
615 " <Field\n"
616 "\t name=\"depth\"\n"
617 "\t type=\"Int32\"\n"
618 "\t cardinality=\"single\"\n"
619 "\t visibility=\"external\"\n"
620 "\t defaultValue=\"1\"\n"
621 "\t access=\"public\"\n"
622 "\t >\n"
623 " </Field>\n"
624 " <Field\n"
625 "\t name=\"bpp\"\n"
626 "\t type=\"Int32\"\n"
627 "\t cardinality=\"single\"\n"
628 "\t visibility=\"external\"\n"
629 "\t defaultValue=\"1\"\n"
630 "\t access=\"public\"\n"
631 "\t >\n"
632 " Bytes of data per pixel.\n"
633 " </Field>\n"
634 " <Field\n"
635 "\t name=\"mipMapCount\"\n"
636 "\t type=\"Int32\"\n"
637 "\t cardinality=\"single\"\n"
638 "\t visibility=\"external\"\n"
639 "\t defaultValue=\"1\"\n"
640 "\t access=\"public\"\n"
641 "\t >\n"
642 " </Field>\n"
643 " <Field\n"
644 "\t name=\"frameCount\"\n"
645 "\t type=\"Int32\"\n"
646 "\t cardinality=\"single\"\n"
647 "\t visibility=\"external\"\n"
648 "\t defaultValue=\"1\"\n"
649 "\t access=\"public\"\n"
650 "\t >\n"
651 " The number of frames in the data.\n"
652 " </Field>\n"
653 " <Field\n"
654 "\t name=\"frameDelay\"\n"
655 "\t type=\"Time\"\n"
656 "\t cardinality=\"single\"\n"
657 "\t visibility=\"external\"\n"
658 "\t defaultValue=\"0\"\n"
659 "\t access=\"public\"\n"
660 "\t >\n"
661 " Time between frames. Determines the frame rate.\n"
662 " </Field>\n"
663 " <Field\n"
664 "\t name=\"pixelFormat\"\n"
665 "\t type=\"UInt32\"\n"
666 "\t cardinality=\"single\"\n"
667 "\t visibility=\"external\"\n"
668 "\t defaultValue=\"Image::OSG_INVALID_PF\"\n"
669 "\t access=\"public\"\n"
670 "\t >\n"
671 " </Field>\n"
672 " <Field\n"
673 "\t name=\"pixel\"\n"
674 "\t type=\"UInt8\"\n"
675 "\t cardinality=\"multi\"\n"
676 "\t visibility=\"external\"\n"
677 "\t access=\"public\"\n"
678 "\t >\n"
679 " The pixel data buffer. This is where the data for the image is stored.\n"
680 " </Field>\n"
681 " <Field\n"
682 "\t name=\"frameSize\"\n"
683 "\t type=\"Int32\"\n"
684 "\t cardinality=\"single\"\n"
685 "\t visibility=\"internal\"\n"
686 "\t defaultValue=\"0\"\n"
687 "\t access=\"public\"\n"
688 "\t >\n"
689 " </Field>\n"
690 " <Field\n"
691 "\t name=\"name\"\n"
692 "\t type=\"std::string\"\n"
693 "\t cardinality=\"single\"\n"
694 "\t visibility=\"external\"\n"
695 "\t access=\"public\"\n"
696 "\t >\n"
697 "\tTexture file path.\n"
698 " </Field>\n"
699 " <Field\n"
700 "\t name=\"dataType\"\n"
701 "\t type=\"Int32\"\n"
702 "\t cardinality=\"single\"\n"
703 "\t visibility=\"external\"\n"
704 "\t defaultValue=\"GL_UNSIGNED_BYTE\"\n"
705 "\t defaultHeader=\"&quot;OSGGL.h&quot;\"\n"
706 "\t access=\"public\"\n"
707 "\t >\n"
708 "\tType of image data.\n"
709 " </Field>\n"
710 " <Field\n"
711 "\t name=\"componentSize\"\n"
712 "\t type=\"Int32\"\n"
713 "\t cardinality=\"single\"\n"
714 "\t visibility=\"internal\"\n"
715 "\t defaultValue=\"1\"\n"
716 "\t access=\"protected\"\n"
717 "\t >\n"
718 "\tSize (in byte) of a single component of the image. Necessary\n"
719 " for High Dynamic Range and other higher-level image types.\n"
720 " </Field>\n"
721 " <Field\n"
722 "\t name=\"sideCount\"\n"
723 "\t type=\"Int32\"\n"
724 "\t cardinality=\"single\"\n"
725 "\t visibility=\"external\"\n"
726 "\t defaultValue=\"1\"\n"
727 "\t access=\"public\"\n"
728 "\t >\n"
729 " </Field>\n"
730 " <Field\n"
731 "\t name=\"sideSize\"\n"
732 "\t type=\"Int32\"\n"
733 "\t cardinality=\"single\"\n"
734 "\t visibility=\"internal\"\n"
735 "\t defaultValue=\"0\"\n"
736 "\t access=\"public\"\n"
737 "\t >\n"
738 " </Field>\n"
739 " <Field\n"
740 "\t name=\"forceCompressedData\"\n"
741 "\t type=\"bool\"\n"
742 "\t cardinality=\"single\"\n"
743 "\t visibility=\"external\"\n"
744 "\t defaultValue=\"false\"\n"
745 "\t access=\"public\"\n"
746 "\t >\n"
747 " Set to true if using the image to keep unknown data for textures.\n"
748 " Generally used in conjunction with TextureChunk::externalFormat.\n"
749 " </Field>\n"
750 " <Field\n"
751 "\t name=\"forceAlphaChannel\"\n"
752 "\t type=\"bool\"\n"
753 "\t cardinality=\"single\"\n"
754 "\t visibility=\"external\"\n"
755 "\t defaultValue=\"false\"\n"
756 "\t access=\"public\"\n"
757 "\t >\n"
758 " Set to true if using the image to keep unknown data for textures.\n"
759 " Generally used in conjunction with TextureChunk::externalFormat.\n"
760 " </Field>\n"
761 " <Field\n"
762 "\t name=\"forceColorChannel\"\n"
763 "\t type=\"bool\"\n"
764 "\t cardinality=\"single\"\n"
765 "\t visibility=\"external\"\n"
766 "\t defaultValue=\"false\"\n"
767 "\t access=\"public\"\n"
768 "\t >\n"
769 " Set to true if using the image to keep unknown data for textures.\n"
770 " Generally used in conjunction with TextureChunk::externalFormat.\n"
771 " </Field>\n"
772 " <Field\n"
773 "\t name=\"forceAlphaBinary\"\n"
774 "\t type=\"bool\"\n"
775 "\t cardinality=\"single\"\n"
776 "\t visibility=\"external\"\n"
777 "\t defaultValue=\"false\"\n"
778 "\t access=\"public\"\n"
779 "\t >\n"
780 " Set to true if using the image to prevent depth sorting for \n"
781 " SimpleTexturedMaterials using this Image.\n"
782 " </Field>\n"
783 " <Field\n"
784 "\t name=\"resX\"\n"
785 "\t type=\"Real32\"\n"
786 "\t cardinality=\"single\"\n"
787 "\t visibility=\"external\"\n"
788 "\t defaultValue=\"72.0f\"\n"
789 "\t access=\"public\"\n"
790 "\t >\n"
791 " </Field>\n"
792 " <Field\n"
793 "\t name=\"resY\"\n"
794 "\t type=\"Real32\"\n"
795 "\t cardinality=\"single\"\n"
796 "\t visibility=\"external\"\n"
797 "\t defaultValue=\"72.0f\"\n"
798 "\t access=\"public\"\n"
799 "\t >\n"
800 " </Field>\n"
801 " <Field\n"
802 "\t name=\"resUnit\"\n"
803 "\t type=\"UInt16\"\n"
804 "\t cardinality=\"single\"\n"
805 "\t visibility=\"external\"\n"
806 "\t defaultValue=\"2\"\n"
807 "\t access=\"public\"\n"
808 "\t >\n"
809 "\tresolution unit (invalid=0, none=1, inch=2)\n"
810 " </Field>\t\n"
811 " <Field\n"
812 "\t name=\"clearOnLoad\"\n"
813 "\t type=\"bool\"\n"
814 "\t cardinality=\"single\"\n"
815 "\t visibility=\"external\"\n"
816 "\t defaultValue=\"false\"\n"
817 "\t access=\"public\"\n"
818 "\t >\n"
819 " Set to true if the image data should be cleared after it has been uploaded to the graphics\n"
820 " card and is no longer needed in main memory.\n"
821 " </Field>\n"
822 "</FieldContainer>\n",
823 "1D/2D/3D Image with various pixel types data, optionally also can hold\n"
824 "mipMap and simple multi-frame data.\n"
827 /*------------------------------ get -----------------------------------*/
829 FieldContainerType &ImageBase::getType(void)
831 return _type;
834 const FieldContainerType &ImageBase::getType(void) const
836 return _type;
839 UInt32 ImageBase::getContainerSize(void) const
841 return sizeof(Image);
844 /*------------------------- decorator get ------------------------------*/
848 SFInt32 *ImageBase::editSFDimension(void)
850 editSField(DimensionFieldMask);
852 return &_sfDimension;
855 const SFInt32 *ImageBase::getSFDimension(void) const
857 return &_sfDimension;
861 SFInt32 *ImageBase::editSFWidth(void)
863 editSField(WidthFieldMask);
865 return &_sfWidth;
868 const SFInt32 *ImageBase::getSFWidth(void) const
870 return &_sfWidth;
874 SFInt32 *ImageBase::editSFHeight(void)
876 editSField(HeightFieldMask);
878 return &_sfHeight;
881 const SFInt32 *ImageBase::getSFHeight(void) const
883 return &_sfHeight;
887 SFInt32 *ImageBase::editSFDepth(void)
889 editSField(DepthFieldMask);
891 return &_sfDepth;
894 const SFInt32 *ImageBase::getSFDepth(void) const
896 return &_sfDepth;
900 SFInt32 *ImageBase::editSFBpp(void)
902 editSField(BppFieldMask);
904 return &_sfBpp;
907 const SFInt32 *ImageBase::getSFBpp(void) const
909 return &_sfBpp;
913 SFInt32 *ImageBase::editSFMipMapCount(void)
915 editSField(MipMapCountFieldMask);
917 return &_sfMipMapCount;
920 const SFInt32 *ImageBase::getSFMipMapCount(void) const
922 return &_sfMipMapCount;
926 SFInt32 *ImageBase::editSFFrameCount(void)
928 editSField(FrameCountFieldMask);
930 return &_sfFrameCount;
933 const SFInt32 *ImageBase::getSFFrameCount(void) const
935 return &_sfFrameCount;
939 SFTime *ImageBase::editSFFrameDelay(void)
941 editSField(FrameDelayFieldMask);
943 return &_sfFrameDelay;
946 const SFTime *ImageBase::getSFFrameDelay(void) const
948 return &_sfFrameDelay;
952 SFUInt32 *ImageBase::editSFPixelFormat(void)
954 editSField(PixelFormatFieldMask);
956 return &_sfPixelFormat;
959 const SFUInt32 *ImageBase::getSFPixelFormat(void) const
961 return &_sfPixelFormat;
965 MFUInt8 *ImageBase::editMFPixel(void)
967 editMField(PixelFieldMask, _mfPixel);
969 return &_mfPixel;
972 const MFUInt8 *ImageBase::getMFPixel(void) const
974 return &_mfPixel;
978 SFInt32 *ImageBase::editSFFrameSize(void)
980 editSField(FrameSizeFieldMask);
982 return &_sfFrameSize;
985 const SFInt32 *ImageBase::getSFFrameSize(void) const
987 return &_sfFrameSize;
991 SFString *ImageBase::editSFName(void)
993 editSField(NameFieldMask);
995 return &_sfName;
998 const SFString *ImageBase::getSFName(void) const
1000 return &_sfName;
1004 SFInt32 *ImageBase::editSFDataType(void)
1006 editSField(DataTypeFieldMask);
1008 return &_sfDataType;
1011 const SFInt32 *ImageBase::getSFDataType(void) const
1013 return &_sfDataType;
1017 SFInt32 *ImageBase::editSFComponentSize(void)
1019 editSField(ComponentSizeFieldMask);
1021 return &_sfComponentSize;
1024 const SFInt32 *ImageBase::getSFComponentSize(void) const
1026 return &_sfComponentSize;
1030 SFInt32 *ImageBase::editSFSideCount(void)
1032 editSField(SideCountFieldMask);
1034 return &_sfSideCount;
1037 const SFInt32 *ImageBase::getSFSideCount(void) const
1039 return &_sfSideCount;
1043 SFInt32 *ImageBase::editSFSideSize(void)
1045 editSField(SideSizeFieldMask);
1047 return &_sfSideSize;
1050 const SFInt32 *ImageBase::getSFSideSize(void) const
1052 return &_sfSideSize;
1056 SFBool *ImageBase::editSFForceCompressedData(void)
1058 editSField(ForceCompressedDataFieldMask);
1060 return &_sfForceCompressedData;
1063 const SFBool *ImageBase::getSFForceCompressedData(void) const
1065 return &_sfForceCompressedData;
1069 SFBool *ImageBase::editSFForceAlphaChannel(void)
1071 editSField(ForceAlphaChannelFieldMask);
1073 return &_sfForceAlphaChannel;
1076 const SFBool *ImageBase::getSFForceAlphaChannel(void) const
1078 return &_sfForceAlphaChannel;
1082 SFBool *ImageBase::editSFForceColorChannel(void)
1084 editSField(ForceColorChannelFieldMask);
1086 return &_sfForceColorChannel;
1089 const SFBool *ImageBase::getSFForceColorChannel(void) const
1091 return &_sfForceColorChannel;
1095 SFBool *ImageBase::editSFForceAlphaBinary(void)
1097 editSField(ForceAlphaBinaryFieldMask);
1099 return &_sfForceAlphaBinary;
1102 const SFBool *ImageBase::getSFForceAlphaBinary(void) const
1104 return &_sfForceAlphaBinary;
1108 SFReal32 *ImageBase::editSFResX(void)
1110 editSField(ResXFieldMask);
1112 return &_sfResX;
1115 const SFReal32 *ImageBase::getSFResX(void) const
1117 return &_sfResX;
1121 SFReal32 *ImageBase::editSFResY(void)
1123 editSField(ResYFieldMask);
1125 return &_sfResY;
1128 const SFReal32 *ImageBase::getSFResY(void) const
1130 return &_sfResY;
1134 SFUInt16 *ImageBase::editSFResUnit(void)
1136 editSField(ResUnitFieldMask);
1138 return &_sfResUnit;
1141 const SFUInt16 *ImageBase::getSFResUnit(void) const
1143 return &_sfResUnit;
1147 SFBool *ImageBase::editSFClearOnLoad(void)
1149 editSField(ClearOnLoadFieldMask);
1151 return &_sfClearOnLoad;
1154 const SFBool *ImageBase::getSFClearOnLoad(void) const
1156 return &_sfClearOnLoad;
1164 /*------------------------------ access -----------------------------------*/
1166 SizeT ImageBase::getBinSize(ConstFieldMaskArg whichField)
1168 SizeT returnValue = Inherited::getBinSize(whichField);
1170 if(FieldBits::NoField != (ParentsFieldMask & whichField))
1172 returnValue += _mfParents.getBinSize();
1174 if(FieldBits::NoField != (DimensionFieldMask & whichField))
1176 returnValue += _sfDimension.getBinSize();
1178 if(FieldBits::NoField != (WidthFieldMask & whichField))
1180 returnValue += _sfWidth.getBinSize();
1182 if(FieldBits::NoField != (HeightFieldMask & whichField))
1184 returnValue += _sfHeight.getBinSize();
1186 if(FieldBits::NoField != (DepthFieldMask & whichField))
1188 returnValue += _sfDepth.getBinSize();
1190 if(FieldBits::NoField != (BppFieldMask & whichField))
1192 returnValue += _sfBpp.getBinSize();
1194 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1196 returnValue += _sfMipMapCount.getBinSize();
1198 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1200 returnValue += _sfFrameCount.getBinSize();
1202 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1204 returnValue += _sfFrameDelay.getBinSize();
1206 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1208 returnValue += _sfPixelFormat.getBinSize();
1210 if(FieldBits::NoField != (PixelFieldMask & whichField))
1212 returnValue += _mfPixel.getBinSize();
1214 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1216 returnValue += _sfFrameSize.getBinSize();
1218 if(FieldBits::NoField != (NameFieldMask & whichField))
1220 returnValue += _sfName.getBinSize();
1222 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1224 returnValue += _sfDataType.getBinSize();
1226 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1228 returnValue += _sfComponentSize.getBinSize();
1230 if(FieldBits::NoField != (SideCountFieldMask & whichField))
1232 returnValue += _sfSideCount.getBinSize();
1234 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1236 returnValue += _sfSideSize.getBinSize();
1238 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1240 returnValue += _sfForceCompressedData.getBinSize();
1242 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1244 returnValue += _sfForceAlphaChannel.getBinSize();
1246 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1248 returnValue += _sfForceColorChannel.getBinSize();
1250 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1252 returnValue += _sfForceAlphaBinary.getBinSize();
1254 if(FieldBits::NoField != (ResXFieldMask & whichField))
1256 returnValue += _sfResX.getBinSize();
1258 if(FieldBits::NoField != (ResYFieldMask & whichField))
1260 returnValue += _sfResY.getBinSize();
1262 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
1264 returnValue += _sfResUnit.getBinSize();
1266 if(FieldBits::NoField != (ClearOnLoadFieldMask & whichField))
1268 returnValue += _sfClearOnLoad.getBinSize();
1271 return returnValue;
1274 void ImageBase::copyToBin(BinaryDataHandler &pMem,
1275 ConstFieldMaskArg whichField)
1277 Inherited::copyToBin(pMem, whichField);
1279 if(FieldBits::NoField != (ParentsFieldMask & whichField))
1281 _mfParents.copyToBin(pMem);
1283 if(FieldBits::NoField != (DimensionFieldMask & whichField))
1285 _sfDimension.copyToBin(pMem);
1287 if(FieldBits::NoField != (WidthFieldMask & whichField))
1289 _sfWidth.copyToBin(pMem);
1291 if(FieldBits::NoField != (HeightFieldMask & whichField))
1293 _sfHeight.copyToBin(pMem);
1295 if(FieldBits::NoField != (DepthFieldMask & whichField))
1297 _sfDepth.copyToBin(pMem);
1299 if(FieldBits::NoField != (BppFieldMask & whichField))
1301 _sfBpp.copyToBin(pMem);
1303 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1305 _sfMipMapCount.copyToBin(pMem);
1307 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1309 _sfFrameCount.copyToBin(pMem);
1311 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1313 _sfFrameDelay.copyToBin(pMem);
1315 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1317 _sfPixelFormat.copyToBin(pMem);
1319 if(FieldBits::NoField != (PixelFieldMask & whichField))
1321 _mfPixel.copyToBin(pMem);
1323 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1325 _sfFrameSize.copyToBin(pMem);
1327 if(FieldBits::NoField != (NameFieldMask & whichField))
1329 _sfName.copyToBin(pMem);
1331 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1333 _sfDataType.copyToBin(pMem);
1335 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1337 _sfComponentSize.copyToBin(pMem);
1339 if(FieldBits::NoField != (SideCountFieldMask & whichField))
1341 _sfSideCount.copyToBin(pMem);
1343 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1345 _sfSideSize.copyToBin(pMem);
1347 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1349 _sfForceCompressedData.copyToBin(pMem);
1351 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1353 _sfForceAlphaChannel.copyToBin(pMem);
1355 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1357 _sfForceColorChannel.copyToBin(pMem);
1359 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1361 _sfForceAlphaBinary.copyToBin(pMem);
1363 if(FieldBits::NoField != (ResXFieldMask & whichField))
1365 _sfResX.copyToBin(pMem);
1367 if(FieldBits::NoField != (ResYFieldMask & whichField))
1369 _sfResY.copyToBin(pMem);
1371 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
1373 _sfResUnit.copyToBin(pMem);
1375 if(FieldBits::NoField != (ClearOnLoadFieldMask & whichField))
1377 _sfClearOnLoad.copyToBin(pMem);
1381 void ImageBase::copyFromBin(BinaryDataHandler &pMem,
1382 ConstFieldMaskArg whichField)
1384 Inherited::copyFromBin(pMem, whichField);
1386 if(FieldBits::NoField != (ParentsFieldMask & whichField))
1388 editMField(ParentsFieldMask, _mfParents);
1389 _mfParents.copyFromBin(pMem);
1391 if(FieldBits::NoField != (DimensionFieldMask & whichField))
1393 editSField(DimensionFieldMask);
1394 _sfDimension.copyFromBin(pMem);
1396 if(FieldBits::NoField != (WidthFieldMask & whichField))
1398 editSField(WidthFieldMask);
1399 _sfWidth.copyFromBin(pMem);
1401 if(FieldBits::NoField != (HeightFieldMask & whichField))
1403 editSField(HeightFieldMask);
1404 _sfHeight.copyFromBin(pMem);
1406 if(FieldBits::NoField != (DepthFieldMask & whichField))
1408 editSField(DepthFieldMask);
1409 _sfDepth.copyFromBin(pMem);
1411 if(FieldBits::NoField != (BppFieldMask & whichField))
1413 editSField(BppFieldMask);
1414 _sfBpp.copyFromBin(pMem);
1416 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
1418 editSField(MipMapCountFieldMask);
1419 _sfMipMapCount.copyFromBin(pMem);
1421 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
1423 editSField(FrameCountFieldMask);
1424 _sfFrameCount.copyFromBin(pMem);
1426 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
1428 editSField(FrameDelayFieldMask);
1429 _sfFrameDelay.copyFromBin(pMem);
1431 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
1433 editSField(PixelFormatFieldMask);
1434 _sfPixelFormat.copyFromBin(pMem);
1436 if(FieldBits::NoField != (PixelFieldMask & whichField))
1438 editMField(PixelFieldMask, _mfPixel);
1439 _mfPixel.copyFromBin(pMem);
1441 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
1443 editSField(FrameSizeFieldMask);
1444 _sfFrameSize.copyFromBin(pMem);
1446 if(FieldBits::NoField != (NameFieldMask & whichField))
1448 editSField(NameFieldMask);
1449 _sfName.copyFromBin(pMem);
1451 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
1453 editSField(DataTypeFieldMask);
1454 _sfDataType.copyFromBin(pMem);
1456 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
1458 editSField(ComponentSizeFieldMask);
1459 _sfComponentSize.copyFromBin(pMem);
1461 if(FieldBits::NoField != (SideCountFieldMask & whichField))
1463 editSField(SideCountFieldMask);
1464 _sfSideCount.copyFromBin(pMem);
1466 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
1468 editSField(SideSizeFieldMask);
1469 _sfSideSize.copyFromBin(pMem);
1471 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
1473 editSField(ForceCompressedDataFieldMask);
1474 _sfForceCompressedData.copyFromBin(pMem);
1476 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
1478 editSField(ForceAlphaChannelFieldMask);
1479 _sfForceAlphaChannel.copyFromBin(pMem);
1481 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
1483 editSField(ForceColorChannelFieldMask);
1484 _sfForceColorChannel.copyFromBin(pMem);
1486 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
1488 editSField(ForceAlphaBinaryFieldMask);
1489 _sfForceAlphaBinary.copyFromBin(pMem);
1491 if(FieldBits::NoField != (ResXFieldMask & whichField))
1493 editSField(ResXFieldMask);
1494 _sfResX.copyFromBin(pMem);
1496 if(FieldBits::NoField != (ResYFieldMask & whichField))
1498 editSField(ResYFieldMask);
1499 _sfResY.copyFromBin(pMem);
1501 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
1503 editSField(ResUnitFieldMask);
1504 _sfResUnit.copyFromBin(pMem);
1506 if(FieldBits::NoField != (ClearOnLoadFieldMask & whichField))
1508 editSField(ClearOnLoadFieldMask);
1509 _sfClearOnLoad.copyFromBin(pMem);
1513 //! create a new instance of the class
1514 ImageTransitPtr ImageBase::createLocal(BitVector bFlags)
1516 ImageTransitPtr fc;
1518 if(getClassType().getPrototype() != NULL)
1520 FieldContainerTransitPtr tmpPtr =
1521 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
1523 fc = dynamic_pointer_cast<Image>(tmpPtr);
1526 return fc;
1529 //! create a new instance of the class, copy the container flags
1530 ImageTransitPtr ImageBase::createDependent(BitVector bFlags)
1532 ImageTransitPtr fc;
1534 if(getClassType().getPrototype() != NULL)
1536 FieldContainerTransitPtr tmpPtr =
1537 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
1539 fc = dynamic_pointer_cast<Image>(tmpPtr);
1542 return fc;
1545 //! create a new instance of the class
1546 ImageTransitPtr ImageBase::create(void)
1548 ImageTransitPtr fc;
1550 if(getClassType().getPrototype() != NULL)
1552 FieldContainerTransitPtr tmpPtr =
1553 getClassType().getPrototype()-> shallowCopy();
1555 fc = dynamic_pointer_cast<Image>(tmpPtr);
1558 return fc;
1561 Image *ImageBase::createEmptyLocal(BitVector bFlags)
1563 Image *returnValue;
1565 newPtr<Image>(returnValue, bFlags);
1567 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1569 return returnValue;
1572 //! create an empty new instance of the class, do not copy the prototype
1573 Image *ImageBase::createEmpty(void)
1575 Image *returnValue;
1577 newPtr<Image>(returnValue, Thread::getCurrentLocalFlags());
1579 returnValue->_pFieldFlags->_bNamespaceMask &=
1580 ~Thread::getCurrentLocalFlags();
1582 return returnValue;
1586 FieldContainerTransitPtr ImageBase::shallowCopyLocal(
1587 BitVector bFlags) const
1589 Image *tmpPtr;
1591 newPtr(tmpPtr, dynamic_cast<const Image *>(this), bFlags);
1593 FieldContainerTransitPtr returnValue(tmpPtr);
1595 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1597 return returnValue;
1600 FieldContainerTransitPtr ImageBase::shallowCopyDependent(
1601 BitVector bFlags) const
1603 Image *tmpPtr;
1605 newPtr(tmpPtr, dynamic_cast<const Image *>(this), ~bFlags);
1607 FieldContainerTransitPtr returnValue(tmpPtr);
1609 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1611 return returnValue;
1614 FieldContainerTransitPtr ImageBase::shallowCopy(void) const
1616 Image *tmpPtr;
1618 newPtr(tmpPtr,
1619 dynamic_cast<const Image *>(this),
1620 Thread::getCurrentLocalFlags());
1622 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1624 FieldContainerTransitPtr returnValue(tmpPtr);
1626 return returnValue;
1632 /*------------------------- constructors ----------------------------------*/
1634 ImageBase::ImageBase(void) :
1635 Inherited(),
1636 _mfParents (),
1637 _sfDimension (Int32(0)),
1638 _sfWidth (Int32(0)),
1639 _sfHeight (Int32(1)),
1640 _sfDepth (Int32(1)),
1641 _sfBpp (Int32(1)),
1642 _sfMipMapCount (Int32(1)),
1643 _sfFrameCount (Int32(1)),
1644 _sfFrameDelay (Time(0)),
1645 _sfPixelFormat (UInt32(Image::OSG_INVALID_PF)),
1646 _mfPixel (),
1647 _sfFrameSize (Int32(0)),
1648 _sfName (),
1649 _sfDataType (Int32(GL_UNSIGNED_BYTE)),
1650 _sfComponentSize (Int32(1)),
1651 _sfSideCount (Int32(1)),
1652 _sfSideSize (Int32(0)),
1653 _sfForceCompressedData (bool(false)),
1654 _sfForceAlphaChannel (bool(false)),
1655 _sfForceColorChannel (bool(false)),
1656 _sfForceAlphaBinary (bool(false)),
1657 _sfResX (Real32(72.0f)),
1658 _sfResY (Real32(72.0f)),
1659 _sfResUnit (UInt16(2)),
1660 _sfClearOnLoad (bool(false))
1664 ImageBase::ImageBase(const ImageBase &source) :
1665 Inherited(source),
1666 _mfParents (),
1667 _sfDimension (source._sfDimension ),
1668 _sfWidth (source._sfWidth ),
1669 _sfHeight (source._sfHeight ),
1670 _sfDepth (source._sfDepth ),
1671 _sfBpp (source._sfBpp ),
1672 _sfMipMapCount (source._sfMipMapCount ),
1673 _sfFrameCount (source._sfFrameCount ),
1674 _sfFrameDelay (source._sfFrameDelay ),
1675 _sfPixelFormat (source._sfPixelFormat ),
1676 _mfPixel (source._mfPixel ),
1677 _sfFrameSize (source._sfFrameSize ),
1678 _sfName (source._sfName ),
1679 _sfDataType (source._sfDataType ),
1680 _sfComponentSize (source._sfComponentSize ),
1681 _sfSideCount (source._sfSideCount ),
1682 _sfSideSize (source._sfSideSize ),
1683 _sfForceCompressedData (source._sfForceCompressedData ),
1684 _sfForceAlphaChannel (source._sfForceAlphaChannel ),
1685 _sfForceColorChannel (source._sfForceColorChannel ),
1686 _sfForceAlphaBinary (source._sfForceAlphaBinary ),
1687 _sfResX (source._sfResX ),
1688 _sfResY (source._sfResY ),
1689 _sfResUnit (source._sfResUnit ),
1690 _sfClearOnLoad (source._sfClearOnLoad )
1695 /*-------------------------- destructors ----------------------------------*/
1697 ImageBase::~ImageBase(void)
1700 /*-------------------------------------------------------------------------*/
1701 /* Parent linking */
1703 bool ImageBase::linkParent(
1704 FieldContainer * const pParent,
1705 UInt16 const childFieldId,
1706 UInt16 const parentFieldId )
1708 if(parentFieldId == ParentsFieldId)
1710 FieldContainer * pTypedParent =
1711 dynamic_cast< FieldContainer * >(pParent);
1713 if(pTypedParent != NULL)
1715 editMField(ParentsFieldMask, _mfParents);
1717 _mfParents.push_back(pTypedParent, childFieldId);
1719 return true;
1722 return false;
1725 return Inherited::linkParent(pParent, childFieldId, parentFieldId);
1728 bool ImageBase::unlinkParent(
1729 FieldContainer * const pParent,
1730 UInt16 const parentFieldId)
1732 if(parentFieldId == ParentsFieldId)
1734 FieldContainer * pTypedParent =
1735 dynamic_cast< FieldContainer * >(pParent);
1737 if(pTypedParent != NULL)
1739 Int32 iParentIdx = _mfParents.findIndex(pTypedParent);
1741 if(iParentIdx != -1)
1743 editMField(ParentsFieldMask, _mfParents);
1745 _mfParents.erase(iParentIdx);
1747 return true;
1750 SWARNING << "Child ([" << this
1751 << "] id [" << this->getId()
1752 << "] type [" << this->getType().getCName()
1753 << "] parentFieldId [" << parentFieldId
1754 << "]) - Parent ([" << pParent
1755 << "] id [" << pParent->getId()
1756 << "] type [" << pParent->getType().getCName()
1757 << "]): link inconsistent!"
1758 << std::endl;
1760 return false;
1763 return false;
1766 return Inherited::unlinkParent(pParent, parentFieldId);
1771 GetFieldHandlePtr ImageBase::getHandleParents (void) const
1773 MFParentFieldContainerPtr::GetHandlePtr returnValue;
1775 return returnValue;
1778 EditFieldHandlePtr ImageBase::editHandleParents (void)
1780 EditFieldHandlePtr returnValue;
1782 return returnValue;
1785 GetFieldHandlePtr ImageBase::getHandleDimension (void) const
1787 SFInt32::GetHandlePtr returnValue(
1788 new SFInt32::GetHandle(
1789 &_sfDimension,
1790 this->getType().getFieldDesc(DimensionFieldId),
1791 const_cast<ImageBase *>(this)));
1793 return returnValue;
1796 EditFieldHandlePtr ImageBase::editHandleDimension (void)
1798 SFInt32::EditHandlePtr returnValue(
1799 new SFInt32::EditHandle(
1800 &_sfDimension,
1801 this->getType().getFieldDesc(DimensionFieldId),
1802 this));
1805 editSField(DimensionFieldMask);
1807 return returnValue;
1810 GetFieldHandlePtr ImageBase::getHandleWidth (void) const
1812 SFInt32::GetHandlePtr returnValue(
1813 new SFInt32::GetHandle(
1814 &_sfWidth,
1815 this->getType().getFieldDesc(WidthFieldId),
1816 const_cast<ImageBase *>(this)));
1818 return returnValue;
1821 EditFieldHandlePtr ImageBase::editHandleWidth (void)
1823 SFInt32::EditHandlePtr returnValue(
1824 new SFInt32::EditHandle(
1825 &_sfWidth,
1826 this->getType().getFieldDesc(WidthFieldId),
1827 this));
1830 editSField(WidthFieldMask);
1832 return returnValue;
1835 GetFieldHandlePtr ImageBase::getHandleHeight (void) const
1837 SFInt32::GetHandlePtr returnValue(
1838 new SFInt32::GetHandle(
1839 &_sfHeight,
1840 this->getType().getFieldDesc(HeightFieldId),
1841 const_cast<ImageBase *>(this)));
1843 return returnValue;
1846 EditFieldHandlePtr ImageBase::editHandleHeight (void)
1848 SFInt32::EditHandlePtr returnValue(
1849 new SFInt32::EditHandle(
1850 &_sfHeight,
1851 this->getType().getFieldDesc(HeightFieldId),
1852 this));
1855 editSField(HeightFieldMask);
1857 return returnValue;
1860 GetFieldHandlePtr ImageBase::getHandleDepth (void) const
1862 SFInt32::GetHandlePtr returnValue(
1863 new SFInt32::GetHandle(
1864 &_sfDepth,
1865 this->getType().getFieldDesc(DepthFieldId),
1866 const_cast<ImageBase *>(this)));
1868 return returnValue;
1871 EditFieldHandlePtr ImageBase::editHandleDepth (void)
1873 SFInt32::EditHandlePtr returnValue(
1874 new SFInt32::EditHandle(
1875 &_sfDepth,
1876 this->getType().getFieldDesc(DepthFieldId),
1877 this));
1880 editSField(DepthFieldMask);
1882 return returnValue;
1885 GetFieldHandlePtr ImageBase::getHandleBpp (void) const
1887 SFInt32::GetHandlePtr returnValue(
1888 new SFInt32::GetHandle(
1889 &_sfBpp,
1890 this->getType().getFieldDesc(BppFieldId),
1891 const_cast<ImageBase *>(this)));
1893 return returnValue;
1896 EditFieldHandlePtr ImageBase::editHandleBpp (void)
1898 SFInt32::EditHandlePtr returnValue(
1899 new SFInt32::EditHandle(
1900 &_sfBpp,
1901 this->getType().getFieldDesc(BppFieldId),
1902 this));
1905 editSField(BppFieldMask);
1907 return returnValue;
1910 GetFieldHandlePtr ImageBase::getHandleMipMapCount (void) const
1912 SFInt32::GetHandlePtr returnValue(
1913 new SFInt32::GetHandle(
1914 &_sfMipMapCount,
1915 this->getType().getFieldDesc(MipMapCountFieldId),
1916 const_cast<ImageBase *>(this)));
1918 return returnValue;
1921 EditFieldHandlePtr ImageBase::editHandleMipMapCount (void)
1923 SFInt32::EditHandlePtr returnValue(
1924 new SFInt32::EditHandle(
1925 &_sfMipMapCount,
1926 this->getType().getFieldDesc(MipMapCountFieldId),
1927 this));
1930 editSField(MipMapCountFieldMask);
1932 return returnValue;
1935 GetFieldHandlePtr ImageBase::getHandleFrameCount (void) const
1937 SFInt32::GetHandlePtr returnValue(
1938 new SFInt32::GetHandle(
1939 &_sfFrameCount,
1940 this->getType().getFieldDesc(FrameCountFieldId),
1941 const_cast<ImageBase *>(this)));
1943 return returnValue;
1946 EditFieldHandlePtr ImageBase::editHandleFrameCount (void)
1948 SFInt32::EditHandlePtr returnValue(
1949 new SFInt32::EditHandle(
1950 &_sfFrameCount,
1951 this->getType().getFieldDesc(FrameCountFieldId),
1952 this));
1955 editSField(FrameCountFieldMask);
1957 return returnValue;
1960 GetFieldHandlePtr ImageBase::getHandleFrameDelay (void) const
1962 SFTime::GetHandlePtr returnValue(
1963 new SFTime::GetHandle(
1964 &_sfFrameDelay,
1965 this->getType().getFieldDesc(FrameDelayFieldId),
1966 const_cast<ImageBase *>(this)));
1968 return returnValue;
1971 EditFieldHandlePtr ImageBase::editHandleFrameDelay (void)
1973 SFTime::EditHandlePtr returnValue(
1974 new SFTime::EditHandle(
1975 &_sfFrameDelay,
1976 this->getType().getFieldDesc(FrameDelayFieldId),
1977 this));
1980 editSField(FrameDelayFieldMask);
1982 return returnValue;
1985 GetFieldHandlePtr ImageBase::getHandlePixelFormat (void) const
1987 SFUInt32::GetHandlePtr returnValue(
1988 new SFUInt32::GetHandle(
1989 &_sfPixelFormat,
1990 this->getType().getFieldDesc(PixelFormatFieldId),
1991 const_cast<ImageBase *>(this)));
1993 return returnValue;
1996 EditFieldHandlePtr ImageBase::editHandlePixelFormat (void)
1998 SFUInt32::EditHandlePtr returnValue(
1999 new SFUInt32::EditHandle(
2000 &_sfPixelFormat,
2001 this->getType().getFieldDesc(PixelFormatFieldId),
2002 this));
2005 editSField(PixelFormatFieldMask);
2007 return returnValue;
2010 GetFieldHandlePtr ImageBase::getHandlePixel (void) const
2012 MFUInt8::GetHandlePtr returnValue(
2013 new MFUInt8::GetHandle(
2014 &_mfPixel,
2015 this->getType().getFieldDesc(PixelFieldId),
2016 const_cast<ImageBase *>(this)));
2018 return returnValue;
2021 EditFieldHandlePtr ImageBase::editHandlePixel (void)
2023 MFUInt8::EditHandlePtr returnValue(
2024 new MFUInt8::EditHandle(
2025 &_mfPixel,
2026 this->getType().getFieldDesc(PixelFieldId),
2027 this));
2030 editMField(PixelFieldMask, _mfPixel);
2032 return returnValue;
2035 GetFieldHandlePtr ImageBase::getHandleFrameSize (void) const
2037 SFInt32::GetHandlePtr returnValue(
2038 new SFInt32::GetHandle(
2039 &_sfFrameSize,
2040 this->getType().getFieldDesc(FrameSizeFieldId),
2041 const_cast<ImageBase *>(this)));
2043 return returnValue;
2046 EditFieldHandlePtr ImageBase::editHandleFrameSize (void)
2048 SFInt32::EditHandlePtr returnValue(
2049 new SFInt32::EditHandle(
2050 &_sfFrameSize,
2051 this->getType().getFieldDesc(FrameSizeFieldId),
2052 this));
2055 editSField(FrameSizeFieldMask);
2057 return returnValue;
2060 GetFieldHandlePtr ImageBase::getHandleName (void) const
2062 SFString::GetHandlePtr returnValue(
2063 new SFString::GetHandle(
2064 &_sfName,
2065 this->getType().getFieldDesc(NameFieldId),
2066 const_cast<ImageBase *>(this)));
2068 return returnValue;
2071 EditFieldHandlePtr ImageBase::editHandleName (void)
2073 SFString::EditHandlePtr returnValue(
2074 new SFString::EditHandle(
2075 &_sfName,
2076 this->getType().getFieldDesc(NameFieldId),
2077 this));
2080 editSField(NameFieldMask);
2082 return returnValue;
2085 GetFieldHandlePtr ImageBase::getHandleDataType (void) const
2087 SFInt32::GetHandlePtr returnValue(
2088 new SFInt32::GetHandle(
2089 &_sfDataType,
2090 this->getType().getFieldDesc(DataTypeFieldId),
2091 const_cast<ImageBase *>(this)));
2093 return returnValue;
2096 EditFieldHandlePtr ImageBase::editHandleDataType (void)
2098 SFInt32::EditHandlePtr returnValue(
2099 new SFInt32::EditHandle(
2100 &_sfDataType,
2101 this->getType().getFieldDesc(DataTypeFieldId),
2102 this));
2105 editSField(DataTypeFieldMask);
2107 return returnValue;
2110 GetFieldHandlePtr ImageBase::getHandleComponentSize (void) const
2112 SFInt32::GetHandlePtr returnValue(
2113 new SFInt32::GetHandle(
2114 &_sfComponentSize,
2115 this->getType().getFieldDesc(ComponentSizeFieldId),
2116 const_cast<ImageBase *>(this)));
2118 return returnValue;
2121 EditFieldHandlePtr ImageBase::editHandleComponentSize (void)
2123 SFInt32::EditHandlePtr returnValue(
2124 new SFInt32::EditHandle(
2125 &_sfComponentSize,
2126 this->getType().getFieldDesc(ComponentSizeFieldId),
2127 this));
2130 editSField(ComponentSizeFieldMask);
2132 return returnValue;
2135 GetFieldHandlePtr ImageBase::getHandleSideCount (void) const
2137 SFInt32::GetHandlePtr returnValue(
2138 new SFInt32::GetHandle(
2139 &_sfSideCount,
2140 this->getType().getFieldDesc(SideCountFieldId),
2141 const_cast<ImageBase *>(this)));
2143 return returnValue;
2146 EditFieldHandlePtr ImageBase::editHandleSideCount (void)
2148 SFInt32::EditHandlePtr returnValue(
2149 new SFInt32::EditHandle(
2150 &_sfSideCount,
2151 this->getType().getFieldDesc(SideCountFieldId),
2152 this));
2155 editSField(SideCountFieldMask);
2157 return returnValue;
2160 GetFieldHandlePtr ImageBase::getHandleSideSize (void) const
2162 SFInt32::GetHandlePtr returnValue(
2163 new SFInt32::GetHandle(
2164 &_sfSideSize,
2165 this->getType().getFieldDesc(SideSizeFieldId),
2166 const_cast<ImageBase *>(this)));
2168 return returnValue;
2171 EditFieldHandlePtr ImageBase::editHandleSideSize (void)
2173 SFInt32::EditHandlePtr returnValue(
2174 new SFInt32::EditHandle(
2175 &_sfSideSize,
2176 this->getType().getFieldDesc(SideSizeFieldId),
2177 this));
2180 editSField(SideSizeFieldMask);
2182 return returnValue;
2185 GetFieldHandlePtr ImageBase::getHandleForceCompressedData (void) const
2187 SFBool::GetHandlePtr returnValue(
2188 new SFBool::GetHandle(
2189 &_sfForceCompressedData,
2190 this->getType().getFieldDesc(ForceCompressedDataFieldId),
2191 const_cast<ImageBase *>(this)));
2193 return returnValue;
2196 EditFieldHandlePtr ImageBase::editHandleForceCompressedData(void)
2198 SFBool::EditHandlePtr returnValue(
2199 new SFBool::EditHandle(
2200 &_sfForceCompressedData,
2201 this->getType().getFieldDesc(ForceCompressedDataFieldId),
2202 this));
2205 editSField(ForceCompressedDataFieldMask);
2207 return returnValue;
2210 GetFieldHandlePtr ImageBase::getHandleForceAlphaChannel (void) const
2212 SFBool::GetHandlePtr returnValue(
2213 new SFBool::GetHandle(
2214 &_sfForceAlphaChannel,
2215 this->getType().getFieldDesc(ForceAlphaChannelFieldId),
2216 const_cast<ImageBase *>(this)));
2218 return returnValue;
2221 EditFieldHandlePtr ImageBase::editHandleForceAlphaChannel(void)
2223 SFBool::EditHandlePtr returnValue(
2224 new SFBool::EditHandle(
2225 &_sfForceAlphaChannel,
2226 this->getType().getFieldDesc(ForceAlphaChannelFieldId),
2227 this));
2230 editSField(ForceAlphaChannelFieldMask);
2232 return returnValue;
2235 GetFieldHandlePtr ImageBase::getHandleForceColorChannel (void) const
2237 SFBool::GetHandlePtr returnValue(
2238 new SFBool::GetHandle(
2239 &_sfForceColorChannel,
2240 this->getType().getFieldDesc(ForceColorChannelFieldId),
2241 const_cast<ImageBase *>(this)));
2243 return returnValue;
2246 EditFieldHandlePtr ImageBase::editHandleForceColorChannel(void)
2248 SFBool::EditHandlePtr returnValue(
2249 new SFBool::EditHandle(
2250 &_sfForceColorChannel,
2251 this->getType().getFieldDesc(ForceColorChannelFieldId),
2252 this));
2255 editSField(ForceColorChannelFieldMask);
2257 return returnValue;
2260 GetFieldHandlePtr ImageBase::getHandleForceAlphaBinary (void) const
2262 SFBool::GetHandlePtr returnValue(
2263 new SFBool::GetHandle(
2264 &_sfForceAlphaBinary,
2265 this->getType().getFieldDesc(ForceAlphaBinaryFieldId),
2266 const_cast<ImageBase *>(this)));
2268 return returnValue;
2271 EditFieldHandlePtr ImageBase::editHandleForceAlphaBinary(void)
2273 SFBool::EditHandlePtr returnValue(
2274 new SFBool::EditHandle(
2275 &_sfForceAlphaBinary,
2276 this->getType().getFieldDesc(ForceAlphaBinaryFieldId),
2277 this));
2280 editSField(ForceAlphaBinaryFieldMask);
2282 return returnValue;
2285 GetFieldHandlePtr ImageBase::getHandleResX (void) const
2287 SFReal32::GetHandlePtr returnValue(
2288 new SFReal32::GetHandle(
2289 &_sfResX,
2290 this->getType().getFieldDesc(ResXFieldId),
2291 const_cast<ImageBase *>(this)));
2293 return returnValue;
2296 EditFieldHandlePtr ImageBase::editHandleResX (void)
2298 SFReal32::EditHandlePtr returnValue(
2299 new SFReal32::EditHandle(
2300 &_sfResX,
2301 this->getType().getFieldDesc(ResXFieldId),
2302 this));
2305 editSField(ResXFieldMask);
2307 return returnValue;
2310 GetFieldHandlePtr ImageBase::getHandleResY (void) const
2312 SFReal32::GetHandlePtr returnValue(
2313 new SFReal32::GetHandle(
2314 &_sfResY,
2315 this->getType().getFieldDesc(ResYFieldId),
2316 const_cast<ImageBase *>(this)));
2318 return returnValue;
2321 EditFieldHandlePtr ImageBase::editHandleResY (void)
2323 SFReal32::EditHandlePtr returnValue(
2324 new SFReal32::EditHandle(
2325 &_sfResY,
2326 this->getType().getFieldDesc(ResYFieldId),
2327 this));
2330 editSField(ResYFieldMask);
2332 return returnValue;
2335 GetFieldHandlePtr ImageBase::getHandleResUnit (void) const
2337 SFUInt16::GetHandlePtr returnValue(
2338 new SFUInt16::GetHandle(
2339 &_sfResUnit,
2340 this->getType().getFieldDesc(ResUnitFieldId),
2341 const_cast<ImageBase *>(this)));
2343 return returnValue;
2346 EditFieldHandlePtr ImageBase::editHandleResUnit (void)
2348 SFUInt16::EditHandlePtr returnValue(
2349 new SFUInt16::EditHandle(
2350 &_sfResUnit,
2351 this->getType().getFieldDesc(ResUnitFieldId),
2352 this));
2355 editSField(ResUnitFieldMask);
2357 return returnValue;
2360 GetFieldHandlePtr ImageBase::getHandleClearOnLoad (void) const
2362 SFBool::GetHandlePtr returnValue(
2363 new SFBool::GetHandle(
2364 &_sfClearOnLoad,
2365 this->getType().getFieldDesc(ClearOnLoadFieldId),
2366 const_cast<ImageBase *>(this)));
2368 return returnValue;
2371 EditFieldHandlePtr ImageBase::editHandleClearOnLoad (void)
2373 SFBool::EditHandlePtr returnValue(
2374 new SFBool::EditHandle(
2375 &_sfClearOnLoad,
2376 this->getType().getFieldDesc(ClearOnLoadFieldId),
2377 this));
2380 editSField(ClearOnLoadFieldMask);
2382 return returnValue;
2386 #ifdef OSG_MT_CPTR_ASPECT
2387 void ImageBase::execSyncV( FieldContainer &oFrom,
2388 ConstFieldMaskArg whichField,
2389 AspectOffsetStore &oOffsets,
2390 ConstFieldMaskArg syncMode,
2391 const UInt32 uiSyncInfo)
2393 Image *pThis = static_cast<Image *>(this);
2395 pThis->execSync(static_cast<Image *>(&oFrom),
2396 whichField,
2397 oOffsets,
2398 syncMode,
2399 uiSyncInfo);
2401 #endif
2404 #ifdef OSG_MT_CPTR_ASPECT
2405 FieldContainer *ImageBase::createAspectCopy(
2406 const FieldContainer *pRefAspect) const
2408 Image *returnValue;
2410 newAspectCopy(returnValue,
2411 dynamic_cast<const Image *>(pRefAspect),
2412 dynamic_cast<const Image *>(this));
2414 return returnValue;
2416 #endif
2418 void ImageBase::resolveLinks(void)
2420 Inherited::resolveLinks();
2422 #ifdef OSG_MT_CPTR_ASPECT
2423 AspectOffsetStore oOffsets;
2425 _pAspectStore->fillOffsetArray(oOffsets, this);
2426 #endif
2428 #ifdef OSG_MT_CPTR_ASPECT
2429 _mfPixel.terminateShare(Thread::getCurrentAspect(),
2430 oOffsets);
2431 #endif
2435 OSG_END_NAMESPACE