Implement basic allocation readback. Add Get height, width to ScriptC_Lib.
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 5ec73d7..ad9c739 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -120,6 +120,11 @@
memcpy(mPtr, data, mType->getSizeBytes());
}
+void Allocation::read(void *data)
+{
+ memcpy(data, mPtr, mType->getSizeBytes());
+}
+
void Allocation::subData(uint32_t xoff, uint32_t count, const void *data)
{
uint32_t eSize = mType->getElementSizeBytes();
@@ -523,6 +528,12 @@
rsc->allocationCheck(a);
}
+void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data)
+{
+ Allocation *a = static_cast<Allocation *>(va);
+ a->read(data);
+}
+
}
}