Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoColorPacker.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20
21#ifndef SOCOLORPACKER_H
22#define SOCOLORPACKER_H
23
24#include <Inventor/sys/port.h>
25#include <Inventor/SbBase.h>
26#include <Inventor/threads/SbThreadMutex.h>
27#include <Inventor/SbColor.h>
28
30
43
44 public:
45
46 //Constructor, makes a colorPacker with NULL packedColor pointer:
48
49 // destructor, deletes packed color array
51
56 uint32_t *getPackedColors() const {
57 return packedColors;
58 }
59 SbBool diffuseMatch(uint64_t nodeId) {
60 return (nodeId == diffuseNodeId);
61 }
62 SbBool transpMatch(uint64_t nodeId) {
63 return (nodeId == transpNodeId);
64 }
65 void setNodeIds(uint64_t diffNodeId, uint64_t tNodeId) {
66 diffuseNodeId = diffNodeId;
67 transpNodeId = tNodeId;
68 }
69 int32_t getSize() {
70 return packedArraySize;
71 }
72 void reallocate(int32_t size);
73
74 static void exitClass();
75
76private:
78 static SoCpuBufferObject* convertBigEndianToSystem(SoCpuBufferObject* source);
79
81 static void packedColorBigEndianToSbColor(SbColor& result, const uint32_t packedColor);
82
83 private:
84
85 // nodeids are used for testing cache validity
86 uint64_t transpNodeId;
87 uint64_t diffuseNodeId;
88 // array of packed colors, or NULL if empty
89 uint32_t *packedColors;
90 // size of packed color array (not necessarily number of valid colors)
91 int32_t packedArraySize;
92
93 static SbThreadMutex *m_mutex;
94
95};
96
97#endif
Color vector class.
Definition SbColor.h:82
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
Stores packed colors.
static void exitClass()
uint32_t * getPackedColors() const
SbBool diffuseMatch(uint64_t nodeId)
void reallocate(int32_t size)
SbBool transpMatch(uint64_t nodeId)
void setNodeIds(uint64_t diffNodeId, uint64_t tNodeId)
int32_t getSize()
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...
int SbBool
Boolean type.
Definition SbBase.h:87