-
Notifications
You must be signed in to change notification settings - Fork 4
/
CPlusPlus_Common.h
1486 lines (1178 loc) · 39.6 KB
/
CPlusPlus_Common.h
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Shared Use License: This file is owned by Derivative Inc. (Derivative)
* and can only be used, and/or modified for use, in conjunction with
* Derivative's TouchDesigner software, and only if you are a licensee who has
* accepted Derivative's TouchDesigner license or assignment agreement
* (which also govern the use of this file). You may share or redistribute
* a modified version of this file provided the following conditions are met:
*
* 1. The shared file or redistribution must retain the information set out
* above and this list of conditions.
* 2. Derivative's name (Derivative Inc.) or its trademarks may not be used
* to endorse or promote products derived from this file without specific
* prior written permission from Derivative.
*/
/*******
Derivative Developers: Make sure the virtual function order
stays the same, otherwise changes won't be backwards compatible
********/
#ifndef __CPlusPlus_Common
#define __CPlusPlus_Common
#ifdef _WIN32
#define NOMINMAX
#include <windows.h>
#include <stdint.h>
#include "GL_Extensions.h"
#define DLLEXPORT __declspec (dllexport)
#else
#include <OpenGL/gltypes.h>
#define DLLEXPORT
#endif
#include <assert.h>
#include <cmath>
#include <float.h>
#ifndef PyObject_HEAD
struct _object;
typedef _object PyObject;
#endif
struct cudaArray;
enum class OP_CPUMemPixelType : int32_t
{
// 8-bit per color, BGRA pixels. This is preferred for 4 channel 8-bit data
BGRA8Fixed = 0,
// 8-bit per color, RGBA pixels. Only use this one if absolutely nesseary.
RGBA8Fixed,
// 32-bit float per color, RGBA pixels
RGBA32Float,
// A few single and two channel versions of the above
R8Fixed,
RG8Fixed,
R32Float,
RG32Float,
R16Fixed = 100,
RG16Fixed,
RGBA16Fixed,
R16Float = 200,
RG16Float,
RGBA16Float,
};
class OP_String;
// Used to describe this Plugin so it can be used as a custom OP.
// Can be filled in as part of the Fill*PluginInfo() callback
class OP_CustomOPInfo
{
public:
// For this plugin to be treated as a Custom OP, all of the below fields
// must be filled in correctly. Otherwise the .dll can only be used
// when manually loaded into the C++ TOP
// The type name of the node, this needs to be unique from all the other
// TOP plugins loaded on the system. The name must start with an upper case
// character (A-Z), and the rest should be lower case
// Only the characters a-z and 0-9 are allowed in the opType.
// Spaces are not allowed
OP_String* opType;
// The english readable label for the node. This is what is shown in the
// OP Create Menu dialog.
// Spaces and other special characters are allowed.
// This can be a UTF-8 encoded string for non-english langauge label
OP_String* opLabel;
// This should be three letters (upper or lower case), or numbers, which
// are used to create an icon for this Custom OP.
OP_String* opIcon;
// The minimum number of wired inputs required for this OP to function.
int32_t minInputs = 0;
// The maximum number of connected inputs allowed for this OP. If this plugin
// always requires 1 input, then set both min and max to 1.
int32_t maxInputs = 0;
// The name of the author
OP_String* authorName;
// The email of the author
OP_String* authorEmail;
// Major version should be used to differentiate between drastically different
// versions of this Custom OP. In particular changes that arn't backwards
// compatible.
// A project file will compare the major version of OPs saved in it with the
// major version of the plugin installed on the system, and expect them to be
// the same.
int32_t majorVersion = 0;
// Minor version is used to denote upgrades to a plugin. It should be increased
// when new features are added to a plugin that would cause loading up a project
// with an older version of the plguin to behavior incorrectly. For example
// if new parameters are added to the plugin.
// A project file will expect the plugin installed on the system to be greater than
// or equal to the plugin version the project was created with. Assuming
// the majorVersion is the same.
int32_t minorVersion = 1;
// If this Custom OP is using CPython objects (PyObject* etc.) obtained via
// getParPython() calls, this needs to be set to the Python
// version this plugin is compiled against.
//
// This ensures when TD's Python version is upgraded the plugins will
// error cleanly. This should be set to PY_VERSION as defined in
// patchlevel.h from the Python include folder. (E.g, "3.5.1")
// It should be left unchanged if CPython isn't being used in this plugin.
OP_String* pythonVersion;
int32_t reserved[98];
};
class OP_NodeInfo
{
public:
// The full path to the operator
const char* opPath;
// A unique ID representing the operator, no two operators will ever
// have the same ID in a single TouchDesigner instance.
uint32_t opId;
// This is the handle to the main TouchDesigner window.
// It's possible this will be 0 the first few times the operator cooks,
// incase it cooks while TouchDesigner is still loading up
#ifdef _WIN32
HWND mainWindowHandle;
#endif
// The path to where the plugin's binary is located on this machine.
// UTF8-8 encoded.
const char* pluginPath;
int32_t reserved[17];
};
class OP_DATInput
{
public:
const char* opPath;
uint32_t opId;
int32_t numRows;
int32_t numCols;
bool isTable;
// data, referenced by (row,col), which will be a const char* for the
// contents of the cell
// E.g getCell(1,2) will be the contents of the cell located at (1,2)
// The string will be in UTF-8 encoding.
const char*
getCell(int32_t row, int32_t col) const
{
return cellData[row * numCols + col];
}
const char** cellData;
// The number of times this node has cooked
int64_t totalCooks;
int32_t reserved[18];
};
class OP_TOPInput
{
public:
const char* opPath;
uint32_t opId;
int32_t width;
int32_t height;
// You can use OP_Inputs::getTOPDataInCPUMemory() to download the
// data from a TOP input into CPU memory easily.
// The OpenGL Texture index for this TOP.
// This is only valid when accessed from C++ TOPs.
// Other C++ OPs will have this value set to 0 (invalid).
GLuint textureIndex;
// The OpenGL Texture target for this TOP.
// E.g GL_TEXTURE_2D, GL_TEXTURE_CUBE,
// GL_TEXTURE_2D_ARRAY
GLenum textureType;
// Depth for 3D and 2D_ARRAY textures, undefined
// for other texture types
uint32_t depth;
// contains the internalFormat for the texture
// such as GL_RGBA8, GL_RGBA32F, GL_R16
GLint pixelFormat;
int32_t reserved1;
// When the TOP_ExecuteMode is CUDA, this will be filled in
cudaArray* cudaInput;
// The number of times this node has cooked
int64_t totalCooks;
int32_t reserved[14];
};
class OP_String
{
protected:
OP_String()
{
}
virtual ~OP_String()
{
}
public:
// val is expected to be UTF-8 encoded
virtual void setString(const char* val) = 0;
int32_t reserved[20];
};
class OP_CHOPInput
{
public:
const char* opPath;
uint32_t opId;
int32_t numChannels;
int32_t numSamples;
double sampleRate;
double startIndex;
// Retrieve a float array for a specific channel.
// 'i' ranges from 0 to numChannels-1
// The returned arrray contains 'numSamples' samples.
// e.g: getChannelData(1)[10] will refer to the 11th sample in the 2nd channel
const float*
getChannelData(int32_t i) const
{
return channelData[i];
}
// Retrieve the name of a specific channel.
// 'i' ranges from 0 to numChannels-1
// For example getChannelName(1) is the name of the 2nd channel
const char*
getChannelName(int32_t i) const
{
return nameData[i];
}
const float** channelData;
const char** nameData;
// The number of times this node has cooked
int64_t totalCooks;
int32_t reserved[18];
};
class OP_ObjectInput
{
public:
const char* opPath;
uint32_t opId;
// Use these methods to calculate object transforms
double worldTransform[4][4];
double localTransform[4][4];
// The number of times this node has cooked
int64_t totalCooks;
int32_t reserved[18];
};
// The type of data the attribute holds
enum class AttribType : int32_t
{
// One or more floats
Float = 0,
// One or more integers
Int,
};
// Right now we only support point attributes.
enum class AttribSet : int32_t
{
Invalid,
Point = 0,
};
// The type of the primitives, currently only Polygon type
// is supported
enum class PrimitiveType : int32_t
{
Invalid,
Polygon = 0,
};
class Vector
{
public:
Vector()
{
x = 0.0f;
y = 0.0f;
z = 0.0f;
}
Vector(float xx, float yy, float zz)
{
x = xx;
y = yy;
z = zz;
}
// inplace operators
inline Vector&
operator*=(const float scalar)
{
x *= scalar;
y *= scalar;
z *= scalar;
return *this;
}
inline Vector&
operator/=(const float scalar)
{
x /= scalar;
y /= scalar;
z /= scalar;
return *this;
}
inline Vector&
operator-=(const Vector& trans)
{
x -= trans.x;
y -= trans.y;
z -= trans.z;
return *this;
}
inline Vector&
operator+=(const Vector& trans)
{
x += trans.x;
y += trans.y;
z += trans.z;
return *this;
}
// non-inplace operations:
inline Vector
operator*(const float scalar) const
{
Vector temp(*this);
temp.x *= scalar;
temp.y *= scalar;
temp.z *= scalar;
return temp;
}
inline Vector
operator/(const float scalar) const
{
Vector temp(*this);
temp.x /= scalar;
temp.y /= scalar;
temp.z /= scalar;
return temp;
}
inline Vector
operator-(const Vector& trans) const
{
Vector temp(*this);
temp.x -= trans.x;
temp.y -= trans.y;
temp.z -= trans.z;
return temp;
}
inline Vector
operator+(const Vector& trans) const
{
Vector temp(*this);
temp.x += trans.x;
temp.y += trans.y;
temp.z += trans.z;
return temp;
}
//------
float
dot(const Vector &v) const
{
return x * v.x + y * v.y + z * v.z;
}
inline float
length() const
{
return sqrtf(dot(*this));
}
inline float
normalize()
{
float dn = x * x + y * y + z * z;
if (dn > FLT_MIN && dn != 1.0F)
{
dn = sqrtf(dn);
(*this) /= dn;
}
return dn;
}
float x;
float y;
float z;
};
class Position
{
public:
Position()
{
x = 0.0f;
y = 0.0f;
z = 0.0f;
}
Position(float xx, float yy, float zz)
{
x = xx;
y = yy;
z = zz;
}
// in-place operators
inline Position& operator*=(const float scalar)
{
x *= scalar;
y *= scalar;
z *= scalar;
return *this;
}
inline Position& operator/=(const float scalar)
{
x /= scalar;
y /= scalar;
z /= scalar;
return *this;
}
inline Position& operator-=(const Vector& trans)
{
x -= trans.x;
y -= trans.y;
z -= trans.z;
return *this;
}
inline Position& operator+=(const Vector& trans)
{
x += trans.x;
y += trans.y;
z += trans.z;
return *this;
}
// non-inplace operators
inline Position operator*(const float scalar) const
{
Position temp(*this);
temp.x *= scalar;
temp.y *= scalar;
temp.z *= scalar;
return temp;
}
inline Position operator/(const float scalar) const
{
Position temp(*this);
temp.x /= scalar;
temp.y /= scalar;
temp.z /= scalar;
return temp;
}
inline Position operator+(const Vector& trans) const
{
Position temp(*this);
temp.x += trans.x;
temp.y += trans.y;
temp.z += trans.z;
return temp;
}
inline Position operator-(const Vector& trans) const
{
Position temp(*this);
temp.x -= trans.x;
temp.y -= trans.y;
temp.z -= trans.z;
return temp;
}
float x;
float y;
float z;
};
class Color
{
public:
Color ()
{
r = 1.0f;
g = 1.0f;
b = 1.0f;
a = 1.0f;
}
Color (float rr, float gg, float bb, float aa)
{
r = rr;
g = gg;
b = bb;
a = aa;
}
float r;
float g;
float b;
float a;
};
class TexCoord
{
public:
TexCoord()
{
u = 0.0f;
v = 0.0f;
w = 0.0f;
}
TexCoord(float uu, float vv, float ww)
{
u = uu;
v = vv;
w = ww;
}
float u;
float v;
float w;
};
class BoundingBox
{
public:
BoundingBox(float minx, float miny, float minz,
float maxx, float maxy, float maxz) :
minX(minx), minY(miny), minZ(minz), maxX(maxx), maxY(maxy), maxZ(maxz)
{
}
BoundingBox(const Position& min, const Position& max)
{
minX = min.x;
maxX = max.x;
minY = min.y;
maxY = max.y;
minZ = min.z;
maxZ = max.z;
}
BoundingBox(const Position& center, float x, float y, float z)
{
minX = center.x - x;
maxX = center.x + x;
minY = center.y - y;
maxY = center.y + y;
minZ = center.z - z;
maxZ = center.z + z;
}
// enlarge the bounding box by the input point Position
void
enlargeBounds(const Position& pos)
{
if (pos.x < minX)
minX = pos.x;
if (pos.x > maxX)
maxX = pos.x;
if (pos.y < minY)
minY = pos.y;
if (pos.y > maxY)
maxY = pos.y;
if (pos.z < minZ)
minZ = pos.z;
if (pos.z > maxZ)
maxZ = pos.z;
}
// enlarge the bounding box by the input bounding box:
void
enlargeBounds(const BoundingBox &box)
{
if (box.minX < minX)
minX = box.minX;
if (box.maxX > maxX)
maxX = box.maxX;
if (box.minY < minY)
minY = box.minY;
if (box.maxY > maxY)
maxY = box.maxY;
if (box.minZ < minZ)
minZ = box.minZ;
if (box.maxZ > maxZ)
maxZ = box.maxZ;
}
// returns the bounding box length in x axis:
float
sizeX()
{
return maxX - minX;
}
// returns the bounding box length in y axis:
float
sizeY()
{
return maxY - minY;
}
// returns the bounding box length in z axis:
float
sizeZ()
{
return maxZ - minZ;
}
bool
getCenter(Position* pos)
{
if (!pos)
return false;
pos->x = (minX + maxX) / 2.0f;
pos->y = (minY + maxY) / 2.0f;
pos->z = (minZ + maxZ) / 2.0f;
return true;
}
// verifies if the input position (pos) is inside the current bounding box or not:
bool
isInside(const Position& pos)
{
if (pos.x >= minX && pos.x <= maxX &&
pos.y >= minY && pos.y <= maxY &&
pos.z >= minZ && pos.z <= maxZ)
return true;
else
return false;
}
float minX;
float minY;
float minZ;
float maxX;
float maxY;
float maxZ;
};
class SOP_NormalInfo
{
public:
SOP_NormalInfo()
{
numNormals = 0;
attribSet = AttribSet::Point;
normals = nullptr;
}
int32_t numNormals;
AttribSet attribSet;
const Vector* normals;
};
class SOP_ColorInfo
{
public:
SOP_ColorInfo()
{
numColors = 0;
attribSet = AttribSet::Point;
colors = nullptr;
}
int32_t numColors;
AttribSet attribSet;
const Color* colors;
};
class SOP_TextureInfo
{
public:
SOP_TextureInfo()
{
numTextures = 0;
attribSet = AttribSet::Point;
textures = nullptr;
numTextureLayers = 0;
}
int32_t numTextures;
AttribSet attribSet;
const TexCoord* textures;
int32_t numTextureLayers;
};
// CustomAttribInfo, all the required data for each custom attribute
// this info can be queried by calling getCustomAttribute() which accepts
// two types of argument:
// 1) a valid index of a custom attribute
// 2) a valid name of a custom attribute
class SOP_CustomAttribInfo
{
public:
SOP_CustomAttribInfo()
{
name = nullptr;
numComponents = 0;
attribType = AttribType::Float;
}
SOP_CustomAttribInfo(const char* n, int32_t numComp, AttribType type)
{
name = n;
numComponents = numComp;
attribType = type;
}
const char* name;
int32_t numComponents;
AttribType attribType;
};
// SOP_CustomAttribData, all the required data for each custom attribute
// this info can be queried by calling getCustomAttribute() which accepts
// a valid name of a custom attribute
class SOP_CustomAttribData : public SOP_CustomAttribInfo
{
public:
SOP_CustomAttribData()
{
floatData = nullptr;
intData = nullptr;
}
SOP_CustomAttribData(const char* n, int32_t numComp, AttribType type) :
SOP_CustomAttribInfo(n, numComp, type)
{
floatData = nullptr;
intData = nullptr;
}
const float* floatData;
const int32_t* intData;
};
// SOP_PrimitiveInfo, all the required data for each primitive
// this info can be queried by calling getPrimitive() which accepts
// a valid index of a primitive as an input argument
class SOP_PrimitiveInfo
{
public:
SOP_PrimitiveInfo()
{
pointIndices = nullptr;
numVertices = 0;
type = PrimitiveType::Invalid;
pointIndicesOffset = 0;
}
// number of vertices of this prim
int32_t numVertices;
// all the indices of the vertices of the primitive. This array has
// numVertices entries in it
const int32_t* pointIndices;
// The type of this primitive
PrimitiveType type;
// the offset of the this primitive's point indices in the index array
// returned from getAllPrimPointIndices()
int32_t pointIndicesOffset;
};
class OP_SOPInput
{
public:
virtual ~OP_SOPInput()
{
}
const char* opPath;
uint32_t opId;
// Returns the total number of points
virtual int32_t getNumPoints() const = 0;
// The total number of vertices, across all primitives.
virtual int32_t getNumVertices() const = 0;
// The total number of primitives
virtual int32_t getNumPrimitives() const = 0;
// The total number of custom attributes
virtual int32_t getNumCustomAttributes() const = 0;
// Returns an array of point positions. This array is getNumPoints() long.
virtual const Position* getPointPositions() const = 0;
// Returns an array of normals.
//
// Returns nullptr if no normals are present
virtual const SOP_NormalInfo* getNormals() const = 0;
// Returns an array of colors.
// Returns nullptr if no colors are present
virtual const SOP_ColorInfo* getColors() const = 0;
// Returns an array of texture coordinates.
// If multiple texture coordinate layers are present, they will be placed
// interleaved back-to-back.
// E.g layer0 followed by layer1 followed by layer0 etc.
//
// Returns nullptr if no texture layers are present
virtual const SOP_TextureInfo* getTextures() const = 0;
// Returns the custom attribute data with an input index
virtual const SOP_CustomAttribData* getCustomAttribute(int32_t customAttribIndex) const = 0;
// Returns the custom attribute data with its name
virtual const SOP_CustomAttribData* getCustomAttribute(const char* customAttribName) const = 0;
// Returns true if the SOP has a normal attribute of the given source
// attribute 'N'
virtual bool hasNormals() const = 0;
// Returns true if the SOP has a color the given source
// attribute 'Cd'
virtual bool hasColors() const = 0;
// Returns the SOP_PrimitiveInfo with primIndex
const SOP_PrimitiveInfo
getPrimitive(int32_t primIndex) const
{
return myPrimsInfo[primIndex];
}
// Returns the full list of all the point indices for all primitives.
// The primitives are stored back to back in this array.
// This is a faster but harder way to work with primitives than
// getPrimPointIndices()
const int32_t*
getAllPrimPointIndices()
{
return myPrimPointIndices;
}
SOP_PrimitiveInfo* myPrimsInfo;
const int32_t* myPrimPointIndices;
// The number of times this node has cooked
int64_t totalCooks;
int32_t reserved[98];
};
enum class OP_TOPInputDownloadType : int32_t
{
// The texture data will be downloaded and and available on the next frame.
// Except for the first time this is used, getTOPDataInCPUMemory()
// will return the texture data on the CPU from the previous frame.
// The first getTOPDataInCPUMemory() is called it will be nullptr.
// ** This mode should be used is most cases for performance reasons **
Delayed = 0,
// The texture data will be downloaded immediately and be available
// this frame. This can cause a large stall though and should be avoided
// in most cases
Instant,
};
class OP_TOPInputDownloadOptions
{
public:
OP_TOPInputDownloadOptions()
{
downloadType = OP_TOPInputDownloadType::Delayed;
verticalFlip = false;
cpuMemPixelType = OP_CPUMemPixelType::BGRA8Fixed;
}
OP_TOPInputDownloadType downloadType;
// Set this to true if you want the image vertically flipped in the
// downloaded data
bool verticalFlip;
// Set this to how you want the pixel data to be give to you in CPU
// memory. BGRA8Fixed should be used for 4 channel 8-bit data if possible
OP_CPUMemPixelType cpuMemPixelType;
};