gl2ps.h

00001 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
00002 /* 
00003  * Copyright (C) 2008 Micha Hersch, EPFL
00004  * RobotCub Consortium, European Commission FP6 Project IST-004370
00005  * email:   micha.hersch@robotcub.org
00006  * website: www.robotcub.org
00007  * Permission is granted to copy, distribute, and/or modify this program
00008  * under the terms of the GNU General Public License, version 2 or any
00009  * later version published by the Free Software Foundation.
00010  *
00011  * A copy of the license can be found at
00012  * http://www.robotcub.org/icub/license/gpl.txt
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00017  * Public License for more details
00018  */
00019 /* $Id: gl2ps.h,v 1.4 2008/08/18 12:38:26 micha Exp $ */
00020 /*
00021  * GL2PS, an OpenGL to PostScript Printing Library
00022  * Copyright (C) 1999-2006 Christophe Geuzaine <geuz@geuz.org>
00023  *
00024  * This program is free software; you can redistribute it and/or
00025  * modify it under the terms of either:
00026  *
00027  * a) the GNU Library General Public License as published by the Free
00028  * Software Foundation, either version 2 of the License, or (at your
00029  * option) any later version; or
00030  *
00031  * b) the GL2PS License as published by Christophe Geuzaine, either
00032  * version 2 of the License, or (at your option) any later version.
00033  *
00034  * This program is distributed in the hope that it will be useful, but
00035  * WITHOUT ANY WARRANTY; without even the implied warranty of
00036  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
00037  * the GNU Library General Public License or the GL2PS License for
00038  * more details.
00039  *
00040  * You should have received a copy of the GNU Library General Public
00041  * License along with this library in the file named "COPYING.LGPL";
00042  * if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
00043  * Cambridge, MA 02139, USA.
00044  *
00045  * You should have received a copy of the GL2PS License with this
00046  * library in the file named "COPYING.GL2PS"; if not, I will be glad
00047  * to provide one.
00048  *
00049  * For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
00050  * Please report all bugs and problems to <gl2ps@geuz.org>.
00051  */
00052 
00053 #ifndef __GL2PS_H__
00054 #define __GL2PS_H__
00055 
00056 #include <stdio.h>
00057 #include <stdlib.h>
00058 
00059 /* Define GL2PSDLL at compile time to build a Windows DLL */
00060 
00061 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
00062 #  if defined(_MSC_VER)
00063 #    pragma warning(disable:4115)
00064 #  endif
00065 #  include <windows.h>
00066 #  if defined(GL2PSDLL)
00067 #    if defined(GL2PSDLL_EXPORTS)
00068 #      define GL2PSDLL_API __declspec(dllexport)
00069 #    else
00070 #      define GL2PSDLL_API __declspec(dllimport)
00071 #    endif
00072 #  else
00073 #    define GL2PSDLL_API
00074 #  endif
00075 #else
00076 #  define GL2PSDLL_API
00077 #endif
00078 
00079 #if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H)
00080 #  include <OpenGL/gl.h>
00081 #else
00082 #  include <GL/gl.h>
00083 #endif
00084 
00085 /* Support for compressed PostScript/PDF/SVG and for embedded PNG
00086    images in SVG */
00087 
00088 #if defined(HAVE_ZLIB) || defined(HAVE_LIBZ)
00089 #  define GL2PS_HAVE_ZLIB
00090 #  if defined(HAVE_LIBPNG) || defined(HAVE_PNG)
00091 #    define GL2PS_HAVE_LIBPNG
00092 #  endif
00093 #endif
00094 
00095 /* Version number */
00096 
00097 #define GL2PS_MAJOR_VERSION 1
00098 #define GL2PS_MINOR_VERSION 3
00099 #define GL2PS_PATCH_VERSION 2
00100 #define GL2PS_EXTRA_VERSION ""
00101 
00102 #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
00103                        0.01 * GL2PS_MINOR_VERSION + \
00104                        0.0001 * GL2PS_PATCH_VERSION)
00105 
00106 #define GL2PS_COPYRIGHT "(C) 1999-2006 Christophe Geuzaine (geuz@geuz.org)"
00107 
00108 /* Output file formats (the values and the ordering are important!) */
00109 
00110 #define GL2PS_PS  0
00111 #define GL2PS_EPS 1
00112 #define GL2PS_TEX 2
00113 #define GL2PS_PDF 3
00114 #define GL2PS_SVG 4
00115 #define GL2PS_PGF 5
00116 
00117 /* Sorting algorithms */
00118 
00119 #define GL2PS_NO_SORT     1
00120 #define GL2PS_SIMPLE_SORT 2
00121 #define GL2PS_BSP_SORT    3
00122 
00123 /* Message levels and error codes */
00124 
00125 #define GL2PS_SUCCESS       0
00126 #define GL2PS_INFO          1
00127 #define GL2PS_WARNING       2
00128 #define GL2PS_ERROR         3
00129 #define GL2PS_NO_FEEDBACK   4
00130 #define GL2PS_OVERFLOW      5
00131 #define GL2PS_UNINITIALIZED 6
00132 
00133 /* Options for gl2psBeginPage */
00134 
00135 #define GL2PS_NONE                 0
00136 #define GL2PS_DRAW_BACKGROUND      (1<<0)
00137 #define GL2PS_SIMPLE_LINE_OFFSET   (1<<1)
00138 #define GL2PS_SILENT               (1<<2)
00139 #define GL2PS_BEST_ROOT            (1<<3)
00140 #define GL2PS_OCCLUSION_CULL       (1<<4)
00141 #define GL2PS_NO_TEXT              (1<<5)
00142 #define GL2PS_LANDSCAPE            (1<<6)
00143 #define GL2PS_NO_PS3_SHADING       (1<<7)
00144 #define GL2PS_NO_PIXMAP            (1<<8)
00145 #define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
00146 #define GL2PS_COMPRESS             (1<<10)
00147 #define GL2PS_NO_BLENDING          (1<<11)
00148 #define GL2PS_TIGHT_BOUNDING_BOX   (1<<12)
00149 
00150 /* Arguments for gl2psEnable/gl2psDisable */
00151 
00152 #define GL2PS_POLYGON_OFFSET_FILL 1
00153 #define GL2PS_POLYGON_BOUNDARY    2
00154 #define GL2PS_LINE_STIPPLE        3
00155 #define GL2PS_BLEND               4
00156 
00157 /* Text alignment (o=raster position; default mode is BL):
00158    +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o 
00159    | o | o   | |   o |   | |   | |   | |   | |   | |   | 
00160    +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+ 
00161     C     CL    CR    B     BL    BR    T     TL    TR */
00162 
00163 #define GL2PS_TEXT_C  1
00164 #define GL2PS_TEXT_CL 2
00165 #define GL2PS_TEXT_CR 3
00166 #define GL2PS_TEXT_B  4
00167 #define GL2PS_TEXT_BL 5
00168 #define GL2PS_TEXT_BR 6
00169 #define GL2PS_TEXT_T  7
00170 #define GL2PS_TEXT_TL 8
00171 #define GL2PS_TEXT_TR 9
00172 
00173 typedef GLfloat GL2PSrgba[4];
00174 
00175 #if defined(__cplusplus)
00176 extern "C" {
00177 #endif
00178 
00179 GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, 
00180                                   GLint viewport[4], GLint format, GLint sort,
00181                                   GLint options, GLint colormode,
00182                                   GLint colorsize, GL2PSrgba *colormap, 
00183                                   GLint nr, GLint ng, GLint nb, GLint buffersize,
00184                                   FILE *stream, const char *filename);
00185 GL2PSDLL_API GLint gl2psEndPage(void);
00186 GL2PSDLL_API GLint gl2psSetOptions(GLint options);
00187 GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
00188 GL2PSDLL_API GLint gl2psEndViewport(void);
00189 GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, 
00190                              GLshort fontsize);
00191 GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, 
00192                                 GLshort fontsize, GLint align, GLfloat angle);
00193 GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str);
00194 GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
00195                                    GLint xorig, GLint yorig,
00196                                    GLenum format, GLenum type, const void *pixels);
00197 GL2PSDLL_API GLint gl2psEnable(GLint mode);
00198 GL2PSDLL_API GLint gl2psDisable(GLint mode);
00199 GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
00200 GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
00201 GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor);
00202 
00203 /* undocumented */
00204 GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height,
00205                                      const GLfloat position[3],
00206                                      const unsigned char *imagemap);
00207 GL2PSDLL_API const char *gl2psGetFileExtension(GLint format);
00208 GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format);
00209 
00210 #if defined(__cplusplus)
00211 }
00212 #endif
00213 
00214 #endif /* __GL2PS_H__ */
 All Data Structures Functions Variables

Generated on Wed Sep 22 16:51:25 2010 for Body_Schema_Learning by  doxygen 1.6.1