g4tools  5.4.0
Classes | Macros | Typedefs | Enumerations | Functions
gl2ps File Reference
#include "gl2ps_begin.icc"
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <stdarg.h>
#include <time.h>
#include <float.h>
#include "gl2ps_end.icc"
Include dependency graph for gl2ps:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _tools_GL2PSbsptree2d
 
struct  tools_GL2PSlist
 
struct  _tools_GL2PSbsptree
 
struct  tools_GL2PStriangle
 
struct  tools_GL2PSstring
 
struct  tools_GL2PSimage
 
struct  _tools_GL2PSimagemap
 
struct  tools_GL2PSprimitive
 
struct  tools_GL2PScompress
 
struct  tools_GL2PSpdfgroup
 
struct  tools_GL2PScontext
 
struct  tools_GL2PSbackend
 

Macros

#define tools_gl2ps
 
#define TOOLS_GL2PS_EPSILON   5.0e-3F
 
#define TOOLS_GL2PS_ZSCALE   1000.0F
 
#define TOOLS_GL2PS_ZOFFSET   5.0e-2F
 
#define TOOLS_GL2PS_ZOFFSET_LARGE   20.0F
 
#define TOOLS_GL2PS_ZERO(arg)   (fabs(arg) < 1.e-20)
 
#define TOOLS_GL2PS_COINCIDENT   1
 
#define TOOLS_GL2PS_IN_FRONT_OF   2
 
#define TOOLS_GL2PS_IN_BACK_OF   3
 
#define TOOLS_GL2PS_SPANNING   4
 
#define TOOLS_GL2PS_POINT_COINCIDENT   0
 
#define TOOLS_GL2PS_POINT_INFRONT   1
 
#define TOOLS_GL2PS_POINT_BACK   2
 
#define TOOLS_GL2PS_BEGIN_OFFSET_TOKEN   1
 
#define TOOLS_GL2PS_END_OFFSET_TOKEN   2
 
#define TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN   3
 
#define TOOLS_GL2PS_END_BOUNDARY_TOKEN   4
 
#define TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN   5
 
#define TOOLS_GL2PS_END_STIPPLE_TOKEN   6
 
#define TOOLS_GL2PS_POINT_SIZE_TOKEN   7
 
#define TOOLS_GL2PS_LINE_CAP_TOKEN   8
 
#define TOOLS_GL2PS_LINE_JOIN_TOKEN   9
 
#define TOOLS_GL2PS_LINE_WIDTH_TOKEN   10
 
#define TOOLS_GL2PS_BEGIN_BLEND_TOKEN   11
 
#define TOOLS_GL2PS_END_BLEND_TOKEN   12
 
#define TOOLS_GL2PS_SRC_BLEND_TOKEN   13
 
#define TOOLS_GL2PS_DST_BLEND_TOKEN   14
 
#define TOOLS_GL2PS_IMAGEMAP_TOKEN   15
 
#define TOOLS_GL2PS_DRAW_PIXELS_TOKEN   16
 
#define TOOLS_GL2PS_TEXT_TOKEN   17
 

Typedefs

typedef tools_GLfloat tools_GL2PSplane[4]
 
typedef struct _tools_GL2PSbsptree2d tools_GL2PSbsptree2d
 
typedef struct _tools_GL2PSbsptree tools_GL2PSbsptree
 
typedef struct _tools_GL2PSimagemap tools_GL2PSimagemap
 

Enumerations

enum  TOOLS_GL2PS_TRIANGLE_PROPERTY {
  T_UNDEFINED = -1, T_CONST_COLOR = 1, T_VAR_COLOR = 1<<1, T_ALPHA_1 = 1<<2,
  T_ALPHA_LESS_1 = 1<<3, T_VAR_ALPHA = 1<<4
}
 

Functions

TOOLS_GL2PSDLL_API void tools_gl2psAddPolyPrimitive (tools_GLshort type, tools_GLshort numverts, tools_GL2PSvertex *verts, tools_GLint offset, tools_GLfloat ofactor, tools_GLfloat ounits, tools_GLushort pattern, tools_GLint factor, tools_GLfloat width, tools_GLint linecap, tools_GLint linejoin, char boundary)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBeginPage (const char *title, const char *producer, tools_GLint viewport[4], tools_GLint format, tools_GLint sort, tools_GLint options, tools_GLint colormode, tools_GLint colorsize, tools_GL2PSrgba *colormap, tools_GLint nr, tools_GLint ng, tools_GLint nb, tools_GLint buffersize, FILE *stream, const char *filename)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEndPage (void)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBeginViewport (tools_GLint viewport[4])
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEndViewport (void)
 
TOOLS_GL2PSDLL_API tools_GLint tools_tools_gl2psTextOptColor (const char *str, const char *fontname, tools_GLshort fontsize, tools_GLint alignment, tools_GLfloat angle, tools_GL2PSrgba color)
 
TOOLS_GL2PSDLL_API tools_GLint tools_tools_gl2psTextOpt (const char *str, const char *fontname, tools_GLshort fontsize, tools_GLint alignment, tools_GLfloat angle)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psText (const char *str, const char *fontname, tools_GLshort fontsize)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSpecial (tools_GLint format, const char *str)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSpecialColor (tools_GLint format, const char *str, tools_GL2PSrgba rgba)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psDrawPixels (tools_GLsizei width, tools_GLsizei height, tools_GLint xorig, tools_GLint yorig, tools_GLenum format, tools_GLenum type, const void *pixels)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psDrawImageMap (tools_GLsizei width, tools_GLsizei height, const tools_GLfloat position[3], const unsigned char *imagemap)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEnable (tools_GLint mode)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psDisable (tools_GLint mode)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psPointSize (tools_GLfloat value)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psLineCap (tools_GLint value)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psLineJoin (tools_GLint value)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psLineWidth (tools_GLfloat value)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBlendFunc (tools_GLenum sfactor, tools_GLenum dfactor)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSetOptions (tools_GLint options)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psGetOptions (tools_GLint *options)
 
TOOLS_GL2PSDLL_API const char * tools_gl2psGetFileExtension (tools_GLint format)
 
TOOLS_GL2PSDLL_API const char * tools_gl2psGetFormatDescription (tools_GLint format)
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psGetFileFormat ()
 
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psForceRasterPos (tools_GL2PSvertex *vert)
 

Macro Definition Documentation

◆ tools_gl2ps

#define tools_gl2ps

Definition at line 2 of file gl2ps.

◆ TOOLS_GL2PS_BEGIN_BLEND_TOKEN

#define TOOLS_GL2PS_BEGIN_BLEND_TOKEN   11

Definition at line 107 of file gl2ps.

◆ TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN

#define TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN   3

Definition at line 99 of file gl2ps.

◆ TOOLS_GL2PS_BEGIN_OFFSET_TOKEN

#define TOOLS_GL2PS_BEGIN_OFFSET_TOKEN   1

Definition at line 97 of file gl2ps.

◆ TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN

#define TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN   5

Definition at line 101 of file gl2ps.

◆ TOOLS_GL2PS_COINCIDENT

#define TOOLS_GL2PS_COINCIDENT   1

Definition at line 84 of file gl2ps.

◆ TOOLS_GL2PS_DRAW_PIXELS_TOKEN

#define TOOLS_GL2PS_DRAW_PIXELS_TOKEN   16

Definition at line 112 of file gl2ps.

◆ TOOLS_GL2PS_DST_BLEND_TOKEN

#define TOOLS_GL2PS_DST_BLEND_TOKEN   14

Definition at line 110 of file gl2ps.

◆ TOOLS_GL2PS_END_BLEND_TOKEN

#define TOOLS_GL2PS_END_BLEND_TOKEN   12

Definition at line 108 of file gl2ps.

◆ TOOLS_GL2PS_END_BOUNDARY_TOKEN

#define TOOLS_GL2PS_END_BOUNDARY_TOKEN   4

Definition at line 100 of file gl2ps.

◆ TOOLS_GL2PS_END_OFFSET_TOKEN

#define TOOLS_GL2PS_END_OFFSET_TOKEN   2

Definition at line 98 of file gl2ps.

◆ TOOLS_GL2PS_END_STIPPLE_TOKEN

#define TOOLS_GL2PS_END_STIPPLE_TOKEN   6

Definition at line 102 of file gl2ps.

◆ TOOLS_GL2PS_EPSILON

#define TOOLS_GL2PS_EPSILON   5.0e-3F

Definition at line 76 of file gl2ps.

◆ TOOLS_GL2PS_IMAGEMAP_TOKEN

#define TOOLS_GL2PS_IMAGEMAP_TOKEN   15

Definition at line 111 of file gl2ps.

◆ TOOLS_GL2PS_IN_BACK_OF

#define TOOLS_GL2PS_IN_BACK_OF   3

Definition at line 86 of file gl2ps.

◆ TOOLS_GL2PS_IN_FRONT_OF

#define TOOLS_GL2PS_IN_FRONT_OF   2

Definition at line 85 of file gl2ps.

◆ TOOLS_GL2PS_LINE_CAP_TOKEN

#define TOOLS_GL2PS_LINE_CAP_TOKEN   8

Definition at line 104 of file gl2ps.

◆ TOOLS_GL2PS_LINE_JOIN_TOKEN

#define TOOLS_GL2PS_LINE_JOIN_TOKEN   9

Definition at line 105 of file gl2ps.

◆ TOOLS_GL2PS_LINE_WIDTH_TOKEN

#define TOOLS_GL2PS_LINE_WIDTH_TOKEN   10

Definition at line 106 of file gl2ps.

◆ TOOLS_GL2PS_POINT_BACK

#define TOOLS_GL2PS_POINT_BACK   2

Definition at line 93 of file gl2ps.

◆ TOOLS_GL2PS_POINT_COINCIDENT

#define TOOLS_GL2PS_POINT_COINCIDENT   0

Definition at line 91 of file gl2ps.

◆ TOOLS_GL2PS_POINT_INFRONT

#define TOOLS_GL2PS_POINT_INFRONT   1

Definition at line 92 of file gl2ps.

◆ TOOLS_GL2PS_POINT_SIZE_TOKEN

#define TOOLS_GL2PS_POINT_SIZE_TOKEN   7

Definition at line 103 of file gl2ps.

◆ TOOLS_GL2PS_SPANNING

#define TOOLS_GL2PS_SPANNING   4

Definition at line 87 of file gl2ps.

◆ TOOLS_GL2PS_SRC_BLEND_TOKEN

#define TOOLS_GL2PS_SRC_BLEND_TOKEN   13

Definition at line 109 of file gl2ps.

◆ TOOLS_GL2PS_TEXT_TOKEN

#define TOOLS_GL2PS_TEXT_TOKEN   17

Definition at line 113 of file gl2ps.

◆ TOOLS_GL2PS_ZERO

#define TOOLS_GL2PS_ZERO (   arg)    (fabs(arg) < 1.e-20)

Definition at line 80 of file gl2ps.

◆ TOOLS_GL2PS_ZOFFSET

#define TOOLS_GL2PS_ZOFFSET   5.0e-2F

Definition at line 78 of file gl2ps.

◆ TOOLS_GL2PS_ZOFFSET_LARGE

#define TOOLS_GL2PS_ZOFFSET_LARGE   20.0F

Definition at line 79 of file gl2ps.

◆ TOOLS_GL2PS_ZSCALE

#define TOOLS_GL2PS_ZSCALE   1000.0F

Definition at line 77 of file gl2ps.

Typedef Documentation

◆ tools_GL2PSbsptree

Definition at line 124 of file gl2ps.

◆ tools_GL2PSbsptree2d

Definition at line 124 of file gl2ps.

◆ tools_GL2PSimagemap

Definition at line 124 of file gl2ps.

◆ tools_GL2PSplane

typedef tools_GLfloat tools_GL2PSplane[4]

Definition at line 124 of file gl2ps.

Enumeration Type Documentation

◆ TOOLS_GL2PS_TRIANGLE_PROPERTY

Enumerator
T_UNDEFINED 
T_CONST_COLOR 
T_VAR_COLOR 
T_ALPHA_1 
T_ALPHA_LESS_1 
T_VAR_ALPHA 

Definition at line 115 of file gl2ps.

115  {
116  T_UNDEFINED = -1,
117  T_CONST_COLOR = 1,
118  T_VAR_COLOR = 1<<1,
119  T_ALPHA_1 = 1<<2,
120  T_ALPHA_LESS_1 = 1<<3,
121  T_VAR_ALPHA = 1<<4

Function Documentation

◆ tools_gl2psAddPolyPrimitive()

TOOLS_GL2PSDLL_API void tools_gl2psAddPolyPrimitive ( tools_GLshort  type,
tools_GLshort  numverts,
tools_GL2PSvertex verts,
tools_GLint  offset,
tools_GLfloat  ofactor,
tools_GLfloat  ounits,
tools_GLushort  pattern,
tools_GLint  factor,
tools_GLfloat  width,
tools_GLint  linecap,
tools_GLint  linejoin,
char  boundary 
)

Definition at line 2231 of file gl2ps.

2237 {
2238  tools_GL2PSprimitive *prim;
2239 
2240  prim = (tools_GL2PSprimitive*)tools_gl2psMalloc(sizeof(tools_GL2PSprimitive));
2241  prim->type = type;
2242  prim->numverts = numverts;
2243  prim->verts = (tools_GL2PSvertex*)tools_gl2psMalloc(numverts * sizeof(tools_GL2PSvertex));
2244  memcpy(prim->verts, verts, numverts * sizeof(tools_GL2PSvertex));
2245  prim->boundary = boundary;
2246  prim->offset = (char)offset;
2247  prim->ofactor = ofactor;
2248  prim->ounits = ounits;
2249  prim->pattern = pattern;
2250  prim->factor = factor;
2251  prim->width = width;
2252  prim->linecap = linecap;
2253  prim->linejoin = linejoin;
2254  prim->culled = 0;
2255 
2256  /* FIXME: here we should have an option to split stretched
2257  tris/quads to enhance SIMPLE_SORT */
2258 
2259  tools_gl2psListAdd(tools_gl2ps_context->primitives, &prim);
2260 }

◆ tools_gl2psBeginPage()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBeginPage ( const char *  title,
const char *  producer,
tools_GLint  viewport[4],
tools_GLint  format,
tools_GLint  sort,
tools_GLint  options,
tools_GLint  colormode,
tools_GLint  colorsize,
tools_GL2PSrgba colormap,
tools_GLint  nr,
tools_GLint  ng,
tools_GLint  nb,
tools_GLint  buffersize,
FILE *  stream,
const char *  filename 
)

Definition at line 5927 of file gl2ps.

5933 {
5934  tools_GLint idx;
5935  int i;
5936 
5937  if(tools_gl2ps_context){
5938  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "tools_gl2psBeginPage called in wrong program state");
5939  return TOOLS_GL2PS_ERROR;
5940  }
5941 
5942  tools_gl2ps_context = (tools_GL2PScontext*)tools_gl2psMalloc(sizeof(tools_GL2PScontext));
5943 
5944  /* Validate options */
5945  if (tools_gl2psCheckOptions(options, colormode) == TOOLS_GL_FALSE) {
5946  tools_gl2psFree(tools_gl2ps_context);
5947  tools_gl2ps_context = NULL;
5948  return TOOLS_GL2PS_ERROR;
5949  }
5950 
5951  if(format >= 0 && format < (tools_GLint)(sizeof(tools_gl2psbackends) / sizeof(tools_gl2psbackends[0]))){
5952  tools_gl2ps_context->format = format;
5953  }
5954  else {
5955  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "Unknown output format: %d", format);
5956  tools_gl2psFree(tools_gl2ps_context);
5957  tools_gl2ps_context = NULL;
5958  return TOOLS_GL2PS_ERROR;
5959  }
5960 
5961  switch(sort){
5962  case TOOLS_GL2PS_NO_SORT :
5964  case TOOLS_GL2PS_BSP_SORT :
5965  tools_gl2ps_context->sort = sort;
5966  break;
5967  default :
5968  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "Unknown sorting algorithm: %d", sort);
5969  tools_gl2psFree(tools_gl2ps_context);
5970  tools_gl2ps_context = NULL;
5971  return TOOLS_GL2PS_ERROR;
5972  }
5973 
5974  if(stream){
5975  tools_gl2ps_context->stream = stream;
5976  }
5977  else{
5978  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "Bad file pointer");
5979  tools_gl2psFree(tools_gl2ps_context);
5980  tools_gl2ps_context = NULL;
5981  return TOOLS_GL2PS_ERROR;
5982  }
5983 
5984  tools_gl2ps_context->header = TOOLS_GL_TRUE;
5985  tools_gl2ps_context->forcerasterpos = TOOLS_GL_FALSE;
5986  tools_gl2ps_context->maxbestroot = 10;
5987  tools_gl2ps_context->options = options;
5988  tools_gl2ps_context->compress = NULL;
5989  tools_gl2ps_context->imagemap_head = NULL;
5990  tools_gl2ps_context->imagemap_tail = NULL;
5991 
5992  if(tools_gl2ps_context->options & TOOLS_GL2PS_USE_CURRENT_VIEWPORT){
5993  tools_glGetIntegerv(TOOLS_GL_VIEWPORT, tools_gl2ps_context->viewport);
5994  }
5995  else{
5996  for(i = 0; i < 4; i++){
5997  tools_gl2ps_context->viewport[i] = viewport[i];
5998  }
5999  }
6000 
6001  if(!tools_gl2ps_context->viewport[2] || !tools_gl2ps_context->viewport[3]){
6002  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "Incorrect viewport (x=%d, y=%d, width=%d, height=%d)",
6003  tools_gl2ps_context->viewport[0], tools_gl2ps_context->viewport[1],
6004  tools_gl2ps_context->viewport[2], tools_gl2ps_context->viewport[3]);
6005  tools_gl2psFree(tools_gl2ps_context);
6006  tools_gl2ps_context = NULL;
6007  return TOOLS_GL2PS_ERROR;
6008  }
6009 
6010  tools_gl2ps_context->threshold[0] = nr ? 1.0F / (tools_GLfloat)nr : 0.064F;
6011  tools_gl2ps_context->threshold[1] = ng ? 1.0F / (tools_GLfloat)ng : 0.034F;
6012  tools_gl2ps_context->threshold[2] = nb ? 1.0F / (tools_GLfloat)nb : 0.100F;
6013  tools_gl2ps_context->colormode = colormode;
6014  tools_gl2ps_context->buffersize = buffersize > 0 ? buffersize : 2048 * 2048;
6015  for(i = 0; i < 3; i++){
6016  tools_gl2ps_context->lastvertex.xyz[i] = -1.0F;
6017  }
6018  for(i = 0; i < 4; i++){
6019  tools_gl2ps_context->lastvertex.rgba[i] = -1.0F;
6020  tools_gl2ps_context->lastrgba[i] = -1.0F;
6021  }
6022  tools_gl2ps_context->lastlinewidth = -1.0F;
6023  tools_gl2ps_context->lastlinecap = 0;
6024  tools_gl2ps_context->lastlinejoin = 0;
6025  tools_gl2ps_context->lastpattern = 0;
6026  tools_gl2ps_context->lastfactor = 0;
6027  tools_gl2ps_context->imagetree = NULL;
6028  tools_gl2ps_context->primitivetoadd = NULL;
6029  tools_gl2ps_context->zerosurfacearea = TOOLS_GL_FALSE;
6030  tools_gl2ps_context->pdfprimlist = NULL;
6031  tools_gl2ps_context->pdfgrouplist = NULL;
6032  tools_gl2ps_context->xreflist = NULL;
6033 
6034  /* get default blending mode from current OpenGL state (enabled by
6035  default for SVG) */
6036  if ((tools_gl2ps_context->options & TOOLS_GL2PS_NO_BLENDING) == TOOLS_GL2PS_NONE) {
6037  tools_gl2ps_context->blending = (tools_gl2ps_context->format == TOOLS_GL2PS_SVG) ? TOOLS_GL_TRUE
6038  : tools_glIsEnabled(TOOLS_GL_BLEND);
6039  tools_glGetIntegerv(TOOLS_GL_BLEND_SRC, &tools_gl2ps_context->blendfunc[0]);
6040  tools_glGetIntegerv(TOOLS_GL_BLEND_DST, &tools_gl2ps_context->blendfunc[1]);
6041  }
6042  else {
6043  tools_gl2ps_context->blending = TOOLS_GL_FALSE;
6044  }
6045 
6046  if(tools_gl2ps_context->colormode == TOOLS_GL_RGBA){
6047  tools_gl2ps_context->colorsize = 0;
6048  tools_gl2ps_context->colormap = NULL;
6049  if ((tools_gl2ps_context->options & TOOLS_GL2PS_NO_OPENGL_CONTEXT) == TOOLS_GL2PS_NONE) {
6050  tools_glGetFloatv(TOOLS_GL_COLOR_CLEAR_VALUE, tools_gl2ps_context->bgcolor);
6051  }
6052  }
6053  else if(tools_gl2ps_context->colormode == TOOLS_GL_COLOR_INDEX){
6054  if(!colorsize || !colormap){
6055  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "Missing colormap for TOOLS_GL_COLOR_INDEX rendering");
6056  tools_gl2psFree(tools_gl2ps_context);
6057  tools_gl2ps_context = NULL;
6058  return TOOLS_GL2PS_ERROR;
6059  }
6060  tools_gl2ps_context->colorsize = colorsize;
6061  tools_gl2ps_context->colormap = (tools_GL2PSrgba*)tools_gl2psMalloc(tools_gl2ps_context->colorsize * sizeof(tools_GL2PSrgba));
6062  memcpy(tools_gl2ps_context->colormap, colormap, tools_gl2ps_context->colorsize * sizeof(tools_GL2PSrgba));
6063  tools_glGetIntegerv(TOOLS_GL_INDEX_CLEAR_VALUE, &idx);
6064  tools_gl2ps_context->bgcolor[0] = tools_gl2ps_context->colormap[idx][0];
6065  tools_gl2ps_context->bgcolor[1] = tools_gl2ps_context->colormap[idx][1];
6066  tools_gl2ps_context->bgcolor[2] = tools_gl2ps_context->colormap[idx][2];
6067  tools_gl2ps_context->bgcolor[3] = 1.0F;
6068  }
6069  else{
6070  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "Unknown color mode in tools_gl2psBeginPage");
6071  tools_gl2psFree(tools_gl2ps_context);
6072  tools_gl2ps_context = NULL;
6073  return TOOLS_GL2PS_ERROR;
6074  }
6075 
6076  if(!title){
6077  tools_gl2ps_context->title = (char*)tools_gl2psMalloc(sizeof(char));
6078  tools_gl2ps_context->title[0] = '\0';
6079  }
6080  else{
6081  tools_gl2ps_context->title = (char*)tools_gl2psMalloc((strlen(title)+1)*sizeof(char));
6082  strcpy(tools_gl2ps_context->title, title);
6083  }
6084 
6085  if(!producer){
6086  tools_gl2ps_context->producer = (char*)tools_gl2psMalloc(sizeof(char));
6087  tools_gl2ps_context->producer[0] = '\0';
6088  }
6089  else{
6090  tools_gl2ps_context->producer = (char*)tools_gl2psMalloc((strlen(producer)+1)*sizeof(char));
6091  strcpy(tools_gl2ps_context->producer, producer);
6092  }
6093 
6094  if(!filename){
6095  tools_gl2ps_context->filename = (char*)tools_gl2psMalloc(sizeof(char));
6096  tools_gl2ps_context->filename[0] = '\0';
6097  }
6098  else{
6099  tools_gl2ps_context->filename = (char*)tools_gl2psMalloc((strlen(filename)+1)*sizeof(char));
6100  strcpy(tools_gl2ps_context->filename, filename);
6101  }
6102 
6103  tools_gl2ps_context->primitives = tools_gl2psListCreate(500, 500, sizeof(tools_GL2PSprimitive*));
6104  tools_gl2ps_context->auxprimitives = tools_gl2psListCreate(100, 100, sizeof(tools_GL2PSprimitive*));
6105 
6106  if ((tools_gl2ps_context->options & TOOLS_GL2PS_NO_OPENGL_CONTEXT) == TOOLS_GL2PS_NONE) {
6107  tools_gl2ps_context->feedback = (tools_GLfloat*)tools_gl2psMalloc(tools_gl2ps_context->buffersize * sizeof(tools_GLfloat));
6108  tools_glFeedbackBuffer(tools_gl2ps_context->buffersize, TOOLS_GL_3D_COLOR, tools_gl2ps_context->feedback);
6109  tools_glRenderMode(TOOLS_GL_FEEDBACK);
6110  }
6111  else {
6112  tools_gl2ps_context->feedback = NULL;
6113  tools_gl2ps_context->buffersize = 0;
6114  }
6115 
6116  return TOOLS_GL2PS_SUCCESS;
6117 }

◆ tools_gl2psBeginViewport()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBeginViewport ( tools_GLint  viewport[4])

Definition at line 6146 of file gl2ps.

6147 {
6148  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6149 
6150  (tools_gl2psbackends[tools_gl2ps_context->format]->beginViewport)(viewport);
6151 
6152  return TOOLS_GL2PS_SUCCESS;
6153 }

◆ tools_gl2psBlendFunc()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBlendFunc ( tools_GLenum  sfactor,
tools_GLenum  dfactor 
)

Definition at line 6439 of file gl2ps.

6440 {
6441  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6442 
6443  if(TOOLS_GL_FALSE == tools_gl2psSupportedBlendMode(sfactor, dfactor))
6444  return TOOLS_GL2PS_WARNING;
6445 
6446  tools_glPassThrough(TOOLS_GL2PS_SRC_BLEND_TOKEN);
6447  tools_glPassThrough((tools_GLfloat)sfactor);
6448  tools_glPassThrough(TOOLS_GL2PS_DST_BLEND_TOKEN);
6449  tools_glPassThrough((tools_GLfloat)dfactor);
6450 
6451  return TOOLS_GL2PS_SUCCESS;
6452 }

◆ tools_gl2psDisable()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psDisable ( tools_GLint  mode)

Definition at line 6374 of file gl2ps.

6375 {
6376  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6377 
6378  switch(mode){
6380  tools_glPassThrough(TOOLS_GL2PS_END_OFFSET_TOKEN);
6381  break;
6383  tools_glPassThrough(TOOLS_GL2PS_END_BOUNDARY_TOKEN);
6384  break;
6386  tools_glPassThrough(TOOLS_GL2PS_END_STIPPLE_TOKEN);
6387  break;
6388  case TOOLS_GL2PS_BLEND :
6389  tools_glPassThrough(TOOLS_GL2PS_END_BLEND_TOKEN);
6390  break;
6391  default :
6392  tools_gl2psMsg(TOOLS_GL2PS_WARNING, "Unknown mode in tools_gl2psDisable: %d", mode);
6393  return TOOLS_GL2PS_WARNING;
6394  }
6395 
6396  return TOOLS_GL2PS_SUCCESS;
6397 }

◆ tools_gl2psDrawImageMap()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psDrawImageMap ( tools_GLsizei  width,
tools_GLsizei  height,
const tools_GLfloat  position[3],
const unsigned char *  imagemap 
)

Definition at line 6313 of file gl2ps.

6315  {
6316  int size, i;
6317  int sizeoffloat = sizeof(tools_GLfloat);
6318 
6319  if(!tools_gl2ps_context || !imagemap) return TOOLS_GL2PS_UNINITIALIZED;
6320 
6321  if((width <= 0) || (height <= 0)) return TOOLS_GL2PS_ERROR;
6322 
6323  size = height + height * ((width - 1) / 8);
6324  tools_glPassThrough(TOOLS_GL2PS_IMAGEMAP_TOKEN);
6325  tools_glBegin(TOOLS_GL_POINTS);
6326  tools_glVertex3f(position[0], position[1],position[2]);
6327  tools_glEnd();
6328  tools_glPassThrough((tools_GLfloat)width);
6329  tools_glPassThrough((tools_GLfloat)height);
6330  for(i = 0; i < size; i += sizeoffloat){
6331  const float *value = (const float*)imagemap;
6332  tools_glPassThrough(*value);
6333  imagemap += sizeoffloat;
6334  }
6335  return TOOLS_GL2PS_SUCCESS;
6336 }

◆ tools_gl2psDrawPixels()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psDrawPixels ( tools_GLsizei  width,
tools_GLsizei  height,
tools_GLint  xorig,
tools_GLint  yorig,
tools_GLenum  format,
tools_GLenum  type,
const void *  pixels 
)

Definition at line 6199 of file gl2ps.

6203 {
6204  int size, i;
6205  const tools_GLfloat *piv;
6206  tools_GLfloat pos[4], zoom_x, zoom_y;
6207  tools_GL2PSprimitive *prim;
6208  tools_GLboolean valid;
6209 
6210  if(!tools_gl2ps_context || !pixels) return TOOLS_GL2PS_UNINITIALIZED;
6211 
6212  if((width <= 0) || (height <= 0)) return TOOLS_GL2PS_ERROR;
6213 
6214  if(tools_gl2ps_context->options & TOOLS_GL2PS_NO_PIXMAP) return TOOLS_GL2PS_SUCCESS;
6215 
6216  if((format != TOOLS_GL_RGB && format != TOOLS_GL_RGBA) || type != TOOLS_GL_FLOAT){
6217  tools_gl2psMsg(TOOLS_GL2PS_ERROR, "tools_gl2psDrawPixels only implemented for "
6218  "TOOLS_GL_RGB/TOOLS_GL_RGBA, TOOLS_GL_FLOAT pixels");
6219  return TOOLS_GL2PS_ERROR;
6220  }
6221 
6222  if (tools_gl2ps_context->forcerasterpos) {
6223  pos[0] = tools_gl2ps_context->rasterpos.xyz[0];
6224  pos[1] = tools_gl2ps_context->rasterpos.xyz[1];
6225  pos[2] = tools_gl2ps_context->rasterpos.xyz[2];
6226  pos[3] = 1.f;
6227  /* Hardcode zoom factors (for now?) */
6228  zoom_x = 1.f;
6229  zoom_y = 1.f;
6230  }
6231  else {
6232  tools_glGetBooleanv(TOOLS_GL_CURRENT_RASTER_POSITION_VALID, &valid);
6233  if(TOOLS_GL_FALSE == valid) return TOOLS_GL2PS_SUCCESS; /* the primitive is culled */
6234  tools_glGetFloatv(TOOLS_GL_CURRENT_RASTER_POSITION, pos);
6235  tools_glGetFloatv(TOOLS_GL_ZOOM_X, &zoom_x);
6236  tools_glGetFloatv(TOOLS_GL_ZOOM_Y, &zoom_y);
6237  }
6238 
6239  prim = (tools_GL2PSprimitive*)tools_gl2psMalloc(sizeof(tools_GL2PSprimitive));
6240  prim->type = TOOLS_GL2PS_PIXMAP;
6241  prim->boundary = 0;
6242  prim->numverts = 1;
6243  prim->verts = (tools_GL2PSvertex*)tools_gl2psMalloc(sizeof(tools_GL2PSvertex));
6244  prim->verts[0].xyz[0] = pos[0] + xorig;
6245  prim->verts[0].xyz[1] = pos[1] + yorig;
6246  prim->verts[0].xyz[2] = pos[2];
6247  prim->culled = 0;
6248  prim->offset = 0;
6249  prim->ofactor = 0.0;
6250  prim->ounits = 0.0;
6251  prim->pattern = 0;
6252  prim->factor = 0;
6253  prim->width = 1;
6254  if (tools_gl2ps_context->forcerasterpos) {
6255  prim->verts[0].rgba[0] = tools_gl2ps_context->rasterpos.rgba[0];
6256  prim->verts[0].rgba[1] = tools_gl2ps_context->rasterpos.rgba[1];
6257  prim->verts[0].rgba[2] = tools_gl2ps_context->rasterpos.rgba[2];
6258  prim->verts[0].rgba[3] = tools_gl2ps_context->rasterpos.rgba[3];
6259  }
6260  else {
6261  tools_glGetFloatv(TOOLS_GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba);
6262  }
6263  prim->data.image = (tools_GL2PSimage*)tools_gl2psMalloc(sizeof(tools_GL2PSimage));
6264  prim->data.image->width = width;
6265  prim->data.image->height = height;
6266  prim->data.image->zoom_x = zoom_x;
6267  prim->data.image->zoom_y = zoom_y;
6268  prim->data.image->format = format;
6269  prim->data.image->type = type;
6270 
6271  tools_gl2ps_context->forcerasterpos = TOOLS_GL_FALSE;
6272 
6273  switch(format){
6274  case TOOLS_GL_RGBA:
6275  if(tools_gl2ps_context->options & TOOLS_GL2PS_NO_BLENDING || !tools_gl2ps_context->blending){
6276  /* special case: blending turned off */
6277  prim->data.image->format = TOOLS_GL_RGB;
6278  size = height * width * 3;
6279  prim->data.image->pixels = (tools_GLfloat*)tools_gl2psMalloc(size * sizeof(tools_GLfloat));
6280  piv = (const tools_GLfloat*)pixels;
6281  for(i = 0; i < size; ++i, ++piv){
6282  prim->data.image->pixels[i] = *piv;
6283  if(!((i + 1) % 3))
6284  ++piv;
6285  }
6286  }
6287  else{
6288  size = height * width * 4;
6289  prim->data.image->pixels = (tools_GLfloat*)tools_gl2psMalloc(size * sizeof(tools_GLfloat));
6290  memcpy(prim->data.image->pixels, pixels, size * sizeof(tools_GLfloat));
6291  }
6292  break;
6293  case TOOLS_GL_RGB:
6294  default:
6295  size = height * width * 3;
6296  prim->data.image->pixels = (tools_GLfloat*)tools_gl2psMalloc(size * sizeof(tools_GLfloat));
6297  memcpy(prim->data.image->pixels, pixels, size * sizeof(tools_GLfloat));
6298  break;
6299  }
6300 
6301  /* If no OpenGL context, just add directly to primitives */
6302  if ((tools_gl2ps_context->options & TOOLS_GL2PS_NO_OPENGL_CONTEXT) == TOOLS_GL2PS_NONE) {
6303  tools_gl2psListAdd(tools_gl2ps_context->auxprimitives, &prim);
6304  tools_glPassThrough(TOOLS_GL2PS_DRAW_PIXELS_TOKEN);
6305  }
6306  else {
6307  tools_gl2psListAdd(tools_gl2ps_context->primitives, &prim);
6308  }
6309 
6310  return TOOLS_GL2PS_SUCCESS;
6311 }

◆ tools_gl2psEnable()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEnable ( tools_GLint  mode)

Definition at line 6338 of file gl2ps.

6339 {
6340  tools_GLint tmp;
6341  tools_GLfloat tmp2;
6342 
6343  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6344 
6345  switch(mode){
6347  tools_glPassThrough(TOOLS_GL2PS_BEGIN_OFFSET_TOKEN);
6348  tools_glGetFloatv(TOOLS_GL_POLYGON_OFFSET_FACTOR, &tmp2);
6349  tools_glPassThrough(tmp2);
6350  tools_glGetFloatv(TOOLS_GL_POLYGON_OFFSET_UNITS, &tmp2);
6351  tools_glPassThrough(tmp2);
6352  break;
6354  tools_glPassThrough(TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN);
6355  break;
6357  tools_glPassThrough(TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN);
6358  tools_glGetIntegerv(TOOLS_GL_LINE_STIPPLE_PATTERN, &tmp);
6359  tools_glPassThrough((tools_GLfloat)tmp);
6360  tools_glGetIntegerv(TOOLS_GL_LINE_STIPPLE_REPEAT, &tmp);
6361  tools_glPassThrough((tools_GLfloat)tmp);
6362  break;
6363  case TOOLS_GL2PS_BLEND :
6364  tools_glPassThrough(TOOLS_GL2PS_BEGIN_BLEND_TOKEN);
6365  break;
6366  default :
6367  tools_gl2psMsg(TOOLS_GL2PS_WARNING, "Unknown mode in tools_gl2psEnable: %d", mode);
6368  return TOOLS_GL2PS_WARNING;
6369  }
6370 
6371  return TOOLS_GL2PS_SUCCESS;
6372 }

◆ tools_gl2psEndPage()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEndPage ( void  )

Definition at line 6119 of file gl2ps.

6120 {
6121  tools_GLint res;
6122 
6123  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6124 
6125  res = tools_gl2psPrintPrimitives();
6126 
6127  if(res != TOOLS_GL2PS_OVERFLOW)
6128  (tools_gl2psbackends[tools_gl2ps_context->format]->printFooter)();
6129 
6130  fflush(tools_gl2ps_context->stream);
6131 
6132  tools_gl2psListDelete(tools_gl2ps_context->primitives);
6133  tools_gl2psListDelete(tools_gl2ps_context->auxprimitives);
6134  tools_tools_gl2psFreeImagemap(tools_gl2ps_context->imagemap_head);
6135  tools_gl2psFree(tools_gl2ps_context->colormap);
6136  tools_gl2psFree(tools_gl2ps_context->title);
6137  tools_gl2psFree(tools_gl2ps_context->producer);
6138  tools_gl2psFree(tools_gl2ps_context->filename);
6139  tools_gl2psFree(tools_gl2ps_context->feedback);
6140  tools_gl2psFree(tools_gl2ps_context);
6141  tools_gl2ps_context = NULL;
6142 
6143  return res;
6144 }

◆ tools_gl2psEndViewport()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEndViewport ( void  )

Definition at line 6155 of file gl2ps.

6156 {
6157  tools_GLint res;
6158 
6159  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6160 
6161  res = (tools_gl2psbackends[tools_gl2ps_context->format]->endViewport)();
6162 
6163  /* reset last used colors, line widths */
6164  tools_gl2psResetLineProperties();
6165 
6166  return res;
6167 }

◆ tools_gl2psForceRasterPos()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psForceRasterPos ( tools_GL2PSvertex vert)

Definition at line 6500 of file gl2ps.

6501 {
6502 
6503  if(!tools_gl2ps_context) {
6505  }
6506 
6507  tools_gl2ps_context->forcerasterpos = TOOLS_GL_TRUE;
6508  tools_gl2ps_context->rasterpos.xyz[0] = vert->xyz[0];
6509  tools_gl2ps_context->rasterpos.xyz[1] = vert->xyz[1];
6510  tools_gl2ps_context->rasterpos.xyz[2] = vert->xyz[2];
6511  tools_gl2ps_context->rasterpos.rgba[0] = vert->rgba[0];
6512  tools_gl2ps_context->rasterpos.rgba[1] = vert->rgba[1];
6513  tools_gl2ps_context->rasterpos.rgba[2] = vert->rgba[2];
6514  tools_gl2ps_context->rasterpos.rgba[3] = vert->rgba[3];
6515 
6516  return TOOLS_GL2PS_SUCCESS;
6517 }

◆ tools_gl2psGetFileExtension()

TOOLS_GL2PSDLL_API const char* tools_gl2psGetFileExtension ( tools_GLint  format)

Definition at line 6479 of file gl2ps.

6480 {
6481  if(format >= 0 && format < (tools_GLint)(sizeof(tools_gl2psbackends) / sizeof(tools_gl2psbackends[0])))
6482  return tools_gl2psbackends[format]->file_extension;
6483  else
6484  return "Unknown format";
6485 }

◆ tools_gl2psGetFileFormat()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psGetFileFormat ( )

Definition at line 6495 of file gl2ps.

6496 {
6497  return tools_gl2ps_context->format;
6498 }

◆ tools_gl2psGetFormatDescription()

TOOLS_GL2PSDLL_API const char* tools_gl2psGetFormatDescription ( tools_GLint  format)

Definition at line 6487 of file gl2ps.

6488 {
6489  if(format >= 0 && format < (tools_GLint)(sizeof(tools_gl2psbackends) / sizeof(tools_gl2psbackends[0])))
6490  return tools_gl2psbackends[format]->description;
6491  else
6492  return "Unknown format";
6493 }

◆ tools_gl2psGetOptions()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psGetOptions ( tools_GLint options)

Definition at line 6467 of file gl2ps.

6468 {
6469  if(!tools_gl2ps_context) {
6470  *options = 0;
6472  }
6473 
6474  *options = tools_gl2ps_context->options;
6475 
6476  return TOOLS_GL2PS_SUCCESS;
6477 }

◆ tools_gl2psLineCap()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psLineCap ( tools_GLint  value)

Definition at line 6409 of file gl2ps.

6410 {
6411  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6412 
6413  tools_glPassThrough(TOOLS_GL2PS_LINE_CAP_TOKEN);
6414  tools_glPassThrough(value);
6415 
6416  return TOOLS_GL2PS_SUCCESS;
6417 }

◆ tools_gl2psLineJoin()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psLineJoin ( tools_GLint  value)

Definition at line 6419 of file gl2ps.

6420 {
6421  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6422 
6423  tools_glPassThrough(TOOLS_GL2PS_LINE_JOIN_TOKEN);
6424  tools_glPassThrough((tools_GLfloat)value); //G.Barrand : _MSC_VER : cast.
6425 
6426  return TOOLS_GL2PS_SUCCESS;
6427 }

◆ tools_gl2psLineWidth()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psLineWidth ( tools_GLfloat  value)

Definition at line 6429 of file gl2ps.

6430 {
6431  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6432 
6433  tools_glPassThrough(TOOLS_GL2PS_LINE_WIDTH_TOKEN);
6434  tools_glPassThrough((tools_GLfloat)value); //G.Barrand : _MSC_VER : cast.
6435 
6436  return TOOLS_GL2PS_SUCCESS;
6437 }

◆ tools_gl2psPointSize()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psPointSize ( tools_GLfloat  value)

Definition at line 6399 of file gl2ps.

6400 {
6401  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6402 
6403  tools_glPassThrough(TOOLS_GL2PS_POINT_SIZE_TOKEN);
6404  tools_glPassThrough(value);
6405 
6406  return TOOLS_GL2PS_SUCCESS;
6407 }

◆ tools_gl2psSetOptions()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSetOptions ( tools_GLint  options)

Definition at line 6454 of file gl2ps.

6455 {
6456  if(!tools_gl2ps_context) return TOOLS_GL2PS_UNINITIALIZED;
6457 
6458  if(tools_gl2psCheckOptions(options, tools_gl2ps_context->colormode) == TOOLS_GL_FALSE) {
6459  return TOOLS_GL2PS_ERROR;
6460  }
6461 
6462  tools_gl2ps_context->options = options;
6463 
6464  return TOOLS_GL2PS_SUCCESS;
6465 }

◆ tools_gl2psSpecial()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSpecial ( tools_GLint  format,
const char *  str 
)

Definition at line 6189 of file gl2ps.

6190 {
6191  return tools_gl2psAddText(TOOLS_GL2PS_SPECIAL, str, "", 0, format, 0.0F, NULL);
6192 }

◆ tools_gl2psSpecialColor()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psSpecialColor ( tools_GLint  format,
const char *  str,
tools_GL2PSrgba  rgba 
)

Definition at line 6194 of file gl2ps.

6195 {
6196  return tools_gl2psAddText(TOOLS_GL2PS_SPECIAL, str, "", 0, format, 0.0F, rgba);
6197 }

◆ tools_gl2psText()

TOOLS_GL2PSDLL_API tools_GLint tools_gl2psText ( const char *  str,
const char *  fontname,
tools_GLshort  fontsize 
)

Definition at line 6183 of file gl2ps.

6184 {
6185  return tools_gl2psAddText(TOOLS_GL2PS_TEXT, str, fontname, fontsize, TOOLS_GL2PS_TEXT_BL, 0.0F,
6186  NULL);
6187 }

◆ tools_tools_gl2psTextOpt()

TOOLS_GL2PSDLL_API tools_GLint tools_tools_gl2psTextOpt ( const char *  str,
const char *  fontname,
tools_GLshort  fontsize,
tools_GLint  alignment,
tools_GLfloat  angle 
)

Definition at line 6177 of file gl2ps.

6179 {
6180  return tools_gl2psAddText(TOOLS_GL2PS_TEXT, str, fontname, fontsize, alignment, angle, NULL);
6181 }

◆ tools_tools_gl2psTextOptColor()

TOOLS_GL2PSDLL_API tools_GLint tools_tools_gl2psTextOptColor ( const char *  str,
const char *  fontname,
tools_GLshort  fontsize,
tools_GLint  alignment,
tools_GLfloat  angle,
tools_GL2PSrgba  color 
)

Definition at line 6169 of file gl2ps.

6172 {
6173  return tools_gl2psAddText(TOOLS_GL2PS_TEXT, str, fontname, fontsize, alignment, angle,
6174  color);
6175 }
TOOLS_GL2PS_NONE
#define TOOLS_GL2PS_NONE
Definition: gl2ps_def.h:59
tools_GL2PSprimitive::width
tools_GLfloat width
Definition: gl2ps:182
TOOLS_GL_BLEND_SRC
#define TOOLS_GL_BLEND_SRC
Definition: gl2ps_def.h:169
tools_GL2PSprimitive::boundary
char boundary
Definition: gl2ps:180
TOOLS_GL2PS_DST_BLEND_TOKEN
#define TOOLS_GL2PS_DST_BLEND_TOKEN
Definition: gl2ps:110
TOOLS_GL2PS_LINE_JOIN_TOKEN
#define TOOLS_GL2PS_LINE_JOIN_TOKEN
Definition: gl2ps:105
TOOLS_GL2PS_USE_CURRENT_VIEWPORT
#define TOOLS_GL2PS_USE_CURRENT_VIEWPORT
Definition: gl2ps_def.h:69
tools_GL2PSprimitive
Definition: gl2ps:177
tools_GL2PScontext::lastfactor
tools_GLint lastfactor
Definition: gl2ps:212
tools_GL2PSprimitive::offset
char offset
Definition: gl2ps:180
tools_GL2PScontext::rasterpos
tools_GL2PSvertex rasterpos
Definition: gl2ps:220
TOOLS_GL2PS_TEXT
#define TOOLS_GL2PS_TEXT
Definition: gl2ps_def.h:119
TOOLS_GL2PS_TRIANGLE_PROPERTY
TOOLS_GL2PS_TRIANGLE_PROPERTY
Definition: gl2ps:115
TOOLS_GL_RGB
#define TOOLS_GL_RGB
Definition: gl2ps_def.h:142
tools_GL2PSprimitive::linecap
tools_GLint linecap
Definition: gl2ps:181
tools_GL2PSprimitive::data
union tools_GL2PSprimitive::@0 data
TOOLS_GL2PS_PIXMAP
#define TOOLS_GL2PS_PIXMAP
Definition: gl2ps_def.h:124
tools_GL2PScontext::buffersize
tools_GLint buffersize
Definition: gl2ps:207
tools_GL2PSimage::zoom_x
tools_GLfloat zoom_x
Definition: gl2ps:166
TOOLS_GL2PS_SPECIAL
#define TOOLS_GL2PS_SPECIAL
Definition: gl2ps_def.h:128
tools_GL2PScontext::pdfprimlist
tools_GL2PSlist * pdfprimlist
Definition: gl2ps:233
TOOLS_GL2PS_NO_PIXMAP
#define TOOLS_GL2PS_NO_PIXMAP
Definition: gl2ps_def.h:68
tools_GL2PSimage::format
tools_GLenum format
Definition: gl2ps:165
tools_GL2PSbackend::beginViewport
void(* beginViewport)(tools_GLint viewport[4])
Definition: gl2ps:251
tools_GL2PScontext::xreflist
int * xreflist
Definition: gl2ps:234
TOOLS_GL2PS_POLYGON_BOUNDARY
#define TOOLS_GL2PS_POLYGON_BOUNDARY
Definition: gl2ps_def.h:78
T_CONST_COLOR
@ T_CONST_COLOR
Definition: gl2ps:117
TOOLS_GL_CURRENT_RASTER_COLOR
#define TOOLS_GL_CURRENT_RASTER_COLOR
Definition: gl2ps_def.h:149
tools_GL2PSprimitive::linejoin
tools_GLint linejoin
Definition: gl2ps:181
TOOLS_GL2PS_POLYGON_OFFSET_FILL
#define TOOLS_GL2PS_POLYGON_OFFSET_FILL
Definition: gl2ps_def.h:77
tools_GL2PSimage::zoom_y
tools_GLfloat zoom_y
Definition: gl2ps:166
tools_GL2PScontext::imagemap_tail
tools_GL2PSimagemap * imagemap_tail
Definition: gl2ps:245
TOOLS_GL2PS_IMAGEMAP_TOKEN
#define TOOLS_GL2PS_IMAGEMAP_TOKEN
Definition: gl2ps:111
T_ALPHA_1
@ T_ALPHA_1
Definition: gl2ps:119
tools_GL2PScontext::colorsize
tools_GLint colorsize
Definition: gl2ps:207
tools_GL2PScontext::blending
tools_GLboolean blending
Definition: gl2ps:210
TOOLS_GL2PS_LINE_STIPPLE
#define TOOLS_GL2PS_LINE_STIPPLE
Definition: gl2ps_def.h:79
TOOLS_GL2PS_END_OFFSET_TOKEN
#define TOOLS_GL2PS_END_OFFSET_TOKEN
Definition: gl2ps:98
TOOLS_GL2PS_POINT_SIZE_TOKEN
#define TOOLS_GL2PS_POINT_SIZE_TOKEN
Definition: gl2ps:103
tools_GL2PScontext::threshold
tools_GL2PSrgba threshold
Definition: gl2ps:213
TOOLS_GL2PS_END_STIPPLE_TOKEN
#define TOOLS_GL2PS_END_STIPPLE_TOKEN
Definition: gl2ps:102
TOOLS_GL_FALSE
#define TOOLS_GL_FALSE
Definition: gl2ps_def.h:134
TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN
#define TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN
Definition: gl2ps:99
tools_GL2PScontext::lastrgba
tools_GL2PSrgba lastrgba
Definition: gl2ps:213
TOOLS_GL_FLOAT
#define TOOLS_GL_FLOAT
Definition: gl2ps_def.h:136
T_VAR_ALPHA
@ T_VAR_ALPHA
Definition: gl2ps:121
TOOLS_GL_INDEX_CLEAR_VALUE
#define TOOLS_GL_INDEX_CLEAR_VALUE
Definition: gl2ps_def.h:166
TOOLS_GL_FEEDBACK
#define TOOLS_GL_FEEDBACK
Definition: gl2ps_def.h:164
tools_GL2PSbackend::file_extension
const char * file_extension
Definition: gl2ps:255
tools_GL2PScontext::colormap
tools_GL2PSrgba * colormap
Definition: gl2ps:213
tools_GL2PSbackend::endViewport
tools_GLint(* endViewport)(void)
Definition: gl2ps:252
tools_GL2PScontext::forcerasterpos
tools_GLboolean forcerasterpos
Definition: gl2ps:221
TOOLS_GL_POLYGON_OFFSET_UNITS
#define TOOLS_GL_POLYGON_OFFSET_UNITS
Definition: gl2ps_def.h:174
T_ALPHA_LESS_1
@ T_ALPHA_LESS_1
Definition: gl2ps:120
TOOLS_GL_CURRENT_RASTER_POSITION
#define TOOLS_GL_CURRENT_RASTER_POSITION
Definition: gl2ps_def.h:148
tools_GL2PSvertex
Definition: gl2ps_def.h:112
tools_GL2PSvertex::rgba
tools_GL2PSrgba rgba
Definition: gl2ps_def.h:114
TOOLS_GL2PS_END_BOUNDARY_TOKEN
#define TOOLS_GL2PS_END_BOUNDARY_TOKEN
Definition: gl2ps:100
tools_GL2PScontext::colormode
tools_GLint colormode
Definition: gl2ps:207
tools_GLfloat
float tools_GLfloat
Definition: gl2ps_def.h:9
TOOLS_GL2PS_SUCCESS
#define TOOLS_GL2PS_SUCCESS
Definition: gl2ps_def.h:49
tools_GL2PSbackend::printFooter
void(* printFooter)(void)
Definition: gl2ps:250
TOOLS_GL_ZOOM_X
#define TOOLS_GL_ZOOM_X
Definition: gl2ps_def.h:178
T_UNDEFINED
@ T_UNDEFINED
Definition: gl2ps:116
TOOLS_GL2PS_BSP_SORT
#define TOOLS_GL2PS_BSP_SORT
Definition: gl2ps_def.h:45
tools_GL2PScontext::primitives
tools_GL2PSlist * primitives
Definition: gl2ps:216
TOOLS_GL2PS_END_BLEND_TOKEN
#define TOOLS_GL2PS_END_BLEND_TOKEN
Definition: gl2ps:108
TOOLS_GL2PS_BLEND
#define TOOLS_GL2PS_BLEND
Definition: gl2ps_def.h:80
tools_GL2PSprimitive::factor
tools_GLint factor
Definition: gl2ps:181
tools::file::size
bool size(const std::string &a_file, long &a_size)
Definition: fsize:13
TOOLS_GL_ZOOM_Y
#define TOOLS_GL_ZOOM_Y
Definition: gl2ps_def.h:179
TOOLS_GL2PS_LINE_WIDTH_TOKEN
#define TOOLS_GL2PS_LINE_WIDTH_TOKEN
Definition: gl2ps:106
TOOLS_GL2PS_NO_BLENDING
#define TOOLS_GL2PS_NO_BLENDING
Definition: gl2ps_def.h:71
tools_GL2PScontext::format
tools_GLint format
Definition: gl2ps:207
TOOLS_GL2PS_BEGIN_OFFSET_TOKEN
#define TOOLS_GL2PS_BEGIN_OFFSET_TOKEN
Definition: gl2ps:97
tools_GL2PSimage::height
tools_GLsizei height
Definition: gl2ps:161
TOOLS_GL2PS_SIMPLE_SORT
#define TOOLS_GL2PS_SIMPLE_SORT
Definition: gl2ps_def.h:44
TOOLS_GL2PS_WARNING
#define TOOLS_GL2PS_WARNING
Definition: gl2ps_def.h:51
TOOLS_GL_BLEND_DST
#define TOOLS_GL_BLEND_DST
Definition: gl2ps_def.h:170
TOOLS_GL2PS_TEXT_BL
#define TOOLS_GL2PS_TEXT_BL
Definition: gl2ps_def.h:103
tools_GLboolean
unsigned char tools_GLboolean
Definition: gl2ps_def.h:14
TOOLS_GL_BLEND
#define TOOLS_GL_BLEND
Definition: gl2ps_def.h:137
tools_GL2PSimage::pixels
tools_GLfloat * pixels
Definition: gl2ps:167
tools_GL2PSbackend::description
const char * description
Definition: gl2ps:256
tools_GL2PScontext::title
char * title
Definition: gl2ps:209
tools_GL2PScontext::lastpattern
tools_GLushort lastpattern
Definition: gl2ps:214
tools_GL2PScontext::maxbestroot
tools_GLint maxbestroot
Definition: gl2ps:224
tools_GL2PSprimitive::ofactor
tools_GLfloat ofactor
Definition: gl2ps:182
tools_GL2PSrgba
tools_GLfloat tools_GL2PSrgba[4]
Definition: gl2ps_def.h:109
tools_GL2PScontext::lastlinecap
tools_GLint lastlinecap
Definition: gl2ps:208
TOOLS_GL2PS_LINE_CAP_TOKEN
#define TOOLS_GL2PS_LINE_CAP_TOKEN
Definition: gl2ps:104
TOOLS_GL_COLOR_INDEX
#define TOOLS_GL_COLOR_INDEX
Definition: gl2ps_def.h:152
tools_GL2PScontext::lastlinejoin
tools_GLint lastlinejoin
Definition: gl2ps:208
TOOLS_GL2PS_BEGIN_BLEND_TOKEN
#define TOOLS_GL2PS_BEGIN_BLEND_TOKEN
Definition: gl2ps:107
tools_GL2PScontext::options
tools_GLint options
Definition: gl2ps:207
tools_GL2PSimage::type
tools_GLenum type
Definition: gl2ps:165
TOOLS_GL_LINE_STIPPLE_PATTERN
#define TOOLS_GL_LINE_STIPPLE_PATTERN
Definition: gl2ps_def.h:175
TOOLS_GL2PS_SRC_BLEND_TOKEN
#define TOOLS_GL2PS_SRC_BLEND_TOKEN
Definition: gl2ps:109
TOOLS_GL2PS_ERROR
#define TOOLS_GL2PS_ERROR
Definition: gl2ps_def.h:52
tools_GL2PSprimitive::type
tools_GLshort type
Definition: gl2ps:178
tools_GL2PScontext::lastvertex
tools_GL2PSvertex lastvertex
Definition: gl2ps:215
tools_GL2PSprimitive::image
tools_GL2PSimage * image
Definition: gl2ps:186
T_VAR_COLOR
@ T_VAR_COLOR
Definition: gl2ps:118
tools_GL2PScontext::viewport
tools_GLint viewport[4]
Definition: gl2ps:212
TOOLS_GL2PS_NO_OPENGL_CONTEXT
#define TOOLS_GL2PS_NO_OPENGL_CONTEXT
Definition: gl2ps_def.h:73
TOOLS_GL_POINTS
#define TOOLS_GL_POINTS
Definition: gl2ps_def.h:145
tools_GL2PSimage
Definition: gl2ps:160
tools_GL2PScontext::zerosurfacearea
tools_GLboolean zerosurfacearea
Definition: gl2ps:227
tools_GL2PScontext::imagetree
tools_GL2PSbsptree2d * imagetree
Definition: gl2ps:228
tools_GL2PScontext::pdfgrouplist
tools_GL2PSlist * pdfgrouplist
Definition: gl2ps:233
TOOLS_GL2PS_DRAW_PIXELS_TOKEN
#define TOOLS_GL2PS_DRAW_PIXELS_TOKEN
Definition: gl2ps:112
TOOLS_GL2PS_OVERFLOW
#define TOOLS_GL2PS_OVERFLOW
Definition: gl2ps_def.h:54
TOOLS_GL2PS_NO_SORT
#define TOOLS_GL2PS_NO_SORT
Definition: gl2ps_def.h:43
TOOLS_GL2PS_UNINITIALIZED
#define TOOLS_GL2PS_UNINITIALIZED
Definition: gl2ps_def.h:55
tools_GL2PScontext::primitivetoadd
tools_GL2PSprimitive * primitivetoadd
Definition: gl2ps:229
tools_GL2PScontext::stream
FILE * stream
Definition: gl2ps:217
tools_GL2PScontext::sort
tools_GLint sort
Definition: gl2ps:207
tools_GL2PScontext
Definition: gl2ps:205
TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN
#define TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN
Definition: gl2ps:101
tools_GL2PSprimitive::pattern
tools_GLushort pattern
Definition: gl2ps:179
TOOLS_GL_CURRENT_RASTER_POSITION_VALID
#define TOOLS_GL_CURRENT_RASTER_POSITION_VALID
Definition: gl2ps_def.h:147
tools_GL2PScontext::blendfunc
tools_GLint blendfunc[2]
Definition: gl2ps:212
tools_GL2PSprimitive::ounits
tools_GLfloat ounits
Definition: gl2ps:182
tools_GL2PSvertex::xyz
tools_GL2PSxyz xyz
Definition: gl2ps_def.h:113
tools_GL2PSprimitive::culled
char culled
Definition: gl2ps:180
tools_GL2PScontext::lastlinewidth
tools_GLfloat lastlinewidth
Definition: gl2ps:211
tools_GL2PSprimitive::verts
tools_GL2PSvertex * verts
Definition: gl2ps:183
tools_GL2PScontext::producer
char * producer
Definition: gl2ps:209
tools_GL2PScontext::bgcolor
tools_GL2PSrgba bgcolor
Definition: gl2ps:213
TOOLS_GL2PS_SVG
#define TOOLS_GL2PS_SVG
Definition: gl2ps_def.h:38
tools_GL2PScontext::filename
char * filename
Definition: gl2ps:209
tools_GL2PSprimitive::numverts
tools_GLshort numverts
Definition: gl2ps:178
TOOLS_GL_COLOR_CLEAR_VALUE
#define TOOLS_GL_COLOR_CLEAR_VALUE
Definition: gl2ps_def.h:165
tools_GL2PScontext::compress
tools_GL2PScompress * compress
Definition: gl2ps:218
TOOLS_GL_POLYGON_OFFSET_FACTOR
#define TOOLS_GL_POLYGON_OFFSET_FACTOR
Definition: gl2ps_def.h:173
TOOLS_GL_RGBA
#define TOOLS_GL_RGBA
Definition: gl2ps_def.h:143
TOOLS_GL_LINE_STIPPLE_REPEAT
#define TOOLS_GL_LINE_STIPPLE_REPEAT
Definition: gl2ps_def.h:176
tools_GL2PScontext::feedback
tools_GLfloat * feedback
Definition: gl2ps:211
tools_GL2PScontext::header
tools_GLboolean header
Definition: gl2ps:219
tools_GL2PScontext::imagemap_head
tools_GL2PSimagemap * imagemap_head
Definition: gl2ps:244
TOOLS_GL_3D_COLOR
#define TOOLS_GL_3D_COLOR
Definition: gl2ps_def.h:171
tools_GL2PSimage::width
tools_GLsizei width
Definition: gl2ps:161
TOOLS_GL_VIEWPORT
#define TOOLS_GL_VIEWPORT
Definition: gl2ps_def.h:168
tools_GLint
int tools_GLint
Definition: gl2ps_def.h:7
tools_GL2PScontext::auxprimitives
tools_GL2PSlist * auxprimitives
Definition: gl2ps:216
TOOLS_GL_TRUE
#define TOOLS_GL_TRUE
Definition: gl2ps_def.h:133