blob: cc9b58b3e3106193d8745a0cb7044bd91228a1b4 [file] [log] [blame]
Jason Samsb8c5a842009-07-31 20:40:47 -07001/*
Jason Samsdd6c8b32013-02-15 17:27:24 -08002 * Copyright (C) 2013 The Android Open Source Project
Jason Samsb8c5a842009-07-31 20:40:47 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.renderscript;
18
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -070019/**
Tim Murrayc11e25c2013-04-09 11:01:01 -070020 * <p>A Type describes the {@link android.renderscript.Element} and dimensions used for an {@link
21 * android.renderscript.Allocation} or a parallel operation. Types are created through {@link
22 * android.renderscript.Type.Builder}.</p>
Jason Samsa1b13ed2010-11-12 14:58:37 -080023 *
Tim Murrayc11e25c2013-04-09 11:01:01 -070024 * <p>A Type always includes an {@link android.renderscript.Element} and an X
25 * dimension. A Type may be multidimensional, up to three dimensions. A nonzero
26 * value in the Y or Z dimensions indicates that the dimension is present. Note
27 * that a Type with only a given X dimension and a Type with the same X
28 * dimension but Y = 1 are not equivalent.</p>
Jason Samsa1b13ed2010-11-12 14:58:37 -080029 *
Tim Murrayc11e25c2013-04-09 11:01:01 -070030 * <p>A Type also supports inclusion of level of detail (LOD) or cube map
31 * faces. LOD and cube map faces are booleans to indicate present or not
32 * present. </p>
33 *
Eino-Ville Talvalaccadaf12013-08-14 10:36:30 -070034 * <p>A Type also supports YUV format information to support an
35 * {@link android.renderscript.Allocation} in a YUV format. The YUV formats
36 * supported are {@link android.graphics.ImageFormat#YV12},
37 * {@link android.graphics.ImageFormat#NV21}, and
38 * {@link android.graphics.ImageFormat#YUV_420_888}</p>
Jason Samsa1b13ed2010-11-12 14:58:37 -080039 *
Joe Fernandez3aef8e1d2011-12-20 10:38:34 -080040 * <div class="special reference">
41 * <h3>Developer Guides</h3>
Tim Murrayc11e25c2013-04-09 11:01:01 -070042 * <p>For more information about creating an application that uses RenderScript, read the
43 * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
Joe Fernandez3aef8e1d2011-12-20 10:38:34 -080044 * </div>
Jason Samsb8c5a842009-07-31 20:40:47 -070045 **/
46public class Type extends BaseObj {
Jason Sams768bc022009-09-21 19:41:04 -070047 int mDimX;
48 int mDimY;
49 int mDimZ;
Jason Samsbf6ef8d2010-12-06 15:59:59 -080050 boolean mDimMipmaps;
Jason Sams768bc022009-09-21 19:41:04 -070051 boolean mDimFaces;
Jason Sams8140d7b2012-12-13 17:01:09 -080052 int mDimYuv;
Jason Sams768bc022009-09-21 19:41:04 -070053 int mElementCount;
Jason Sams1bada8c2009-08-09 17:01:55 -070054 Element mElement;
Jason Sams46ba27e32015-02-06 17:45:15 -080055 int mArrays[];
56
57 static final int mMaxArrays = 4;
Jason Sams768bc022009-09-21 19:41:04 -070058
Jason Sams49a05d72010-12-29 14:31:29 -080059 public enum CubemapFace {
Stephen Hines20fbd012011-06-16 17:44:53 -070060 POSITIVE_X (0),
Jason Sams49a05d72010-12-29 14:31:29 -080061 NEGATIVE_X (1),
Stephen Hines20fbd012011-06-16 17:44:53 -070062 POSITIVE_Y (2),
Jason Sams49a05d72010-12-29 14:31:29 -080063 NEGATIVE_Y (3),
Stephen Hines20fbd012011-06-16 17:44:53 -070064 POSITIVE_Z (4),
65 NEGATIVE_Z (5),
66 @Deprecated
67 POSITVE_X (0),
68 @Deprecated
69 POSITVE_Y (2),
70 @Deprecated
71 POSITVE_Z (4);
Jason Sams49a05d72010-12-29 14:31:29 -080072
73 int mID;
74 CubemapFace(int id) {
75 mID = id;
76 }
77 }
78
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -070079 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -080080 * Return the element associated with this Type.
81 *
82 * @return Element
83 */
Jason Samse17964e2010-01-04 16:52:27 -080084 public Element getElement() {
85 return mElement;
86 }
Jason Sams1bada8c2009-08-09 17:01:55 -070087
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -070088 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -080089 * Return the value of the X dimension.
90 *
91 * @return int
92 */
Jason Sams768bc022009-09-21 19:41:04 -070093 public int getX() {
94 return mDimX;
95 }
Jason Samsa1b13ed2010-11-12 14:58:37 -080096
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -070097 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -080098 * Return the value of the Y dimension or 0 for a 1D allocation.
99 *
100 * @return int
101 */
Jason Sams768bc022009-09-21 19:41:04 -0700102 public int getY() {
103 return mDimY;
104 }
Jason Samsa1b13ed2010-11-12 14:58:37 -0800105
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700106 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800107 * Return the value of the Z dimension or 0 for a 1D or 2D allocation.
108 *
109 * @return int
110 */
Jason Sams768bc022009-09-21 19:41:04 -0700111 public int getZ() {
112 return mDimZ;
113 }
Jason Samsa1b13ed2010-11-12 14:58:37 -0800114
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700115 /**
Jason Sams5a722cf2013-03-26 13:27:37 -0700116 * Get the YUV format
117 *
Jason Sams02d56d92013-04-12 16:40:50 -0700118 *
Jason Sams5a722cf2013-03-26 13:27:37 -0700119 * @return int
120 */
121 public int getYuv() {
122 return mDimYuv;
123 }
124
125 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800126 * Return if the Type has a mipmap chain.
127 *
128 * @return boolean
129 */
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800130 public boolean hasMipmaps() {
131 return mDimMipmaps;
Jason Sams768bc022009-09-21 19:41:04 -0700132 }
Jason Samsa1b13ed2010-11-12 14:58:37 -0800133
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700134 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800135 * Return if the Type is a cube map.
136 *
137 * @return boolean
138 */
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800139 public boolean hasFaces() {
Jason Sams768bc022009-09-21 19:41:04 -0700140 return mDimFaces;
141 }
Jason Samsa1b13ed2010-11-12 14:58:37 -0800142
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700143 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800144 * Return the total number of accessable cells in the Type.
145 *
146 * @return int
147 */
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800148 public int getCount() {
Jason Sams768bc022009-09-21 19:41:04 -0700149 return mElementCount;
150 }
151
Jason Sams46ba27e32015-02-06 17:45:15 -0800152 /**
Jason Sams6a420b52015-03-30 15:31:26 -0700153 * Return the dimension of the specified array.
154 *
155 * @param arrayNum The array dimension to query
156 * @return int
157 */
158 public int getArray(int arrayNum) {
159 if ((arrayNum < 0) || (arrayNum >= mMaxArrays)) {
Jason Sams46ba27e32015-02-06 17:45:15 -0800160 throw new RSIllegalArgumentException("Array dimension out of range.");
161 }
162
Jason Sams6a420b52015-03-30 15:31:26 -0700163 if (mArrays == null || arrayNum >= mArrays.length) {
Jason Sams46ba27e32015-02-06 17:45:15 -0800164 // Dimension in range but no array for that dimension allocated
165 return 0;
166 }
167
Jason Sams6a420b52015-03-30 15:31:26 -0700168 return mArrays[arrayNum];
Jason Sams46ba27e32015-02-06 17:45:15 -0800169 }
170
171 /**
Jason Sams6a420b52015-03-30 15:31:26 -0700172 * Return the number of array dimensions.
173 *
174 * @return int
175 */
Jason Sams46ba27e32015-02-06 17:45:15 -0800176 public int getArrayCount() {
177 if (mArrays != null) return mArrays.length;
178 return 0;
179 }
180
Jason Sams768bc022009-09-21 19:41:04 -0700181 void calcElementCount() {
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800182 boolean hasLod = hasMipmaps();
Jason Sams768bc022009-09-21 19:41:04 -0700183 int x = getX();
184 int y = getY();
185 int z = getZ();
186 int faces = 1;
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800187 if (hasFaces()) {
Jason Sams768bc022009-09-21 19:41:04 -0700188 faces = 6;
189 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800190 if (x == 0) {
Jason Sams768bc022009-09-21 19:41:04 -0700191 x = 1;
192 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800193 if (y == 0) {
Jason Sams768bc022009-09-21 19:41:04 -0700194 y = 1;
195 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800196 if (z == 0) {
Jason Sams768bc022009-09-21 19:41:04 -0700197 z = 1;
198 }
199
200 int count = x * y * z * faces;
Alex Sakhartchouk9ea30a62011-03-02 12:33:50 -0800201
202 while (hasLod && ((x > 1) || (y > 1) || (z > 1))) {
Jason Sams768bc022009-09-21 19:41:04 -0700203 if(x > 1) {
204 x >>= 1;
205 }
206 if(y > 1) {
207 y >>= 1;
208 }
209 if(z > 1) {
210 z >>= 1;
211 }
212
213 count += x * y * z * faces;
214 }
Jason Sams46ba27e32015-02-06 17:45:15 -0800215
216 if (mArrays != null) {
217 for (int ct = 0; ct < mArrays.length; ct++) {
218 count *= mArrays[ct];
219 }
220 }
221
Jason Sams768bc022009-09-21 19:41:04 -0700222 mElementCount = count;
223 }
224
225
Tim Murray460a0492013-11-19 12:45:54 -0800226 Type(long id, RenderScript rs) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700227 super(id, rs);
Jason Sams43ee06852009-08-12 17:54:11 -0700228 }
229
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700230 @Override
231 void updateFromNative() {
Ashok Bhat98071552014-02-12 09:54:43 +0000232 // We have 6 integer/long to obtain mDimX; mDimY; mDimZ;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700233 // mDimLOD; mDimFaces; mElement;
Ashok Bhat98071552014-02-12 09:54:43 +0000234 long[] dataBuffer = new long[6];
235 mRS.nTypeGetNativeData(getID(mRS), dataBuffer);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700236
Ashok Bhat98071552014-02-12 09:54:43 +0000237 mDimX = (int)dataBuffer[0];
238 mDimY = (int)dataBuffer[1];
239 mDimZ = (int)dataBuffer[2];
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800240 mDimMipmaps = dataBuffer[3] == 1 ? true : false;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700241 mDimFaces = dataBuffer[4] == 1 ? true : false;
242
Ashok Bhat98071552014-02-12 09:54:43 +0000243 long elementID = dataBuffer[5];
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700244 if(elementID != 0) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700245 mElement = new Element(elementID, mRS);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700246 mElement.updateFromNative();
247 }
248 calcElementCount();
249 }
250
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700251 /**
Jason Samsec44e5d2013-10-09 17:15:36 -0700252 * Utility function for creating basic 1D types. The type is
253 * created without mipmaps enabled.
254 *
255 * @param rs The RenderScript context
256 * @param e The Element for the Type
257 * @param dimX The X dimension, must be > 0
258 *
259 * @return Type
260 */
261 static public Type createX(RenderScript rs, Element e, int dimX) {
262 if (dimX < 1) {
263 throw new RSInvalidStateException("Dimension must be >= 1.");
264 }
265
Tim Murray460a0492013-11-19 12:45:54 -0800266 long id = rs.nTypeCreate(e.getID(rs), dimX, 0, 0, false, false, 0);
Jason Samsec44e5d2013-10-09 17:15:36 -0700267 Type t = new Type(id, rs);
268 t.mElement = e;
269 t.mDimX = dimX;
270 t.calcElementCount();
271 return t;
272 }
273
274 /**
275 * Utility function for creating basic 2D types. The type is
276 * created without mipmaps or cubemaps.
277 *
278 * @param rs The RenderScript context
279 * @param e The Element for the Type
280 * @param dimX The X dimension, must be > 0
281 * @param dimY The Y dimension, must be > 0
282 *
283 * @return Type
284 */
285 static public Type createXY(RenderScript rs, Element e, int dimX, int dimY) {
286 if ((dimX < 1) || (dimY < 1)) {
287 throw new RSInvalidStateException("Dimension must be >= 1.");
288 }
289
Tim Murray460a0492013-11-19 12:45:54 -0800290 long id = rs.nTypeCreate(e.getID(rs), dimX, dimY, 0, false, false, 0);
Jason Samsec44e5d2013-10-09 17:15:36 -0700291 Type t = new Type(id, rs);
292 t.mElement = e;
293 t.mDimX = dimX;
294 t.mDimY = dimY;
295 t.calcElementCount();
296 return t;
297 }
298
299 /**
300 * Utility function for creating basic 3D types. The type is
301 * created without mipmaps.
302 *
303 * @param rs The RenderScript context
304 * @param e The Element for the Type
305 * @param dimX The X dimension, must be > 0
306 * @param dimY The Y dimension, must be > 0
307 * @param dimZ The Z dimension, must be > 0
308 *
309 * @return Type
310 */
311 static public Type createXYZ(RenderScript rs, Element e, int dimX, int dimY, int dimZ) {
312 if ((dimX < 1) || (dimY < 1) || (dimZ < 1)) {
313 throw new RSInvalidStateException("Dimension must be >= 1.");
314 }
315
Tim Murray460a0492013-11-19 12:45:54 -0800316 long id = rs.nTypeCreate(e.getID(rs), dimX, dimY, dimZ, false, false, 0);
Jason Samsec44e5d2013-10-09 17:15:36 -0700317 Type t = new Type(id, rs);
318 t.mElement = e;
319 t.mDimX = dimX;
320 t.mDimY = dimY;
321 t.mDimZ = dimZ;
322 t.calcElementCount();
323 return t;
324 }
325
326 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800327 * Builder class for Type.
328 *
329 */
Jason Samsb8c5a842009-07-31 20:40:47 -0700330 public static class Builder {
331 RenderScript mRS;
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800332 int mDimX = 1;
333 int mDimY;
334 int mDimZ;
335 boolean mDimMipmaps;
336 boolean mDimFaces;
Jason Samsb109cc72013-01-07 18:20:12 -0800337 int mYuv;
Jason Sams46ba27e32015-02-06 17:45:15 -0800338 int[] mArray = new int[mMaxArrays];
Jason Samsb8c5a842009-07-31 20:40:47 -0700339
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800340 Element mElement;
Jason Samsb8c5a842009-07-31 20:40:47 -0700341
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700342 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800343 * Create a new builder object.
344 *
345 * @param rs
346 * @param e The element for the type to be created.
347 */
Jason Sams22534172009-08-04 16:58:20 -0700348 public Builder(RenderScript rs, Element e) {
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800349 e.checkValid();
Jason Sams22534172009-08-04 16:58:20 -0700350 mRS = rs;
Jason Sams22534172009-08-04 16:58:20 -0700351 mElement = e;
Jason Samsb8c5a842009-07-31 20:40:47 -0700352 }
353
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700354 /**
Jason Samsa1b13ed2010-11-12 14:58:37 -0800355 * Add a dimension to the Type.
356 *
357 *
Jason Samsa1b13ed2010-11-12 14:58:37 -0800358 * @param value
359 */
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800360 public Builder setX(int value) {
Jason Sams3c0dfba2009-09-27 17:50:38 -0700361 if(value < 1) {
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800362 throw new RSIllegalArgumentException("Values of less than 1 for Dimension X are not valid.");
Jason Sams3c0dfba2009-09-27 17:50:38 -0700363 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800364 mDimX = value;
365 return this;
Jason Sams22534172009-08-04 16:58:20 -0700366 }
367
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800368 public Builder setY(int value) {
369 if(value < 1) {
370 throw new RSIllegalArgumentException("Values of less than 1 for Dimension Y are not valid.");
371 }
372 mDimY = value;
373 return this;
374 }
375
Jason Samsd1c306a2012-12-27 20:26:41 -0800376 public Builder setZ(int value) {
377 if(value < 1) {
378 throw new RSIllegalArgumentException("Values of less than 1 for Dimension Z are not valid.");
379 }
380 mDimZ = value;
381 return this;
382 }
383
Jason Sams46ba27e32015-02-06 17:45:15 -0800384 /**
Jason Sams6a420b52015-03-30 15:31:26 -0700385 * Adds an array dimension to the builder
Jason Sams46ba27e32015-02-06 17:45:15 -0800386 *
387 * @param dim
388 * @param value
389 *
390 * @return Builder
391 */
392 public Builder setArray(int dim, int value) {
393 if(dim < 0 || dim >= mMaxArrays) {
394 throw new RSIllegalArgumentException("Array dimension out of range.");
395 }
396 mArray[dim] = value;
397 return this;
398 }
399
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800400 public Builder setMipmaps(boolean value) {
401 mDimMipmaps = value;
402 return this;
403 }
404
405 public Builder setFaces(boolean value) {
406 mDimFaces = value;
407 return this;
408 }
409
Jason Samsb109cc72013-01-07 18:20:12 -0800410 /**
Tim Murrayc11e25c2013-04-09 11:01:01 -0700411 * Set the YUV layout for a Type.
Jason Samsb109cc72013-01-07 18:20:12 -0800412 *
Eino-Ville Talvalaccadaf12013-08-14 10:36:30 -0700413 * @param yuvFormat {@link android.graphics.ImageFormat#YV12}, {@link android.graphics.ImageFormat#NV21}, or
414 * {@link android.graphics.ImageFormat#YUV_420_888}.
Jason Samsb109cc72013-01-07 18:20:12 -0800415 */
416 public Builder setYuvFormat(int yuvFormat) {
417 switch (yuvFormat) {
418 case android.graphics.ImageFormat.NV21:
419 case android.graphics.ImageFormat.YV12:
Eino-Ville Talvalaccadaf12013-08-14 10:36:30 -0700420 case android.graphics.ImageFormat.YUV_420_888:
Jason Samsb109cc72013-01-07 18:20:12 -0800421 break;
422
423 default:
Eino-Ville Talvalaccadaf12013-08-14 10:36:30 -0700424 throw new RSIllegalArgumentException(
425 "Only ImageFormat.NV21, .YV12, and .YUV_420_888 are supported..");
Jason Samsb109cc72013-01-07 18:20:12 -0800426 }
427
428 mYuv = yuvFormat;
429 return this;
430 }
431
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800432
Stephen Hines9c9ad3f8c22012-05-07 15:34:29 -0700433 /**
Tim Murrayc11e25c2013-04-09 11:01:01 -0700434 * Validate structure and create a new Type.
Jason Samsa1b13ed2010-11-12 14:58:37 -0800435 *
436 * @return Type
437 */
Jason Samsb8c5a842009-07-31 20:40:47 -0700438 public Type create() {
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800439 if (mDimZ > 0) {
440 if ((mDimX < 1) || (mDimY < 1)) {
Jason Samsa1b13ed2010-11-12 14:58:37 -0800441 throw new RSInvalidStateException("Both X and Y dimension required when Z is present.");
442 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800443 if (mDimFaces) {
Jason Samsa1b13ed2010-11-12 14:58:37 -0800444 throw new RSInvalidStateException("Cube maps not supported with 3D types.");
445 }
446 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800447 if (mDimY > 0) {
448 if (mDimX < 1) {
Jason Samsa1b13ed2010-11-12 14:58:37 -0800449 throw new RSInvalidStateException("X dimension required when Y is present.");
450 }
451 }
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800452 if (mDimFaces) {
453 if (mDimY < 1) {
Jason Samsa1b13ed2010-11-12 14:58:37 -0800454 throw new RSInvalidStateException("Cube maps require 2D Types.");
455 }
456 }
457
Jason Samsb109cc72013-01-07 18:20:12 -0800458 if (mYuv != 0) {
459 if ((mDimZ != 0) || mDimFaces || mDimMipmaps) {
460 throw new RSInvalidStateException("YUV only supports basic 2D.");
461 }
462 }
463
Jason Sams46ba27e32015-02-06 17:45:15 -0800464 int[] arrays = null;
465 for (int ct = mMaxArrays - 1; ct >= 0; ct--) {
466 if (mArray[ct] != 0 && arrays == null) {
467 arrays = new int[ct];
468 }
469 if ((mArray[ct] == 0) && (arrays != null)) {
470 throw new RSInvalidStateException("Array dimensions must be contigous from 0.");
471 }
472 }
473
Tim Murray460a0492013-11-19 12:45:54 -0800474 long id = mRS.nTypeCreate(mElement.getID(mRS),
Jason Samsb109cc72013-01-07 18:20:12 -0800475 mDimX, mDimY, mDimZ, mDimMipmaps, mDimFaces, mYuv);
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800476 Type t = new Type(id, mRS);
477 t.mElement = mElement;
478 t.mDimX = mDimX;
479 t.mDimY = mDimY;
480 t.mDimZ = mDimZ;
481 t.mDimMipmaps = mDimMipmaps;
482 t.mDimFaces = mDimFaces;
Jason Samsb109cc72013-01-07 18:20:12 -0800483 t.mDimYuv = mYuv;
Jason Sams46ba27e32015-02-06 17:45:15 -0800484 t.mArrays = arrays;
Jason Samsbf6ef8d2010-12-06 15:59:59 -0800485
Jason Sams768bc022009-09-21 19:41:04 -0700486 t.calcElementCount();
Jason Sams1bada8c2009-08-09 17:01:55 -0700487 return t;
Jason Samsb8c5a842009-07-31 20:40:47 -0700488 }
489 }
490
491}