00001 /** 00002 * \file drawgen.h <mi32/drawgen.h> 00003 * \brief Declarations for "generic" drawing functions 00004 * 00005 * \if NODOC 00006 * $Log: drawgen.h_v $ 00007 * Revision 1.56 2004/03/30 17:04:52 scowan 00008 * Removed unused function prototype. 00009 * 00010 * Revision 1.55 2003/09/15 13:49:56 fileserver!dwilliss 00011 * Doxygen 00012 * 00013 * \endif 00014 **/ 00015 00016 #ifndef INC_MI32_DRAWGEN_H 00017 #define INC_MI32_DRAWGEN_H 00018 00019 #ifndef INC_MI32_MSTATUS_H 00020 #include <mi32/mstatus.h> 00021 #endif 00022 00023 #ifdef GEOMDLL 00024 #define GEOMLIBEXPORT MI_DLLEXPORT 00025 #else 00026 #define GEOMLIBEXPORT MI_DLLIMPORT 00027 #endif 00028 00029 //---------------------------------------------------------------------------- 00030 //! Function prototypes 00031 //---------------------------------------------------------------------------- 00032 00033 //!:Associate with "Generic Drawing Functions" 00034 //!\addtogroup DrawGen Generic Drawing Functions 00035 //!@{ 00036 00037 #if defined(__cplusplus) 00038 extern "C" { 00039 #endif 00040 00041 //! Generic horizontal span function. 00042 typedef int (*GDrawHSpanL)(INT32,INT32,INT32,void*); 00043 00044 //! Generic putpixel function. 00045 typedef int (*GDrawPointL)(INT32,INT32,void*); 00046 00047 //! Generic function to test if point in region. 00048 typedef int (*GTestPointL)(INT32,INT32,void*); 00049 00050 #define DRAWGEN_Highlight 0x0001 //!< "Highlight" when drawing 00051 #define DRAWGEN_Closed 0x0002 //!< Set to "close" polylines, forming a polygon 00052 #define DRAWGEN_NoLastPixel 0x0040 //!< Don't draw last pixel in horizontal span when filling 00053 #define DRAWGEN_4Connected 0x0080 //!< Draw 4-connected lines in MxgDrawLineGenX() 00054 00055 #define TRACEGEN_8Connected 0x0001 //!< Trace 8-connected boundary 00056 00057 //! Draw multiple connected lines on "generic display". 00058 GEOMLIBEXPORT int DrawLineGen ( 00059 INT32 x1, //!< Starting X coordinate 00060 INT32 y1, //!< Starting Y coordinate 00061 INT32 x2, //!< Ending X coordinate 00062 INT32 y2, //!< Ending Y coordinate 00063 GDrawPointL gdrawpoint, //!< Generic putpixel function 00064 void *userdata, //!< Data to pass on to drawhspan 00065 UINT32 flags //!< Flags: 00066 //! DRAWGEN_4Connected Create 4-connected line (default is 8-connected) 00067 ); 00068 00069 //! Draw multiple connected lines on "generic display". 00070 GEOMLIBEXPORT int DrawLinesGen ( 00071 LPOINT2D *points, //!< Array of points 00072 int numpoints, //!< Number of points 00073 GDrawPointL gdrawpoint, //!< Generic putpixel function 00074 void *userdata, //!< Data to pass on to drawhspan 00075 UINT32 flags //!< Flags: 00076 //! DRAWGEN_4Connected Create 4-connected line (default is 8-connected) 00077 //! DRAWGEN_Closed Line defines close shape 00078 ); 00079 00080 //! Draw wide line on "generic display". 00081 GEOMLIBEXPORT int DrawLineWideGen ( 00082 INT32 x1, //!< Starting X coordinate 00083 INT32 y1, //!< Starting Y coordinate 00084 INT32 x2, //!< Ending X coordinate 00085 INT32 y2, //!< Ending y coordinate 00086 double width, //!< Line width in pixels 00087 GDrawHSpanL gdrawhspan, //!< Generic horizontal span function 00088 GDrawPointL gdrawpoint, //!< Generic putpixel function 00089 void *userdata, //!< Data to pass on to drawhspan 00090 UINT32 flags //!< Flags: 00091 //! DRAWGEN_4Connected Create 4-connected line (default is 8-connected) 00092 ); 00093 00094 //! Fill circle in generic bitmap. 00095 int FillCircleGen ( 00096 INT32 x, //!< X coordinate of center 00097 INT32 y, //!< Y coordinate of center 00098 INT32 radius, //!< Radius in pixels 00099 GDrawHSpanL gdrawhspan, //!< Generic horizontal span function 00100 void *userdata, //!< Data to pass on to drawhspan 00101 UINT32 flags //!< Flags (none currently) 00102 ); 00103 00104 //! Fill polygon(s) in generic bitmap. 00105 GEOMLIBEXPORT int FillPolygonsGen ( 00106 int numpolys, //!< Number of polygons to fill 00107 LPOLYGON *polys, //!< Array of polygons to fill 00108 GDrawHSpanL gdrawhspan, //!< Generic horizontal span function 00109 GDrawPointL gdrawpoint, //!< Generic putpixel function 00110 void *userdata, //!< Data to pass on to drawhspan/drawpoint 00111 MSTATUSINTERFACE statinterface, //!< Status interface 00112 UINT32 flags //!< Flags: 00113 //! DRAWGEN_NoLastPixel Don't draw last pixel in horizontal span when filling 00114 ); 00115 00116 //! Perform seeded fill on "generic display" (LONG coordinates). 00117 int FillSeededGenL ( 00118 INT32 SeedX, //!< Seed point X coordinate 00119 INT32 SeedY, //!< Seed point Y coordinate 00120 GTestPointL TestInside, //!< Function to test if a point is inside region 00121 GDrawHSpanL gdrawhspan, //!< Function to "draw" horizontal spans 00122 LPOINT2D* boundpt, //!< Rightmost "boundary" point returned (NULL if not needed) 00123 void *userdata, //!< Data to pass to TestInside and DrawHSpan functions 00124 UINT32 flags //!< Flags (none currently defined) 00125 ); 00126 00127 //! Find boundary of a region (LONG coordinates). 00128 int TraceBoundaryL ( 00129 INT32 xstart, //!< X starting coordinate 00130 INT32 ystart, //!< Y starting coordinate 00131 LPOLYGON *poly, //!< Polygon returned 00132 GTestPointL testfunc, //!< Function to test if point in region 00133 void *userdata, //!< Data to be passed to testfunc 00134 UINT32 flags //!< Flags: 00135 //! TRACEGEN_8Connected Trace 8-connected (allow diagonals) boundary 00136 ); 00137 00138 #if defined(__cplusplus) 00139 } 00140 #endif 00141 00142 //!@} 00143 00144 #endif 00145
1.3.8-20040913