PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/R2008-04-29/extra/jhandles/src/gl2ps.h

#
C Header | 202 lines | 124 code | 29 blank | 49 comment | 10 complexity | f4b5c42512f4becb7ca58207f7c3bc4f MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause, LGPL-2.1, GPL-3.0, LGPL-3.0
  1. /* $Id: gl2ps.h 4354 2007-12-06 21:04:27Z goffioul $ */
  2. /*
  3. * GL2PS, an OpenGL to PostScript Printing Library
  4. * Copyright (C) 1999-2006 Christophe Geuzaine <geuz@geuz.org>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of either:
  8. *
  9. * a) the GNU Library General Public License as published by the Free
  10. * Software Foundation, either version 2 of the License, or (at your
  11. * option) any later version; or
  12. *
  13. * b) the GL2PS License as published by Christophe Geuzaine, either
  14. * version 2 of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
  19. * the GNU Library General Public License or the GL2PS License for
  20. * more details.
  21. *
  22. * You should have received a copy of the GNU Library General Public
  23. * License along with this library in the file named "COPYING.LGPL";
  24. * if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  25. * Cambridge, MA 02139, USA.
  26. *
  27. * You should have received a copy of the GL2PS License with this
  28. * library in the file named "COPYING.GL2PS"; if not, I will be glad
  29. * to provide one.
  30. *
  31. * For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
  32. * Please report all bugs and problems to <gl2ps@geuz.org>.
  33. */
  34. #ifndef __GL2PS_H__
  35. #define __GL2PS_H__
  36. #include <stdio.h>
  37. #include <stdlib.h>
  38. /* Define GL2PSDLL at compile time to build a Windows DLL */
  39. #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
  40. # if defined(_MSC_VER)
  41. # pragma warning(disable:4115)
  42. # endif
  43. # include <windows.h>
  44. # if defined(GL2PSDLL)
  45. # if defined(GL2PSDLL_EXPORTS)
  46. # define GL2PSDLL_API __declspec(dllexport)
  47. # else
  48. # define GL2PSDLL_API __declspec(dllimport)
  49. # endif
  50. # else
  51. # define GL2PSDLL_API
  52. # endif
  53. #else
  54. # define GL2PSDLL_API
  55. #endif
  56. #if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H)
  57. # include <OpenGL/gl.h>
  58. #else
  59. # include <GL/gl.h>
  60. #endif
  61. /* Support for compressed PostScript/PDF/SVG and for embedded PNG
  62. images in SVG */
  63. #if defined(HAVE_ZLIB) || defined(HAVE_LIBZ)
  64. # define GL2PS_HAVE_ZLIB
  65. # if defined(HAVE_LIBPNG) || defined(HAVE_PNG)
  66. # define GL2PS_HAVE_LIBPNG
  67. # endif
  68. #endif
  69. /* Version number */
  70. #define GL2PS_MAJOR_VERSION 1
  71. #define GL2PS_MINOR_VERSION 3
  72. #define GL2PS_PATCH_VERSION 2
  73. #define GL2PS_EXTRA_VERSION ""
  74. #define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
  75. 0.01 * GL2PS_MINOR_VERSION + \
  76. 0.0001 * GL2PS_PATCH_VERSION)
  77. #define GL2PS_COPYRIGHT "(C) 1999-2006 Christophe Geuzaine (geuz@geuz.org)"
  78. /* Output file formats (the values and the ordering are important!) */
  79. #define GL2PS_PS 0
  80. #define GL2PS_EPS 1
  81. #define GL2PS_TEX 2
  82. #define GL2PS_PDF 3
  83. #define GL2PS_SVG 4
  84. #define GL2PS_PGF 5
  85. /* Sorting algorithms */
  86. #define GL2PS_NO_SORT 1
  87. #define GL2PS_SIMPLE_SORT 2
  88. #define GL2PS_BSP_SORT 3
  89. /* Message levels and error codes */
  90. #define GL2PS_SUCCESS 0
  91. #define GL2PS_INFO 1
  92. #define GL2PS_WARNING 2
  93. #define GL2PS_ERROR 3
  94. #define GL2PS_NO_FEEDBACK 4
  95. #define GL2PS_OVERFLOW 5
  96. #define GL2PS_UNINITIALIZED 6
  97. /* Options for gl2psBeginPage */
  98. #define GL2PS_NONE 0
  99. #define GL2PS_DRAW_BACKGROUND (1<<0)
  100. #define GL2PS_SIMPLE_LINE_OFFSET (1<<1)
  101. #define GL2PS_SILENT (1<<2)
  102. #define GL2PS_BEST_ROOT (1<<3)
  103. #define GL2PS_OCCLUSION_CULL (1<<4)
  104. #define GL2PS_NO_TEXT (1<<5)
  105. #define GL2PS_LANDSCAPE (1<<6)
  106. #define GL2PS_NO_PS3_SHADING (1<<7)
  107. #define GL2PS_NO_PIXMAP (1<<8)
  108. #define GL2PS_USE_CURRENT_VIEWPORT (1<<9)
  109. #define GL2PS_COMPRESS (1<<10)
  110. #define GL2PS_NO_BLENDING (1<<11)
  111. #define GL2PS_TIGHT_BOUNDING_BOX (1<<12)
  112. /* Arguments for gl2psEnable/gl2psDisable */
  113. #define GL2PS_POLYGON_OFFSET_FILL 1
  114. #define GL2PS_POLYGON_BOUNDARY 2
  115. #define GL2PS_LINE_STIPPLE 3
  116. #define GL2PS_BLEND 4
  117. /* Text alignment (o=raster position; default mode is BL):
  118. +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o
  119. | o | o | | o | | | | | | | | | | | |
  120. +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+
  121. C CL CR B BL BR T TL TR */
  122. #define GL2PS_TEXT_C 1
  123. #define GL2PS_TEXT_CL 2
  124. #define GL2PS_TEXT_CR 3
  125. #define GL2PS_TEXT_B 4
  126. #define GL2PS_TEXT_BL 5
  127. #define GL2PS_TEXT_BR 6
  128. #define GL2PS_TEXT_T 7
  129. #define GL2PS_TEXT_TL 8
  130. #define GL2PS_TEXT_TR 9
  131. /* vertical alignment on font's baseline */
  132. #define GL2PS_TEXT_L 10
  133. #define GL2PS_TEXT_LL 11
  134. #define GL2PS_TEXT_LR 12
  135. typedef GLfloat GL2PSrgba[4];
  136. #if defined(__cplusplus)
  137. extern "C" {
  138. #endif
  139. GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer,
  140. GLint viewport[4], GLint format, GLint sort,
  141. GLint options, GLint colormode,
  142. GLint colorsize, GL2PSrgba *colormap,
  143. GLint nr, GLint ng, GLint nb, GLint buffersize,
  144. FILE *stream, const char *filename);
  145. GL2PSDLL_API GLint gl2psEndPage(void);
  146. GL2PSDLL_API GLint gl2psSetOptions(GLint options);
  147. GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]);
  148. GL2PSDLL_API GLint gl2psEndViewport(void);
  149. GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname,
  150. GLshort fontsize);
  151. GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname,
  152. GLshort fontsize, GLint align, GLfloat angle, GLfloat margin,
  153. GLboolean offsetmargin, GLfloat linewidth, GL2PSrgba linecolor,
  154. GLushort linepattern, GLint linefactor, GL2PSrgba fillcolor);
  155. GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str, int moveTo);
  156. GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
  157. GLint xorig, GLint yorig,
  158. GLenum format, GLenum type, const void *pixels);
  159. GL2PSDLL_API GLint gl2psEnable(GLint mode);
  160. GL2PSDLL_API GLint gl2psDisable(GLint mode);
  161. GL2PSDLL_API GLint gl2psPointSize(GLfloat value);
  162. GL2PSDLL_API GLint gl2psLineWidth(GLfloat value);
  163. GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor);
  164. /* undocumented */
  165. GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height,
  166. const GLfloat position[3],
  167. const unsigned char *imagemap);
  168. GL2PSDLL_API const char *gl2psGetFileExtension(GLint format);
  169. GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format);
  170. #if defined(__cplusplus)
  171. }
  172. #endif
  173. #endif /* __GL2PS_H__ */