fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/***********************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCopyright 1989, 1998 The Open Group
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePermission to use, copy, modify, distribute, and sell this software and its
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedocumentation for any purpose is hereby granted without fee, provided that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortethe above copyright notice appear in all copies and that both that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecopyright notice and this permission notice appear in supporting
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedocumentation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteThe above copyright notice and this permission notice shall be included in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteall copies or substantial portions of the Software.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteExcept as contained in this notice, the name of The Open Group shall not be
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteused in advertising or otherwise to promote the sale, use or other dealings
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortein this Software without prior written authorization from The Open Group.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteCopyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte All Rights Reserved
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePermission to use, copy, modify, and distribute this software and its
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedocumentation for any purpose and without fee is hereby granted,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteprovided that the above copyright notice appear in all copies and that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteboth that copyright notice and this permission notice appear in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesupporting documentation, and that the name of Digital not be
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteused in advertising or publicity pertaining to distribution of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortesoftware without specific, written prior permission.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteSOFTWARE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte******************************************************************/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef MISPANS_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MISPANS_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int count; /* number of spans */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DDXPointPtr points; /* pointer to list of start points */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int *widths; /* pointer to list of widths */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} Spans;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int size; /* Total number of *Spans allocated */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int count; /* Number of *Spans actually in group */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Spans *group; /* List of Spans */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ymin, ymax; /* Min, max y values encountered */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} SpanGroup;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Initialize SpanGroup. MUST BE DONE before use. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern _X_EXPORT void miInitSpanGroup(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SpanGroup * /*spanGroup*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern _X_EXPORT void miAppendSpans(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SpanGroup * /*spanGroup*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SpanGroup * /*otherGroup*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Spans * /*spans*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Paint a span group, insuring that each pixel is painted at most once */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern _X_EXPORT void miFillUniqueSpanGroup(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DrawablePtr /*pDraw*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte GCPtr /*pGC*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SpanGroup * /*spanGroup*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Free up data in a span group. MUST BE DONE or you'll suffer memory leaks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern _X_EXPORT void miFreeSpanGroup(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SpanGroup * /*spanGroup*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern _X_EXPORT int miClipSpans(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RegionPtr /*prgnDst*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DDXPointPtr /*ppt*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int * /*pwidth*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int /*nspans*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DDXPointPtr /*pptNew*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int * /*pwidthNew*/,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int /*fSorted*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Rops which must use span groups */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define miSpansEasyRop(rop) (!miSpansCarefulRop(rop))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* MISPANS_H */