#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"
Go to the source code of this file.
|
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) |
|
◆ tools_gl2ps
Definition at line 2 of file gl2ps.
◆ TOOLS_GL2PS_BEGIN_BLEND_TOKEN
#define TOOLS_GL2PS_BEGIN_BLEND_TOKEN 11 |
◆ 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 |
◆ 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 |
◆ TOOLS_GL2PS_DST_BLEND_TOKEN
#define TOOLS_GL2PS_DST_BLEND_TOKEN 14 |
◆ TOOLS_GL2PS_END_BLEND_TOKEN
#define TOOLS_GL2PS_END_BLEND_TOKEN 12 |
◆ TOOLS_GL2PS_END_BOUNDARY_TOKEN
#define TOOLS_GL2PS_END_BOUNDARY_TOKEN 4 |
◆ 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 |
◆ 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 |
◆ 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 |
◆ TOOLS_GL2PS_LINE_JOIN_TOKEN
#define TOOLS_GL2PS_LINE_JOIN_TOKEN 9 |
◆ TOOLS_GL2PS_LINE_WIDTH_TOKEN
#define TOOLS_GL2PS_LINE_WIDTH_TOKEN 10 |
◆ 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 |
◆ 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 |
◆ TOOLS_GL2PS_TEXT_TOKEN
#define TOOLS_GL2PS_TEXT_TOKEN 17 |
◆ 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.
◆ tools_GL2PSbsptree
◆ tools_GL2PSbsptree2d
◆ tools_GL2PSimagemap
◆ tools_GL2PSplane
◆ 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.
◆ 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.
2246 prim->
offset = (char)offset;
2251 prim->
width = width;
2259 tools_gl2psListAdd(tools_gl2ps_context->
primitives, &prim);
◆ 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.
5937 if(tools_gl2ps_context){
5938 tools_gl2psMsg(
TOOLS_GL2PS_ERROR,
"tools_gl2psBeginPage called in wrong program state");
5945 if (tools_gl2psCheckOptions(options, colormode) ==
TOOLS_GL_FALSE) {
5946 tools_gl2psFree(tools_gl2ps_context);
5947 tools_gl2ps_context = NULL;
5951 if(format >= 0 && format < (
tools_GLint)(
sizeof(tools_gl2psbackends) /
sizeof(tools_gl2psbackends[0]))){
5952 tools_gl2ps_context->
format = format;
5956 tools_gl2psFree(tools_gl2ps_context);
5957 tools_gl2ps_context = NULL;
5965 tools_gl2ps_context->
sort = sort;
5969 tools_gl2psFree(tools_gl2ps_context);
5970 tools_gl2ps_context = NULL;
5975 tools_gl2ps_context->
stream = stream;
5979 tools_gl2psFree(tools_gl2ps_context);
5980 tools_gl2ps_context = NULL;
5987 tools_gl2ps_context->
options = options;
5988 tools_gl2ps_context->
compress = NULL;
5996 for(i = 0; i < 4; i++){
5997 tools_gl2ps_context->
viewport[i] = viewport[i];
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)",
6005 tools_gl2psFree(tools_gl2ps_context);
6006 tools_gl2ps_context = NULL;
6013 tools_gl2ps_context->
colormode = colormode;
6014 tools_gl2ps_context->
buffersize = buffersize > 0 ? buffersize : 2048 * 2048;
6015 for(i = 0; i < 3; i++){
6018 for(i = 0; i < 4; i++){
6020 tools_gl2ps_context->
lastrgba[i] = -1.0F;
6032 tools_gl2ps_context->
xreflist = NULL;
6048 tools_gl2ps_context->
colormap = NULL;
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;
6060 tools_gl2ps_context->
colorsize = colorsize;
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;
6070 tools_gl2psMsg(
TOOLS_GL2PS_ERROR,
"Unknown color mode in tools_gl2psBeginPage");
6071 tools_gl2psFree(tools_gl2ps_context);
6072 tools_gl2ps_context = NULL;
6077 tools_gl2ps_context->
title = (
char*)tools_gl2psMalloc(
sizeof(
char));
6078 tools_gl2ps_context->
title[0] =
'\0';
6081 tools_gl2ps_context->
title = (
char*)tools_gl2psMalloc((strlen(title)+1)*
sizeof(
char));
6082 strcpy(tools_gl2ps_context->
title, title);
6086 tools_gl2ps_context->
producer = (
char*)tools_gl2psMalloc(
sizeof(
char));
6087 tools_gl2ps_context->
producer[0] =
'\0';
6090 tools_gl2ps_context->
producer = (
char*)tools_gl2psMalloc((strlen(producer)+1)*
sizeof(
char));
6091 strcpy(tools_gl2ps_context->
producer, producer);
6095 tools_gl2ps_context->
filename = (
char*)tools_gl2psMalloc(
sizeof(
char));
6096 tools_gl2ps_context->
filename[0] =
'\0';
6099 tools_gl2ps_context->
filename = (
char*)tools_gl2psMalloc((strlen(filename)+1)*
sizeof(
char));
6100 strcpy(tools_gl2ps_context->
filename, filename);
6112 tools_gl2ps_context->
feedback = NULL;
◆ tools_gl2psBeginViewport()
◆ tools_gl2psBlendFunc()
◆ tools_gl2psDisable()
◆ tools_gl2psDrawImageMap()
Definition at line 6313 of file gl2ps.
6323 size = height + height * ((width - 1) / 8);
6326 tools_glVertex3f(position[0], position[1],position[2]);
6330 for(i = 0; i <
size; i += sizeoffloat){
6331 const float *value = (
const float*)imagemap;
6332 tools_glPassThrough(*value);
6333 imagemap += sizeoffloat;
◆ tools_gl2psDrawPixels()
Definition at line 6199 of file gl2ps.
6218 "TOOLS_GL_RGB/TOOLS_GL_RGBA, TOOLS_GL_FLOAT pixels");
6244 prim->
verts[0].
xyz[0] = pos[0] + xorig;
6245 prim->
verts[0].
xyz[1] = pos[1] + yorig;
6278 size = height * width * 3;
6281 for(i = 0; i <
size; ++i, ++piv){
6288 size = height * width * 4;
6295 size = height * width * 3;
6303 tools_gl2psListAdd(tools_gl2ps_context->
auxprimitives, &prim);
6307 tools_gl2psListAdd(tools_gl2ps_context->
primitives, &prim);
◆ tools_gl2psEnable()
Definition at line 6338 of file gl2ps.
6349 tools_glPassThrough(tmp2);
6351 tools_glPassThrough(tmp2);
◆ tools_gl2psEndPage()
Definition at line 6119 of file gl2ps.
6125 res = tools_gl2psPrintPrimitives();
6130 fflush(tools_gl2ps_context->
stream);
6132 tools_gl2psListDelete(tools_gl2ps_context->
primitives);
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;
◆ tools_gl2psEndViewport()
Definition at line 6155 of file gl2ps.
6164 tools_gl2psResetLineProperties();
◆ tools_gl2psForceRasterPos()
Definition at line 6500 of file gl2ps.
6503 if(!tools_gl2ps_context) {
◆ tools_gl2psGetFileExtension()
Definition at line 6479 of file gl2ps.
6481 if(format >= 0 && format < (
tools_GLint)(
sizeof(tools_gl2psbackends) /
sizeof(tools_gl2psbackends[0])))
6484 return "Unknown format";
◆ tools_gl2psGetFileFormat()
Definition at line 6495 of file gl2ps.
6497 return tools_gl2ps_context->
format;
◆ tools_gl2psGetFormatDescription()
Definition at line 6487 of file gl2ps.
6489 if(format >= 0 && format < (
tools_GLint)(
sizeof(tools_gl2psbackends) /
sizeof(tools_gl2psbackends[0])))
6492 return "Unknown format";
◆ tools_gl2psGetOptions()
Definition at line 6467 of file gl2ps.
6469 if(!tools_gl2ps_context) {
6474 *options = tools_gl2ps_context->
options;
◆ tools_gl2psLineCap()
Definition at line 6409 of file gl2ps.
6414 tools_glPassThrough(value);
◆ tools_gl2psLineJoin()
◆ tools_gl2psLineWidth()
◆ tools_gl2psPointSize()
Definition at line 6399 of file gl2ps.
6404 tools_glPassThrough(value);
◆ tools_gl2psSetOptions()
Definition at line 6454 of file gl2ps.
6462 tools_gl2ps_context->
options = options;
◆ tools_gl2psSpecial()
◆ tools_gl2psSpecialColor()
◆ tools_gl2psText()
◆ tools_tools_gl2psTextOpt()
Definition at line 6177 of file gl2ps.
6180 return tools_gl2psAddText(
TOOLS_GL2PS_TEXT, str, fontname, fontsize, alignment, angle, NULL);
◆ tools_tools_gl2psTextOptColor()
Definition at line 6169 of file gl2ps.
6173 return tools_gl2psAddText(
TOOLS_GL2PS_TEXT, str, fontname, fontsize, alignment, angle,
#define TOOLS_GL_BLEND_SRC
#define TOOLS_GL2PS_DST_BLEND_TOKEN
#define TOOLS_GL2PS_LINE_JOIN_TOKEN
#define TOOLS_GL2PS_USE_CURRENT_VIEWPORT
tools_GL2PSvertex rasterpos
TOOLS_GL2PS_TRIANGLE_PROPERTY
#define TOOLS_GL2PS_PIXMAP
#define TOOLS_GL2PS_SPECIAL
tools_GL2PSlist * pdfprimlist
#define TOOLS_GL2PS_NO_PIXMAP
#define TOOLS_GL2PS_POLYGON_BOUNDARY
#define TOOLS_GL_CURRENT_RASTER_COLOR
#define TOOLS_GL2PS_POLYGON_OFFSET_FILL
tools_GL2PSimagemap * imagemap_tail
#define TOOLS_GL2PS_IMAGEMAP_TOKEN
#define TOOLS_GL2PS_LINE_STIPPLE
#define TOOLS_GL2PS_END_OFFSET_TOKEN
#define TOOLS_GL2PS_POINT_SIZE_TOKEN
tools_GL2PSrgba threshold
#define TOOLS_GL2PS_END_STIPPLE_TOKEN
#define TOOLS_GL2PS_BEGIN_BOUNDARY_TOKEN
#define TOOLS_GL_INDEX_CLEAR_VALUE
#define TOOLS_GL_FEEDBACK
tools_GL2PSrgba * colormap
tools_GLboolean forcerasterpos
#define TOOLS_GL_POLYGON_OFFSET_UNITS
#define TOOLS_GL_CURRENT_RASTER_POSITION
#define TOOLS_GL2PS_END_BOUNDARY_TOKEN
#define TOOLS_GL2PS_SUCCESS
#define TOOLS_GL2PS_BSP_SORT
tools_GL2PSlist * primitives
#define TOOLS_GL2PS_END_BLEND_TOKEN
#define TOOLS_GL2PS_BLEND
#define TOOLS_GL2PS_LINE_WIDTH_TOKEN
#define TOOLS_GL2PS_NO_BLENDING
#define TOOLS_GL2PS_BEGIN_OFFSET_TOKEN
#define TOOLS_GL2PS_SIMPLE_SORT
#define TOOLS_GL2PS_WARNING
#define TOOLS_GL_BLEND_DST
#define TOOLS_GL2PS_TEXT_BL
unsigned char tools_GLboolean
tools_GLushort lastpattern
tools_GLfloat tools_GL2PSrgba[4]
#define TOOLS_GL2PS_LINE_CAP_TOKEN
#define TOOLS_GL_COLOR_INDEX
#define TOOLS_GL2PS_BEGIN_BLEND_TOKEN
#define TOOLS_GL_LINE_STIPPLE_PATTERN
#define TOOLS_GL2PS_SRC_BLEND_TOKEN
#define TOOLS_GL2PS_ERROR
tools_GL2PSvertex lastvertex
#define TOOLS_GL2PS_NO_OPENGL_CONTEXT
tools_GLboolean zerosurfacearea
tools_GL2PSbsptree2d * imagetree
tools_GL2PSlist * pdfgrouplist
#define TOOLS_GL2PS_DRAW_PIXELS_TOKEN
#define TOOLS_GL2PS_OVERFLOW
#define TOOLS_GL2PS_NO_SORT
#define TOOLS_GL2PS_UNINITIALIZED
tools_GL2PSprimitive * primitivetoadd
#define TOOLS_GL2PS_BEGIN_STIPPLE_TOKEN
#define TOOLS_GL_CURRENT_RASTER_POSITION_VALID
tools_GLfloat lastlinewidth
#define TOOLS_GL_COLOR_CLEAR_VALUE
tools_GL2PScompress * compress
#define TOOLS_GL_POLYGON_OFFSET_FACTOR
#define TOOLS_GL_LINE_STIPPLE_REPEAT
tools_GL2PSimagemap * imagemap_head
#define TOOLS_GL_3D_COLOR
#define TOOLS_GL_VIEWPORT
tools_GL2PSlist * auxprimitives