Navigation C API Pages Python bindings Applications

Environment Variables

The GFXprim library behavior may be changed by a couple of environment variables:

GP_THREADS

GP_THREADS overrides GP_NrThreadsSet() settings. The value is the same as it would have been set by GP_NrThreadsSet() which is described in the table bellow:

Table 1. GP_THREADS possible values
Value Description

0

Use auto-detection, algorithms runs in nCPU threads unless the image buffer is too small.

1

Use one thread only.

>=2

Use N threads unless the image buffer is too small.

GP_DEBUG

The GP_DEBUG environment variable may be used to set library debug level. See debug messages description for more information.

The variable and its value is used only once at the time first debug message is about to be printed.

The debug level is an integer number, the higher it is the more verbose messages are printed. Current the maximum used in GFXprim sources is 4, this may change in the future. Use GP_DEBUG=10 to enable all debug messages for sure.

The output is, by default, written to stderr and will look like:

1: GP_Debug.c:GP_DebugPrint():67: Using debug level GP_DEBUG=10 from enviroment variable
1: GP_Debug.c:GP_DebugPrint():71: GFXprim library version 1.0.0-rc0
1: GP_X11_Conn.h:x11_open():43: Opening X11 display '(null)'
1: GP_InputDriverX11.c:init_table():154: Initializing X11 KeyCode table
  3: GP_InputDriverX11.c:init_table():174: Mapping Key 'Up' KeySym 'Up' (65362) to KeyCode 111
...
1: GP_Loader.c:loader_by_filename():222: Loading file by filename extension 'pgm'
1: GP_Loader.c:loader_by_extension():198: Found loader 'Netpbm portable Graymap'
1: GP_PNM.c:load_header():244: Have header P2 (ASCII encoded PGM) 24x7 depth=15
1: GP_Context.c:GP_ContextAlloc():62: Allocating context 24 x 7 - G4
   4: GP_X11.c:x11_update_rect():71: Updating rect 222x458-418x479
   4: GP_X11.c:x11_update_rect():71: Updating rect 214x458-426x479
 2: GP_Blit.c:GP_BlitXYXY_Clipped():129: Blitting 23x6, available 332x244
 2: GP_Blit.c:GP_BlitXYXY_Clipped():139: Blitting 0x0->23x6 in 24x7 to 308x236 in 640x480
  3: GP_X11.c:x11_set_attributes():225: Setting window caption to 'Spiv ~ test.pgm 1:1.000'
   4: GP_X11.c:x11_flip():91: Flipping context
1: GP_Context.c:GP_ContextFree():102: Freeing context (0x7f5008000b60)
1: GP_X11_Conn.h:x11_close():72: Closing X11 display