gl2ps.h

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

Generated on Tue Jul 5 14:16:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1