21 #ifndef QTAV_OPENGLTYPES_H 22 #define QTAV_OPENGLTYPES_H 23 #include <QtCore/QVector> 30 enum { V = 16, Vec = 1<<V, M = 20, Mat = 1<<M };
39 BVec2 = Bool|Vec|(2<<(V+1)),
40 BVec3 = Bool|Vec|(3<<(V+1)),
41 BVec4 = Bool|Vec|(4<<(V+1)),
42 IVec2 = Int|Vec|(2<<(V+1)),
43 IVec3 = Int|Vec|(3<<(V+1)),
44 IVec4 = Int|Vec|(4<<(V+1)),
45 UVec2 = UInt|Vec|(2<<(V+1)),
46 UVec3 = UInt|Vec|(3<<(V+1)),
47 UVec4 = UInt|Vec|(4<<(V+1)),
48 Vec2 = Float|Vec|(2<<(V+1)),
49 Vec3 = Float|Vec|(3<<(V+1)),
50 Vec4 = Float|Vec|(4<<(V+1)),
51 Mat2 = Float|Mat|(2<<(M+1)),
52 Mat3 = Float|Mat|(3<<(M+1)),
53 Mat4 = Float|Mat|(4<<(M+1)),
54 DMat2 = Double|Mat|(2<<(M+1)),
55 DMat3 = Double|Mat|(3<<(M+1)),
56 DMat4 = Double|Mat|(4<<(M+1)),
58 bool isBool()
const {
return type()&Bool;}
59 bool isInt()
const {
return type()∬}
60 bool isUInt()
const {
return type()&UInt;}
61 bool isFloat()
const {
return type()&Float;}
63 bool isVec()
const {
return type()&Vec;}
64 bool isMat()
const {
return type()&Mat;}
82 void set(
const float& v,
int count = 0);
83 void set(
const unsigned& v,
int count = 0);
84 void set(
const int& v,
int count = 0);
85 void set(
const float* v,
int count = 0);
86 void set(
const unsigned* v,
int count = 0);
87 void set(
const int* v,
int count = 0);
93 void set(
const QVariant& v);
102 if (type() != other.
type())
104 if (name != other.
name)
106 if (data != other.data)
124 template<
typename T> QVector<T>
value()
const {
125 Q_ASSERT(
sizeof(T)*tupleSize()*arraySize() <= data.size()*
sizeof(int) &&
"Bad type or array size");
126 QVector<T> v(tupleSize()*arraySize());
127 memcpy((
char*)v.data(), (
const char*)data.constData(), v.size()*
sizeof(T));
130 template<
typename T>
const T*
address()
const {
131 Q_ASSERT(
sizeof(T)*tupleSize()*arraySize() <= data.size()*
sizeof(int) &&
"Bad type or array size");
132 return reinterpret_cast<const T*
>(data.constData());
140 #ifndef QT_NO_DEBUG_STREAM 146 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 148 Q_DECLARE_METATYPE(QVector<double>)
149 Q_DECLARE_METATYPE(QVector<float>)
150 Q_DECLARE_METATYPE(QVector<int>)
151 Q_DECLARE_METATYPE(QVector<unsigned>)
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
Q_AV_EXPORT QDebug operator<<(QDebug debug, const AudioFormat &fmt)
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31