Skip to content
Browse files

Updated doxygen template

  • Loading branch information...
1 parent a8d86eb commit a81daf6a2a40f5fa58103ab144ef602a77393578 @kyamagu committed
Showing with 38 additions and 36 deletions.
  1. +38 −36 doc/MainPage.dox
View
74 doc/MainPage.dox
@@ -1,15 +1,17 @@
-/** @mainpage
-@brief Collection of mex functions for OpenCV library
-@author Kota Yamaguchi
-@date December 2011
+/** \mainpage
+\brief Collection of mex functions for OpenCV library
+\author Kota Yamaguchi
+\date March 2012
-@section development Developing a new mex function
+http://www.cs.stonybrook.edu/~kyamagu/mexopencv/
-All you need to do is to add your mex source file in src/+cv/. If you
-want to add a mex function called myfunc, create src/+cv/myfunc.cpp.
+\section development Developing a new mex function
+
+All you need to do is to add your mex source file in \c src/+cv/. If you
+want to add a mex function called myfunc, create \c src/+cv/myfunc.cpp.
The minimum contents of the myfunc.cpp would look like this:
-@code
+\code
#include "mexopencv.hpp"
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[] )
@@ -26,20 +28,20 @@ The minimum contents of the myfunc.cpp would look like this:
// Convert cv::Mat back to mxArray*
plhs[0] = MxArray(mat);
}
-@endcode
+\endcode
This example simply copies an input to cv::Mat object and then copies again to
-the output. Notice how the `MxArray` class provided by mexopencv converts
+the output. Notice how the \c MxArray class provided by mexopencv converts
mxArray to cv::Mat object. Of course you would want to do something more with
-the object. Once you create a file, type 'make' to build your new function. The
-compiled mex function will be located inside `+cv/` and accessible through
-`cv.myfunc` within matlab.
+the object. Once you create a file, type \c cv.make to build your new function. The
+compiled mex function will be located inside \c +cv/ and accessible through
+\c cv.myfunc within matlab.
-The `mexopencv.hpp` header includes a class `MxArray` to manipulate `mxArray`
+The \c mexopencv.hpp header includes a class \c MxArray to manipulate \c mxArray
object. Mostly this class is used to convert between opencv data types and
-mxArray.
+\c mxArray.
-@code
+\code
int i = MxArray(prhs[0]).toInt();
double d = MxArray(prhs[0]).toDouble();
bool b = MxArray(prhs[0]).toBool();
@@ -51,8 +53,8 @@ mxArray.
cv::Rect rct = MxArray(prhs[0]).toRect();
cv::Scalar sc = MxArray(prhs[0]).toScalar();
cv::SparseMat sp = MxArray(prhs[0]).toSparseMat(); // Only double to float
-@endcode
-@code
+\endcode
+\code
mxArray* plhs[0] = MxArray(i);
mxArray* plhs[0] = MxArray(d);
mxArray* plhs[0] = MxArray(b);
@@ -64,33 +66,33 @@ mxArray.
mxArray* plhs[0] = MxArray(rct);
mxArray* plhs[0] = MxArray(sc);
mxArray* plhs[0] = MxArray(sp); // Only 2D float to double
-@endcode
+\endcode
-Check `MxArraay.hpp` for the complete list of conversion API.
+Check \c MxArraay.hpp for the complete list of conversion API.
If you rather want to develop a matlab function that internally calls a mex
-function, make use of the `+cv/private` directory. Any function placed under
-private directory is only accessible from `+cv/` directory. So, for example,
+function, make use of the \c +cv/private directory. Any function placed under
+private directory is only accessible from \c +cv/ directory. So, for example,
when you want to design a matlab class that wraps the various behavior of the
-mex function, define your class at `+cv/MyClass.m` and develop a mex function
-dedicated for that class in `src/+cv/private/MyClass_.cpp`. Inside of
-`+cv/MyClass.m`, you can call `MyClass_()` without cv namescope.
+mex function, define your class at \c +cv/MyClass.m and develop a mex function
+dedicated for that class in \c src/+cv/private/MyClass_.cpp . Inside of
+\c +cv/MyClass.m, you can call \c MyClass_() without cv namescope.
-@section testing Testing
+\section testing Testing
Optionally, you can add a testing script for your new function. The testing
convention in mexopencv is that testing scripts are all written as a static
-function in a matlab class. For example, `test/unit_tests/TestFilter2D.m` is
+function in a matlab class. For example, \c test/unit_tests/TestFilter2D.m is
a class that describes test cases for filter2d function. Inside of the class,
a couple of test cases are written as a static function whose name starts with
'test'.
-If there is such a class inside `test/unit_tests/`, typing 'make test' would
-invoke all test cases and show your result. Use test/ directory to place any
+If there is such a class inside \c test/unit_tests/ , typing `make test` would
+invoke all test cases and show your result. Use \c test/ directory to place any
resource file necessary for testing. An example of testing class is shown below:
-@code
+\code
classdef TestMyFunc
methods (Static)
function test_1
@@ -110,22 +112,22 @@ resource file necessary for testing. An example of testing class is shown below:
end
end
end
-@endcode
+\endcode
-In Windows, add path to the `test` directory and invoke `UnitTest` to run all
+In Windows, add path to the \c test directory and invoke \c UnitTest to run all
the test routines.
-@section documenting Documenting
+\section documenting Documenting
You can create a Matlab help documentation for mex function by having the same
file with '.m' extension. For example, on linux 64-bit architecture, the help
-file for filter2D.mexa64 would be filter2D.m. Inside the help file should be
+file for \c filter2D.mexa64 would be \c filter2D.m. Inside the help file should be
only matlab comments. An example is shown below:
-@code
+\code
%MYFUNC brief description about myfunc
%
% Detailed description of function continues
% ...
-@endcode
+\endcode
*/

0 comments on commit a81daf6

Please sign in to comment.
Something went wrong with that request. Please try again.