#include <rsCppStructs.h>
Public Member Functions | |
sp< const Type > | getType () const |
void | syncAll (RsAllocationUsageType srcLocation) |
void | generateMipmaps () |
void | copy1DRangeFrom (uint32_t off, size_t count, const void *data) |
void | copy1DRangeFrom (uint32_t off, size_t count, sp< const Allocation > data, uint32_t dataOff) |
void | copy1DRangeTo (uint32_t off, size_t count, void *data) |
void | copy1DFrom (const void *data) |
void | copy1DTo (void *data) |
void | copy2DRangeFrom (uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, const void *data) |
void | copy2DRangeTo (uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, void *data) |
void | copy2DRangeFrom (uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, sp< const Allocation > data, uint32_t dataXoff, uint32_t dataYoff) |
void | copy2DStridedFrom (uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, const void *data, size_t stride) |
void | copy2DStridedFrom (const void *data, size_t stride) |
void | copy2DStridedTo (uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, void *data, size_t stride) |
void | copy2DStridedTo (void *data, size_t stride) |
void | copy3DRangeFrom (uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t w, uint32_t h, uint32_t d, const void *data) |
void | copy3DRangeFrom (uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t w, uint32_t h, uint32_t d, sp< const Allocation > data, uint32_t dataXoff, uint32_t dataYoff, uint32_t dataZoff) |
Static Public Member Functions | |
static sp< Allocation > | createTyped (sp< RS > rs, sp< const Type > type, RsAllocationMipmapControl mipmaps, uint32_t usage) |
static sp< Allocation > | createTyped (sp< RS > rs, sp< const Type > type, RsAllocationMipmapControl mipmaps, uint32_t usage, void *pointer) |
static sp< Allocation > | createTyped (sp< RS > rs, sp< const Type > type, uint32_t usage=RS_ALLOCATION_USAGE_SCRIPT) |
static sp< Allocation > | createSized (sp< RS > rs, sp< const Element > e, size_t count, uint32_t usage=RS_ALLOCATION_USAGE_SCRIPT) |
static sp< Allocation > | createSized2D (sp< RS > rs, sp< const Element > e, size_t x, size_t y, uint32_t usage=RS_ALLOCATION_USAGE_SCRIPT) |
This class provides the primary method through which data is passed to and from RenderScript kernels. An Allocation provides the backing store for a given Type.
An Allocation also contains a set of usage flags that denote how the Allocation could be used. For example, an Allocation may have usage flags specifying that it can be used from a script as well as input to a Sampler. A developer must synchronize across these different usages using syncAll(int) in order to ensure that different users of the Allocation have a consistent view of memory. For example, in the case where an Allocation is used as the output of one kernel and as Sampler input in a later kernel, a developer must call syncAll(RS_ALLOCATION_USAGE_SCRIPT) prior to launching the second kernel to ensure correctness.
Definition at line 293 of file rsCppStructs.h.
void android::RSC::Allocation::copy1DFrom | ( | const void * | data | ) |
Copy entire array to an Allocation.
[in] | data | array from which to copy |
void android::RSC::Allocation::copy1DRangeFrom | ( | uint32_t | off, |
size_t | count, | ||
const void * | data | ||
) |
Copy an array into part of this Allocation.
[in] | off | offset of first Element to be overwritten |
[in] | count | number of Elements to copy |
[in] | data | array from which to copy |
void android::RSC::Allocation::copy1DRangeFrom | ( | uint32_t | off, |
size_t | count, | ||
sp< const Allocation > | data, | ||
uint32_t | dataOff | ||
) |
Copy part of an Allocation into part of this Allocation.
[in] | off | offset of first Element to be overwritten |
[in] | count | number of Elements to copy |
[in] | data | Allocation from which to copy |
[in] | dataOff | offset of first Element in data to copy |
void android::RSC::Allocation::copy1DRangeTo | ( | uint32_t | off, |
size_t | count, | ||
void * | data | ||
) |
Copy an array into part of this Allocation.
[in] | off | offset of first Element to be overwritten |
[in] | count | number of Elements to copy |
[in] | data | array from which to copy |
void android::RSC::Allocation::copy1DTo | ( | void * | data | ) |
Copy entire Allocation to an array.
[in] | data | destination array |
void android::RSC::Allocation::copy2DRangeFrom | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
const void * | data | ||
) |
Copy from an array into a rectangular region in this Allocation. The array is assumed to be tightly packed.
[in] | xoff | X offset of region to update in this Allocation |
[in] | yoff | Y offset of region to update in this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | data | Array from which to copy |
void android::RSC::Allocation::copy2DRangeFrom | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
sp< const Allocation > | data, | ||
uint32_t | dataXoff, | ||
uint32_t | dataYoff | ||
) |
Copy from an Allocation into a rectangular region in this Allocation.
[in] | xoff | X offset of region to update in this Allocation |
[in] | yoff | Y offset of region to update in this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | data | Allocation from which to copy |
[in] | dataXoff | X offset of region to copy from in data |
[in] | dataYoff | Y offset of region to copy from in data |
void android::RSC::Allocation::copy2DRangeTo | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
void * | data | ||
) |
Copy from this Allocation into a rectangular region in an array. The array is assumed to be tightly packed.
[in] | xoff | X offset of region to copy from this Allocation |
[in] | yoff | Y offset of region to copy from this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | data | destination array |
void android::RSC::Allocation::copy2DStridedFrom | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
const void * | data, | ||
size_t | stride | ||
) |
Copy from a strided array into a rectangular region in this Allocation.
[in] | xoff | X offset of region to update in this Allocation |
[in] | yoff | Y offset of region to update in this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | data | array from which to copy |
[in] | stride | stride of data in bytes |
void android::RSC::Allocation::copy2DStridedFrom | ( | const void * | data, |
size_t | stride | ||
) |
Copy from a strided array into this Allocation.
[in] | data | array from which to copy |
[in] | stride | stride of data in bytes |
void android::RSC::Allocation::copy2DStridedTo | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
void * | data, | ||
size_t | stride | ||
) |
Copy from a rectangular region in this Allocation into a strided array.
[in] | xoff | X offset of region to update in this Allocation |
[in] | yoff | Y offset of region to update in this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | data | destination array |
[in] | stride | stride of data in bytes |
void android::RSC::Allocation::copy2DStridedTo | ( | void * | data, |
size_t | stride | ||
) |
Copy this Allocation into a strided array.
[in] | data | destination array |
[in] | stride | stride of data in bytes |
void android::RSC::Allocation::copy3DRangeFrom | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | zoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
uint32_t | d, | ||
const void * | data | ||
) |
Copy from an array into a 3D region in this Allocation. The array is assumed to be tightly packed.
[in] | xoff | X offset of region to update in this Allocation |
[in] | yoff | Y offset of region to update in this Allocation |
[in] | zoff | Z offset of region to update in this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | d | Depth of region to update |
[in] | data | Array from which to copy |
void android::RSC::Allocation::copy3DRangeFrom | ( | uint32_t | xoff, |
uint32_t | yoff, | ||
uint32_t | zoff, | ||
uint32_t | w, | ||
uint32_t | h, | ||
uint32_t | d, | ||
sp< const Allocation > | data, | ||
uint32_t | dataXoff, | ||
uint32_t | dataYoff, | ||
uint32_t | dataZoff | ||
) |
Copy from an Allocation into a 3D region in this Allocation.
[in] | xoff | X offset of region to update in this Allocation |
[in] | yoff | Y offset of region to update in this Allocation |
[in] | zoff | Z offset of region to update in this Allocation |
[in] | w | Width of region to update |
[in] | h | Height of region to update |
[in] | d | Depth of region to update |
[in] | data | Allocation from which to copy |
[in] | dataXoff | X offset of region in data to copy from |
[in] | dataYoff | Y offset of region in data to copy from |
[in] | dataZoff | Z offset of region in data to copy from |
static sp<Allocation> android::RSC::Allocation::createSized | ( | sp< RS > | rs, |
sp< const Element > | e, | ||
size_t | count, | ||
uint32_t | usage = RS_ALLOCATION_USAGE_SCRIPT |
||
) | [static] |
Creates an Allocation with a specified number of given elements.
[in] | rs | Context to which the Allocation will belong |
[in] | e | Element used in the Allocation |
[in] | count | Number of elements of the Allocation |
[in] | usage | usage for the Allocation |
static sp<Allocation> android::RSC::Allocation::createSized2D | ( | sp< RS > | rs, |
sp< const Element > | e, | ||
size_t | x, | ||
size_t | y, | ||
uint32_t | usage = RS_ALLOCATION_USAGE_SCRIPT |
||
) | [static] |
Creates a 2D Allocation with a specified number of given elements.
[in] | rs | Context to which the Allocation will belong |
[in] | e | Element used in the Allocation |
[in] | x | Width in Elements of the Allocation |
[in] | y | Height of the Allocation |
[in] | usage | usage for the Allocation |
static sp<Allocation> android::RSC::Allocation::createTyped | ( | sp< RS > | rs, |
sp< const Type > | type, | ||
RsAllocationMipmapControl | mipmaps, | ||
uint32_t | usage | ||
) | [static] |
Creates an Allocation for use by scripts with a given Type.
[in] | rs | Context to which the Allocation will belong |
[in] | type | Type of the Allocation |
[in] | mipmaps | desired mipmap behavior for the Allocation |
[in] | usage | usage for the Allocation |
static sp<Allocation> android::RSC::Allocation::createTyped | ( | sp< RS > | rs, |
sp< const Type > | type, | ||
RsAllocationMipmapControl | mipmaps, | ||
uint32_t | usage, | ||
void * | pointer | ||
) | [static] |
Creates an Allocation for use by scripts with a given Type and a backing pointer. For use with RS_ALLOCATION_USAGE_SHARED.
[in] | rs | Context to which the Allocation will belong |
[in] | type | Type of the Allocation |
[in] | mipmaps | desired mipmap behavior for the Allocation |
[in] | usage | usage for the Allocation |
[in] | pointer | existing backing store to use for this Allocation if possible |
static sp<Allocation> android::RSC::Allocation::createTyped | ( | sp< RS > | rs, |
sp< const Type > | type, | ||
uint32_t | usage = RS_ALLOCATION_USAGE_SCRIPT |
||
) | [static] |
Creates an Allocation for use by scripts with a given Type with no mipmaps.
[in] | rs | Context to which the Allocation will belong |
[in] | type | Type of the Allocation |
[in] | usage | usage for the Allocation |
void android::RSC::Allocation::generateMipmaps | ( | ) |
Generate a mipmap chain. This is only valid if the Type of the Allocation includes mipmaps. This function will generate a complete set of mipmaps from the top level LOD and place them into the script memory space. If the Allocation is also using other memory spaces, a call to syncAll(Allocation.USAGE_SCRIPT) is required.
sp<const Type> android::RSC::Allocation::getType | ( | ) | const [inline] |
Return Type for the allocation.
Definition at line 338 of file rsCppStructs.h.
void android::RSC::Allocation::syncAll | ( | RsAllocationUsageType | srcLocation | ) |
Propagate changes from one usage of the Allocation to other usages of the Allocation.
[in] | srcLocation | source location with changes to propagate elsewhere |