MMPAINT.H
[目次 | 型・クラス・構造体 | マクロ]
1|/***************************************************************************
2|* 1. <<< ポリゴン塗りつぶし (MMPaint) >>>
3|****************************************************************************/
4|
5|#ifndef __MMPAINT_H
6|#define __MMPAINT_H
7|
8|/*----------------------------------------------------------------------
9|[Module Property]
10|name = MMPaint
11|title = ポリゴン塗りつぶし
12|category = グラフィック
13|src = mmpaint.c
14|depend =
15|priority =
16|accord =
17|----------------------------------------------------------------------*/
18|
19|#ifndef USES_PRIORITY_HEADER
20|/*[START_OF_PRIORITY_HEADER]*/
21|
22|#define USES_MMPAINT
23|typedef struct _MMPaint MMPaint;
24|
25|/*[END_OF_PRIORITY_HEADER]*/
26|#endif /* USES_PRIORITY_HEADER */
27|
28|
29|
30|/*-----------------------------------------------------------------*/
31|/* 2. <<< Interface Area ---------------------------------------- >>> */
32|/*-----------------------------------------------------------------*/
33|
34|
35|
36|/*************************************************************************
37|* 3. <<< ポリゴン塗りつぶし [MMPaint] >>>
38|*【役割】
39|*・凸型の多角形を塗りつぶすための情報が格納されています。
40|*【補足】
41|*・塗りつぶす領域の各 Y に対する X の最小値と最大値を持っています。
42|*・MMPaint は、MinMaxPaint の略です。
43|*・実際の塗りつぶしは、Screen_paintByMMPaint 関数などが行います。
44|**************************************************************************/
45|struct _MMPaint {
46| int* xmin; /* ある行(Y) の X の最小値、要素数 height の配列 */
47| int* xmax; /* ある行(Y) の X の最大値、要素数 height の配列 */
48| int ymin; /* ポリゴンの Y の最小値 */
49| int ymax; /* ポリゴンの Y の最大値 */
50| int height; /* xmin, xmax を格納する配列の要素数 */
51|};
52|void MMPaint_init( MMPaint*, int* mmBuf, size_t mmBuf_sizeof, int height );
53|void MMPaint_clear( MMPaint* );
54|int MMPaint_isNoBound( MMPaint* );
55|void MMPaint_setBound( MMPaint*, int x1, int y1, int x2, int y2 );
56|
57|
58|
59|/*-----------------------------------------------------------------*/
60|/* 4. <<< Mapping Area ------------------------------------------ >>> */
61|/*-----------------------------------------------------------------*/
62|
63|
64|
65|/*************************************************************************
66|* 5. <<< [MMPaint_isNoBound] 境界線が1つも設定されていないかどうか >>>
67|**************************************************************************/
68|#define MMPaint_isNoBound( this ) \
69| ( (this)->ymin == INT_MAX )
70|
71|
72|
73|#endif /* __MMPAINT_H */
74|
75|