2007-11-16 18:25:45 +00:00
|
|
|
/* ASE - Allegro Sprite Editor
|
2011-01-20 21:32:31 +00:00
|
|
|
* Copyright (C) 2001-2011 David Capello
|
2007-09-18 23:57:02 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2009-08-17 21:38:00 +00:00
|
|
|
#ifndef RASTER_PATH_H_INCLUDED
|
|
|
|
#define RASTER_PATH_H_INCLUDED
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
#include "raster/gfxobj.h"
|
2010-11-06 23:40:03 +00:00
|
|
|
#include <string>
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
struct _ArtBpath;
|
2008-10-01 01:27:51 +00:00
|
|
|
class Image;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
/* path join style */
|
|
|
|
enum {
|
|
|
|
PATH_JOIN_MITER,
|
|
|
|
PATH_JOIN_ROUND,
|
|
|
|
PATH_JOIN_BEVEL,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* path cap type */
|
|
|
|
enum {
|
|
|
|
PATH_CAP_BUTT,
|
|
|
|
PATH_CAP_ROUND,
|
|
|
|
PATH_CAP_SQUARE,
|
|
|
|
};
|
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
class Path : public GfxObj
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
2008-10-01 01:27:51 +00:00
|
|
|
public:
|
2010-11-06 23:40:03 +00:00
|
|
|
std::string name;
|
2007-09-18 23:57:02 +00:00
|
|
|
int join, cap;
|
|
|
|
int size, end;
|
|
|
|
struct _ArtBpath *bpath;
|
2008-10-01 01:27:51 +00:00
|
|
|
|
2010-11-06 23:40:54 +00:00
|
|
|
explicit Path(const char* name);
|
|
|
|
explicit Path(const Path& path);
|
2008-10-01 01:27:51 +00:00
|
|
|
virtual ~Path();
|
2007-09-18 23:57:02 +00:00
|
|
|
};
|
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
/* void path_union(Path* path, Path* op); */
|
|
|
|
/* void path_intersect(Path* path, Path* op); */
|
|
|
|
/* void path_diff(Path* path, Path* op); */
|
|
|
|
/* void path_minus(Path* path, Path* op); */
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
void path_set_join(Path* path, int join);
|
|
|
|
void path_set_cap(Path* path, int cap);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
void path_moveto(Path* path, double x, double y);
|
|
|
|
void path_lineto(Path* path, double x, double y);
|
|
|
|
void path_curveto(Path* path,
|
|
|
|
double control_x1, double control_y1,
|
|
|
|
double control_x2, double control_y2,
|
|
|
|
double end_x, double end_y);
|
|
|
|
void path_close(Path* path);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
void path_move(Path* path, double x, double y);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
void path_stroke(Path* path, Image* image, int color, double brush_size);
|
|
|
|
void path_fill(Path* path, Image* image, int color);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2009-08-17 21:38:00 +00:00
|
|
|
#endif
|