本文整理汇总了C++中Handle::GetIndexedPropertiesExternalArrayDataType方法的典型用法代码示例。如果您正苦于以下问题:C++ Handle::GetIndexedPropertiesExternalArrayDataType方法的具体用法?C++ Handle::GetIndexedPropertiesExternalArrayDataType怎么用?C++ Handle::GetIndexedPropertiesExternalArrayDataType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Handle
的用法示例。
在下文中一共展示了Handle::GetIndexedPropertiesExternalArrayDataType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Identify
GDALDataType TypedArray::Identify(Handle<Object> obj) {
switch(obj->GetIndexedPropertiesExternalArrayDataType()){
case kExternalByteArray: return GDT_Byte;
case kExternalUnsignedByteArray: return GDT_Byte;
case kExternalShortArray: return GDT_Int16;
case kExternalUnsignedShortArray: return GDT_UInt16;
case kExternalIntArray: return GDT_Int32;
case kExternalUnsignedIntArray: return GDT_UInt32;
case kExternalFloatArray: return GDT_Float32;
case kExternalDoubleArray: return GDT_Float64;
default: return GDT_Unknown;
}
}
示例2: TypedArray
void TypedArray (const Wrapper* wrapper, Handle<Value> value, vector<void*>& natives) {
void *buff = NULL;
size_t byteLength = 0;
if (value->IsObject()) {
Handle<Object> obj = value->ToObject();
if (obj->HasIndexedPropertiesInExternalArrayData()) {
buff = obj->GetIndexedPropertiesExternalArrayData();
byteLength = obj->GetIndexedPropertiesExternalArrayDataLength();
switch (obj->GetIndexedPropertiesExternalArrayDataType()) {
case kExternalByteArray:
case kExternalUnsignedByteArray:
case kExternalPixelArray:
break;
case kExternalShortArray:
case kExternalUnsignedShortArray:
byteLength *= 2;
break;
case kExternalIntArray:
case kExternalUnsignedIntArray:
case kExternalFloatArray:
byteLength *= 4;
break;
case kExternalDoubleArray:
byteLength *= 8;
break;
}
} else {
buff = Get<void*>(value);
}
}
PushBackWrapped(natives, buff);
PushBackWrapped(natives, byteLength);
}