/*
*     ___                       ___
*    / _ \___ _    _____ ____  / _ \_______ __    __
*   / ___/ _ \ |/|/ / -_) __/ / // / __/ _ `/ |/|/ /
*  /_/   \___/__,__/\__/_/   /____/_/  \_,_/|__,__/
*
*
*   Original Code by John Garrison
*   Written June 3-7, August 5, 1999
*   To be released under the LGPL
*
*   Basic drawing of graphics primitives
*
*   See LICENSE.TXT for more LGPL info
*/

#ifndef _PD_primitives_H
#define _PD_primitives_H

#ifdef __cplusplus
extern "C" {
#endif

#include "powerdraw.h"

// Internal funtions - use PD_PutPixel
extern int (*_PutPixel)(PD_Surface *Surface, Sint32 X, Sint32 Y, PD_Color Color);

int fast_putpixel1(PD_Surface *Surface, Sint32 X, Sint32 Y, PD_Color Color);
int fast_putpixel2(PD_Surface *Surface, Sint32 X, Sint32 Y, PD_Color Color);
int fast_putpixel3(PD_Surface *Surface, Sint32 X, Sint32 Y, PD_Color Color);
int fast_putpixel4(PD_Surface *Surface, Sint32 X, Sint32 Y, PD_Color Color);

int _HLine (PD_Surface *Surface, Sint32 X1, Sint32 X2, Sint32 Y, PD_Color Color);
int _VLine (PD_Surface *Surface, Sint32 Y1, Sint32 Y2, Sint32 X, PD_Color Color);
int _sgn (long a);
float _DegToRad (float deg);

int PD_PutPixel (PD_Surface *Surface, Sint32 X, Sint32 Y, PD_Color Color);
PD_Color PD_GetPixel (PD_Surface *Surface, Sint32 X, Sint32 Y);

int PD_HLine (PD_Surface *Surface, Sint32 X1, Sint32 X2, Sint32 Y, PD_Color Color);
int PD_VLine (PD_Surface *Surface, Sint32 Y1, Sint32 Y2, Sint32 X, PD_Color Color);
int PD_DoLine (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_Line (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, PD_Color Color);

int PD_Rect (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, PD_Color Color);
int PD_DoRect (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_RectFilled (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, PD_Color Color);

int PD_DoCircle (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_Circle (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, PD_Color Color);
int PD_CircleFilled (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, PD_Color Color);

int PD_DoEllipse (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 XRad, Sint32 YRad, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_Ellipse (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 XRad, Sint32 YRad, PD_Color Color);
int PD_EllipseFilled (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 XRad, Sint32 YRad, PD_Color Color);

int PD_DoTriangle (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Sint32 X3, Sint32 Y3, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_Triangle (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Sint32 X3, Sint32 Y3, PD_Color Color);
int PD_TriangleFilled (PD_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Sint32 X3, Sint32 Y3, PD_Color Color);

int PD_DoPolygon (PD_Surface *Surface, Sint32 Vertices, Sint32 *X, Sint32 *Y, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_Polygon (PD_Surface *Surface, Sint32 Vertices, Sint32 *X, Sint32 *Y, PD_Color Color);
int PD_PolygonFilled (PD_Surface *Surface, Sint32 Vertices, Sint32 *X, Sint32 *Y, PD_Color Color);

int PD_DoArc (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, float Deg1, float Deg2, PD_Color Color, int Callback (PD_Surface *Surf, Sint32 X, Sint32 Y, PD_Color Color));
int PD_Arc (PD_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, float Deg1, float Deg2, PD_Color Color);

#ifdef __cplusplus
};
#endif

#endif



