#include <mi32/bintoreg.h>
Inheritance diagram for BINARYTOREGIONINTERFACE:

Public Member Functions | |
| ERRVALUE | AddSpan (INT32 x1, INT32 x2, INT32 y) |
| ERRVALUE | AddSpanFast (INT32 x1, INT32 x2, INT32 y) |
| ERRVALUE | AddSpansFromBytes (INT32 lin, INT32 col, INT32 len, const UINT8 *buf, bool bFast=false) |
| void | Clear () |
| bool | IsPointOnSpan (INT32 x, INT32 y) const |
| ERRVALUE | ProcessSpans () |
Protected Member Functions | |
| BINARYTOREGIONINTERFACE () | |
| virtual | ~BINARYTOREGIONINTERFACE () |
Private Types | |
| typedef SIMPLE_ARRAY< SPAN > | SPANDATA |
Private Member Functions | |
| virtual void | v_Clear () |
| virtual ERRVALUE | v_ProcessLine (LPOINT2D *points, int numpts) |
| virtual ERRVALUE | v_Subtract (const POLYLINE &polyline) |
| virtual bool | v_TestPoint (const DPOINT2D &point) const |
| virtual ERRVALUE | v_Union (const POLYLINE &polyline) |
Static Private Member Functions | |
| int | FillSpan (INT32 x1, INT32 x2, INT32 y, void *cbdata) |
| int | TraceTest (INT32 x, INT32 y, void *cbdata) |
Private Attributes | |
| SIMPLE_ARRAY< SPANDATA * > | m_Spans |
This is a generic base class which can be extended to create any sort of region: REGION2D, X region or Windows Region.
Definition at line 40 of file bintoreg.h.
|
|
Definition at line 113 of file bintoreg.h. |
|
|
|
|
|
|
|
||||||||||||||||
|
Add a span to the region. This is used to transfer the binary object (whatever the source) into a format that this class can use. Note, this method makes sure that the spans are kept in order and combines spans which overlap. If you know you're adding spans in top-to-bottom, left-to-right order, call AddSpanFast() instead. |
|
||||||||||||||||
|
Add a span to the region. This is used to transfer the binary object (whatever the source) into a format that this class can use. Note, no attempt is made to keep the spans sorted or make sure the span does not overlap any existing spans. If you know you're adding spans in top-to-bottom, left-to-right order, you can use this method and it will be much faster than AddSpan() |
|
||||||||||||||||||||||||
|
Add spans to the region from a buffer of UINT8s. This function takes an array of UINT8s representing a raster line and adds spans for all of the non-zero runs. The buffer is treated as one byte per pixel with 0 being false and non-zero being true. The bFast parameter tells the function whether or not you're procssing lines in a top-down order without back-tracking. If you are, pass true and it can add the spans without having to keep them sorted. |
|
|
Clear any existing spans.
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
Determine if specified point is on existing span.
|
|
|
Process the spans that have been set.
|
|
||||||||||||||||
|
|
|
|
Clear the current region. Will be called by the Clear() method, which also gets called by the destructor. Reimplemented in BINARYTOXREGION. Definition at line 120 of file bintoreg.h. |
|
||||||||||||
|
Add or remove a line from the region. The default implementation of this method converts the points to a POLYLINE and calls v_CheckPoint followed by v_Union of v_Subtract. Override this ONLY if you can deal with integer (raster) coordinates more effeciently than POLYLINES. (For example, to create an X Region). Note that the points array passed in is not const for a reason. The method is allowed to modify the points in the buffer before adding them to the region. Just don't free the buffer. Reimplemented in BINARYTOXREGION. |
|
|
Subtract a polyline from the region. The polyline is "validated" Reimplemented in BINARYTOREGION2D. |
|
|
Check to see if a point is inside the region. Should return true if it is, false if not. Reimplemented in BINARYTOREGION2D. |
|
|
Add a polyline to the region. The polyline is "validated" Reimplemented in BINARYTOREGION2D. |
|
|
Definition at line 115 of file bintoreg.h. |
1.3.8-20040913