Skip to content

Commit

Permalink
Further reformatting for doxygen
Browse files Browse the repository at this point in the history
 * Fixed some strange text issues with parens in affinecompose.c
 * Fixed a few more > 80 char lines
 * Added <pre> etc to some comments, or moved <pre> to include comments
   not numbered in a "Notes" section.
  • Loading branch information
DanBloomberg committed Apr 19, 2016
1 parent 7e68e78 commit 2e32e08
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 117 deletions.
14 changes: 7 additions & 7 deletions src/adaptmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@
* shrinking the dynamic range
* (3) results should otherwise not be sensitive to these values
*/
static const l_int32 DEFAULT_TILE_WIDTH = 10; /*!< pixBackgroundNormSimple() default tile width */
static const l_int32 DEFAULT_TILE_HEIGHT = 15; /*!< pixBackgroundNormSimple() default tile height */
static const l_int32 DEFAULT_FG_THRESHOLD = 60; /*!< pixBackgroundNormSimple() default fg threshold */
static const l_int32 DEFAULT_MIN_COUNT = 40; /*!< pixBackgroundNormSimple() default minimum count */
static const l_int32 DEFAULT_BG_VAL = 200; /*!< pixBackgroundNormSimple() default bg value */
static const l_int32 DEFAULT_X_SMOOTH_SIZE = 2; /*!< pixBackgroundNormSimple() default x smooth size */
static const l_int32 DEFAULT_Y_SMOOTH_SIZE = 1; /*!< pixBackgroundNormSimple() default y smooth size */
static const l_int32 DEFAULT_TILE_WIDTH = 10; /*!< default tile width */
static const l_int32 DEFAULT_TILE_HEIGHT = 15; /*!< default tile height */
static const l_int32 DEFAULT_FG_THRESHOLD = 60; /*!< default fg threshold */
static const l_int32 DEFAULT_MIN_COUNT = 40; /*!< default minimum count */
static const l_int32 DEFAULT_BG_VAL = 200; /*!< default bg value */
static const l_int32 DEFAULT_X_SMOOTH_SIZE = 2; /*!< default x smooth size */
static const l_int32 DEFAULT_Y_SMOOTH_SIZE = 1; /*!< default y smooth size */

static l_int32 *iaaGetLinearTRC(l_int32 **iaa, l_int32 diff);

Expand Down
3 changes: 2 additions & 1 deletion src/affine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,8 @@ PIX *pixt1, *pixt2, *pixd;
* src points from the axes to the actual dest position.
* These values are also needed to scale the image. */
th3p = atan2((l_float64)(x1p - x3p), (l_float64)(y1p - y3p));
x2sp = (l_float32)(x2p - ((l_float32)(y1p - y2p) * (x3p - x1p)) / (y1p - y3p));
x2sp = (l_float32)(x2p -
((l_float32)(y1p - y2p) * (x3p - x1p)) / (y1p - y3p));
if (x2sp == (l_float32)x1p)
return (PIX *)ERROR_PTR("x2sp == x1p!", procName, NULL);
ph2p = atan2((l_float64)(y1p - y2p), (l_float64)(x2sp - x1p));
Expand Down
78 changes: 45 additions & 33 deletions src/affinecompose.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@
* \param[in] transy y component of translation wrt. the origin
* \return 3x3 transform matrix, or NULL on error
*
* Notes;
* 1 The translation is equivalent to:
* <pre>
* Notes:
* (1) The translation is equivalent to:
* v' = Av
* where v and v' are 1x3 column vectors in the form
* v = [x, y, 1]^ ^ denotes transpose
Expand All @@ -79,10 +80,11 @@
* 0 1 ty
* 0 0 1 ]
*
* 2 We consider translation as with respect to a fixed origin.
* (2) We consider translation as with respect to a fixed origin.
* In a clipping operation, the origin moves and the points
* are fixed, and you use -tx, -ty) where (tx, ty is the
* are fixed, and you use (-tx, -ty) where (tx, ty) is the
* translation vector of the origin.
* </pre>
*/
l_float32 *
createMatrix2dTranslate(l_float32 transx,
Expand All @@ -109,19 +111,21 @@ l_float32 *mat;
* \param[in] scaley vertical scale factor
* \return 3x3 transform matrix, or NULL on error
*
* Notes;
* 1 The scaling is equivalent to:
* <pre>
* Notes:
* (1) The scaling is equivalent to:
* v' = Av
* where v and v' are 1x3 column vectors in the form
* v = [x, y, 1]^ ^ denotes transpose
* and the affine scaling matrix is
* where v and v' are 1x3 column vectors in the form
* v = [x, y, 1]^ ^ denotes transpose
* and the affine scaling matrix is
* A = [ sx 0 0
* 0 sy 0
* 0 0 1 ]
*
* 2 We consider scaling as with respect to a fixed origin.
* (2) We consider scaling as with respect to a fixed origin.
* In other words, the origin is the only point that doesn't
* move in the scaling transform.
* </pre>
*/
l_float32 *
createMatrix2dScale(l_float32 scalex,
Expand All @@ -148,8 +152,9 @@ l_float32 *mat;
* \param[in] angle rotation in radians; clockwise is positive
* \return 3x3 transform matrix, or NULL on error
*
* Notes;
* 1 The rotation is equivalent to:
* <pre>
* Notes:
* (1) The rotation is equivalent to:
* v' = Av
* where v and v' are 1x3 column vectors in the form
* v = [x, y, 1]^ ^ denotes transpose
Expand All @@ -166,13 +171,14 @@ l_float32 *mat;
*
* These relations follow from the following equations, which
* you can convince yourself are correct as follows. Draw a
* circle centered on xc,yc) and passing through (x,y, with
* x',y') on the arc at an angle 'a' clockwise from (x,y.
* [ Hint: cosa + b = cosa * cosb - sina * sinb
* sina + b = sina * cosb + cosa * sinb ]
* circle centered on xc,yc) and passing through (x,y), with
* (x',y') on the arc at an angle 'a' clockwise from (x,y).
* [ Hint: cosa + b = cosa * cosb - sina * sinb
* sina + b = sina * cosb + cosa * sinb ]
*
* x' - xc = x - xc) * cosa - (y - yc * sina
* y' - yc = x - xc) * sina + (y - yc * cosa
* </pre>
*/
l_float32 *
createMatrix2dRotate(l_float32 xc,
Expand Down Expand Up @@ -211,8 +217,10 @@ l_float32 *mat;
* \param[in] transy y component of translation wrt. the origin
* \return ptad translated points, or NULL on error
*
* Notes;
* 1) See createMatrix2dTranslate( for details of transform.
* <pre>
* Notes:
* (1) See createMatrix2dTranslate() for details of transform.
* </pre>
*/
PTA *
ptaTranslate(PTA *ptas,
Expand Down Expand Up @@ -248,8 +256,10 @@ PTA *ptad;
* \param[in] scaley vertical scale factor
* \return 0 if OK; 1 on error
*
* Notes;
* 1) See createMatrix2dScale( for details of transform.
* <pre>
* Notes:
* (1) See createMatrix2dScale() for details of transform.
* </pre>
*/
PTA *
ptaScale(PTA *ptas,
Expand Down Expand Up @@ -285,20 +295,22 @@ PTA *ptad;
* \param[in] angle rotation in radians; clockwise is positive
* \return 0 if OK; 1 on error
*
* Notes;
* 1) See createMatrix2dScale( for details of transform.
* 2 This transform can be thought of as composed of the
* <pre>
* Notes;
* (1) See createMatrix2dScale() for details of transform.
* (2) This transform can be thought of as composed of the
* sum of two parts:
* a) an (x,y-dependent rotation about the origin:
* a) an (x,y)-dependent rotation about the origin:
* xr = x * cosa - y * sina
* yr = x * sina + y * cosa
* b) an (x,y-independent translation that depends on the
* b) an (x,y)-independent translation that depends on the
* rotation center and the angle:
* xt = xc - xc * cosa + yc * sina
* yt = yc - xc * sina - yc * cosa
* The translation part xt,yt is equal to the difference
* between the center xc,yc and the location of the
* The translation part (xt,yt) is equal to the difference
* between the center (xc,yc) and the location of the
* center after it is rotated about the origin.
* </pre>
*/
PTA *
ptaRotate(PTA *ptas,
Expand Down Expand Up @@ -342,8 +354,8 @@ PTA *ptad;
* \param[in] transy y component of translation wrt. the origin
* \return boxad translated boxas, or NULL on error
*
* Notes;
* 1) See createMatrix2dTranslate( for details of transform.
* Notes:
* (1) See createMatrix2dTranslate() for details of transform.
*/
BOXA *
boxaTranslate(BOXA *boxas,
Expand Down Expand Up @@ -375,8 +387,8 @@ BOXA *boxad;
* \param[in] scaley vertical scale factor
* \return boxad scaled boxas, or NULL on error
*
* Notes;
* 1) See createMatrix2dScale( for details of transform.
* Notes:
* (1) See createMatrix2dScale() for details of transform.
*/
BOXA *
boxaScale(BOXA *boxas,
Expand Down Expand Up @@ -408,8 +420,8 @@ BOXA *boxad;
* \param[in] angle rotation in radians; clockwise is positive
* \return boxad scaled boxas, or NULL on error
*
* Notes;
* 1) See createMatrix2dRotate( for details of transform.
* Notes:
* (1) See createMatrix2dRotate() for details of transform.
*/
BOXA *
boxaRotate(BOXA *boxas,
Expand Down
24 changes: 13 additions & 11 deletions src/bilinear.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,10 @@ PTA *ptad2, *ptas2;
* \param[out] pvc vector of coefficients of transform
* \return 0 if OK; 1 on error
*
* We have a set of 8 equations, describing the bilinear
* transformation that takes 4 points ptas into 4 other
* points ptad. These equations are:
* <pre>
* We have a set of 8 equations, describing the bilinear
* transformation that takes 4 points ptas into 4 other
* points ptad. These equations are:
*
* x1' = c[0]*x1 + c[1]*y1 + c[2]*x1*y1 + c[3]
* y1' = c[4]*x1 + c[5]*y1 + c[6]*x1*y1 + c[7]
Expand All @@ -739,16 +740,16 @@ PTA *ptad2, *ptas2;
* x4' = c[0]*x4 + c[1]*y4 + c[2]*x4*y4 + c[3]
* y4' = c[4]*x4 + c[5]*y4 + c[6]*x4*y4 + c[7]
*
* This can be represented as
* This can be represented as
*
* AC = B
*
* where B and C are column vectors
* where B and C are column vectors
*
* B = [ x1' y1' x2' y2' x3' y3' x4' y4' ]
* C = [ c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] ]
*
* and A is the 8x8 matrix
* and A is the 8x8 matrix
*
* x1 y1 x1*y1 1 0 0 0 0
* 0 0 0 0 x1 y1 x1*y1 1
Expand All @@ -759,16 +760,17 @@ PTA *ptad2, *ptas2;
* x4 y4 x4*y4 1 0 0 0 0
* 0 0 0 0 x4 y4 x4*y4 1
*
* These eight equations are solved here for the coefficients C.
* These eight equations are solved here for the coefficients C.
*
* These eight coefficients can then be used to find the mapping
* x,y) --> (x',y':
* These eight coefficients can then be used to find the mapping
* x,y) --> (x',y':
*
* x' = c[0]x + c[1]y + c[2]xy + c[3]
* y' = c[4]x + c[5]y + c[6]xy + c[7]
*
* that are implemented in bilinearXformSampledPt and
* bilinearXFormPt.
* that are implemented in bilinearXformSampledPt and
* bilinearXFormPt.
* </pre>
*/
l_int32
getBilinearXformCoeffs(PTA *ptas,
Expand Down
8 changes: 5 additions & 3 deletions src/ccbord.c
Original file line number Diff line number Diff line change
Expand Up @@ -2268,8 +2268,8 @@ PTA *pta;
pta = ccb->start;
for (j = 0; j < nb; j++) {
ptaGetIPt(pta, j, &startx, &starty);
bbufferRead(bbuf, (l_uint8 *)&startx, 4); /* starting x in border */
bbufferRead(bbuf, (l_uint8 *)&starty, 4); /* starting y in border */
bbufferRead(bbuf, (l_uint8 *)&startx, 4); /* starting x in border */
bbufferRead(bbuf, (l_uint8 *)&starty, 4); /* starting y in border */
na = numaaGetNuma(naa, j, L_CLONE);
n = numaGetCount(na);
for (k = 0; k < n; k++) {
Expand All @@ -2279,7 +2279,7 @@ PTA *pta;
else
bval |= (l_uint8)val;
if (k % 2 == 1)
bbufferRead(bbuf, (l_uint8 *)&bval, 1); /* 2 border steps */
bbufferRead(bbuf, (l_uint8 *)&bval, 1); /* 2 border steps */
}
if (n % 2 == 1) {
bval |= 0x8;
Expand Down Expand Up @@ -2340,6 +2340,7 @@ CCBORDA *ccba;
* \param[in] fp file stream
* \return ccba, or NULL on error
*
* \code
* Format: ccba: %7d cc\n num. c.c.) (ascii) (17B
* pix width 4B
* pix height 4B
Expand All @@ -2355,6 +2356,7 @@ CCBORDA *ccba;
* [for k = 1, nb]
* 2 steps 1B
* end in z8 or 88 1B
* \endcode
*/
CCBORDA *
ccbaReadStream(FILE *fp)
Expand Down
6 changes: 3 additions & 3 deletions src/classapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
#include <string.h>
#include "allheaders.h"

static const l_int32 L_BUF_SIZE = 512; /*!< size of filename buffer */
static const l_int32 JB_WORDS_MIN_WIDTH = 5; /*!< min. word width in pixels */
static const l_int32 JB_WORDS_MIN_HEIGHT = 3; /*!< min. word height in pixels */
static const l_int32 L_BUF_SIZE = 512; /*!< size of filename buffer */
static const l_int32 JB_WORDS_MIN_WIDTH = 5; /*!< min. word width in pixels */
static const l_int32 JB_WORDS_MIN_HEIGHT = 3; /*!< min. word height in pixels */

/* Static comparison functions */
static l_int32 testLineAlignmentX(NUMA *na1, NUMA *na2, l_int32 shiftx,
Expand Down
1 change: 0 additions & 1 deletion src/colormap.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
#include <string.h>
#include "allheaders.h"


/*-------------------------------------------------------------*
* Colormap creation and addition *
*-------------------------------------------------------------*/
Expand Down
Loading

0 comments on commit 2e32e08

Please sign in to comment.