Class Buffer
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Buffer stores a raw byte array, which can be used to access image data. In the Java API, you can get the buffer from Image_ and then copy the data to a Java byte array. In all versions of EasyAR Sense, you can access the image data. Refer to Image_.
public class Buffer : RefBase, IDisposable
- Inheritance
-
Buffer
- Implements
- Inherited Members
Methods
Clone()
public Buffer Clone()
Returns
CloneObject()
protected override object CloneObject()
Returns
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 a specified byte length.
public static Buffer create(int size)
Parameters
size
Returns
data()
Returns the raw memory address.
public virtual IntPtr data()
Returns
memoryCopy(IntPtr, IntPtr, int)
Copies raw memory. Mainly used in 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
Returns
size()
The byte length of the Buffer.
public virtual int size()
Returns
tryCopyFrom(IntPtr, int, int, int)
Attempts to copy data from the raw memory address to the Buffer. Returns true if the copy is successful, otherwise returns false. The reasons for failure are: the source data range or the target data range exceeds the available range.
public virtual bool tryCopyFrom(IntPtr src, int srcIndex, int index, int length)
Parameters
srcsrcIndexindexlength
Returns
tryCopyTo(int, IntPtr, int, int)
Attempts to copy data from the Buffer to the raw memory address. Returns true if the copy is successful, otherwise returns false. The reasons for failure are: the source data range or the target data range exceeds the available range.
public virtual bool tryCopyTo(int index, IntPtr dest, int destIndex, int length)
Parameters
indexdestdestIndexlength
Returns
wrap(IntPtr, int, Action)
Wraps a raw memory block of a specified length. When the Buffer is completely released, the deleter callback is called to perform user-defined memory destruction behavior. The deleter must be thread-safe.
public static Buffer wrap(IntPtr ptr, int size, Action deleter)
Parameters
ptrsizedeleter
Returns
wrapByteArray(byte[])
public static Buffer wrapByteArray(byte[] bytes)
Parameters
bytes
Returns
wrapByteArray(byte[], int, int)
public static Buffer wrapByteArray(byte[] bytes, int index, int length)
Parameters
bytesindexlength
Returns
wrapByteArray(byte[], int, int, Action)
public static Buffer wrapByteArray(byte[] bytes, int index, int length, Action deleter)
Parameters
bytesindexlengthdeleter