Lines Matching full:allocation
30 * Memory allocation class for renderscript. An allocation combines a
46 * For example, when creating a allocation for a texture, the user can
49 * synchronization if a script modifies an allocation used by other targets it must
55 * memory types. A {@link android.renderscript.Allocation#syncAll syncAll()}
59 * <p>Allocation data is uploaded in one of two primary ways. For simple
66 public class Allocation extends BaseObj {
70 Allocation mAdaptedAllocation;
88 * The usage of the allocation. These signal to renderscript
89 * where to place the allocation in memory.
91 * SCRIPT The allocation will be bound to and accessed by
104 * GRAPHICS_VERTEX The allocation will be used as a graphics
112 * GRAPHICS_CONSTANTS The allocation will be used as the source
139 * type of the allocation will contain a full mipmap chain. On
145 * The type of the allocation will be the same as MIPMAP_NONE.
147 * graphics copy of the allocation data will contain a full
179 Allocation(int id, RenderScript rs, Type t, int usage) {
201 "32 bit integer source does not match allocation type " + mType.mElement.mType);
210 "16 bit integer source does not match allocation type " + mType.mElement.mType);
219 "8 bit integer source does not match allocation type " + mType.mElement.mType);
227 "32 bit float source does not match allocation type " + mType.mElement.mType);
244 "Object source does not match allocation type " + mType.mElement.mType);
280 throw new RSIllegalArgumentException("Array size mismatch, allocation sizeX = " +
295 throw new RSIllegalArgumentException("Allocation kind is " +
305 throw new RSIllegalArgumentException("Allocation kind is " +
315 throw new RSIllegalArgumentException("Allocation kind is " +
325 throw new RSIllegalArgumentException("Allocation kind is " +
338 throw new RSIllegalArgumentException("Cannot update allocation from bitmap, sizes mismatch");
343 * Copy an allocation from an array. This variant is not type
354 * Copy an allocation from an array. This variant is not type
365 * Copy an allocation from an array. This variant is not type
376 * Copy an allocation from an array. This variant is not type
388 * Copy an allocation from an array. This variant is type
389 * checked and will generate exceptions if the Allocation type
400 * Copy an allocation from an array. This variant is type
401 * checked and will generate exceptions if the Allocation type
412 * Copy an allocation from an array. This variant is type
413 * checked and will generate exceptions if the Allocation type
424 * Copy an allocation from an array. This variant is type
425 * checked and will generate exceptions if the Allocation type
436 * Copy an allocation from a bitmap. The height, width, and
437 * format of the bitmap must match the existing allocation.
508 throw new RSIllegalArgumentException("Array too small for allocation type.");
513 * Generate a mipmap chain. Requires the type of the allocation
519 * If the allocation is also using other memory spaces a
527 * Copy part of an allocation from an array. This variant is
541 * Copy part of an allocation from an array. This variant is
555 * Copy part of an allocation from an array. This variant is
569 * Copy part of an allocation from an array. This variant is
584 * Copy part of an allocation from an array. This variant is
585 * type checked and will generate exceptions if the Allocation
598 * Copy part of an allocation from an array. This variant is
599 * type checked and will generate exceptions if the Allocation
612 * Copy part of an allocation from an array. This variant is
613 * type checked and will generate exceptions if the Allocation
626 * Copy part of an allocation from an array. This variant is
627 * type checked and will generate exceptions if the Allocation
640 * Copy part of an allocation from another allocation.
644 * @param data the source data allocation.
648 public void copy1DRangeFrom(int off, int count, Allocation data, int dataOff) {
667 throw new RSIllegalArgumentException("Updated region larger than allocation.");
673 * Copy a rectangular region from the array into the allocation.
680 * @param data to be placed into the allocation
711 * Copy a rectangular region into the allocation from another
712 * allocation.
718 * @param data source allocation.
723 Allocation data, int dataXoff, int dataYoff) {
733 * Copy a bitmap into an allocation. The height and width of
750 * Copy from the Allocation into a Bitmap. The bitmap must
751 * match the dimensions of the Allocation.
753 * @param b The bitmap to be set from the Allocation.
763 * Copy from the Allocation into a byte array. The array must
764 * be at least as large as the Allocation. The allocation must
767 * @param d The array to be set from the Allocation.
776 * Copy from the Allocation into a short array. The array must
777 * be at least as large as the Allocation. The allocation must
780 * @param d The array to be set from the Allocation.
789 * Copy from the Allocation into a int array. The array must be
790 * at least as large as the Allocation. The allocation must be
793 * @param d The array to be set from the Allocation.
802 * Copy from the Allocation into a float array. The array must
803 * be at least as large as the Allocation. The allocation must
806 * @param d The array to be set from the Allocation.
815 * Resize a 1D allocation. The contents of the allocation are
824 * @param dimX The new size of the allocation.
864 * allocation
865 * @param usage bit field specifying how the allocation is
868 static public Allocation createTyped(RenderScript rs, Type type, MipmapControl mips, int usage) {
875 throw new RSRuntimeException("Allocation creation failed.");
877 return new Allocation(id, rs, type, usage);
881 * Creates a renderscript allocation with the size specified by
884 * @param rs Context to which the allocation will belong.
886 * @param usage bit field specifying how the allocation is
889 * @return allocation
891 static public Allocation createTyped(RenderScript rs, Type type, int usage) {
896 * Creates a renderscript allocation for use by the script with
900 * @param rs Context to which the allocation will belong.
903 * @return allocation
905 static public Allocation createTyped(RenderScript rs, Type type) {
910 * Creates a renderscript allocation with a specified number of
913 * @param rs Context to which the allocation will belong.
914 * @param e describes what each element of an allocation is
915 * @param count specifies the number of element in the allocation
916 * @param usage bit field specifying how the allocation is
919 * @return allocation
921 static public Allocation createSized(RenderScript rs, Element e,
930 throw new RSRuntimeException("Allocation creation failed.");
932 return new Allocation(id, rs, t, usage);
936 * Creates a renderscript allocation with a specified number of
939 * @param rs Context to which the allocation will belong.
940 * @param e describes what each element of an allocation is
941 * @param count specifies the number of element in the allocation
943 * @return allocation
945 static public Allocation createSized(RenderScript rs, Element e, int count) {
977 * Creates a renderscript allocation from a bitmap
979 * @param rs Context to which the allocation will belong.
980 * @param b bitmap source for the allocation data
982 * allocation
983 * @param usage bit field specifying how the allocation is
986 * @return renderscript allocation containing bitmap data
989 static public Allocation createFromBitmap(RenderScript rs, Bitmap b,
999 return new Allocation(id, rs, t, usage);
1003 * Creates a non-mipmapped renderscript allocation to use as a
1006 * @param rs Context to which the allocation will belong.
1007 * @param b bitmap source for the allocation data
1009 * @return renderscript allocation containing bitmap data
1012 static public Allocation createFromBitmap(RenderScript rs, Bitmap b) {
1018 * Creates a cubemap allocation from a bitmap containing the
1022 * @param rs Context to which the allocation will belong.
1028 * @return allocation containing cubemap data
1031 static public Allocation createCubemapFromBitmap(RenderScript rs, Bitmap b,
1062 return new Allocation(id, rs, t, usage);
1066 * Creates a non-mipmapped cubemap allocation for use as a
1071 * @param rs Context to which the allocation will belong.
1075 * @return allocation containing cubemap data
1078 static public Allocation createCubemapFromBitmap(RenderScript rs,
1085 * Creates a cubemap allocation from 6 bitmaps containing
1089 * @param rs Context to which the allocation will belong.
1099 * @return allocation containing cubemap data
1102 static public Allocation createCubemapFromCubeFaces(RenderScript rs,
1132 Allocation cubemap = Allocation.createTyped(rs, t, mips, usage);
1152 * Creates a non-mipmapped cubemap allocation for use as a
1157 * @param rs Context to which the allocation will belong.
1165 * @return allocation containing cubemap data
1168 static public Allocation createCubemapFromCubeFaces(RenderScript rs,
1181 * Creates a renderscript allocation from the bitmap referenced
1184 * @param rs Context to which the allocation will belong.
1188 * allocation
1189 * @param usage bit field specifying how the allocation is
1192 * @return renderscript allocation containing resource data
1195 static public Allocation createFromBitmapResource(RenderScript rs,
1203 Allocation alloc = createFromBitmap(rs, b, mips, usage);
1209 * Creates a non-mipmapped renderscript allocation to use as a
1212 * @param rs Context to which the allocation will belong.
1216 * @return renderscript allocation containing resource data
1219 static public Allocation createFromBitmapResource(RenderScript rs,
1228 * Creates a renderscript allocation containing string data
1231 * @param rs Context to which the allocation will belong.
1232 * @param str string to create the allocation from
1237 static public Allocation createFromString(RenderScript rs,
1244 Allocation alloc = Allocation.createSized(rs, Element.U8(rs), allocArray.length, usage);