本文整理汇总了C++中Allocation::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ Allocation::getType方法的具体用法?C++ Allocation::getType怎么用?C++ Allocation::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Allocation
的用法示例。
在下文中一共展示了Allocation::getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AllocationGenerateScriptMips
static void AllocationGenerateScriptMips(RsContext con, RsAllocation va) {
Context *rsc = static_cast<Context *>(con);
Allocation *texAlloc = static_cast<Allocation *>(va);
uint32_t numFaces = texAlloc->getType()->getDimFaces() ? 6 : 1;
for (uint32_t face = 0; face < numFaces; face ++) {
Adapter2D adapt(rsc, texAlloc);
Adapter2D adapt2(rsc, texAlloc);
adapt.setFace(face);
adapt2.setFace(face);
for (uint32_t lod=0; lod < (texAlloc->getType()->getLODCount() -1); lod++) {
adapt.setLOD(lod);
adapt2.setLOD(lod + 1);
mip(adapt2, adapt);
}
}
}
示例2: rsi_AllocationRead
void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data, size_t sizeBytes) {
Allocation *a = static_cast<Allocation *>(va);
const Type * t = a->getType();
if(t->getDimY()) {
a->read(rsc, 0, 0, 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X,
t->getDimX(), t->getDimY(), data, sizeBytes, 0);
} else {
a->read(rsc, 0, 0, t->getDimX(), data, sizeBytes);
}
}
示例3: rsi_AllocationCopyToBitmap
void rsi_AllocationCopyToBitmap(Context *rsc, RsAllocation va, void *data, size_t dataLen) {
Allocation *texAlloc = static_cast<Allocation *>(va);
const Type * t = texAlloc->getType();
size_t s = t->getDimX() * t->getDimY() * t->getElementSizeBytes();
if (s != dataLen) {
rsc->setError(RS_ERROR_BAD_VALUE, "Bitmap size didn't match allocation size");
return;
}
memcpy(data, texAlloc->getPtr(), s);
}
示例4: rsaAllocationGetType
extern "C" const void * rsaAllocationGetType(RsContext con, RsAllocation va) {
Allocation *a = static_cast<Allocation *>(va);
a->getType()->incUserRef();
return a->getType();
}