/usr/include/opencollada/COLLADAStreamWriter/COLLADASWFormatHint.h is in opencollada-dev 0.1.0~20140703.ddf8f47+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | /*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADAStreamWriter.
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __COLLADASTREAMWRITER_FORMAT_HINT_H__
#define __COLLADASTREAMWRITER_FORMAT_HINT_H__
#include "COLLADASWPrerequisites.h"
#include "COLLADASWElementWriter.h"
#include "COLLADASWExtraTechnique.h"
namespace COLLADASW
{
/** <format_hint> is a child element of <surface>.
An application uses <format_hint> if <format> does
not exist or is not understood by the application and
<format_hint> exists. This element describes the
important features intended by the author so that the
application can pick a format that best represents what
the author wanted. */
class FormatHint : public ElementWriter, public BaseExtraTechnique
{
public:
/** Contains an enumeration value that describes the per-texel
layout of the format. The length of the enumeration string
indicates how many channels there are and each letter
represents the name of a channel. There are typically 1 to 4
channels. This element has no attributes.
Valid enumeration values are:
� RGB: Red/Green/Blue color map.
� RGBA: Red/Green/Blue/Alpha map, often used
for color and transparency or other things packed
into channel A, such as specular power.
� L: Luminance map, often used for light mapping.
� LA: Luminance/Alpha map, often used for light
mapping.
� D: Depth map, often used for displacement,
parallax, relief, or shadow mapping.
� XYZ: Typically used for normal maps or threecomponent
displacement maps.
� XYZW: Typically used for normal maps, where W
is the depth for relief or parallax mapping. */
enum Channels
{
RGB,
RGBA,
L,
LA,
D,
XYZ,
XYZW,
UNKNOWN_CHANNEL
};
/** Contains an enumeration that describes the range of texel
channel values. Each channel represents a range of values.
Some example ranges are signed or unsigned integers, or
are within a clamped range such as 0.0f to 1.0f, or are a
high dynamic range via floating point. This element has no
attributes.
Valid enumeration values are:
� SNORM: Format represents a decimal value that
remains within the -1 to 1 range. Implementation
could be integer, fixed-point, or float.
� UNORM: Format represents a decimal value that
remains within the 0 to 1 range. Implementation
could be integer, fixed-point, or float.
� SINT: Format represents signed integer numbers;
for example, 8 bits can represent -128 to 127.
� UINT: Format represents unsigned integer
numbers. For example, 8 bits can represent 0 to
255.
� FLOAT: Format should support full floating-point
ranges typically used for high dynamic range. */
enum Range
{
SNORM,
UNORM,
SINT,
UINT,
FLOAT,
UNKNOWN_RANGE
};
/** Contains an enumeration that identifies the precision of the
texel channel value.Each channel of the texel has a
precision. Typically, channels have the same precision. An
exact format may lower the precision of an individual
channel but applying a higher precision by linking the
channels may still convey the same information. This
element has no attributes.
Valid enumeration values are:
� LOW: For integers, this typically represents 8 bits.
For floats, typically 16 bits.
� MID: For integers, this typically represents 8 to 24
bits. For floats, typically 16 to 32 bits.
� HIGH: For integers, this typically represents 16 to
32 bits. For floats, typically 24 to 32 bits. */
enum Precision
{
LOW,
MID,
HIGH,
UNKNOWN_PRECISION
};
/** Contains additional hints about data relationships and other
things to help an application pick the best format. This
element has no attributes.
Valid enumeration values are:
� SRGB_GAMMA: Colors are stored with respect
to the sRGB 2.2 gamma curve rather than linear.
� NORMALIZED3: The texel�s XYZ/RGB should be
normalized such as in a normal map.
� NORMALIZED4: The texel�s XYZW/RGBA should
be normalized such as in a normal map.
� COMPRESSABLE: The surface may use run-time
compression. Consider the best compression
based on desired <channels>, <range>,
<precision>, and <option>s. */
enum Option
{
SRGB_GAMMA,
NORMALIZED3,
NORMALIZED4,
COMPRESSABLE,
UNKNOWN_OPTIONS
};
private:
/** Contains an enumeration value that describes the per-texel
layout of the format. The length of the enumeration string
indicates how many channels there are and each letter
represents the name of a channel. There are typically 1 to 4
channels. */
Channels mChannels;
/** Contains an enumeration that describes the range of texel
channel values. Each channel represents a range of values.
Some example ranges are signed or unsigned integers, or
are within a clamped range such as 0.0f to 1.0f, or are a
high dynamic range via floating point. */
Range mRange;
/** Contains an enumeration that identifies the precision of the
texel channel value.Each channel of the texel has a
precision. Typically, channels have the same precision. An
exact format may lower the precision of an individual
channel but applying a higher precision by linking the
channels may still convey the same information. */
Precision mPrecision;
/** Contains additional hints about data relationships and other
things to help an application pick the best format. */
std::vector<Option> mOptions;
/** Flag, if the format hint is initialized. */
bool mIsInitialized;
public:
/** Constructor. */
FormatHint ();
/** Constructor. */
FormatHint ( StreamWriter* streamWriter, Channels channels, Range range );
/** Destructor. */
virtual ~FormatHint () {}
/** Flag, if the format hint is initialized. */
const bool getIsInitialized () const { return mIsInitialized; }
/** Flag, if the format hint is initialized. */
void setIsInitialized ( const bool val ) { mIsInitialized = val; }
/** Set the current precision. */
void setPrecision ( Precision precision );
/** Set the current options. */
void addOption ( Option option );
/** Returns the string value of the current channel. */
static const String& getChannelsString ( Channels channel );
/** Returns the string value of the current range. */
static const String& getRangeString ( Range range );
/** Returns the string value of the current precision. */
static const String& getPrecisionString ( Precision precision );
/** Returns the string value of the current option. */
static const String& getOptionString ( Option option );
/** Write the <format_hint> element to the collada stream. */
void add () const;
};
}
#endif // __COLLADASTREAMWRITER_FORMAT_HINT_H__
|