Class Buffer
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Buffer stores a raw byte array and can be used to access image data. In the Java API, you can get a buffer from `Image`_ and then copy data to a Java byte array. In all versions of EasyAR Sense, you can access image data. See `Image`_.
public class Buffer : RefBase, IDisposable
- Inheritance
-
Buffer
- Implements
- Inherited Members
Methods
Clone()
public Buffer Clone()
copyFromByteArray(byte[])
public void copyFromByteArray(byte[] src)
Parameters
src
copyFromByteArray(byte[], int, int, int)
public void copyFromByteArray(byte[] src, int srcIndex, int index, int length)
Parameters
srcsrcIndexindexlength
copyToByteArray(byte[])
public void copyToByteArray(byte[] dest)
Parameters
dest
copyToByteArray(int, byte[], int, int)
public void copyToByteArray(int index, byte[] dest, int destIndex, int length)
Parameters
indexdestdestIndexlength
create(int)
Creates a Buffer with the specified byte length.
public static Buffer create(int size)
Parameters
size
data()
Returns the raw memory address.
public virtual IntPtr data()
memoryCopy(IntPtr, IntPtr, int)
Copies raw memory. Mainly used for languages or environments with incomplete memory operations.
public static void memoryCopy(IntPtr src, IntPtr dest, int length)
Parameters
srcdestlength
partition(int, int)
Creates a sub-Buffer and references the original Buffer. A Buffer is released only after all sub-Buffers are released.
public virtual Buffer partition(int index, int length)
Parameters
indexlength
size()
Byte length of the Buffer.
public virtual int size()
tryCopyFrom(IntPtr, int, int, int)
Attempts to copy data from a raw memory address into a Buffer. Returns true if copying succeeds, otherwise false. Failure reasons include the source data range or target data range exceeding the available range.
public virtual bool tryCopyFrom(IntPtr src, int srcIndex, int index, int length)
Parameters
srcsrcIndexindexlength
tryCopyTo(int, IntPtr, int, int)
Attempts to copy data from a Buffer to a raw memory address. Returns true if copying succeeds, otherwise false. Failure reasons include the source data range or target data range exceeding the available range.
public virtual bool tryCopyTo(int index, IntPtr dest, int destIndex, int length)
Parameters
indexdestdestIndexlength
wrap(IntPtr, int, Action)
Wraps a raw memory block of a specified length. When the Buffer is fully released, the deleter callback is called to execute user-defined memory destruction behavior. deleter must be thread-safe.
public static Buffer wrap(IntPtr ptr, int size, Action deleter)
Parameters
ptrsizedeleter
wrapByteArray(byte[])
public static Buffer wrapByteArray(byte[] bytes)
Parameters
bytes
wrapByteArray(byte[], int, int)
public static Buffer wrapByteArray(byte[] bytes, int index, int length)
Parameters
bytesindexlength
wrapByteArray(byte[], int, int, Action)
public static Buffer wrapByteArray(byte[] bytes, int index, int length, Action deleter)
Parameters
bytesindexlengthdeleter