From 90d8d0e7eff47ae79dc07ee5196924d5db9bcb78 Mon Sep 17 00:00:00 2001 From: jamesb Date: Tue, 30 Mar 2010 00:56:24 +0000 Subject: [PATCH] #146 CvMemStorage documented git-svn-id: https://code.ros.org/svn/opencv/trunk@2943 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08 --- opencv/doc/cxcore_dynamic_structures.tex | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/opencv/doc/cxcore_dynamic_structures.tex b/opencv/doc/cxcore_dynamic_structures.tex index 736d3d18..591eb579 100644 --- a/opencv/doc/cxcore_dynamic_structures.tex +++ b/opencv/doc/cxcore_dynamic_structures.tex @@ -2,11 +2,11 @@ \ifCPy -\ifC \cvclass{CvMemStorage}\label{CvMemStorage} Growing memory storage. +\ifC % { \begin{lstlisting} typedef struct CvMemStorage { @@ -46,7 +46,24 @@ bottom of the stack and the pair (\texttt{top}, \texttt{free\_space}) indicating top of the stack. The stack top may be saved via \cvCPyCross{SaveMemStoragePos}, restored via \cvCPyCross{RestoreMemStoragePos}, or reset via \cvCPyCross{ClearStorage}. +\else % }{ + +Many OpenCV functions use a given storage area for their results +and working storage. These storage areas can be created using +\cross{CreateMemStorage}. OpenCV Python tracks the objects occupying a +CvMemStorage, and automatically releases the CvMemStorage when there are +no objects referring to it. For this reason, there is explicit function +to release a CvMemStorage. + +\begin{lstlisting} +>>> import cv +>>> image = cv.LoadImageM("building.jpg", cv.CV_LOAD_IMAGE_GRAYSCALE) +>>> seq = cv.FindContours(image, cv.CreateMemStorage(), cv.CV_RETR_TREE, cv.CV_CHAIN_APPROX_SIMPLE) +>>> del seq # associated storage is also released +\end{lstlisting} +\fi % } +\ifC \cvclass{CvMemBlock}\label{CvMemBlock} Memory storage block. -- 2.39.2