sprint 1-alpha
|
00001 /****************************************************************************** 00002 * sprint::drawing 00003 * 00004 * Copyright (C) 2005-2011 Paolo Medici <www.pmx.it> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 * 00020 *******************************************************************************/ 00021 #ifndef _IMAGE_DRAWING_H 00022 #define _IMAGE_DRAWING_H 00023 00024 // #include <sprint/math/point.h> 00025 // #include <sprint/math/rect.h> 00026 #include <sprint/image/copy.h> 00027 #include <sprint/image/blend.h> 00028 00032 namespace sprint { 00033 00034 // FW 00035 struct imageview; 00036 00038 // unsigned int rgba_to_native(unsigned int img_type, unsigned int color); 00039 00040 /*** drawing primitives ***/ 00041 00043 int pixel(imageview & image, int x0, int y0, unsigned int color); 00044 00046 int line(imageview & image, int x0, int y0, int x1, int y1, unsigned int color, unsigned int thikness=1); 00047 00049 int circle(imageview & image, int x0, int y0, int radius, unsigned int color); 00050 00052 int circumference(imageview & image, int x0, int y0, int radius, unsigned int color, unsigned int thikness=1); 00053 00055 int box(imageview & image, int x0, int y0, int x1, int y1, unsigned int color); 00056 00058 int rectangle(imageview & image, int x0, int y0, int x1, int y1, unsigned int color, unsigned int thikness=1); 00059 00061 int triangle(imageview & image, int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color); 00062 00064 int polygon(imageview & image, int *x, int *y, unsigned int color); 00065 00066 /****** antialiased ******/ 00067 00069 int apoint(imageview & image, float x0, float y0, float size, unsigned int color, float thikness=1.0f); 00070 00072 int aline(imageview & image, float x0, float y0, float x1, float y1, unsigned int color, float thikness=1.0f); 00073 00074 } 00075 00076 #endif