/* geometry_types.h --
 *	
 *	Forward declarations of geometry structs.  
 *
 *     ********************************************************************* 
 *     * Copyright (C) 1985, 1990 Regents of the University of California. * 
 *     * Permission to use, copy, modify, and distribute this              * 
 *     * software and its documentation for any purpose and without        * 
 *     * fee is hereby granted, provided that the above copyright          * 
 *     * notice appear in all copies.  The University of California        * 
 *     * makes no representations about the suitability of this            * 
 *     * software for any purpose.  It is provided "as is" without         * 
 *     * express or implied warranty.  Export of this software outside     * 
 *     * of the United States of America may require an export license.    * 
 *     *********************************************************************
 *
 */

#ifndef	__UTILS_GEOMETRY_TYPES_H__
#define	__UTILS_GEOMETRY_TYPES_H__

/* all types here are defined in "utils/geometry.h" */

/*-------------------------------------------------------------------
 * Point
 * Structure definition for Point (an x,y pair).
 * typedef'd to Point in "utils/geometry_types.h"
 *-------------------------------------------------------------------
 */
struct point_t {
    int p_x;
    int p_y;
};	/* Point */

typedef	struct point_t		Point;

/*-------------------------------------------------------------------
 * Rect
 * Structure definition for rectangles.  A rectangle is defined
 * by the coordinates of its lower-left and upper-right corners.
 * Most routines that manipulate rectangles require the first
 * point to really be the lower-left one, so be careful about this.
 * A null rectangle is indicated by making both x-coordinates the
 * same.
 * typedef'd to Rect in "utils/geometry_types.h"
 *-------------------------------------------------------------------
 */
struct rect_t {
    Point r_ll;			/* Lower-left corner of rectangle. */
    Point r_ur;			/* Upper-right corner of rectangle. */
};	/* Rect */

typedef	struct rect_t		Rect;

struct G1;
typedef	struct G1		LinkedRect;

/*-------------------------------------------------------------------
 * Transform, typedef'd in "utils/geometry_types.h".
 * Structure definition for geometrical transformers.  They are
 * stored in the form described by Newman and Sproull on page 57.
 * Magic allows only 90 degree orientations, and normally there
 * is no scaling (scaling only occurs when transforming to pixel
 * coordinates).  Thus the elements a, b, d, and e always have
 * one of the following forms, where S is the scaling factor:
 *
 *  S  0    0 -S    -S  0    0  S    S  0    0  S    -S  0    0 -S
 *  0  S    S  0     0 -S   -S  0    0 -S    S  0     0  S   -S  0
 *
 * The first four forms correspond to clockwise rotations of 0, 90,
 * 180, and 270 degrees, and the second four correspond to the same
 * four orientations flipped upside down (mirror across the x-axis
 * after rotating).
 *-------------------------------------------------------------------
 */
struct transform_t
{
    int t_a, t_b, t_c, t_d, t_e, t_f;
};	/* Transform */

typedef	struct transform_t	Transform;

#endif	/* __UTILS_GEOMETRY_TYPES_H__ */

