Graphviz 13.0.0~dev.20241222.1117
Loading...
Searching...
No Matches
gdtclft.c File Reference
#include "config.h"
#include "gd.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tcl.h>
#include <util/agxbuf.h>
#include <util/startswith.h>
#include <util/streq.h>
Include dependency graph for gdtclft.c:

Go to the source code of this file.

Data Structures

struct  cmdDataOptions
 
struct  cmdImgOptions
 

Macros

#define IMGPTR(O)   (O->internalRep.otherValuePtr)
 

Typedefs

typedef int() GdDataFunction(Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
typedef int() GdImgFunction(Tcl_Interp *interp, gdImagePtr gdImg, int argc, const int args[])
 

Functions

static int tclGd_GetColor (Tcl_Interp *interp, Tcl_Obj *obj, int *color)
 
static int gdCmd (ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdCreateCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdDestroyCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdWriteCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdInterlaceCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdColorCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdColorNewCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdColorExactCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdColorClosestCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdColorResolveCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdColorFreeCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdColorTranspCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdColorGetCmd (Tcl_Interp *interp, gdImagePtr im, int argc, const int args[])
 
static int tclGdBrushCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdTileCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdStyleCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdSetCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdLineCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdRectCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdArcCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdPolygonCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdFillCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdCopyCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdGetCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdSizeCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
static int tclGdTextCmd (Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])
 
int Gdtclft_Init (Tcl_Interp *interp)
 
int Gdtclft_SafeInit (Tcl_Interp *interp)
 

Variables

static Tcl_UpdateStringProc GdPtrTypeUpdate
 
static Tcl_SetFromAnyProc GdPtrTypeSet
 
static Tcl_ObjType GdPtrType
 
Tcl_AppInitProc Gdtclft_Init
 
Tcl_AppInitProc Gdtclft_SafeInit
 
static GdDataFunction tclGdCreateCmd
 
static GdDataFunction tclGdDestroyCmd
 
static GdDataFunction tclGdWriteCmd
 
static GdDataFunction tclGdColorCmd
 
static GdDataFunction tclGdInterlaceCmd
 
static GdDataFunction tclGdSetCmd
 
static GdDataFunction tclGdLineCmd
 
static GdDataFunction tclGdRectCmd
 
static GdDataFunction tclGdArcCmd
 
static GdDataFunction tclGdFillCmd
 
static GdDataFunction tclGdSizeCmd
 
static GdDataFunction tclGdTextCmd
 
static GdDataFunction tclGdCopyCmd
 
static GdDataFunction tclGdGetCmd
 
static GdDataFunction tclGdWriteBufCmd
 
static GdDataFunction tclGdBrushCmd
 
static GdDataFunction tclGdStyleCmd
 
static GdDataFunction tclGdTileCmd
 
static GdDataFunction tclGdPolygonCmd
 
static GdImgFunction tclGdColorNewCmd
 
static GdImgFunction tclGdColorExactCmd
 
static GdImgFunction tclGdColorClosestCmd
 
static GdImgFunction tclGdColorResolveCmd
 
static GdImgFunction tclGdColorFreeCmd
 
static GdImgFunction tclGdColorTranspCmd
 
static GdImgFunction tclGdColorGetCmd
 
static cmdDataOptions subcmdVec []
 
static cmdImgOptions colorCmdVec []
 

Macro Definition Documentation

◆ IMGPTR

#define IMGPTR (   O)    (O->internalRep.otherValuePtr)

Definition at line 35 of file gdtclft.c.

Typedef Documentation

◆ GdDataFunction

typedef int() GdDataFunction(Tcl_Interp *interp, int argc, Tcl_Obj *const objv[])

Definition at line 47 of file gdtclft.c.

◆ GdImgFunction

typedef int() GdImgFunction(Tcl_Interp *interp, gdImagePtr gdImg, int argc, const int args[])

Definition at line 49 of file gdtclft.c.

Function Documentation

◆ gdCmd()

static int gdCmd ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 350 of file gdtclft.c.

References cmd, fname, GdPtrType, GdPtrTypeSet, cmdDataOptions::ishandle, cmdDataOptions::minargs, NULL, streq(), cmdDataOptions::subcmds, subcmdVec, and usage.

Referenced by Gdtclft_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gdtclft_Init()

int Gdtclft_Init ( Tcl_Interp *  interp)

Definition at line 1254 of file gdtclft.c.

References gdCmd(), and NULL.

Here is the call graph for this function:

◆ Gdtclft_SafeInit()

int Gdtclft_SafeInit ( Tcl_Interp *  interp)

Definition at line 1280 of file gdtclft.c.

References Gdtclft_Init.

◆ tclGd_GetColor()

static int tclGd_GetColor ( Tcl_Interp *  interp,
Tcl_Obj *  obj,
int *  color 
)
static

Definition at line 179 of file gdtclft.c.

References color().

Referenced by tclGdArcCmd(), tclGdFillCmd(), tclGdLineCmd(), tclGdPolygonCmd(), tclGdRectCmd(), tclGdSetCmd(), and tclGdTextCmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tclGdArcCmd()

static int tclGdArcCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 970 of file gdtclft.c.

References cmd, color(), IMGPTR, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdBrushCmd()

static int tclGdBrushCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 820 of file gdtclft.c.

References IMGPTR.

◆ tclGdColorClosestCmd()

static int tclGdColorClosestCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 740 of file gdtclft.c.

References color().

Here is the call graph for this function:

◆ tclGdColorCmd()

static int tclGdColorCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 665 of file gdtclft.c.

References cmd, cmdImgOptions::cmd, colorCmdVec, cmdImgOptions::f, IMGPTR, cmdImgOptions::minargs, streq(), and usage.

Here is the call graph for this function:

◆ tclGdColorExactCmd()

static int tclGdColorExactCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 729 of file gdtclft.c.

References color().

Here is the call graph for this function:

◆ tclGdColorFreeCmd()

static int tclGdColorFreeCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 762 of file gdtclft.c.

◆ tclGdColorGetCmd()

static int tclGdColorGetCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 785 of file gdtclft.c.

References NULL.

◆ tclGdColorNewCmd()

static int tclGdColorNewCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 718 of file gdtclft.c.

References color().

Here is the call graph for this function:

◆ tclGdColorResolveCmd()

static int tclGdColorResolveCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 751 of file gdtclft.c.

References color().

Here is the call graph for this function:

◆ tclGdColorTranspCmd()

static int tclGdColorTranspCmd ( Tcl_Interp *  interp,
gdImagePtr  im,
int  argc,
const int  args[] 
)
static

Definition at line 771 of file gdtclft.c.

References color().

Here is the call graph for this function:

◆ tclGdCopyCmd()

static int tclGdCopyCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 1119 of file gdtclft.c.

References IMGPTR.

◆ tclGdCreateCmd()

static int tclGdCreateCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 414 of file gdtclft.c.

References cmd, GdPtrType, IMGPTR, NULL, and streq().

Here is the call graph for this function:

◆ tclGdDestroyCmd()

static int tclGdDestroyCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 526 of file gdtclft.c.

References IMGPTR.

◆ tclGdFillCmd()

static int tclGdFillCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 1092 of file gdtclft.c.

References color(), IMGPTR, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdGetCmd()

static int tclGdGetCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 1156 of file gdtclft.c.

References color(), and IMGPTR.

Here is the call graph for this function:

◆ tclGdInterlaceCmd()

static int tclGdInterlaceCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 642 of file gdtclft.c.

References IMGPTR.

◆ tclGdLineCmd()

static int tclGdLineCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 911 of file gdtclft.c.

References color(), IMGPTR, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdPolygonCmd()

static int tclGdPolygonCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 1027 of file gdtclft.c.

References cmd, color(), IMGPTR, NULL, out(), points, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdRectCmd()

static int tclGdRectCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 938 of file gdtclft.c.

References cmd, color(), IMGPTR, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdSetCmd()

static int tclGdSetCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 888 of file gdtclft.c.

References color(), IMGPTR, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdSizeCmd()

static int tclGdSizeCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 1177 of file gdtclft.c.

References IMGPTR.

◆ tclGdStyleCmd()

static int tclGdStyleCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 852 of file gdtclft.c.

References IMGPTR, and NULL.

◆ tclGdTextCmd()

static int tclGdTextCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 1192 of file gdtclft.c.

References color(), error, GdPtrType, GdPtrTypeSet, IMGPTR, len(), NULL, str, and tclGd_GetColor().

Here is the call graph for this function:

◆ tclGdTileCmd()

static int tclGdTileCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 836 of file gdtclft.c.

References IMGPTR.

◆ tclGdWriteCmd()

static int tclGdWriteCmd ( Tcl_Interp *  interp,
int  argc,
Tcl_Obj *const  objv[] 
)
static

Definition at line 540 of file gdtclft.c.

References cmd, fname, IMGPTR, NULL, and streq().

Here is the call graph for this function:

Variable Documentation

◆ colorCmdVec

cmdImgOptions colorCmdVec[]
static
Initial value:
= {
{"new", tclGdColorNewCmd, 5, 5, "red green blue"},
{"exact", tclGdColorExactCmd, 5, 5, "red green blue"},
{"closest", tclGdColorClosestCmd, 5, 5, "red green blue"},
{"resolve", tclGdColorResolveCmd, 5, 5, "red green blue"},
{"free", tclGdColorFreeCmd, 3, 3, "color"},
{"transparent", tclGdColorTranspCmd, 2, 3, "?color?"},
{"get", tclGdColorGetCmd, 2, 3, "?color?"}}
static GdImgFunction tclGdColorGetCmd
Definition gdtclft.c:60
static GdImgFunction tclGdColorTranspCmd
Definition gdtclft.c:59
static GdImgFunction tclGdColorResolveCmd
Definition gdtclft.c:59
static GdImgFunction tclGdColorNewCmd
Definition gdtclft.c:58
static GdImgFunction tclGdColorFreeCmd
Definition gdtclft.c:59
static GdImgFunction tclGdColorExactCmd
Definition gdtclft.c:58
static GdImgFunction tclGdColorClosestCmd
Definition gdtclft.c:58

Definition at line 167 of file gdtclft.c.

Referenced by tclGdColorCmd().

◆ GdPtrType

Tcl_ObjType GdPtrType
static
Initial value:
= {.name = "gd",
.updateStringProc = GdPtrTypeUpdate,
.setFromAnyProc = GdPtrTypeSet}
static Tcl_UpdateStringProc GdPtrTypeUpdate
Definition gdtclft.c:30
static Tcl_SetFromAnyProc GdPtrTypeSet
Definition gdtclft.c:31

Definition at line 32 of file gdtclft.c.

Referenced by gdCmd(), tclGdCreateCmd(), and tclGdTextCmd().

◆ GdPtrTypeSet

Tcl_SetFromAnyProc GdPtrTypeSet
static

Definition at line 31 of file gdtclft.c.

Referenced by gdCmd(), and tclGdTextCmd().

◆ GdPtrTypeUpdate

Tcl_UpdateStringProc GdPtrTypeUpdate
static

Definition at line 30 of file gdtclft.c.

◆ Gdtclft_Init

Tcl_AppInitProc Gdtclft_Init

Definition at line 41 of file gdtclft.c.

Referenced by Gdtclft_SafeInit(), and Tcldot_Init().

◆ Gdtclft_SafeInit

Tcl_AppInitProc Gdtclft_SafeInit

Definition at line 45 of file gdtclft.c.

◆ subcmdVec

cmdDataOptions subcmdVec[]
static

Definition at line 79 of file gdtclft.c.

Referenced by gdCmd().

◆ tclGdArcCmd

GdDataFunction tclGdArcCmd
static

Definition at line 54 of file gdtclft.c.

◆ tclGdBrushCmd

GdDataFunction tclGdBrushCmd
static

Definition at line 55 of file gdtclft.c.

◆ tclGdColorClosestCmd

GdImgFunction tclGdColorClosestCmd
static

Definition at line 58 of file gdtclft.c.

◆ tclGdColorCmd

GdDataFunction tclGdColorCmd
static

Definition at line 53 of file gdtclft.c.

◆ tclGdColorExactCmd

GdImgFunction tclGdColorExactCmd
static

Definition at line 58 of file gdtclft.c.

◆ tclGdColorFreeCmd

GdImgFunction tclGdColorFreeCmd
static

Definition at line 59 of file gdtclft.c.

◆ tclGdColorGetCmd

GdImgFunction tclGdColorGetCmd
static

Definition at line 60 of file gdtclft.c.

◆ tclGdColorNewCmd

GdImgFunction tclGdColorNewCmd
static

Definition at line 58 of file gdtclft.c.

◆ tclGdColorResolveCmd

GdImgFunction tclGdColorResolveCmd
static

Definition at line 59 of file gdtclft.c.

◆ tclGdColorTranspCmd

GdImgFunction tclGdColorTranspCmd
static

Definition at line 59 of file gdtclft.c.

◆ tclGdCopyCmd

GdDataFunction tclGdCopyCmd
static

Definition at line 54 of file gdtclft.c.

◆ tclGdCreateCmd

GdDataFunction tclGdCreateCmd
static

Definition at line 52 of file gdtclft.c.

◆ tclGdDestroyCmd

GdDataFunction tclGdDestroyCmd
static

Definition at line 52 of file gdtclft.c.

◆ tclGdFillCmd

GdDataFunction tclGdFillCmd
static

Definition at line 54 of file gdtclft.c.

◆ tclGdGetCmd

GdDataFunction tclGdGetCmd
static

Definition at line 55 of file gdtclft.c.

◆ tclGdInterlaceCmd

GdDataFunction tclGdInterlaceCmd
static

Definition at line 53 of file gdtclft.c.

◆ tclGdLineCmd

GdDataFunction tclGdLineCmd
static

Definition at line 53 of file gdtclft.c.

◆ tclGdPolygonCmd

GdDataFunction tclGdPolygonCmd
static

Definition at line 56 of file gdtclft.c.

◆ tclGdRectCmd

GdDataFunction tclGdRectCmd
static

Definition at line 53 of file gdtclft.c.

◆ tclGdSetCmd

GdDataFunction tclGdSetCmd
static

Definition at line 53 of file gdtclft.c.

◆ tclGdSizeCmd

GdDataFunction tclGdSizeCmd
static

Definition at line 54 of file gdtclft.c.

◆ tclGdStyleCmd

GdDataFunction tclGdStyleCmd
static

Definition at line 55 of file gdtclft.c.

◆ tclGdTextCmd

GdDataFunction tclGdTextCmd
static

Definition at line 54 of file gdtclft.c.

◆ tclGdTileCmd

GdDataFunction tclGdTileCmd
static

Definition at line 55 of file gdtclft.c.

◆ tclGdWriteBufCmd

GdDataFunction tclGdWriteBufCmd
static

Definition at line 55 of file gdtclft.c.

◆ tclGdWriteCmd

GdDataFunction tclGdWriteCmd
static

Definition at line 52 of file gdtclft.c.