#include <BufferType.hh>
◆ fromJsArrayBuffer()
PyObject * BufferType::fromJsArrayBuffer |
( |
JSContext * |
cx, |
|
|
JS::HandleObject |
arrayBuffer |
|
) |
| |
|
staticprotected |
◆ fromJsTypedArray()
PyObject * BufferType::fromJsTypedArray |
( |
JSContext * |
cx, |
|
|
JS::HandleObject |
typedArray |
|
) |
| |
|
staticprotected |
◆ getPyObject()
PyObject * BufferType::getPyObject |
( |
JSContext * |
cx, |
|
|
JS::HandleObject |
bufObj |
|
) |
| |
|
static |
Construct a new BufferType object from a JS TypedArray or ArrayBuffer, as a Python memoryview object.
- Parameters
-
cx | - javascript context pointer |
bufObj | - JS object to be coerced |
- Returns
- PyObject* pointer to the resulting PyObject
◆ isSupportedJsTypes()
bool BufferType::isSupportedJsTypes |
( |
JSObject * |
obj | ) |
|
|
static |
- Returns
- Is the given JS object either a TypedArray or an ArrayBuffer?
◆ toJsTypedArray()
JSObject * BufferType::toJsTypedArray |
( |
JSContext * |
cx, |
|
|
PyObject * |
pyObject |
|
) |
| |
|
static |
Convert a Python object that provides the buffer interface to JS TypedArray. The subtype (Uint8Array, Float64Array, ...) is automatically determined by the Python buffer's format
- Parameters
-
cx | - javascript context pointer |
pyObject | - the object to be converted |
The documentation for this struct was generated from the following files: