Class MemStorage
Represents a growing memory storage.
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public class MemStorage : CVHandle
Constructors
| Improve this Doc View SourceMemStorage()
Initializes a new instance of the MemStorage class.
Declaration
public MemStorage()
MemStorage(MemStorage)
Initializes a new instance of the MemStorage class that will
borrow its memory blocks from the specified parent
storage.
Declaration
public MemStorage(MemStorage parent)
Parameters
Type | Name | Description |
---|---|---|
MemStorage | parent | The parent memory storage. |
MemStorage(Int32)
Initializes a new instance of the MemStorage class with the
specified blockSize
.
Declaration
public MemStorage(int blockSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | blockSize | The size of storage blocks, in bytes. |
Methods
| Improve this Doc View SourceAlloc(UIntPtr)
Allocates a memory buffer in a storage block.
Declaration
public IntPtr Alloc(UIntPtr size)
Parameters
Type | Name | Description |
---|---|---|
UIntPtr | size | The size of the memory block, in bytes. |
Returns
Type | Description |
---|---|
IntPtr | A pointer to the newly allocated memory block. |
AllocString(String)
Allocates a text string in a storage block.
Declaration
public IntPtr AllocString(string value)
Parameters
Type | Name | Description |
---|---|---|
String | value | The string to be copied to the storage. |
Returns
Type | Description |
---|---|
IntPtr | The pointer to the copy of the string in storage. |
Clear()
Clears the memory storage. If the storage has a parent, the method returns all memory blocks to the parent.
Declaration
public void Clear()
ReleaseHandle()
Executes the code required to free the native MemStorage handle.
Declaration
protected override bool ReleaseHandle()
Returns
Type | Description |
---|---|
Boolean | true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. |
RestorePosition(MemStoragePos)
Restores the memory storage position.
Declaration
public void RestorePosition(MemStoragePos pos)
Parameters
Type | Name | Description |
---|---|---|
MemStoragePos | pos | The new position of the storage top. |
SavePosition()
Saves the memory storage position.
Declaration
public MemStoragePos SavePosition()
Returns
Type | Description |
---|---|
MemStoragePos | The current position of the storage top. |