File: bmSegments.h

package info (click to toggle)
ted 2.16-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,944 kB
  • ctags: 20,273
  • sloc: ansic: 167,980; makefile: 12,518; sh: 263
file content (83 lines) | stat: -rw-r--r-- 2,115 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#   ifndef		BM_SEGMENTS_H
#   define		BM_SEGMENTS_H

#   include	<stdio.h>
#   include	<stddef.h>
#   include	<stdlib.h>
#   include	"bitmap.h"

typedef struct DataRun
    {
    short int	drX0;
    short int	drXp;
    short int	drRepeatCount;
    } DataRun;

typedef struct SegmentEdge
    {
    struct SegmentNode *	seFrom;
    struct SegmentNode *	seTo;
    DataRun *			seRuns;
    short int			seRunCount;
    } SegmentEdge;

typedef struct SegmentNode
    {
    SegmentEdge **	snUpEdges;
    SegmentEdge **	snDownEdges;
    short int		snUpEdgeCount;
    short int		snDownEdgeCount;
    short int		snY0;
    } SegmentNode;

/************************************************************************/
/*									*/
/*  A 'segment' as discovered during the segmentation process.		*/
/*									*/
/*  NOTE that conceptually there is a similarity with the graph		*/
/*	resulting from the skeleton of a component. In this		*/
/*	implementation, the is no relationship however.			*/
/*									*/
/************************************************************************/

typedef struct BitmapSegment
    {
    short int			bsX0;
    short int			bsX1;
    short int			bsY0;
    short int			bsY1;
    short int			bsNodeCount;
    short int			bsEdgeCount;
    SegmentNode **		bsNodes;
    SegmentEdge **		bsEdges;
    } BitmapSegment;

/************************************************************************/
/*									*/
/*  Routine declarations.						*/
/*									*/
/************************************************************************/

extern int bcComponents(	BitmapSegment ***		pSegments,
				int *				pCount,
				const unsigned char *		buffer,
				const BitmapDescription *	bd );

extern void bmFreeSegment(	BitmapSegment * bs );

extern int bmcDrawComponent(	const BitmapSegment *	bs,
				unsigned char *		buffer,
				int			col0,
				int			row0,
				int			bytesPerRow,
				int			colorEncoding );

extern void bmcStatistics(	const BitmapSegment *		bs,
				int *				pN,
				float *				pSx,
				float *				pSy,
				float *				pSxx,
				float *				pSyy,
				float *				pSxy );

#   endif	/*	BM_SEGMENTS_H	*/