c:\harbour\contrib\hbgd
gdwrp.c |
Type | Function | Source | Line |
STATIC HB_GARBAGE_FUNC( | hb_gdImage_Destructor )
static HB_GARBAGE_FUNC( hb_gdImage_Destructor )
{
/* Retrieve image pointer holder */
gdImagePtr * imPtr = ( gdImagePtr * ) Cargo;
/* Check if pointer is not NULL to avoid multiple freeing */
if( * imPtr )
{
/* Destroy the image */
gdImageDestroy( * imPtr );
/* set pointer to NULL to avoid multiple freeing */
* imPtr = NULL;
}
}
| gdwrp.c | 101 |
STATIC GDIMAGEPTR | hb_parGdImage( int iParam )
static gdImagePtr hb_parGdImage( int iParam )
{
gdImagePtr * imPtr =
( gdImagePtr * ) hb_parptrGC( hb_gdImage_Destructor, iParam );
if( imPtr )
return * imPtr;
else
return NULL;
}
| gdwrp.c | 121 |
STATIC VOID | hb_retGdImage( gdImagePtr im )
static void hb_retGdImage( gdImagePtr im )
{
gdImagePtr * imPtr;
imPtr = ( gdImagePtr * ) hb_gcAlloc( sizeof( gdImagePtr ),
hb_gdImage_Destructor );
* imPtr = im;
hb_retptrGC( ( void * ) imPtr );
}
| gdwrp.c | 137 |
STATIC PHB_ITEM | hb_gdImageItemNew( gdImagePtr im )
static PHB_ITEM hb_gdImageItemNew( gdImagePtr im )
{
gdImagePtr * imPtr;
imPtr = ( gdImagePtr * ) hb_gcAlloc( sizeof( gdImagePtr ),
hb_gdImage_Destructor );
* imPtr = im;
return hb_itemPutPtrGC( NULL, ( void * ) imPtr );
}
#endif
| gdwrp.c | 152 |
STATIC HB_GARBAGE_FUNC( | hb_gdFont_Destructor )
static HB_GARBAGE_FUNC( hb_gdFont_Destructor )
{
/* Retrieve Font pointer holder */
gdFontPtr * fontPtr = ( gdFontPtr * ) Cargo;
/* Check if pointer is not NULL to avoid multiple freeing */
if( * fontPtr )
{
/* Destroy the Font */
#if 0
/* do nothing, GD handles it directly and gdFontDestroy() not exists */
gdFontDestroy( * fontPtr );
#endif
/* set pointer to NULL to avoid multiple freeing */
* fontPtr = NULL;
}
}
| gdwrp.c | 170 |
STATIC GDFONTPTR | hb_parGdFont( int iParam )
static gdFontPtr hb_parGdFont( int iParam )
{
gdFontPtr * fontPtr =
( gdFontPtr * ) hb_parptrGC( hb_gdFont_Destructor, iParam );
if( fontPtr )
return * fontPtr;
else
return NULL;
}
| gdwrp.c | 193 |
STATIC VOID | hb_retGdFont( gdFontPtr font )
static void hb_retGdFont( gdFontPtr font )
{
gdFontPtr * fontPtr;
fontPtr = ( gdFontPtr * ) hb_gcAlloc( sizeof( gdFontPtr ),
hb_gdFont_Destructor );
* fontPtr = font;
hb_retptrGC( ( void * ) fontPtr );
}
| gdwrp.c | 209 |
STATIC PHB_ITEM | hb_gdFontItemNew( gdFontPtr font )
static PHB_ITEM hb_gdFontItemNew( gdFontPtr font )
{
gdFontPtr * fontPtr;
fontPtr = ( gdFontPtr * ) hb_gcAlloc( sizeof( gdFontPtr ),
hb_gdFont_Destructor );
* fontPtr = font;
return hb_itemPutPtrGC( NULL, ( void * ) fontPtr );
}
#endif
| gdwrp.c | 224 |
STATIC VOID * | LoadImageFromHandle( FHANDLE fhandle, int sz )
static void * LoadImageFromHandle( FHANDLE fhandle, int sz )
{
void *iptr;
if ( !( fhandle ) )
{
fhandle = 0; /* 0 = std input */
}
/* Read file */
iptr = ( BYTE * ) hb_xgrab( sz );
hb_fsReadLarge( fhandle, ( BYTE *) iptr, (ULONG) sz );
/* TraceLog( NULL, "Error dim %i, read %i", sz, iRead ); */
return iptr;
}
| gdwrp.c | 239 |
STATIC VOID * | LoadImageFromFile( char *szFile, int *sz )
static void * LoadImageFromFile( char *szFile, int *sz )
{
void *iptr;
FHANDLE fhandle;
if ( ( fhandle = hb_fsOpen( ( BYTE * ) szFile, FO_READ ) ) != FS_ERROR )
{
/* get lenght */
*sz = hb_fsSeek( fhandle, 0, FS_END );
/* rewind */
hb_fsSeek( fhandle, 0, FS_SET );
/* Read file */
iptr = ( BYTE * ) hb_xgrab( *sz );
hb_fsReadLarge( fhandle, ( BYTE *) iptr, (ULONG) *sz );
/* TraceLog( NULL, "Error dim %i, read %i", sz, iRead ); */
/* Close file */
hb_fsClose( fhandle );
}
else
{
/* File error */
iptr = NULL;
*sz = 0;
}
return iptr;
}
| gdwrp.c | 259 |
STATIC VOID | SaveImageToHandle( FHANDLE fhandle, void *iptr, int sz )
static void SaveImageToHandle( FHANDLE fhandle, void *iptr, int sz )
{
if ( !(fhandle) )
{
fhandle = 1; /* 1 = std output */
}
/* Write Image */
hb_fsWriteLarge( fhandle, ( BYTE *) iptr, (ULONG) sz );
}
| gdwrp.c | 292 |
STATIC VOID | SaveImageToFile( char *szFile, void *iptr, int sz )
static void SaveImageToFile( char *szFile, void *iptr, int sz )
{
FHANDLE fhandle;
if ( ( fhandle = hb_fsCreate( ( BYTE * ) szFile, FC_NORMAL ) ) != FS_ERROR )
{
/* Write Image */
SaveImageToHandle( fhandle, ( BYTE *) iptr, (ULONG) sz );
/* Close file */
hb_fsClose( fhandle );
}
}
| gdwrp.c | 305 |
STATIC VOID | GDImageCreateFrom( int nType )
static void GDImageCreateFrom( int nType )
{
gdImagePtr im = NULL;
char *szFile;
int sz;
void *iptr;
/*TraceLog( NULL, "Params = %i, 1 = %i, 2 = %i \n\r", hb_pcount(), hb_parinfo( 1 ), hb_parinfo( 2 ) );*/
if ( hb_pcount() == 1 &&
( hb_parinfo( 1 ) & HB_IT_STRING )
)
{
/* Retrieve file name */
szFile = hb_parcx( 1 );
/* Retrieve image */
iptr = LoadImageFromFile( szFile, &sz );
}
/* From Image Pointer + size */
else if ( hb_pcount() == 2 &&
( hb_parinfo( 1 ) & HB_IT_POINTER ) &&
( hb_parinfo( 2 ) & HB_IT_NUMERIC )
)
{
/* Retrieve image pointer */
iptr = hb_parGdImage( 1 );
/* Retrieve image size */
sz = hb_parni( 2 );
}
/* From file handle */
else if ( hb_pcount() == 2 &&
( hb_parinfo( 1 ) & HB_IT_NUMERIC ) &&
( hb_parinfo( 2 ) & HB_IT_NUMERIC )
)
{
FHANDLE fhandle;
/* Retrieve file handle */
fhandle = ( hb_parinfo( 1 ) & HB_IT_NUMERIC ) ? hb_parnl( 1 ) : 0; /* 0 = std input */
/* Retrieve image size */
sz = hb_parni( 2 );
/* retrieve image from handle */
iptr = LoadImageFromHandle( fhandle, sz );
}
else
{
/* Parameter error */
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
"GDIMAGECREATEFROM*", 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
if ( iptr && sz )
{
/* Create Image */
switch ( nType )
{
case IMAGE_JPEG :
im = gdImageCreateFromJpegPtr( sz, ( BYTE *) iptr );
break;
case IMAGE_GIF :
im = gdImageCreateFromGifPtr( sz, ( BYTE *) iptr );
break;
case IMAGE_PNG :
im = gdImageCreateFromPngPtr( sz, ( BYTE *) iptr );
break;
case IMAGE_WBMP :
im = gdImageCreateFromWBMPPtr( sz, ( BYTE *) iptr );
break;
case IMAGE_GD :
im = gdImageCreateFromGdPtr( sz, ( BYTE *) iptr );
break;
}
/* Return image pointer */
hb_retGdImage( im );
/* Free memory */
hb_xfree( iptr );
}
}
| gdwrp.c | 321 |
STATIC VOID | GDImageSaveTo( int nType )
static void GDImageSaveTo( int nType )
{
if ( hb_pcount() >= 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
char *szFile;
int sz;
void *iptr = NULL;
FHANDLE fhandle;
int level = 0, fg = 0;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Get file name or an output handler or NIL it I want a return string */
if ( !( ISNIL(2) ||
hb_parinfo( 2 ) & HB_IT_STRING ||
hb_parinfo( 2 ) & HB_IT_NUMERIC ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 0,
"Second argument must be NIL or numeric or a string.",
"GDIMAGE* (Save functions)", 2,
hb_paramError( 2 ) );
return;
}
/* Retrieve compression level */
/*TraceLog( NULL, "Count = %i\n\r", hb_pcount() ); */
/* check if is numeric */
if ( !( ISNIL(3) || hb_parinfo( 3 ) & HB_IT_NUMERIC ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 0,
"Tirdh argument must be NIL or numeric.",
"GDIMAGE* (Save functions)", 1,
hb_paramError( 3 ) );
return;
}
if ( nType == IMAGE_JPEG )
{
/* check range */
level = ( hb_parinfo( 3 ) & HB_IT_NUMERIC ? hb_parni( 3 ) : -1 );
if ( !( level >= -1 && level <= 95 ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 0,
"Compression level must be -1 (default) or a value between 0 and 95.",
"GDIMAGEJPEG (Save functions)", 1,
hb_paramError( 3 ) );
return;
}
}
else if ( nType == IMAGE_PNG )
{
/* check range */
level = ( hb_parinfo( 3 ) & HB_IT_NUMERIC ? hb_parni( 3 ) : -1 );
if ( !( level >= -1 && level <= 9 ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 0,
"Compression level must be -1 (default) or a value between 0 and 9.",
"GDIMAGEPNG (Save functions)", 1,
hb_paramError( 3 ) );
return;
}
}
else if ( nType == IMAGE_WBMP )
{
if ( !( hb_parinfo( 3 ) & HB_IT_NUMERIC ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 0,
"Foreground color nedeed",
"GDIMAGEWBMP (Save functions)", 1,
hb_paramError( 3 ) );
return;
}
fg = hb_parni( 3 );
}
switch ( nType )
{
case IMAGE_JPEG :
/* Get image Ptr */
iptr = gdImageJpegPtr (im, &sz, level);
break;
case IMAGE_GIF :
/* Get image Ptr */
iptr = gdImageGifPtr (im, &sz);
break;
case IMAGE_PNG :
/* Get image Ptr */
iptr = gdImagePngPtrEx (im, &sz, level);
break;
case IMAGE_WBMP :
/* Get image Ptr */
iptr = gdImageWBMPPtr (im, &sz, fg);
break;
case IMAGE_GD :
/* Get image Ptr */
iptr = gdImageGdPtr (im, &sz);
break;
}
/* If i get a file name */
if ( hb_parinfo( 2 ) & HB_IT_STRING )
{
szFile = hb_parcx( 2 );
SaveImageToFile( szFile, iptr, sz );
}
/* Write to file handle (1 = std output) */
else if ( hb_parinfo( 2 ) & HB_IT_NUMERIC )
{
/* Write to std output or to a passed file */
fhandle = ( hb_parnl( 2 ) > -1 ) ? hb_parnl( 2 ) : 1 ; /* 1 = std output */
/* Write Image */
SaveImageToHandle( fhandle, iptr, sz );
}
/* Return image as string) */
else
{
/* Return as string */
hb_retclen( (const char *) iptr, (ULONG) sz );
}
/* Free memory */
gdFree( iptr );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
"GDIMAGE* (save functions)", 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 414 |
HB_FUNC | GDVERSION(void)
HB_FUNC( GDVERSION )
{
#if ( GD_VERS >= 2034 )
char szVer[ 30 ];
snprintf( szVer, sizeof( szVer ), "GD Version %s", GD_VERSION_STRING );
hb_retc( szVer );
#elif ( GD_VERS >= 2033 )
hb_retc( "GD Version 2.0.33" );
#else
hb_retc( "GD Version 2.0.28" );
#endif
}
| gdwrp.c | 559 |
HB_FUNC | GDVERSIONNUMBER(void)
HB_FUNC( GDVERSIONNUMBER )
{
#if ( GD_VERS >= 2034 )
hb_retni( GD_MAJOR_VERSION * 1000 + GD_MINOR_VERSION * 100 + GD_RELEASE_VERSION );
#elif ( GD_VERS >= 2033 )
hb_retni( 2033 );
#else
hb_retni( 2028 );
#endif
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* IMAGE CREATION, DESTRUCTION, LOADING AND SAVING */
| gdwrp.c | 572 |
HB_FUNC | GDIMAGECREATE(void)
HB_FUNC( GDIMAGECREATE ) /* gdImagePtr gdImageCreate(sx, sy) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_NUMERIC &&
hb_parinfo( 2 ) & HB_IT_NUMERIC )
{
gdImagePtr im;
int sx, sy;
/* Retrieve dimensions */
sx = hb_parni( 1 );
sy = hb_parni( 2 );
/* Create the image */
im = gdImageCreate( sx, sy );
/* Return image pointer */
hb_retGdImage( im );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 589 |
HB_FUNC | GDIMAGECREATEPALETTE(void)
HB_FUNC( GDIMAGECREATEPALETTE ) /* gdImagePtr gdImageCreatePalette(sx, sy) */
{
/* Alias of GDCreate() */
HB_FUNC_EXEC( GDIMAGECREATE );
}
| gdwrp.c | 622 |
HB_FUNC | GDIMAGECREATETRUECOLOR(void)
HB_FUNC( GDIMAGECREATETRUECOLOR ) /* gdImageCreateTrueColor(sx, sy) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_NUMERIC &&
hb_parinfo( 2 ) & HB_IT_NUMERIC )
{
gdImagePtr im;
int sx, sy;
/* Retrieve dimensions */
sx = hb_parni( 1 );
sy = hb_parni( 2 );
/* Create the image */
im = gdImageCreateTrueColor( sx, sy );
/* Return image pointer */
hb_retGdImage( im );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 631 |
HB_FUNC | GDIMAGECREATEFROMJPEG(void)
HB_FUNC( GDIMAGECREATEFROMJPEG ) /* gdImageCreateFromJpegPtr(int size, void *data) */
/* implementation: gdImagePtr gdImageCreateFromJpeg( char *szFile ) */
{
GDImageCreateFrom( IMAGE_JPEG );
}
| gdwrp.c | 665 |
HB_FUNC | GDIMAGECREATEFROMGIF(void)
HB_FUNC( GDIMAGECREATEFROMGIF ) /* gdImageCreateFromGifPtr(int size, void *data) */
/* implementation: gdImagePtr gdImageCreateFromGif( char *szFile ) */
{
GDImageCreateFrom( IMAGE_GIF );
}
| gdwrp.c | 674 |
HB_FUNC | GDIMAGECREATEFROMPNG(void)
HB_FUNC( GDIMAGECREATEFROMPNG ) /* gdImageCreateFromPngPtr(int size, void *data) */
/* implementation: gdImagePtr gdImageCreateFromPng( char *szFile ) */
{
GDImageCreateFrom( IMAGE_PNG );
}
| gdwrp.c | 683 |
HB_FUNC | GDIMAGECREATEFROMWBMP(void)
HB_FUNC( GDIMAGECREATEFROMWBMP ) /* gdImagePtr gdImageCreateFromWBMPPtr (int size, void *data) */
/* implementation: gdImagePtr gdImageCreateFromWBMP ( char *szFile ) */
{
GDImageCreateFrom( IMAGE_WBMP );
}
| gdwrp.c | 692 |
HB_FUNC | GDIMAGECREATEFROMGD(void)
HB_FUNC( GDIMAGECREATEFROMGD ) /* gdImagePtr gdImageCreateFromGdPtr (int size, void *data) */
/* implementation: gdImagePtr gdImageCreateFromGd ( char *szFile ) */
{
GDImageCreateFrom( IMAGE_GD );
}
/* ---------------------------------------------------------------------------*/
| gdwrp.c | 701 |
HB_FUNC | GDIMAGEJPEG(void)
HB_FUNC( GDIMAGEJPEG ) /* original: void gdImageJpeg(gdImagePtr im, FILE *out) */
/* implementation: void gdImageJpeg(gdImagePtr im, char *szFile) */
{
GDImageSaveTo( IMAGE_JPEG );
}
| gdwrp.c | 712 |
HB_FUNC | GDIMAGEGIF(void)
HB_FUNC( GDIMAGEGIF ) /* original: void gdImageGif(gdImagePtr im, FILE *out) */
/* implementation: void gdImageGif(gdImagePtr im, char *szFile) */
{
GDImageSaveTo( IMAGE_GIF );
}
| gdwrp.c | 721 |
HB_FUNC | GDIMAGEPNG(void)
HB_FUNC( GDIMAGEPNG ) /* original: void gdImagePngEx(gdImagePtr im, FILE *out, int level) */
/* implementation: void gdImagePng(gdImagePtr im, char *szFile [, int level] ) */
{
GDImageSaveTo( IMAGE_PNG );
}
| gdwrp.c | 727 |
HB_FUNC | GDIMAGEWBMP(void)
HB_FUNC( GDIMAGEWBMP ) /* original: void gdImageWBMP(gdImagePtr im, FILE *out) */
/* implementation: void gdImageWBMP(gdImagePtr im, char *szFile, int fg) */
{
GDImageSaveTo( IMAGE_WBMP );
}
| gdwrp.c | 735 |
HB_FUNC | GDIMAGEGD(void)
HB_FUNC( GDIMAGEGD ) /* original: void gdImageGD(gdImagePtr im, FILE *out) */
/* implementation: void gdImageGD(gdImagePtr im, char *szFile) */
{
GDImageSaveTo( IMAGE_GD );
}
| gdwrp.c | 744 |
HB_FUNC | GDIMAGEDESTROY(void)
HB_FUNC( GDIMAGEDESTROY ) /* gdImageDestroy(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER )
{
/*
gdImagePtr im;
*/
/* Retrieve image pointer */
/*
im = (gdImagePtr)hb_parptr( 1 );
*/
/* Destroy the image */
/*
gdImageDestroy( im );
*/
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* DRAWING FUNCTIONS */
| gdwrp.c | 753 |
HB_FUNC | GDIMAGESETPIXEL(void)
HB_FUNC( GDIMAGESETPIXEL ) /* void gdImageSetPixel(gdImagePtr im, int x, int y, int color) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x, y;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord values */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Retrieve color value */
color = hb_parni( 4 );
/* Draw a rectangle */
gdImageSetPixel(im, x, y, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 796 |
HB_FUNC | GDIMAGELINE(void)
HB_FUNC( GDIMAGELINE ) /* void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x1, y1, x2, y2;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord values */
x1 = hb_parni( 2 );
y1 = hb_parni( 3 );
x2 = hb_parni( 4 );
y2 = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw a rectangle */
gdImageLine(im, x1, y1, x2, y2, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 837 |
HB_FUNC | GDIMAGEDASHEDLINE(void)
HB_FUNC( GDIMAGEDASHEDLINE ) /* void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x1, y1, x2, y2;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord values */
x1 = hb_parni( 2 );
y1 = hb_parni( 3 );
x2 = hb_parni( 4 );
y2 = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw a rectangle */
gdImageDashedLine(im, x1, y1, x2, y2, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 883 |
HB_FUNC | GDIMAGEPOLYGON(void)
HB_FUNC( GDIMAGEPOLYGON ) /* original: void gdImagePolygon(gdImagePtr im, gdPointPtr points, int pointsTotal, int color) */
/* implementation: void gdImagePolygon(gdImagePtr im, gdPointPtr points, int color) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_ARRAY &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
/*gdPointPtr points; */
int pointsTotal;
int color;
PHB_ITEM pPoints;
int i;
/* Max Points of polygon */
gdPoint points[50]; /* TODO: make this dynamic */
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point array */
pPoints = hb_param( 2, HB_IT_ARRAY );
pointsTotal = hb_arrayLen( pPoints );
for( i = 0; i < pointsTotal; i ++ )
{
PHB_ITEM pPoint = hb_arrayGetItemPtr( pPoints, i+1 );
if( HB_IS_ARRAY( pPoint ) )
{
points[ i ].x = hb_arrayGetNI( pPoint, 1 );
points[ i ].y = hb_arrayGetNI( pPoint, 2 );
}
}
/* Retrieve color value */
color = hb_parni( 3 );
/* Draw a polygon */
gdImagePolygon(im, (gdPointPtr) points, pointsTotal, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 929 |
HB_FUNC | GDIMAGEOPENPOLYGON(void)
HB_FUNC( GDIMAGEOPENPOLYGON ) /* original: void gdImageOpenPolygon(gdImagePtr im, gdPointPtr points, int pointsTotal, int color) */
/* implementation: void gdImageOpenPolygon(gdImagePtr im, gdPointPtr points, int color) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_ARRAY &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
/*gdPointPtr points; */
int pointsTotal;
int color;
PHB_ITEM pPoints;
int i;
/* Max Points of polygon */
gdPoint points[50]; /* TODO: make this dynamic */
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point array */
pPoints = hb_param( 2, HB_IT_ARRAY );
pointsTotal = hb_arrayLen( pPoints );
for( i = 0; i < pointsTotal; i ++ )
{
PHB_ITEM pPoint = hb_arrayGetItemPtr( pPoints, i+1 );
if( HB_IS_ARRAY( pPoint ) )
{
points[ i ].x = hb_arrayGetNI( pPoint, 1 );
points[ i ].y = hb_arrayGetNI( pPoint, 2 );
}
}
/* Retrieve color value */
color = hb_parni( 3 );
/* Draw a polygon */
gdImageOpenPolygon(im, (gdPointPtr) points, pointsTotal, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
#endif /* ( GD_VERS >= 2033 ) */
| gdwrp.c | 986 |
HB_FUNC | GDIMAGERECTANGLE(void)
HB_FUNC( GDIMAGERECTANGLE ) /* void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x1, y1, x2, y2;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord values */
x1 = hb_parni( 2 );
y1 = hb_parni( 3 );
x2 = hb_parni( 4 );
y2 = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw a rectangle */
gdImageRectangle(im, x1, y1, x2, y2, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 1044 |
HB_FUNC | GDIMAGEELLIPSE(void)
HB_FUNC( GDIMAGEELLIPSE ) /* void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int cx, cy, w, h, color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
cx = hb_parni( 2 );
cy = hb_parni( 3 );
/* Retrieve width and height values */
w = hb_parni( 4 );
h = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw an ellipse */
gdImageEllipse(im, cx, cy, w, h, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
#endif
| gdwrp.c | 1091 |
HB_FUNC | GDIMAGEFILLEDPOLYGON(void)
HB_FUNC( GDIMAGEFILLEDPOLYGON ) /* original: void gdImageFilledPolygon(gdImagePtr im, gdPointPtr points, int pointsTotal, int color) */
/* implementation: void gdImageFilledPolygon(gdImagePtr im, gdPointPtr points, int color) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_ARRAY &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
/*gdPointPtr points; */
int pointsTotal;
int color;
PHB_ITEM pPoints;
int i;
/* Max Points of polygon */
gdPoint points[50];
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point array */
pPoints = hb_param( 2, HB_IT_ARRAY );
pointsTotal = hb_arrayLen( pPoints );
for( i = 0; i < pointsTotal; i ++ )
{
PHB_ITEM pPoint = hb_arrayGetItemPtr( pPoints, i+1 );
if( HB_IS_ARRAY( pPoint ) )
{
points[ i ].x = hb_arrayGetNI( pPoint, 1 );
points[ i ].y = hb_arrayGetNI( pPoint, 2 );
}
}
/* Retrieve color value */
color = hb_parni( 3 );
/* Draw a filled polygon */
gdImageFilledPolygon(im, (gdPointPtr) points, pointsTotal, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 1137 |
HB_FUNC | GDIMAGEFILLEDRECTANGLE(void)
HB_FUNC( GDIMAGEFILLEDRECTANGLE ) /* void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x1, y1, x2, y2;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord values */
x1 = hb_parni( 2 );
y1 = hb_parni( 3 );
x2 = hb_parni( 4 );
y2 = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw a filled rectangle */
gdImageFilledRectangle(im, x1, y1, x2, y2, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 1194 |
HB_FUNC | GDIMAGEARC(void)
HB_FUNC( GDIMAGEARC ) /* void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) */
{
if ( hb_pcount() == 8 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int cx, cy, w, h, s, e, color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
cx = hb_parni( 2 );
cy = hb_parni( 3 );
/* Retrieve width and height values */
w = hb_parni( 4 );
h = hb_parni( 5 );
/* Retrieve starting and ending degree values */
s = hb_parni( 6 );
e = hb_parni( 7 );
/* Retrieve color value */
color = hb_parni( 8 );
/* Draw an arc */
gdImageArc(im, cx, cy, w, h, s, e, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 8,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ) );
return;
}
}
}
| gdwrp.c | 1240 |
HB_FUNC | GDIMAGEFILLEDARC(void)
HB_FUNC( GDIMAGEFILLEDARC ) /* void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color[, int style]) */
{
if ( hb_pcount() >= 8 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int cx, cy, w, h, s, e, color, style;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
cx = hb_parni( 2 );
cy = hb_parni( 3 );
/* Retrieve width and height values */
w = hb_parni( 4 );
h = hb_parni( 5 );
/* Retrieve starting and ending degree values */
s = hb_parni( 6 );
e = hb_parni( 7 );
/* Retrieve color value */
color = hb_parni( 8 );
/* Retrieve style value */
style = ( hb_parinfo( 9 ) & HB_IT_NUMERIC ? hb_parni( 9 ) : gdNoFill );
/* Draw a filled arc */
gdImageFilledArc(im, cx, cy, w, h, s, e, color, style);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 9,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ) );
return;
}
}
}
| gdwrp.c | 1290 |
HB_FUNC | GDIMAGEFILLEDELLIPSE(void)
HB_FUNC( GDIMAGEFILLEDELLIPSE ) /* void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int cx, cy, w, h, color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
cx = hb_parni( 2 );
cy = hb_parni( 3 );
/* Retrieve width and height values */
w = hb_parni( 4 );
h = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw a filled ellipse */
gdImageFilledEllipse(im, cx, cy, w, h, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 1344 |
HB_FUNC | GDIMAGEFILLTOBORDER(void)
HB_FUNC( GDIMAGEFILLTOBORDER ) /* void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color) */
{
if ( hb_pcount() == 5 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x, y, border, color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Retrieve color to use as border */
border = hb_parni( 4 );
/* Retrieve color value */
color = hb_parni( 5 );
/* Fill image to border */
gdImageFillToBorder(im, x, y, border, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 5,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ) );
return;
}
}
}
| gdwrp.c | 1389 |
HB_FUNC | GDIMAGEELLIPSE(void)
HB_FUNC( GDIMAGEELLIPSE ) /* void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int cx, cy, w, h, color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
cx = hb_parni( 2 );
cy = hb_parni( 3 );
/* Retrieve width and height values */
w = hb_parni( 4 );
h = hb_parni( 5 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Draw a filled ellipse */
gdImageEllipse(im, cx, cy, w, h, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
#endif /* ( GD_VERS >= 2035 ) */
| gdwrp.c | 1432 |
HB_FUNC | GDIMAGEFILL(void)
HB_FUNC( GDIMAGEFILL ) /* void gdImageFill(gdImagePtr im, int x, int y, int color) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x, y, color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve point values */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Retrieve color value */
color = hb_parni( 4 );
/* Fill image */
gdImageFill(im, x, y, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 1478 |
HB_FUNC | GDIMAGESETANTIALIASED(void)
HB_FUNC( GDIMAGESETANTIALIASED ) /* void gdImageSetAntiAliased(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve color value */
color = hb_parni( 2 );
/* Set Antialias */
gdImageSetAntiAliased(im, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1517 |
HB_FUNC | GDIMAGESETANTIALIASEDDONTBLEND(void)
HB_FUNC( GDIMAGESETANTIALIASEDDONTBLEND ) /* void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
int dont_blend;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve color value */
color = hb_parni( 2 );
/* Retrieve dont_blend value */
dont_blend = hb_parni( 3 );
/* Set Antialias but don't blend */
gdImageSetAntiAliasedDontBlend(im, color, dont_blend);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 1551 |
HB_FUNC | GDIMAGESETBRUSH(void)
HB_FUNC( GDIMAGESETBRUSH ) /* void gdImageSetBrush(gdImagePtr im, gdImagePtr brush) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER
)
{
gdImagePtr im;
gdImagePtr brush;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve brush pointer */
brush = hb_parGdImage( 2 );
/* Set Brush */
gdImageSetBrush(im, brush);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1590 |
HB_FUNC | GDIMAGESETTILE(void)
HB_FUNC( GDIMAGESETTILE ) /* void gdImageSetTile(gdImagePtr im, gdImagePtr tile) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER
)
{
gdImagePtr im;
gdImagePtr tile;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve tile pointer */
tile = hb_parGdImage( 2 );
/* Set Tile */
gdImageSetTile(im, tile);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1624 |
HB_FUNC | GDIMAGESETSTYLE(void)
HB_FUNC( GDIMAGESETSTYLE ) /* original: void gdImageSetStyle(gdImagePtr im, int *style, int styleLength) */
/* implementation: void gdImageSetStyle(gdImagePtr im, int *style) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_ARRAY
)
{
gdImagePtr im;
PHB_ITEM pStyles;
int styleLength;
int i;
/* Max numbery of Styles */
int styles[50]; /* TODO: make this dynamic */
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve style array */
pStyles = hb_param( 2, HB_IT_ARRAY );
styleLength = hb_arrayLen( pStyles );
for( i = 0; i < styleLength; i ++ )
{
styles[ i ] = hb_arrayGetNI( pStyles, i+1 );
}
/* Set style */
gdImageSetStyle(im, (int *) styles, styleLength);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1658 |
HB_FUNC | GDIMAGESETTHICKNESS(void)
HB_FUNC( GDIMAGESETTHICKNESS ) /* void gdImageSetThickness(gdImagePtr im, int thickness) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int thickness;
int oldthick;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve thickness value */
thickness = hb_parni( 2 );
/* Previous value */
oldthick = im->thick;
/* Set thickness */
gdImageSetThickness(im, thickness);
/* Return previous */
hb_retni( oldthick );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1703 |
HB_FUNC | GDIMAGEALPHABLENDING(void)
HB_FUNC( GDIMAGEALPHABLENDING ) /* void gdImageAlphaBlending(gdImagePtr im, int blending) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_LOGICAL
)
{
gdImagePtr im;
int blending;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve blending value - logical */
blending = hb_parl( 2 );
/* Set blending */
gdImageAlphaBlending(im, blending);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1744 |
HB_FUNC | GDIMAGESAVEALPHA(void)
HB_FUNC( GDIMAGESAVEALPHA ) /* void gdImageSaveAlpha(gdImagePtr im, int saveFlag) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_LOGICAL
)
{
gdImagePtr im;
int saveFlag;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value - logical */
saveFlag = hb_parl( 2 );
/* Set saveFlag */
gdImageSaveAlpha(im, saveFlag);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1778 |
HB_FUNC | GDIMAGESETCLIP(void)
HB_FUNC( GDIMAGESETCLIP ) /* void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2) */
{
if ( hb_pcount() == 5 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x1, y1, x2, y2;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coords value */
x1 = hb_parni( 2 );
y1 = hb_parni( 3 );
x2 = hb_parni( 4 );
y2 = hb_parni( 5 );
/* Set clipping rectangle */
gdImageSetClip(im, x1, y1, x2, y2);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 5,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ) );
return;
}
}
}
| gdwrp.c | 1812 |
HB_FUNC | GDIMAGEGETCLIP(void)
HB_FUNC( GDIMAGEGETCLIP ) /* original: void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) */
/* implementation: array gdImageGetClip(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
int x1, y1, x2, y2;
PHB_ITEM pClipArray;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Get clipping rectangle */
gdImageGetClip(im, &x1, &y1, &x2, &y2);
/* Return clipping rectangle value in an array */
pClipArray = hb_itemArrayNew( 4 );
hb_itemPutNI( hb_arrayGetItemPtr( pClipArray, 1 ), x1 );
hb_itemPutNI( hb_arrayGetItemPtr( pClipArray, 2 ), y1 );
hb_itemPutNI( hb_arrayGetItemPtr( pClipArray, 3 ), x2 );
hb_itemPutNI( hb_arrayGetItemPtr( pClipArray, 4 ), y2 );
/* return array */
hb_itemRelease( hb_itemReturnForward( pClipArray ) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* QUERY FUNCTIONS */
| gdwrp.c | 1853 |
HB_FUNC | GDIMAGECOLORSTOTAL(void)
HB_FUNC( GDIMAGECOLORSTOTAL ) /* int gdImageColorsTotal(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Get Colors total */
hb_retni( gdImageColorsTotal(im) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 1900 |
HB_FUNC | GDIMAGEALPHA(void)
HB_FUNC( GDIMAGEALPHA ) /* int gdImageAlpha(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value */
color = hb_parni( 2 );
/* Get Alpha Level */
hb_retni( gdImageAlpha(im, color) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1929 |
HB_FUNC | GDIMAGERED(void)
HB_FUNC( GDIMAGERED ) /* int gdImageRed(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value */
color = hb_parni( 2 );
/* Get Red Level */
hb_retni( gdImageRed(im, color) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1963 |
HB_FUNC | GDIMAGEGREEN(void)
HB_FUNC( GDIMAGEGREEN ) /* int gdImageGreen(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value */
color = hb_parni( 2 );
/* Get Green Level */
hb_retni( gdImageGreen(im, color) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 1997 |
HB_FUNC | GDIMAGEBLUE(void)
HB_FUNC( GDIMAGEBLUE ) /* int gdImageBlue(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value */
color = hb_parni( 2 );
/* Get Blue Level */
hb_retni( gdImageBlue(im, color) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 2031 |
HB_FUNC | GDIMAGESX(void)
HB_FUNC( GDIMAGESX ) /* int gdImageSX(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Get Image Width in pixels */
hb_retni( gdImageSX(im) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 2065 |
HB_FUNC | GDIMAGESY(void)
HB_FUNC( GDIMAGESY ) /* int gdImageSX(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Get Image Height in pixels */
hb_retni( gdImageSY(im) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 2094 |
HB_FUNC | GDIMAGEGETPIXEL(void)
HB_FUNC( GDIMAGEGETPIXEL ) /* int gdImageGetPixel(gdImagePtr im, int x, int y) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x,y;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord value */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Get Color of a pixel */
hb_retni( gdImageGetPixel(im, x, y) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 2123 |
HB_FUNC | GDIMAGEBOUNDSSAFE(void)
HB_FUNC( GDIMAGEBOUNDSSAFE ) /* int gdImageBoundsSafe(gdImagePtr im, int x, int y) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x,y;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord value */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Get if pixel in Clipping region */
hb_retl( gdImageBoundsSafe(im, x, y) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 2159 |
HB_FUNC | GDIMAGEGETINTERLACED(void)
HB_FUNC( GDIMAGEGETINTERLACED ) /* int gdImageGetInterlaced(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Image is interlaced ? */
hb_retl( gdImageGetInterlaced(im) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 2195 |
HB_FUNC | GDIMAGEGETTRANSPARENT(void)
HB_FUNC( GDIMAGEGETTRANSPARENT ) /* int gdImageGetTransparent(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Image is trasparent ? */
hb_retl( gdImageGetTransparent(im) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 2224 |
HB_FUNC | GDIMAGETRUECOLOR(void)
HB_FUNC( GDIMAGETRUECOLOR ) /* int gdImageTrueColor(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Is TrueColor ? */
hb_retl( gdImageTrueColor(im) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 2253 |
HB_FUNC | GDIMAGETRUECOLORTOPALETTE(void)
HB_FUNC( GDIMAGETRUECOLORTOPALETTE ) /* void gdImageTrueColorToPalette (gdImagePtr im, int ditherFlag, int colorsWanted) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_LOGICAL &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int ditherFlag, colorsWanted;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve ditherFlag - logical */
ditherFlag = hb_parl( 2 );
/* Retrieve number of color wanted */
colorsWanted = hb_parni( 3 );
/* Converts a truecolor image to a palette-based image */
gdImageTrueColorToPalette(im, ditherFlag, colorsWanted);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 2282 |
HB_FUNC | GDIMAGECREATEPALETTEFROMTRUECOLOR(void)
HB_FUNC( GDIMAGECREATEPALETTEFROMTRUECOLOR ) /* gdImagePtr gdImageCreatePaletteFromTrueColor(gdImagePtr im, int ditherFlag, int colorsWanted) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_LOGICAL &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
gdImagePtr imNew;
int ditherFlag, colorsWanted;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve ditherFlag - logical */
ditherFlag = hb_parl( 2 );
/* Retrieve number of color wanted */
colorsWanted = hb_parni( 3 );
/* Converts a truecolor image to a palette-based image and return the image */
imNew = gdImageCreatePaletteFromTrueColor(im, ditherFlag, colorsWanted);
/* Return image pointer */
hb_retGdImage( imNew );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 2320 |
HB_FUNC | GDIMAGEPALETTEPIXEL(void)
HB_FUNC( GDIMAGEPALETTEPIXEL ) /* int gdImagePalettePixel(gdImagePtr im, int x, int y) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x,y;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord value */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Get Color of a pixel */
hb_retni( gdImagePalettePixel(im, x, y) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 2362 |
HB_FUNC | GDIMAGETRUECOLORPIXEL(void)
HB_FUNC( GDIMAGETRUECOLORPIXEL ) /* int gdImageTrueColorPixel(gdImagePtr im, int x, int y) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int x,y;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve coord value */
x = hb_parni( 2 );
y = hb_parni( 3 );
/* Get Color of a pixel */
hb_retni( gdImageTrueColorPixel(im, x, y) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 2398 |
HB_FUNC | GDIMAGEGETTHICKNESS(void)
HB_FUNC( GDIMAGEGETTHICKNESS ) /* void gdImageGetThickness(gdImagePtr im) */
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdImagePtr im;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Return previous */
hb_retni( im->thick );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* FONTS AND TEXT-HANDLING FUNCTIONS */
| gdwrp.c | 2434 |
HB_FUNC | GDFONTGETSMALL(void)
HB_FUNC( GDFONTGETSMALL ) /* gdFontPtr gdFontGetSmall(void) */
{
gdFontPtr font;
/* Get font pointer */
font = gdFontGetSmall();
/* Return font pointer */
hb_retGdFont( font );
/*hb_retptr( font ); */
}
| gdwrp.c | 2467 |
HB_FUNC | GDFONTGETLARGE(void)
HB_FUNC( GDFONTGETLARGE ) /* gdFontPtr gdFontGetLarge(void) */
{
gdFontPtr font;
/* Get font pointer */
font = gdFontGetLarge();
/* Return font pointer */
hb_retGdFont( font );
/*hb_retptr( font ); */
}
| gdwrp.c | 2481 |
HB_FUNC | GDFONTGETMEDIUMBOLD(void)
HB_FUNC( GDFONTGETMEDIUMBOLD ) /* gdFontPtr gdFontGetMediumBold(void) */
{
gdFontPtr font;
/* Get font pointer */
font = gdFontGetMediumBold();
/* Return font pointer */
hb_retGdFont( font );
/*hb_retptr( font ); */
}
| gdwrp.c | 2495 |
HB_FUNC | GDFONTGETGIANT(void)
HB_FUNC( GDFONTGETGIANT ) /* gdFontPtr gdFontGetGiant(void) */
{
gdFontPtr font;
/* Get font pointer */
font = gdFontGetGiant();
/* Return font pointer */
hb_retGdFont( font );
/*hb_retptr( font ); */
}
| gdwrp.c | 2509 |
HB_FUNC | GDFONTGETTINY(void)
HB_FUNC( GDFONTGETTINY ) /* gdFontPtr gdFontGetTiny(void) */
{
gdFontPtr font;
/* Get font pointer */
font = gdFontGetTiny();
/* Return font pointer */
hb_retGdFont( font );
/*hb_retptr( font ); */
}
| gdwrp.c | 2523 |
HB_FUNC | GDIMAGESTRING(void)
HB_FUNC( GDIMAGESTRING ) /* void gdImageChar(gdImagePtr im, gdFontPtr font, int x, int y, int c, int color) */
/* void gdImageString(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_STRING &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
gdFontPtr font;
int x, y, c, color;
unsigned char *s;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve font pointer */
font = hb_parGdFont( 2 );
/* Retrieve coord value */
x = hb_parni( 3 );
y = hb_parni( 4 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Write char */
if ( hb_parclen(5) == 1 )
{
/* Retrieve char value */
c = hb_parni( 5 );
gdImageChar(im, font, x, y, c, color);
}
else
{
/* Retrieve string value */
s = ( unsigned char * )hb_parcx( 5 );
gdImageString(im, font, x, y, s, color);
}
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 2537 |
HB_FUNC | GDIMAGESTRINGUP(void)
HB_FUNC( GDIMAGESTRINGUP ) /* void gdImageCharUp(gdImagePtr im, gdFontPtr font, int x, int y, int c, int color) */
/* void gdImageStringUp(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color) */
{
if ( hb_pcount() == 6 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_STRING &&
hb_parinfo( 6 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
gdFontPtr font;
int x, y, c, color;
unsigned char *s;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve font pointer */
font = hb_parGdFont( 2 );
/* Retrieve coord value */
x = hb_parni( 3 );
y = hb_parni( 4 );
/* Retrieve color value */
color = hb_parni( 6 );
/* Write char */
if ( hb_parclen(5) == 1 )
{
/* Retrieve char value */
c = hb_parni( 5 );
gdImageCharUp(im, font, x, y, c, color);
}
else
{
/* Retrieve string value */
s = ( unsigned char * )hb_parcx( 5 );
gdImageStringUp(im, font, x, y, s, color);
}
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 6,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ) );
return;
}
}
}
| gdwrp.c | 2597 |
HB_FUNC | GDIMAGESTRINGFTEX(void)
/* char *gdImageStringFTEx(gdImagePtr im, int *brect, int fg, char *fontname, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex) */
/* implementation: cError := gdImageStringFTEx( im, aRect, int fg, cFontname, nPtSize, nAngle, x, y, cString, nLinespacing, nCharmap, nResolution ) */
HB_FUNC( GDIMAGESTRINGFTEX )
{
/* TraceLog( NULL, "Parameters: %i, Type 1 =%i=\n\r", hb_pcount(), hb_parinfo( 1 ) ); */
if ( hb_pcount() >= 9 &&
( ISNIL(1) || hb_parinfo( 1 ) & ( HB_IT_POINTER ) ) &&
hb_parinfo( 2 ) & HB_IT_ARRAY &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_STRING &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
hb_parinfo( 9 ) & HB_IT_STRING
)
{
gdImagePtr im;
gdFTStringExtra extra;
int fg;
char *fontname;
double ptsize, angle;
int x, y, i;
char *string;
PHB_ITEM pRect;
int aRect[8];
char *err;
int flags;
double linespacing;
int charmap;
int resolution;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/*TraceLog( NULL, "Image pointer: %p\n\r", im ); */
/* Retrieve rectangle array */
pRect = hb_param( 2, HB_IT_ARRAY );
for( i = 0; i < 8; i ++ )
{
aRect[ i ] = hb_arrayGetNI( pRect, i+1 );
}
/* Retrieve foreground color value */
fg = hb_parni( 3 );
/*TraceLog( NULL, "Forecolor: %i\n\r", fg ); */
/* Retrieve fontname value */
fontname = hb_parc( 4 );
/*TraceLog( NULL, "Font: %s\n\r", fontname ); */
/* Retrieve point size value */
ptsize = hb_parni( 5 );
/*TraceLog( NULL, "PTSize: %lf\n\r", ptsize ); */
/* Retrieve angle value in radians */
angle = hb_parnd( 6 );
/*TraceLog( NULL, "Angle: %lf\n\r", angle ); */
/* Retrieve pos value */
x = hb_parni( 7 );
y = hb_parni( 8 );
/*TraceLog( NULL, "Pos: %i, %i\n\r", x, y ); */
/* Retrieve string value */
string = hb_parcx( 9 );
/*TraceLog( NULL, "String: %s\n\r", string ); */
/* EXTENDED FLAGS */
flags = 0;
/* defaults */
linespacing = 1.05;
charmap = gdFTEX_Unicode;
resolution = 96;
/* Retrieve line spacing */
if ( hb_parinfo( 10 ) & HB_IT_DOUBLE )
{
linespacing = hb_parnd( 10 );
flags |= gdFTEX_LINESPACE;
}
/* Retrieve charmap */
if ( hb_parinfo( 11 ) & HB_IT_NUMERIC )
{
charmap = hb_parni( 11 );
flags |= gdFTEX_CHARMAP;
}
/* Retrieve resolution */
if ( hb_parinfo( 12 ) & HB_IT_NUMERIC )
{
resolution = hb_parni( 12 );
flags |= gdFTEX_RESOLUTION;
}
if ( !( flags == 0 ) )
{
extra.flags = flags;
extra.linespacing = ( flags & gdFTEX_LINESPACE ? linespacing : 1.05 );
extra.charmap = ( flags & gdFTEX_CHARMAP ? charmap : gdFTEX_Unicode );
extra.hdpi = ( flags & gdFTEX_RESOLUTION ? resolution : 96 );
extra.vdpi = ( flags & gdFTEX_RESOLUTION ? resolution : 96 );
}
/* Write string */
err = gdImageStringFTEx(im, &aRect[0], fg, fontname, ptsize, angle, x, y, string, ( !( flags == 0 ) ? &extra : 0 ));
if ( !( err ) )
{
/* Save in array the correct text rectangle dimensions */
PHB_ITEM pArray;
pArray = hb_itemArrayNew( 8 );
for( i = 0; i < 8; i ++ )
{
hb_itemPutNI( hb_arrayGetItemPtr( pArray, i+1 ), aRect[i] );
}
hb_itemCopy( pRect, pArray );
hb_itemRelease( pArray );
}
hb_retc( err );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 12,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ), hb_paramError( 10 ), hb_paramError( 11 ), hb_paramError( 12 ) );
return;
}
}
}
| gdwrp.c | 2655 |
HB_FUNC | GDIMAGESTRINGFTCIRCLE(void)
HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, int cx, int cy, double radius, double textRadius, double fillPortion, char *font, double points, char *top, char *bottom, int fgcolor) */
{
/*TraceLog( NULL, "Parameters: %i, Type 9 =%i=\n\r", hb_pcount(), hb_parinfo( 10 ) ); */
if ( hb_pcount() == 11 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_STRING &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
( ISNIL( 9 ) || ( hb_parinfo( 9 ) & HB_IT_STRING ) ) &&
( ISNIL( 10 ) || ( hb_parinfo( 10 ) & HB_IT_STRING ) ) &&
hb_parinfo( 11 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int cx, cy;
double radius, textRadius, fillPortion, points;
char *top;
char *bottom;
int fgcolor;
char *font;
char *err;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve pos value */
cx = hb_parni( 2 );
cy = hb_parni( 3 );
/* Retrieve radius value */
radius = hb_parnd( 4 );
/* Retrieve textRadius value */
textRadius = hb_parnd( 5 );
/* Retrieve textRadius value */
fillPortion = hb_parnd( 6 );
/* Retrieve fontname value */
font = hb_parcx( 7 );
/* Retrieve points value */
points = hb_parnd( 8 );
/* Retrieve top string value */
top = hb_parcx( 9 );
/* Retrieve top string value */
bottom = hb_parcx( 10 );
/* Retrieve foreground color value */
fgcolor = hb_parni( 11 );
/* Write string */
err = gdImageStringFTCircle(im, cx, cy, radius, textRadius, fillPortion, font, points, top, bottom, fgcolor);
hb_retc( err );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 11,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ), hb_paramError( 10 ), hb_paramError( 11 ) );
return;
}
}
}
| gdwrp.c | 2796 |
HB_FUNC | GDFONTCACHESETUP(void)
HB_FUNC( GDFONTCACHESETUP ) /* int gdFontCacheSetup (void) */
{
/* This function initializes the font cache for freetype text output functions */
hb_retl( gdFontCacheSetup() );
}
| gdwrp.c | 2875 |
HB_FUNC | GDFONTCACHESHUTDOWN(void)
HB_FUNC( GDFONTCACHESHUTDOWN ) /* void gdFontCacheShutdown (void) */
{
/* This function initializes the font cache for freetype text output functions */
gdFontCacheShutdown();
}
| gdwrp.c | 2883 |
HB_FUNC | GDFONTGETWIDTH(void)
HB_FUNC( GDFONTGETWIDTH )
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdFontPtr font;
/* Retrieve font pointer */
font = hb_parGdFont( 1 );
/* Return value */
hb_retni( font->w );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
| gdwrp.c | 2891 |
HB_FUNC | GDFONTGETHEIGHT(void)
HB_FUNC( GDFONTGETHEIGHT )
{
if ( hb_pcount() == 1 &&
hb_parinfo( 1 ) & HB_IT_POINTER
)
{
gdFontPtr font;
/* Retrieve font pointer */
font = hb_parGdFont( 1 );
/* Return value */
hb_retni( font->h );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 ) );
return;
}
}
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* COLOR HANDLING FUNCTIONS */
| gdwrp.c | 2920 |
HB_FUNC | GDIMAGECOLORALLOCATE(void)
HB_FUNC( GDIMAGECOLORALLOCATE ) /* int gdImageColorAllocate(gdImagePtr im, int r, int g, int b) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Allocate color */
color = gdImageColorAllocate(im, r, g, b);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 2953 |
HB_FUNC | GDIMAGECOLORDEALLOCATE(void)
HB_FUNC( GDIMAGECOLORDEALLOCATE ) /* void gdImageColorDeallocate(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value */
color = hb_parni( 2 );
/* Deallocate color */
gdImageColorDeallocate(im, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 2995 |
HB_FUNC | GDIMAGECOLORALLOCATEALPHA(void)
HB_FUNC( GDIMAGECOLORALLOCATEALPHA ) /* int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a) */
{
if ( hb_pcount() == 5 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
int a;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Retrieve Alpha value */
a = hb_parni( 5 );
/* Allocate color */
color = gdImageColorAllocateAlpha(im, r, g, b, a);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 5,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ) );
return;
}
}
}
| gdwrp.c | 3029 |
HB_FUNC | GDIMAGECOLORCLOSEST(void)
HB_FUNC( GDIMAGECOLORCLOSEST ) /* int gdImageColorClosest(gdImagePtr im, int r, int g, int b) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Search color closest */
color = gdImageColorClosest(im, r, g, b);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 3077 |
HB_FUNC | GDIMAGECOLORCLOSESTALPHA(void)
HB_FUNC( GDIMAGECOLORCLOSESTALPHA ) /* int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a) */
{
if ( hb_pcount() == 5 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
int a;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Retrieve Alpha value */
a = hb_parni( 5 );
/* Allocate color */
color = gdImageColorClosestAlpha(im, r, g, b, a);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 5,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ) );
return;
}
}
}
| gdwrp.c | 3119 |
HB_FUNC | GDIMAGECOLORCLOSESTHWB(void)
HB_FUNC( GDIMAGECOLORCLOSESTHWB ) /* gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Search color closest */
color = gdImageColorClosestHWB(im, r, g, b);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 3167 |
HB_FUNC | GDIMAGECOLOREXACT(void)
HB_FUNC( GDIMAGECOLOREXACT ) /* int gdImageColorExact(gdImagePtr im, int r, int g, int b) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Search if there is the color */
color = gdImageColorExact(im, r, g, b);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 3209 |
HB_FUNC | GDIMAGECOLORRESOLVE(void)
HB_FUNC( GDIMAGECOLORRESOLVE ) /* int gdImageColorResolve(gdImagePtr im, int r, int g, int b) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Search if there is the color or similar, if not it creates */
color = gdImageColorResolve(im, r, g, b);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
| gdwrp.c | 3251 |
HB_FUNC | GDIMAGECOLORRESOLVEALPHA(void)
HB_FUNC( GDIMAGECOLORRESOLVEALPHA ) /* int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a) */
{
if ( hb_pcount() == 5 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int r, g, b;
int color;
int a;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve RGB values */
r = hb_parni( 2 );
g = hb_parni( 3 );
b = hb_parni( 4 );
/* Retrieve Alpha value */
a = hb_parni( 5 );
/* Allocate color */
color = gdImageColorResolveAlpha(im, r, g, b, a);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 5,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ) );
return;
}
}
}
| gdwrp.c | 3293 |
HB_FUNC | GDIMAGECOLORTRANSPARENT(void)
HB_FUNC( GDIMAGECOLORTRANSPARENT ) /* void gdImageColorTransparent(gdImagePtr im, int color) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int color;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve saveFlag value */
color = hb_parni( 2 );
/* Set transparent color (to define no transparent color set -1) */
gdImageColorTransparent(im, color);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 3341 |
HB_FUNC | GDTRUECOLOR(void)
HB_FUNC( GDTRUECOLOR ) /* int gdTrueColor(int red, int green, int blue) */
{
if ( hb_pcount() == 3 &&
hb_parinfo( 1 ) & HB_IT_NUMERIC &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC
)
{
int r, g, b;
int color;
/* Retrieve RGB values */
r = hb_parni( 1 );
g = hb_parni( 2 );
b = hb_parni( 3 );
/* Allocate color */
color = gdTrueColor(r, g, b);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 3375 |
HB_FUNC | GDTRUECOLORALPHA(void)
HB_FUNC( GDTRUECOLORALPHA ) /* int gdTrueColorAlpha(int red, int green, int blue, int alpha) */
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_NUMERIC &&
hb_parinfo( 2 ) & HB_IT_NUMERIC &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
int r, g, b, a;
int color;
/* Retrieve RGB values */
r = hb_parni( 1 );
g = hb_parni( 2 );
b = hb_parni( 3 );
a = hb_parni( 4 );
/* Allocate color */
color = gdTrueColorAlpha(r, g, b, a);
/* return color */
hb_retni( color );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) );
return;
}
}
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* COPY AND RESIZING FUNCTIONS */
| gdwrp.c | 3412 |
HB_FUNC | GDIMAGECOPY(void)
HB_FUNC( GDIMAGECOPY ) /* void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h) */
{
if ( hb_pcount() == 8 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC
)
{
gdImagePtr dst, src;
int dstX, dstY, srcX, srcY, w, h;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Retrieve destination pos value */
dstX = hb_parni( 3 );
dstY = hb_parni( 4 );
/* Retrieve source pos value */
srcX = hb_parni( 5 );
srcY = hb_parni( 6 );
/* Retrieve width value */
w = hb_parni( 7 );
/* Retrieve height value */
h = hb_parni( 8 );
/* Perform copy */
gdImageCopy(dst, src, dstX, dstY, srcX, srcY, w, h);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 8,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ) );
return;
}
}
}
| gdwrp.c | 3455 |
HB_FUNC | GDIMAGECOPYRESIZED(void)
HB_FUNC( GDIMAGECOPYRESIZED ) /* void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) */
{
if ( hb_pcount() == 10 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
hb_parinfo( 9 ) & HB_IT_NUMERIC &&
hb_parinfo( 10 ) & HB_IT_NUMERIC
)
{
gdImagePtr dst, src;
int dstX, dstY, srcX, srcY;
int dstW, dstH, srcW, srcH;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Retrieve destination pos value */
dstX = hb_parni( 3 );
dstY = hb_parni( 4 );
/* Retrieve source pos value */
srcX = hb_parni( 5 );
srcY = hb_parni( 6 );
/* Retrieve dest width value */
dstW = hb_parni( 7 );
/* Retrieve dest height value */
dstH = hb_parni( 8 );
/* Retrieve source width value */
srcW = hb_parni( 9 );
/* Retrieve source height value */
srcH = hb_parni( 10 );
/* Perform copy */
gdImageCopyResized(dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 10,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ), hb_paramError( 10 ) );
return;
}
}
}
| gdwrp.c | 3509 |
HB_FUNC | GDIMAGECOPYRESAMPLED(void)
HB_FUNC( GDIMAGECOPYRESAMPLED ) /* void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) */
{
if ( hb_pcount() == 10 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
hb_parinfo( 9 ) & HB_IT_NUMERIC &&
hb_parinfo( 10 ) & HB_IT_NUMERIC
)
{
gdImagePtr dst, src;
int dstX, dstY, srcX, srcY;
int dstW, dstH, srcW, srcH;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Retrieve destination pos value */
dstX = hb_parni( 3 );
dstY = hb_parni( 4 );
/* Retrieve source pos value */
srcX = hb_parni( 5 );
srcY = hb_parni( 6 );
/* Retrieve dest width value */
dstW = hb_parni( 7 );
/* Retrieve dest height value */
dstH = hb_parni( 8 );
/* Retrieve source width value */
srcW = hb_parni( 9 );
/* Retrieve source height value */
srcH = hb_parni( 10 );
/* Perform copy */
gdImageCopyResampled(dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 10,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ), hb_paramError( 10 ) );
return;
}
}
}
| gdwrp.c | 3573 |
HB_FUNC | GDIMAGECOPYROTATED(void)
HB_FUNC( GDIMAGECOPYROTATED ) /* void gdImageCopyRotated(gdImagePtr dst, gdImagePtr src, double dstX, double dstY, int srcX, int srcY, int srcW, int srcH, int angle) */
{
if ( hb_pcount() == 9 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
hb_parinfo( 9 ) & HB_IT_NUMERIC
)
{
gdImagePtr dst, src;
double dstX, dstY;
int srcX, srcY, srcW, srcH, angle;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Retrieve destination pos value */
dstX = hb_parnd( 3 );
dstY = hb_parnd( 4 );
/* Retrieve source pos value */
srcX = hb_parni( 5 );
srcY = hb_parni( 6 );
/* Retrieve source width value */
srcW = hb_parni( 7 );
/* Retrieve source height value */
srcH = hb_parni( 8 );
/* Retrieve angle value */
angle = hb_parni( 9 );
/* Perform rotation */
gdImageCopyRotated(dst, src, dstX, dstY, srcX, srcY, srcW, srcH, angle);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 9,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ) );
return;
}
}
}
| gdwrp.c | 3637 |
HB_FUNC | GDIMAGECOPYMERGE(void)
HB_FUNC( GDIMAGECOPYMERGE ) /* void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) */
{
if ( hb_pcount() == 9 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
hb_parinfo( 9 ) & HB_IT_NUMERIC
)
{
gdImagePtr dst, src;
int dstX, dstY, srcX, srcY, w, h, pct;
/* Retrieve destination image pointer */
dst =hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Retrieve destination pos value */
dstX = hb_parni( 3 );
dstY = hb_parni( 4 );
/* Retrieve source pos value */
srcX = hb_parni( 5 );
srcY = hb_parni( 6 );
/* Retrieve width value */
w = hb_parni( 7 );
/* Retrieve height value */
h = hb_parni( 8 );
/* Retrieve percentual value */
pct = hb_parni( 9 );
/* Perform copy */
gdImageCopyMerge(dst, src, dstX, dstY, srcX, srcY, w, h, pct);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 9,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ) );
return;
}
}
}
| gdwrp.c | 3697 |
HB_FUNC | GDIMAGECOPYMERGEGRAY(void)
HB_FUNC( GDIMAGECOPYMERGEGRAY ) /* void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) */
{
if ( hb_pcount() == 9 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
hb_parinfo( 8 ) & HB_IT_NUMERIC &&
hb_parinfo( 9 ) & HB_IT_NUMERIC
)
{
gdImagePtr dst, src;
int dstX, dstY, srcX, srcY, w, h, pct;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Retrieve destination pos value */
dstX = hb_parni( 3 );
dstY = hb_parni( 4 );
/* Retrieve source pos value */
srcX = hb_parni( 5 );
srcY = hb_parni( 6 );
/* Retrieve width value */
w = hb_parni( 7 );
/* Retrieve height value */
h = hb_parni( 8 );
/* Retrieve percentual value */
pct = hb_parni( 9 );
/* Perform copy */
gdImageCopyMergeGray(dst, src, dstX, dstY, srcX, srcY, w, h, pct);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 9,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ),
hb_paramError( 9 ) );
return;
}
}
}
| gdwrp.c | 3756 |
HB_FUNC | GDIMAGEPALETTECOPY(void)
HB_FUNC( GDIMAGEPALETTECOPY ) /* void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER
)
{
gdImagePtr dst, src;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Perform copy */
gdImagePaletteCopy(dst, src);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 3815 |
HB_FUNC | GDIMAGESQUARETOCIRCLE(void)
HB_FUNC( GDIMAGESQUARETOCIRCLE ) /* void gdImageSquareToCircle(gdImagePtr im, int radius) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int radius;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve radius value */
radius = hb_parni( 2 );
/* TODO */
gdImageSquareToCircle(im, radius);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 3847 |
HB_FUNC | GDIMAGESHARPEN(void)
HB_FUNC( GDIMAGESHARPEN ) /* void gdImageSharpen(gdImagePtr im, int pct) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
int pct;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve percentual value */
pct = hb_parni( 2 );
/* Sharpens the specified image */
gdImageSharpen(im, pct);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
/* ---------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------*/
/* MISCELLANEOUS FUNCTIONS */
| gdwrp.c | 3881 |
HB_FUNC | GDIMAGECOMPARE(void)
HB_FUNC( GDIMAGECOMPARE ) /* int gdImageCompare(gdImagePtr im1, gdImagePtr im2) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_POINTER
)
{
gdImagePtr dst, src;
/* Retrieve destination image pointer */
dst = hb_parGdImage( 1 );
/* Retrieve source image pointer */
src = hb_parGdImage( 2 );
/* Compare images - if return <> 0 check value for infos */
hb_retni( gdImageCompare(dst, src) );
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 3919 |
HB_FUNC | GDIMAGEINTERLACE(void)
HB_FUNC( GDIMAGEINTERLACE ) /* void gdImageInterlace(gdImagePtr im, int interlace) */
{
if ( hb_pcount() == 2 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
hb_parinfo( 2 ) & HB_IT_LOGICAL
)
{
gdImagePtr im;
int interlace;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve interlace value */
interlace = hb_parl( 2 );
/* Set interlace */
gdImageInterlace(im, interlace);
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 2,
hb_paramError( 1 ), hb_paramError( 2 ) );
return;
}
}
}
| gdwrp.c | 3951 |
STATIC VOID | AddImageToFile( char *szFile, void *iptr, int sz )
static void AddImageToFile( char *szFile, void *iptr, int sz )
{
FHANDLE fhandle;
if ( ( fhandle = hb_fsOpen( ( BYTE * ) szFile, FO_READWRITE ) ) != FS_ERROR )
{
/* move to end of file */
hb_fsSeek(fhandle, 0, FS_END);
/* Write Image */
SaveImageToHandle( fhandle, ( BYTE *) iptr, (ULONG) sz );
/* Close file */
hb_fsClose( fhandle );
}
}
| gdwrp.c | 3987 |
HB_FUNC | GDIMAGEGIFANIMBEGIN(void)
/* implementation: (void *) gdImageGifAnimBegin( gdImagePtr im, cFile | nHandle, int GlobalCM, int Loops); */
HB_FUNC( GDIMAGEGIFANIMBEGIN )
{
if ( hb_pcount() == 4 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
( hb_parinfo( 2 ) & HB_IT_STRING || hb_parinfo( 2 ) & HB_IT_NUMERIC || ISNIL( 2 ) ) &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC
)
{
gdImagePtr im;
void *iptr;
int size;
int GlobalCM, Loops;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
/* Retrieve global color map value */
GlobalCM = hb_parni( 3 );
/* Retrieve Loops value */
Loops = hb_parni( 4 );
/* run function */
iptr = gdImageGifAnimBeginPtr(im, &size, GlobalCM, Loops);
/* Check if 2nd parameter is a file name or an handle */
if ( hb_parinfo( 2 ) & HB_IT_STRING )
{
char *szFile;
szFile = hb_parcx( 2 );
SaveImageToFile( szFile, iptr, size );
}
else if ( hb_parinfo( 2 ) & HB_IT_NUMERIC || ISNIL( 2 ) )
{
FHANDLE fhandle;
/* Retrieve file handle */
fhandle = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ) ? hb_parnl( 2 ) : 1; /* 1 = std output */
SaveImageToHandle( fhandle, iptr, size );
}
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 3,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) );
return;
}
}
}
| gdwrp.c | 4004 |
HB_FUNC | GDIMAGEGIFANIMADD(void)
/* implementation: (void *) gdImageGifAnimAdd( gdImagePtr im, cFile | nHandle, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm); */
HB_FUNC( GDIMAGEGIFANIMADD )
{
if ( hb_pcount() == 8 &&
hb_parinfo( 1 ) & HB_IT_POINTER &&
( hb_parinfo( 2 ) & HB_IT_STRING || hb_parinfo( 2 ) & HB_IT_NUMERIC || ISNIL( 2 ) ) &&
hb_parinfo( 3 ) & HB_IT_NUMERIC &&
hb_parinfo( 4 ) & HB_IT_NUMERIC &&
hb_parinfo( 5 ) & HB_IT_NUMERIC &&
hb_parinfo( 6 ) & HB_IT_NUMERIC &&
hb_parinfo( 7 ) & HB_IT_NUMERIC &&
( hb_parinfo( 8 ) & HB_IT_POINTER || ISNIL( 8 ) )
)
{
gdImagePtr im, previm;
void *iptr;
int size;
int LocalCM, LeftOfs, TopOfs, Delay, Disposal;
/* Retrieve parameters */
im = hb_parGdImage( 1 );
LocalCM = hb_parni( 3 );
LeftOfs = hb_parni( 4 );
TopOfs = hb_parni( 5 );
Delay = hb_parni( 6 );
Disposal = hb_parni( 7 );
previm = hb_parGdImage( 8 );
/* Run function and return value */
iptr = gdImageGifAnimAddPtr(im, &size, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm);
/* Check if 2nd parameter is a file name or an handle */
if ( hb_parinfo( 2 ) & HB_IT_STRING )
{
char *szFile;
szFile = hb_parcx( 2 );
AddImageToFile( szFile, iptr, size );
}
else if ( hb_parinfo( 2 ) & HB_IT_NUMERIC || ISNIL( 2 ) )
{
FHANDLE fhandle;
/* Retrieve file handle */
fhandle = ( hb_parinfo( 2 ) & HB_IT_NUMERIC ) ? hb_parnl( 2 ) : 1; /* 1 = std output */
SaveImageToHandle( fhandle, iptr, size );
}
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 8,
hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ),
hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 )
);
return;
}
}
}
| gdwrp.c | 4066 |
HB_FUNC | GDIMAGEGIFANIMEND(void)
/* implementation: gdImageGifAnimEnd( cFile | nHandle ); */
HB_FUNC( GDIMAGEGIFANIMEND )
{
if ( hb_pcount() == 1 &&
( hb_parinfo( 1 ) & HB_IT_STRING || hb_parinfo( 1 ) & HB_IT_NUMERIC || ISNIL( 1 ) )
)
{
void *iptr;
int size;
/* Run function and return value */
iptr = gdImageGifAnimEndPtr(&size);
/* Check if 1st parameter is a file name or an handle */
if ( hb_parinfo( 1 ) & HB_IT_STRING )
{
char *szFile;
szFile = hb_parcx( 1 );
AddImageToFile( szFile, iptr, size );
}
else if ( hb_parinfo( 2 ) & HB_IT_NUMERIC || ISNIL( 2 ) )
{
FHANDLE fhandle;
/* Retrieve file handle */
fhandle = ( hb_parinfo( 1 ) & HB_IT_NUMERIC ) ? hb_parnl( 1 ) : 1; /* 1 = std output */
SaveImageToHandle( fhandle, iptr, size );
}
}
else
{
/* Parameter error */
{
hb_errRT_BASE_SubstR( EG_ARG, 0, NULL,
HB_ERR_FUNCNAME, 1,
hb_paramError( 1 )
);
return;
}
}
}
| gdwrp.c | 4135 |
gd.prg |
Type | Function | Source | Line |
FUNCTION | gdImageChar( im, font, x, y, char, color )
FUNCTION gdImageChar( im, font, x, y, char, color )
RETURN gdImageString( im, font, x, y, char, color )
| gd.prg | 61 |
FUNCTION | gdImageCharUp( im, font, x, y, char, color )
FUNCTION gdImageCharUp( im, font, x, y, char, color )
RETURN gdImageStringUp( im, font, x, y, char, color )
| gd.prg | 64 |
FUNCTION | gdImageCircle( im, cx, cy, w, color )
FUNCTION gdImageCircle( im, cx, cy, w, color )
RETURN gdImageArc( im, cx, cy, w, w, 0, 360, color )
| gd.prg | 67 |
FUNCTION | gdImageFilledCircle( im, cx, cy, w, color )
FUNCTION gdImageFilledCircle( im, cx, cy, w, color )
RETURN gdImageFilledEllipse( im, cx, cy, w, w, color )
| gd.prg | 70 |
FUNCTION | gdImageEllipse( im, cx, cy, w, h, color )
FUNCTION gdImageEllipse( im, cx, cy, w, h, color )
RETURN gdImageArc( im, cx, cy, w, h, 0, 360, color )
| gd.prg | 73 |
FUNCTION | gdImageFTWidth( fontname, ptsize, angle )
FUNCTION gdImageFTWidth( fontname, ptsize, angle )
LOCAL nWidth := 0
LOCAL cErr
LOCAL aRect := Array(8)
DEFAULT fontname TO "Arial"
DEFAULT ptsize TO 8
DEFAULT angle TO 0
cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" )
//__OutDebug( "ptsize", ptsize, aRect )
IF cErr == ""
nWidth := aRect[3] - aRect[1]
ENDIF
RETURN nWidth
| gd.prg | 76 |
FUNCTION | gdImageFTHeight( fontname, ptsize, angle )
FUNCTION gdImageFTHeight( fontname, ptsize, angle )
LOCAL nWidth := 0
LOCAL cErr
LOCAL aRect := Array(8)
DEFAULT fontname TO "Arial"
DEFAULT ptsize TO 8
DEFAULT angle TO 0
cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, "M" )
IF cErr == ""
nWidth := aRect[2] - aRect[8]
ENDIF
RETURN nWidth
| gd.prg | 91 |
FUNCTION | gdImageFTSize( string, fontname, ptsize, angle )
FUNCTION gdImageFTSize( string, fontname, ptsize, angle )
LOCAL nWidth := 0
LOCAL nHeight := 0
LOCAL nX, nY
LOCAL cErr
LOCAL aRect := Array(8)
DEFAULT fontname TO "Arial"
DEFAULT ptsize TO 8
DEFAULT angle TO 0
cErr := gdImageStringFTEx( , @aRect, 0, fontname, ptsize, angle, 0, 0, string )
//__OutDebug( "ptsize", ptsize, aRect )
IF cErr == ""
nWidth := aRect[3] - aRect[1]
nHeight := aRect[2] - aRect[8]
nX := aRect[1]
nY := aRect[2]
ENDIF
RETURN { nWidth, nHeight, nX, nY }
| gd.prg | 106 |
FUNCTION | gdImageStringFT( im, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution )
FUNCTION gdImageStringFT( im, fg, fontname, ptsize, angle, x, y, string, ;
linespacing, charmap, resolution )
LOCAL cErr
LOCAL aRect := Array(8)
cErr := gdImageStringFTEx( , @aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution )
IF cErr == ""
cErr := gdImageStringFTEx( im, aRect, fg, fontname, ptsize, angle, x, y, string, linespacing, charmap, resolution )
ENDIF
RETURN cErr
| gd.prg | 126 |
FUNCTION | gdImageFromFile( cFile )
FUNCTION gdImageFromFile( cFile )
LOCAL cPath, cName, cExt, cDrive
LOCAL cType, cMime
LOCAL hFile := {=>}
LOCAL oImage
IF File( cFile )
HB_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive )
//TraceLog( cFile, cPath, cName, cExt, cDrive )
cExt := Lower( cExt )
DO CASE
CASE cExt == ".jpg" .OR. cExt == ".jpeg"
hFile[ "file" ] := cFile
hFile[ "path" ] := cPath
hFile[ "name" ] := cName
hFile[ "ext" ] := cExt
hFile[ "drive" ] := cDrive
cType := "jpeg"
cMime := "image/jpeg"
oImage := GDImage():LoadFromJpeg( cFile )
CASE cExt == ".gif"
hFile[ "file" ] := cFile
hFile[ "path" ] := cPath
hFile[ "name" ] := cName
hFile[ "ext" ] := cExt
hFile[ "drive" ] := cDrive
cType := "gif"
cMime := "image/gif"
oImage := GDImage():LoadFromGif( cFile )
CASE cExt == ".png"
hFile[ "file" ] := cFile
hFile[ "path" ] := cPath
hFile[ "name" ] := cName
hFile[ "ext" ] := cExt
hFile[ "drive" ] := cDrive
cType := "png"
cMime := "image/png"
oImage := GDImage():LoadFromPng( cFile )
ENDCASE
ENDIF
RETURN { oImage, hFile, cType, cMime }
| gd.prg | 136 |
FUNCTION | gdImageToString( oImage )
FUNCTION gdImageToString( oImage )
LOCAL cString
//Tracelog( "oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' )", ;
// oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' ) )
IF ValType( oImage ) == "O" .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) )
WITH OBJECT oImage
IF :cType != NIL
DO CASE
CASE :cType == "jpeg"
cString := :ToStringJpeg()
CASE :cType == "gif"
cString := :ToStringGif()
CASE :cType == "png"
cString := :ToStringPng()
ENDCASE
ENDIF
END
ENDIF
RETURN cString
| gd.prg | 184 |
PROCEDURE | gdImageToFile( oImage, cFile )
PROCEDURE gdImageToFile( oImage, cFile )
LOCAL cString, cExt
DEFAULT cFile TO "image"
//Tracelog( "oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' )", ;
// oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' ) )
IF ValType( oImage ) == "O" .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) )
WITH OBJECT oImage
IF :cType != NIL
DO CASE
CASE :cType == "jpeg"
cString := :ToStringJpeg()
cExt := "jpg"
CASE :cType == "gif"
cString := :ToStringGif()
cExt := "gif"
CASE :cType == "png"
cString := :ToStringPng()
cExt := "png"
ENDCASE
IF cString != NIL
MemoWrit( cFile + "." + cExt, cString )
ENDIF
ENDIF
END
ENDIF
RETURN
| gd.prg | 206 |
PROCEDURE | gdImageToHandle( oImage, nHandle )
PROCEDURE gdImageToHandle( oImage, nHandle )
DEFAULT nHandle TO 1
//Tracelog( "oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' )", ;
// oImage, oImage:ClassName, oImage:IsDerivedFrom( 'GDIMAGE' ) )
IF ValType( oImage ) == "O" .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) )
WITH OBJECT oImage
IF :cType != NIL
DO CASE
CASE :cType == "jpeg"
:OutputJpeg( nHandle )
CASE :cType == "gif"
:OutputGif( nHandle )
CASE :cType == "png"
:OutputPng( nHandle )
ENDCASE
ENDIF
END
ENDIF
RETURN
| gd.prg | 237 |
gdbar.prg |
Type | Function | Source | Line |
CLASS | TBarCode FROM GDImage
CLASS TBarCode FROM GDImage
// class attributes
DATA positionX AS NUMERIC INIT 4
DATA positionY AS NUMERIC
DATA maxHeight AS NUMERIC INIT 25
DATA maxHDefa AS NUMERIC INIT 25
DATA lastX AS NUMERIC
DATA lastY AS NUMERIC
DATA error AS NUMERIC
DATA imWidth AS NUMERIC
// Barcode attributes
DATA Parity
DATA LeftHand_Even AS ARRAY
DATA Right_Hand AS ARRAY
DATA LeftHand_Odd AS ARRAY
DATA keys AS ARRAY
DATA book AS LOGICAL INIT .F.
DATA acode AS ARRAY
DATA KeysModeA AS CHARACTER
DATA KeysModeB AS CHARACTER
DATA KeysModeC AS ARRAY
// image attributes
DATA res AS NUMERIC
DATA textfont AS NUMERIC
DATA text AS CHARACTER
DATA filename AS CHARACTER
DATA color_b AS ARRAY
DATA color_f AS ARRAY
DATA FillColor AS NUMERIC
DATA BackColor AS NUMERIC
DATA lDrawValue AS LOGICAL INIT .T.
// Methods
METHOD CreateBar( sx, sy, filename, ccolor)
METHOD Configure( nmaxHeight, aFillColor, aBackColor, nres, ntextfont, lbook, lDrawValue )
METHOD Allocate()
METHOD DrawError(ptext)
METHOD DrawSingleBar(pcode )
METHOD DrawSingleI25( pcode )
METHOD DrawText()
METHOD nextX()
METHOD Finish( image_style, quality )
METHOD SetText( ptext )
METHOD ResetColor()
METHOD CheckCode()
METHOD CheckValInArray(cchar)
ENDCLASS
| gdbar.prg | 70 |
TBARCODE:METHOD | CreateBar( sx, sy, filename, ccolor ) CLASS TBarCode
METHOD CreateBar( sx, sy, filename, ccolor ) CLASS TBarCode
::Create(sx, sy)
DEFAULT ccolor TO {255,255,255}
::setcolor( ccolor[1], ccolor[2], ccolor[3] )
::error := 0
::positionY := 0
::imWidth := sx
if !empty( filename )
::filename := filename
endif
::FillColor := ::setcolor( ::color_f[1] ,::color_f[2] ,::color_f[3] )
::BackColor := ::setcolor( ::color_b[1] ,::color_b[2] ,::color_b[3] )
::Setfont("Arial")
// configures Fontes
If ::textfont == 1 ; ::SetFontSmall()
ElseIf ::textfont == 2 ; ::SetFontLarge()
ElseIf ::textfont == 3 ; ::SetFontMediumBold()
ElseIf ::textfont == 4 ; ::SetFontGiant()
ElseIf ::textfont == 5 ; ::SetFontTiny()
EndIf
::SetFontPitch(::textfont)
// always restores
::maxHeight := ::maxHDefa
Return Self
| gdbar.prg | 123 |
TBARCODE:METHOD | Configure( nmaxHeight, aFillColor, aBackColor, nres, ntextfont, lbook, lDrawValue ) CLASS TBarCode
METHOD Configure( nmaxHeight, aFillColor, aBackColor, nres, ntextfont, lbook, lDrawValue ) CLASS TBarCode
DEFAULT lbook TO .F.
DEFAULT lDrawValue TO .T.
DEFAULT nmaxHeight TO 25
DEFAULT ntextfont TO 2
DEFAULT nres TO 2
DEFAULT aBackColor TO {255,255,255}
DEFAULT aFillColor TO {0,0,0}
::book := lbook
::maxHeight := nmaxHeight
::res := nres
::textfont := ntextfont
::lDrawValue := lDrawValue
::color_b := aClone(aBackColor)
::color_f := aClone(aFillColor)
RETURN NIL
| gdbar.prg | 159 |
TBARCODE:METHOD | SetText( ptext ) CLASS TBarCode
METHOD SetText( ptext ) CLASS TBarCode
::text := ptext
Return NIL
| gdbar.prg | 181 |
TBARCODE:METHOD | ResetColor() CLASS TBarCode
METHOD ResetColor() CLASS TBarCode
::FillColor := ::setcolor( ::color_f[1] ,::color_f[2] ,::color_f[3] )
::BackColor := ::setcolor( ::color_b[1] ,::color_b[2] ,::color_b[3] )
Return NIL
| gdbar.prg | 187 |
TBARCODE:METHOD | Allocate() CLASS TBarCode
METHOD Allocate() CLASS TBarCode
LOCAL R := ::color_b[1]
LOCAL G := ::color_b[2]
LOCAL B := ::color_b[3]
Return ::SetColor(R,G,B)
| gdbar.prg | 194 |
TBARCODE:METHOD | DrawSingleBar( pcode ) CLASS TBarCode
METHOD DrawSingleBar( pcode ) CLASS TBarCode
LOCAL i := 0
LOCAL j := 0
For j := 1 To Len( pcode )
For i := 1 TO ::res
::Line( ::positionX + i , ::positionY , ::positionX + i , (::positionY+::maxHeight) ,;
iif( SubStr(pcode,j,1) $ "0", ::BackColor, ::FillColor ) )
Next
::NextX()
Next
Return NIL
| gdbar.prg | 202 |
TBARCODE:METHOD | DrawSingleI25( pcode ) CLASS TBarCode
METHOD DrawSingleI25( pcode ) CLASS TBarCode
LOCAL i := 0
LOCAL j := 0
LOCAL widthSlimBar := 1
LOCAL widthFatBar := 3
LOCAL imgBar
LOCAL imgWid
LOCAL end_y
LOCAL qw
::positionX := 10
For j := 1 To Len( pcode )
imgBar := iif( j % 2 == 0, ::FillColor, ::BackColor )
imgWid := iif( SubStr(pcode,j,1) =="0" , widthSlimBar, widthFatBar )
end_y := ::maxHeight
For qw := 1 TO imgWid
::Line( ::positionX, 1, ::positionX, end_y, imgBar)
::nextX(.T.)
Next
Next
Return NIL
| gdbar.prg | 220 |
TBARCODE:METHOD | DrawError(ptext) CLASS TBarCode
METHOD DrawError(ptext) CLASS TBarCode
::Say( 5, ::error*15, ptext, ::FillColor )
::error++
::lastX := iif( (::GetFontWidth()*Len(ptext) ) > ::lastX , ( ::GetFontWidth()*Len(ptext)) , ::lastX )
::lastY := ::error*15
Return NIL
| gdbar.prg | 252 |
TBARCODE:METHOD | nextX(lI25) CLASS TBarCode
METHOD nextX(lI25) CLASS TBarCode
DEFAULT li25 TO .F.
If li25
::positionX ++
Else
::positionX += ::res
EndIf
Return NIL
| gdbar.prg | 263 |
TBARCODE:METHOD | DrawText(lIsI25) CLASS TBarCode
METHOD DrawText(lIsI25) CLASS TBarCode
LOCAL xPosition
DEFAULT lIsI25 TO .F.
If lIsI25
If ::textfont != 0
xPosition := 10 * ::GetFontWidth()
::say( xPosition, ::maxHeight, "*" + ::text + "*" , ::FillColor )
::lastY := ::maxHeight + ::GetFontHeight()
EndIf
Else
If ::textfont != 0
xPosition := ( ::positionX / 2) - ( Len( ::text ) /2 ) * ::GetFontWidth()
::say( xPosition, ::maxHeight, ::text, ::FillColor )
::lastY := ::maxHeight + ::GetFontHeight()
EndIf
EndIf
Return .T.
| gdbar.prg | 275 |
TBARCODE:METHOD | CheckCode() CLASS TBarCode
METHOD CheckCode() CLASS TBarCode
LOCAL lRet := .T.
LOCAL i
For i := 1 To Len( ::text )
If !IsInt( ::CheckValInArray( SubStr( ::text, i, 1 ) ) )
::DrawError("Character "+SubStr( ::text, i, 1 )+" not allowed .")
lRet := .F.
EndIf
Next
Return lRet
| gdbar.prg | 297 |
TBARCODE:METHOD | CheckValInArray(cchar) CLASS TBarCode
METHOD CheckValInArray(cchar) CLASS TBarCode
LOCAL npos
LOCAL uret
npos := ASCAN( ::keys, { |x| SubStr( x, 1, 1 ) == cchar } )
If npos > 0
uret := npos
Else
uret := NIL
EndIf
Return uret
| gdbar.prg | 311 |
TBARCODE:METHOD | Finish( image_style, quality, nFG ) CLASS TBarCode
METHOD Finish( image_style, quality, nFG ) CLASS TBarCode
DEFAULT image_style TO IMG_FORMAT_PNG
DEFAULT quality TO 95
DEFAULT nFG TO {255,255,255}
If Empty( ::filename ) .OR. ::filename == NIL
// Output std handle == 1
//::filename := ::text
If image_style == IMG_FORMAT_PNG
::OutputPng()
Elseif image_style == IMG_FORMAT_JPEG
::OutputJpeg( , quality )
ElseIf image_style == IMG_FORMAT_WBMP
::OutputWBmp( , nFG )
ElseIf image_style == IMG_FORMAT_GIF
::OutputGif()
EndIf
else
If image_style == IMG_FORMAT_PNG
::SavePng( ::filename )
Elseif image_style == IMG_FORMAT_JPEG
::Savejpeg( ::filename, quality )
ElseIf image_style == IMG_FORMAT_WBMP
::SaveWBmp( ::filename, nFG )
ElseIf image_style == IMG_FORMAT_GIF
::SaveGif( ::filename )
EndIf
EndIf
Return .T.
| gdbar.prg | 326 |
FUNCTION | IsInt( pvar )
FUNCTION IsInt( pvar )
If Valtype( pvar ) == "C"
Return .F.
EndIf
Return .T.
| gdbar.prg | 379 |
gdbarcod.prg |
Type | Function | Source | Line |
CLASS | TCode FROM TBarCode
CLASS TCode FROM TBarCode
DATA nType
// EAN-13 ISBN
METHOD New( nType ) CONSTRUCTOR
METHOD Draw( cText )
METHOD Draw13( cText )
METHOD DrawText13()
// EAN-8
METHOD Draw8( cText )
METHOD DrawText8()
// EAN-128
METHOD Draw128( cText, cModeCode )
// I25
METHOD DrawI25( cText )
METHOD GenCodei25()
// Utils
METHOD FindCharCode( cstring, cchar )
METHOD MixCode(bar_string)
METHOD Findcode( uval )
ENDCLASS
| gdbarcod.prg | 69 |
TCODE:METHOD | New( nTypeCode ) CLASS TCode
METHOD New( nTypeCode ) CLASS TCode
Local ii
If ( nTypeCode == 13 .OR.;
nTypeCode == 8 )
::LeftHand_Odd := {"0011001", "0010011", "0111101", "0100011", "0110001", "0101111", "0111011", "0110111", "0001011","0001101"}
::LeftHand_Even := {"0110011", "0011011", "0100001", "0011101", "0111001", "0000101", "0010001", "0001001", "0010111","0100111"}
::Right_Hand := {"1100110", "1101100", "1000010", "1011100", "1001110", "1010000", "1000100", "1001000", "1110100","1110010"}
::Parity := {"OOEOEE", "OOEEOE", "OOEEEO", "OEOOEE", "OEEOOE", "OEEEOO", "OEOEOE", "OEOEEO", "OEEOEO","OOOOOO" }
::keys := {'1','2','3','4','5','6','7','8','9','0'}
ElseIf nTypeCode == 128 // 128
::aCode :={ "212222","222122","222221","121223","121322","131222","122213","122312","132212","221213",;
"221312","231212","112232","122132","122231","113222","123122","123221","223211","221132",;
"221231","213212","223112","312131","311222","321122","321221","312212","322112","322211",;
"212123","212321","232121","111323","131123","131321","112313","132113","132311","211313",;
"231113","231311","112133","112331","132131","113123","113321","133121","313121","211331",;
"231131","213113","213311","213131","311123","311321","331121","312113","312311","332111",;
"314111","221411","431111","111224","111422","121124","121421","141122","141221","112214",;
"112412","122114","122411","142112","142211","241211","221114","213111","241112","134111",;
"111242","121142","121241","114212","124112","124211","411212","421112","421211","212141",;
"214121","412121","111143","111341","131141","114113","114311","411113","411311","113141",;
"114131","311141","411131","211412","211214","211232","2331112";
}
::KeysmodeA := " " + [!"#$%&\()*+-.,/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ] + "[\]^_"
::KeysmodeB := " " + [!"#$%&\()*+-.,/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ] + "[\]^_abcdefghijklmnopqrstuvwxyz{|}~"
::KeysModeC := Array(99)
For ii := 1 TO 99
::KeysmodeC[ii] := StrZero(ii,2)
Next
ElseIf nTypeCode == 25
::keys := {'1','2','3','4','5','6','7','8','9','0'}
::aCode := Array(12)
::aCode[1] := "10001" //1 digit
::aCode[2] := "01001" //2 digit
::aCode[3] := "11000" //3 digit
::aCode[4] := "00101" //4 digit
::aCode[5] := "10100" //5 digit
::aCode[6] := "01100" //6 digit
::aCode[7] := "00011" //7 digit
::aCode[8] := "10010" //8 digit
::aCode[9] := "01010" //9 digit
::aCode[10] := "00110" //0 digit
::acode[11] := "10000" //pre-amble
::acode[12] := "100" //post-amble
Else
Alert(" Invalid type to barcode !")
Return NIL
EndIf
::nType := nTypeCode
Return SELF
| gdbarcod.prg | 98 |
TCODE:METHOD | Draw( cText ) CLASS TCode
METHOD Draw( cText ) CLASS TCode
if ::nType == 13
::Draw13( cText )
elseif ::nType == 8
::Draw8( cText )
elseif ::nType == 128
::Draw128( cText )
elseif ::nType == 25
::DrawI25( cText )
endif
Return NIL
| gdbarcod.prg | 166 |
TCODE:METHOD | Draw13(cText) CLASS TCode
METHOD Draw13(cText) CLASS TCode
LOCAL lerror := .f.
LOCAL nchkSum :=0
LOCAL nChk :=0
LOCAL ii,jj
LOCAL xParity
::Settext( ctext )
// Valid characters
If !::CheckCode()
lerror := .T.
EndIf
If !lerror
If ::book .AND. Len( ::text) != 10
::DrawError("Must contains 10 chars if ISBN is true.")
lerror := .T.
EndIf
// book, we changed the code to the right
If ( ::book .And. Len( ::text )==10 )
::text := "978"+substr(::text,1, Len( ::text )-1 )
EndIF
// contain only 12 characters ?
If Len( ::text ) != 12
::DrawError( "Must contains 12 chars, the 13th digit is automatically added.")
lerror := .t.
EndIf
If !lerror
// If we have to write text, we moved the barcode to the right to have space to put digit
::positionX := iif( ::textfont == 0 , 0, 10 )
xParity := ::Parity[ Val( SubStr( ::text, 1, 1 ) ) ]
// First Bar
::positionX := 10
::maxHeight := ::maxHeight + 9
::DrawSingleBar("101")
// start code
::maxHeight := ::maxHeight - 9
For ii := 1 To Len( ::text )
// Calculate check digit
If Mod( ((Len(::text) + 1) - ii), 2 ) == 0
nchkSum := nchkSum + Int( Val( Substr(::text , ii, 1) ) )
Else
nchkSum := nchkSum + Int( Val( Substr( ::text , ii, 1) ) ) * 3
EndIf
// ANow, the bar of the middle
If ii == 8
::positionX += 1
::maxHeight := ::maxHeight + 9
::DrawSingleBar("101")
::maxHeight := ::maxHeight - 9
::positionX += 1
EndIf
jj := Val( SubStr( ::text, ii, 1) )
If jj == 0
jj := 10
EndIf
If ii > 1 .And. ii < 8
::DrawSingleBar( iif( Substr(xParity, ii - 1, 1) == "E",;
::LeftHand_Even[jj],;
::LeftHand_Odd[jj] ) )
ElseIf ii > 1 .And. ii >= 8
::DrawSingleBar( ::Right_Hand[jj] )
EndIf
Next
jj := Mod( nchkSum, 10 )
If jj != 0
nChk := 10 - jj
EndIf
If nChk == 0
nChk := 10
EndIf
::DrawSingleBar( ::Right_Hand[nChk] )
// Now, finish bar
::maxHeight := ::maxHeight + 9
::DrawSingleBar("101")
::lastX := ::positionX
::lastY := ::maxHeight
ctext+=AllTrim( Str( nChk,1 ) )
// Draw Text
If ::lDrawValue
::Settext( ctext )
::DrawText13()
EndIf
EndIf
EndIf
Return NIL
| gdbarcod.prg | 180 |
TCODE:METHOD | DrawText13() CLASS TCode
METHOD DrawText13() CLASS TCode
if ( ::textfont != 0 )
::Say( 2, ::maxHeight-( ::GetFontHeight() / 2 ),SubStr( ::text,1,1) , ::FillColor )
::Say( (10+(3*::res+48*::res)/2)-(::GetFontWidth()*(6/2)),::maxHeight+1,substr(::text,2,6), ::FillColor )
::Say( 10+46*::res+(3*::res+46*::res)/2-::GetFontWidth()*(6/2),::maxHeight+1,substr(::text,8,6),::FillColor)
EndIf
::lastY := ::maxHeight + ::GetFontHeight()
Return NIL
| gdbarcod.prg | 298 |
TCODE:METHOD | Draw8( cText ) CLASS TCode
METHOD Draw8( cText ) CLASS TCode
LOCAL lerror := .f.
LOCAL ii,jj
LOCAL xParity
LOCAL nchkSum := 0
LOCAL nChk := 0
::Settext( ctext )
// Valid characters
If !::CheckCode()
lerror := .T.
EndIf
If !lerror
::positionX := iif( ::textfont == 0 , 0, 10 )
xParity := ::Parity[ 7 ]
// First Bar
::positionX := 10
::maxHeight := ::maxHeight + 9
::DrawSingleBar("101")
// Start Code
::maxHeight := ::maxHeight - 9
For ii := 1 To Len(::text)
If Mod( ((Len(::text) + 1 ) - ii ), 2 ) == 0
nchkSum := nchkSum + Int( Val(Substr( ::text, ii, 1) ) )
Else
nchkSum := nchkSum + Int( Val(Substr( ::text, ii, 1) ) ) * 3
EndIf
If ii == 5
::positionX += 1
::maxHeight := ::maxHeight + 9
::DrawSingleBar("01010")
::maxHeight := ::maxHeight - 9
::positionX += 1
EndIf
jj := Val( SubStr( ::text, ii, 1) )
If jj == 0
jj := 10
EndIf
If ii < 5
::DrawSingleBar( ::LeftHand_Odd[jj] )
ElseIf ii >= 5
::DrawSingleBar( ::Right_Hand[jj] )
EndIf
Next
jj := Mod( nchkSum, 10 )
If jj != 0
nChk := 10 - jj
EndIf
::DrawSingleBar(::Right_Hand[nChk])
// Now, finish bar
::maxHeight := ::maxHeight + 9
::DrawSingleBar("101")
::lastX := ::positionX
::lastY := ::maxHeight
ctext+=AllTrim( Str( nChk,1 ) )
// Draw text
If ::lDrawValue
::Settext( ctext )
::DrawText8()
EndIf
EndIf
Return NIL
| gdbarcod.prg | 312 |
TCODE:METHOD | DrawText8() CLASS TCode
METHOD DrawText8() CLASS TCode
::say( 10+( (3*::res+34*::res)/2-::GetFontWidth()*(4/2) ),::maxHeight+1, substr( ::text,1,4 ),::fillcolor)
::say(10+(32*::res+(3*::res+32*::res)/2-::GetFontWidth()*(4/2)),::maxHeight+1,substr(::text,5,4),::fillcolor)
::lastY := ::maxHeight + ::GetFontHeight()
Return NIL
| gdbarcod.prg | 399 |
TCODE:METHOD | FindCharCode( cstring, cchar ) CLASS TCode
METHOD FindCharCode( cstring, cchar ) CLASS TCode
LOCAL i
LOCAL nC := 0
LOCAL nret := 0
FOR i := 1 TO Len( cstring )
If SubStr( cstring, i, 1 ) == cchar
++nC
nRet := nC
EXIT
EndIf
++nC
NEXT
Return nret
| gdbarcod.prg | 408 |
TCODE:METHOD | Draw128( cText, cModeCode ) CLASS TCode
METHOD Draw128( cText, cModeCode ) CLASS TCode
Local cchar, nvalchar, n, i
Local nSum := 0
Local nC := 0
LOCAL npos := 0
LOCAL value_test := 0
Local lTypeCodeC := .F.
Local lTypeCodeA := .F.
LOCAL lerror := .F.
Local cBarCode := ""
Local cconc := ""
DEFAULT cModeCode TO "B"
::settext( cText )
If !Empty( cModeCode )
If valtype(cModeCode)='C' .and. Upper(cModeCode) $'ABC'
cModeCode := Upper(cModeCode)
Else
::DrawError("Code 128 Modes are A,B o C. Character values.")
lerror := .T.
EndIf
EndIf
// Checking if all chars are allowed
For i := 1 TO Len( ::text )
If cModeCode == "C"
npos := AsCAn( ::KeysmodeC, { |x| x == SubStr( ::Text, i, 1 ) + SubStr( ::Text, i+1, 1 ) } )
If npos == 0
::DrawError("With Code C, you must provide always pair of two integers. Char "+SubStr( ::text, i, 1 )+SubStr( ::text, i+1, 1 )+" not allowed." )
lerror := .T.
EndIf
ElseIf cModeCode == "B"
If ::FindCharCode( ::KeysmodeB, SubStr( ::Text, i, 1 ) ) == 0
::DrawError('Char '+ SubStr( ::text, i, 1 )+" not allowed.")
lerror := .T.
EndIf
ElseiF cModeCode == "A"
If ::FindCharCode( ::KeysmodeA, SubStr( ::text, i, 1 ) ) == 0
::DrawError('Char '+ SubStr( ::text, i, 1 ) +" not allowed.")
lerror := .T.
EndIf
EndIf
Next
If !lerror
If Empty(cModeCode)
If Str( Val( ::text ), Len( ::text ) ) == ::text
lTypeCodeC := .T.
cconc := ::aCode[ STARTC ]
nSum := STARTB
Else
For n := 1 TO Len( ::text )
nC += iif( substr( ::text ,n,1 ) > 31, 1, 0 )
Next
If nC < Len( ::text ) / 2
lTypeCodeA:= .t.
cconc := ::aCode[STARTA]
nSum := FNC1
Else
cconc := ::aCode[STARTB]
nSum := STARTA
EndIf
EndIf
Else
If cModeCode =='C'
lTypeCodeC := .T.
cconc := ::aCode[STARTC]
nSum := STARTB
Elseif cModeCode =='A'
lTypeCodeA := .t.
cconc := ::aCode[STARTB]
nSum := FNC1
Else
cconc := ::aCode[STARTB]
nSum := STARTA
EndIf
EndIf
nC := 0
For n := 1 To Len( ::text )
nC ++
cchar := Substr(::text,n,1)
if lTypeCodeC
If Len( ::TEXT ) == n
cconc += ::aCode[101]
nvalchar := Asc(cchar)-31
Else
nvalchar := Val(Substr( ::text,n,2 ) ) + 1
n++
EndIf
Elseif lTypeCodeA
If cchar > '_'
cconc += ::aCode[101]
nvalchar := Asc(cchar)-31
Elseif cchar <= ' '
nvalchar := Asc(cchar)+64
Else
nvalchar := Asc(cchar)-31
Endif
Else
If cchar < ' '
cconc += ::aCode[CODEA]
nvalchar := Asc(cchar)+64
Else
nvalchar := Asc(cchar)-31
EndIf
Endif
nSum += (nvalchar-1)*nC
cconc := cconc +::aCode[nvalchar]
next
nSum := nSum%103 +1
cconc := cconc + ::aCode[ nSum ] +::aCode[107]
For n:=1 To Len(cconc) STEP 2
cBarCode +=Replicate('1', Val( Substr( cconc, n,1 ) ) )
cBarCode +=Replicate('0', Val( substr( cconc, n+1,1 ) ) )
Next
::DrawSingleBar( cBarCode )
::lastX := ::positionX
::lastY := ::maxHeight
// Draw Text
If ::lDrawValue
::Settext( ctext )
::DrawText()
EndIf
EndIf
Return NIL
| gdbarcod.prg | 428 |
TCODE:METHOD | DrawI25( cText ) CLASS TCode
METHOD DrawI25( cText ) CLASS TCode
::settext( cText )
::GenCodei25()
Return NIL
| gdbarcod.prg | 602 |
TCODE:METHOD | GenCodei25() CLASS TCode
METHOD GenCodei25() CLASS TCode
LOCAL lError := .F.
LOCAL bc_string := ::text
LOCAL new_string := ""
If ( Len(::text) % 2 )!= 0
::DrawError("Invalid barcode lenght")
lError := .T.
Endif
If !lError
bc_string := upper( ::text )
// encode itemId to I25 barcode standard. //////////////////////////////////////
bc_string := ::MixCode( bc_string )
///////////////////////////////////////////////////////////////////////////////////////////////
//Adding Start and Stop Pattern
::DrawSingleI25( ::acode[11] + bc_string + ::acode[12] )
::lastY := ::maxHeight
// Draw Text
If ::lDrawValue
::DrawText(.T.)
EndIf
EndIf
Return NIL
| gdbarcod.prg | 610 |
TCODE:METHOD | MixCode(value) CLASS TCode
METHOD MixCode(value) CLASS TCode
LOCAL l,i,k
LOCAL s
LOCAL bar_string := ""
LOCAL cfirst
LOCAL cnext
l := Len( value )
If ( l % 2 ) != 0
::DrawError("Code cannot be intercalated: Invalid length (mix)")
Else
i := 1
s := ""
While i < l
cFirst := ::Findcode( value[i] )
cnext := ::Findcode( value[i+1] )
// Mix of the codes
// NNNNWNNWWW
// N N N W W
For k := 1 TO 5
s += cFirst[k] + cnext[k]
Next
i += 2
EndDo
bar_string := s
EndIf
Return bar_string
| gdbarcod.prg | 648 |
TCODE:METHOD | Findcode( uval ) CLASS TCode
METHOD Findcode( uval ) CLASS TCode
LOCAL npos
LOCAL cretc
npos := AsCan( ::keys, { |x| x[1] == uval } )
cretc := ::acode[npos]
Return cretc
| gdbarcod.prg | 687 |
gdchart.prg |
Type | Function | Source | Line |
CLASS | GDChart FROM GDImage
CLASS GDChart FROM GDImage
DATA cTitle
DATA cAxisX
DATA cAxisY
DATA nWidth
DATA nHeight
DATA nScaleX
DATA nScaleY
DATA aSeries
DATA aDataOfHashes // Hash contains graph datas
DATA hDefs
METHOD New( sx, sy ) CONSTRUCTOR
METHOD AddData()
METHOD AddDef()
METHOD SetData()
METHOD SetDefs()
METHOD PieChart()
METHOD VerticalBarChart()
METHOD HorizontalBarChart()
METHOD LineChart()
// clone method for gdchart
METHOD Clone()
PROTECTED:
METHOD CloneDataFrom()
ENDCLASS
| gdchart.prg | 66 |
GDCHART:METHOD | New( sx, sy ) CLASS GDChart
METHOD New( sx, sy ) CLASS GDChart
DEFAULT sx TO 320
DEFAULT sy TO 200
::cTitle := "Chart"
::aSeries := {}
::hDefs := {=>}
::aDataOfHashes := {}
::Create( sx, sy )
RETURN Self
| gdchart.prg | 100 |
GDCHART:METHOD | AddData( hData ) CLASS GDChart
METHOD AddData( hData ) CLASS GDChart
IF ValType( hData ) == "H"
aAdd( ::aDataOfHashes, hData )
ENDIF
RETURN Self
| gdchart.prg | 113 |
GDCHART:METHOD | SetData( aData ) CLASS GDChart
METHOD SetData( aData ) CLASS GDChart
IF ValType( aData ) == "A"
::aDataOfHashes := aData
ENDIF
RETURN Self
| gdchart.prg | 119 |
GDCHART:METHOD | AddDef( cDefKey, xDefVal ) CLASS GDChart
METHOD AddDef( cDefKey, xDefVal ) CLASS GDChart
IF ValType( cDefKey ) == "C"
HB_hSet( ::hDefs, Upper( cDefKey ), xDefVal )
ENDIF
RETURN Self
| gdchart.prg | 125 |
GDCHART:METHOD | SetDefs( hDefs ) CLASS GDChart
METHOD SetDefs( hDefs ) CLASS GDChart
IF ValType( hDefs ) == "H"
::hDefs := hDefs
ENDIF
RETURN Self
| gdchart.prg | 131 |
GDCHART:METHOD | PieChart() CLASS GDChart
METHOD PieChart() CLASS GDChart
LOCAL hElement, nTot := 0
LOCAL nDegree := 0
LOCAL lFilled, lExtruded, nExtrude, nTotExtr := 0, pTile
LOCAL colorp
LOCAL nVal, nDim
LOCAL nPosX, nPosY
LOCAL cLabel, hFont, cFontName, nPitch, nAngle, textcolor
LOCAL x, y, nWidth
LOCAL aPieDataOfHash, hDefs
LOCAL cFontPitch
aPieDataOfHash := ::aDataOfHashes
hDefs := ::hDefs
x := HGetValue( hDefs, "POSX" )
y := HGetValue( hDefs, "POSY" )
nWidth := HGetValue( hDefs, "WIDTH" )
cFontPitch := HGetValue( hDefs, "FONTPITCH" )
DEFAULT x TO ::CenterWidth()
DEFAULT y TO ::CenterHeight()
DEFAULT nWidth TO Min( ::Width(), ::Height() )
DEFAULT cFontPitch TO "TINY"
DO CASE
CASE cFontPitch == "TINY"
::SetFontTiny()
CASE cFontPitch == "SMALL"
::SetFontSmall()
CASE cFontPitch == "MEDIUM"
::SetFontMediumBold()
CASE cFontPitch == "LARGE"
::SetFontLarge()
CASE cFontPitch == "GIANT"
::SetFontGiant()
ENDCASE
//__OutDebug( "x, y, nWidth", x, y, nWidth )
/*
hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"]
*/
// Before sum of values to determine perentual
FOR EACH hElement IN aPieDataOfHash
nTot += hElement["VALUE"]
// Check extrution
IF ( nExtrude := HGetValue( hElement, "EXTRUDE" ) ) <> NIL
nTotExtr := Max( nTotExtr, nExtrude )
ENDIF
NEXT
nWidth -= ( nTotExtr + 2 ) * 2
//__OutDebug( "nTotExtr, nWidth", nTotExtr, nWidth )
// Second,
FOR EACH hElement IN aPieDataOfHash
cLabel := HGetValue( hElement, "LABEL" )
lFilled := HGetValue( hElement, "FILLED" )
nExtrude := HGetValue( hElement, "EXTRUDE" )
pTile := HGetValue( hElement, "TILE" )
IF nExtrude <> NIL
lExtruded := TRUE
ELSE
lExtruded := FALSE
ENDIF
colorp := HGetValue( hElement, "COLOR" )
nVal := hElement["VALUE"]
nDim := 360 * ( ( nVal / nTot ) * 100 ) / 100
DEFAULT lFilled TO FALSE
DEFAULT nExtrude TO 0
DEFAULT colorp TO ::SetColor( 0, 0, 0 )
IF lExtruded
nPosX := x + nExtrude * cos(::Radians( nDegree + nDim / 2 ))
nPosY := y + nExtrude * sin(::Radians( nDegree + nDim / 2 ))
ELSE
nPosX := x
nPosY := y
ENDIF
IF pTile <> NIL
::SetTile( pTile )
colorp := gdTiled
ELSE
if ISARRAY( colorp )
colorp := ::SetColor( colorp[1], colorp[2], colorp[3] )
endif
ENDIF
IF lFilled
::Arc( nPosX, nPosY, nWidth, nWidth, nDegree, nDegree + nDim, TRUE, colorp, gdPie )
ELSE
::Arc( nPosX, nPosY, nWidth, nWidth, nDegree, nDegree + nDim, TRUE, colorp, gdNoFill + gdEdged )
ENDIF
IF cLabel <> NIL
//hFont := HGetValue( hElement, "FONT" )
//IF hFont == NIL
// ::SetFontMediumBold()
cFontName := NIL
nPitch := NIL
nAngle := NIL
textcolor := NIL
//ELSE
// cFontName := HGetValue( hFont, "NAME" )
// nPitch := HGetValue( hFont, "PITCH" )
// nAngle := HGetValue( hFont, "ANGLE" )
// textcolor := HGetValue( hFont, "COLOR" )
// DEFAULT cFontName TO "Arial"
// DEFAULT nPitch TO 8
// DEFAULT nAngle TO 0
//ENDIF
nPosX := nPosX + ( (nExtrude + nWidth) / 4 ) * cos(::Radians( nDegree + nDim / 2 ))
nPosY := nPosY + ( (nExtrude + nWidth) / 4 ) * sin(::Radians( nDegree + nDim / 2 ))
IF textcolor == NIL
colorp := ::GetPixel( nPosX, nPosY )
textcolor := ::SetColor( 255 - ::Red( colorp ), 255 - ::Green( colorp ), 255 - ::Blue( colorp ) )
ENDIF
//cTitle := LTrim( Str( nVal ) )
IF hFont == NIL
::Say( nPosX, nPosY, cLabel, textcolor, gdAlignCenter )
ELSE
::SayFreeType( nPosX, nPosY, cLabel, cFontName, nPitch, nAngle, textcolor, gdAlignCenter )
ENDIF
ENDIF
nDegree += nDim + 0.1
NEXT
RETURN Self
| gdchart.prg | 137 |
GDCHART:METHOD | VerticalBarChart() CLASS GDChart
METHOD VerticalBarChart() CLASS GDChart
LOCAL hElement, nTot := 0
LOCAL nDegree := 0
LOCAL lFilled, lExtruded, nExtrude, pTile
LOCAL colorp
LOCAL nVal, nDim
LOCAL nPosX, nPosY
LOCAL nSize, nMax
LOCAL nBorder, nThick, n
LOCAL x, y, nWidth, nHeight, nMaxValue, color, nMaxLabel, cLabel
LOCAL lShowAxis, lShowGrid
LOCAL nLeftLabelSpace //:= 40
LOCAL nRightLabelSpace //:= 40
LOCAL nBottomLabelSpace //:= 40
LOCAL nTopLabelSpace := 40
LOCAL lShowLabelLeft := TRUE
LOCAL lShowLabelRight := TRUE //FALSE
LOCAL lShowLabelBottom := TRUE
LOCAL lShowLabelTop := FALSE
LOCAL cAxisPict
LOCAL cFontPitch
LOCAL aDataOfHash, hDefs
aDataOfHash := ::aDataOfHashes
hDefs := ::hDefs
x := HGetValue( hDefs, "POSX" )
y := HGetValue( hDefs, "POSY" )
nWidth := HGetValue( hDefs, "WIDTH" )
nHeight := HGetValue( hDefs, "HEIGHT" )
nMaxValue := HGetValue( hDefs, "MAXVALUE" )
color := HGetValue( hDefs, "COLOR" )
lShowAxis := HGetValue( hDefs, "SHOWAXIS" )
lShowGrid := HGetValue( hDefs, "SHOWGRID" )
cAxisPict := HGetValue( hDefs, "AXISPICT" )
cFontPitch := HGetValue( hDefs, "FONTPITCH" )
DEFAULT x TO 0
DEFAULT y TO 0
DEFAULT nWidth TO ::Width()
DEFAULT nHeight TO ::Height()
DEFAULT color TO ::GetColor()
DEFAULT lShowAxis TO TRUE
DEFAULT lShowGrid TO TRUE
DEFAULT cAxisPict TO "@E 9,999.99"
DEFAULT cFontPitch TO "TINY"
DEFAULT nBorder TO 4
/*
hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"]
*/
DO CASE
CASE cFontPitch == "TINY"
::SetFontTiny()
CASE cFontPitch == "SMALL"
::SetFontSmall()
CASE cFontPitch == "MEDIUM"
::SetFontMediumBold()
CASE cFontPitch == "LARGE"
::SetFontLarge()
CASE cFontPitch == "GIANT"
::SetFontGiant()
ENDCASE
// Before sum of values to determine perentual
nMaxLabel := 0
nMax := 0
FOR EACH hElement IN aDataOfHash
IF hElement:__enumIndex() == 1
nMax := hElement["VALUE"]
ELSE
nMax := Max( nMax, hElement["VALUE"] )
ENDIF
cLabel := HGetValue( hElement, "LABEL" )
nMaxLabel := Max( nMaxLabel, Len( IIF( cLabel <> NIL, cLabel, "" ) ) )
nTot += hElement["VALUE"]
NEXT
//__OutDebug( "Len( LTrim( Str( nMax ) ) )", Len( LTrim( cStr( nMax ) ) ), Str( nMax ) )
DEFAULT nLeftLabelSpace TO nBorder + Len( LTrim( Transform( nMax, cAxisPict ) ) ) * ::GetFontWidth() + nBorder
DEFAULT nRightLabelSpace TO nLeftLabelSpace //nBorder + Len( LTrim( Str( nMax ) ) ) * ::GetFontWidth() + nBorder
DEFAULT nBottomLabelSpace TO nBorder + nMaxLabel * ::GetFontWidth() + nBorder
DEFAULT nMaxValue TO nMax
IF lShowAxis
IF lShowLabelLeft
x += nLeftLabelSpace
nWidth -= nLeftLabelSpace
ENDIF
IF lShowLabelRight
nWidth -= nRightLabelSpace
ENDIF
IF lShowLabelBottom
y += nBottomLabelSpace
nHeight -= nBottomLabelSpace
ENDIF
IF lShowLabelTop
nHeight -= nTopLabelSpace
ENDIF
ENDIF
nSize := nWidth / Len( aDataOfHash )
IF lShowGrid
::Rectangle( x, ::Height() - ( y + nHeight ), x + nWidth, ::Height() - y, FALSE, color )
nThick := ::SetThickness( 1 )
::ResetStyles()
::AddStyle( color )
::AddStyle( color )
::AddStyle( color )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::SetStyle()
FOR n := 10 TO 100 STEP 10
nDim := ( ( nMaxValue / 100 ) * n )
nPosY := ( nDim / nMaxValue ) * nHeight
//__OutDebug( "nDim", nDim )
::Line( x, ::Height() - ( y + nPosY), x + nWidth, ::Height() - ( y + nPosY ), gdStyled )
NEXT
::SetThickness( nThick )
ENDIF
IF lShowAxis
// Y Axis
FOR n := 10 TO 100 STEP 10
nDim := ( ( nMaxValue / 100 ) * n )
cLabel := LTrim( Transform( nDim, cAxisPict ) )
nPosY := ( nDim / nMaxValue ) * nHeight
IF lShowLabelLeft
::Say( x - nLeftLabelSpace + nBorder, ::Height() - ( y + nPosY ), PadL( cLabel, Len( LTrim( Transform( nMaxValue, cAxisPict ) ) ) ), color )
ENDIF
IF lShowLabelRight
::Say( x + nWidth + nBorder, ::Height() - ( y + nPosY ), cLabel, color )
ENDIF
NEXT
ENDIF
// Second,
FOR EACH hElement IN aDataOfHash
cLabel := HGetValue( hElement, "LABEL" )
lFilled := HGetValue( hElement, "FILLED" )
nExtrude := HGetValue( hElement, "EXTRUDE" )
pTile := HGetValue( hElement, "TILE" )
IF nExtrude <> NIL
lExtruded := TRUE
ELSE
lExtruded := FALSE
ENDIF
colorp := HGetValue( hElement, "COLOR" )
nVal := hElement["VALUE"]
nDim := ( nVal / nMaxValue ) * nHeight
DEFAULT lFilled TO FALSE
DEFAULT nExtrude TO 0
DEFAULT colorp TO ::SetColor( 0, 0, 0 )
nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) )
nPosY := y
IF pTile <> NIL
::SetTile( pTile )
colorp := gdTiled
ELSE
if ISARRAY( colorp )
colorp := ::SetColor( colorp[1], colorp[2], colorp[3] )
endif
ENDIF
::Rectangle( nPosX + nBorder, ::Height() - ( nPosY + nDim ), nPosX + nSize - nBorder, ::Height() - nPosY, lFilled, colorp )
IF lShowAxis
// Y Axis
IF lShowLabelBottom
::SayVertical( nPosX + nSize / 2 - ::GetFontHeight() / 2, ::Height() - nBorder, PadL( cLabel, nMaxLabel ), color )
ENDIF
ENDIF
NEXT
RETURN Self
| gdchart.prg | 267 |
GDCHART:METHOD | HorizontalBarChart() CLASS GDChart
METHOD HorizontalBarChart() CLASS GDChart
LOCAL hElement, nTot := 0
LOCAL nDegree := 0
LOCAL lFilled, lExtruded, nExtrude, pTile
LOCAL colorp
LOCAL nVal, nDim
LOCAL nPosX, nPosY
LOCAL nSize, nMax
LOCAL nBorder, nThick, n
LOCAL x, y, nWidth, nHeight, nMaxValue, color, nMaxLabel, cLabel
LOCAL lShowAxis, lShowGrid
LOCAL nLeftLabelSpace //:= 40
LOCAL nRightLabelSpace //:= 40
LOCAL nBottomLabelSpace //:= 40
LOCAL nTopLabelSpace //:= 40
LOCAL lShowLabelLeft := TRUE
LOCAL lShowLabelRight := TRUE
LOCAL lShowLabelBottom := TRUE
LOCAL lShowLabelTop := TRUE
LOCAL cAxisPict
LOCAL cFontPitch
LOCAL aDataOfHash, hDefs
aDataOfHash := ::aDataOfHashes
hDefs := ::hDefs
x := HGetValue( hDefs, "POSX" )
y := HGetValue( hDefs, "POSY" )
nWidth := HGetValue( hDefs, "WIDTH" )
nHeight := HGetValue( hDefs, "HEIGHT" )
nMaxValue := HGetValue( hDefs, "MAXVALUE" )
color := HGetValue( hDefs, "COLOR" )
lShowAxis := HGetValue( hDefs, "SHOWAXIS" )
lShowGrid := HGetValue( hDefs, "SHOWGRID" )
cAxisPict := HGetValue( hDefs, "AXISPICT" )
cFontPitch := HGetValue( hDefs, "FONTPITCH" )
DEFAULT x TO 0
DEFAULT y TO 0
DEFAULT nWidth TO ::Width()
DEFAULT nHeight TO ::Height()
DEFAULT color TO ::GetColor()
DEFAULT lShowAxis TO TRUE
DEFAULT lShowGrid TO TRUE
DEFAULT cAxisPict TO "@E 9,999.99"
DEFAULT cFontPitch TO "TINY"
DEFAULT nBorder TO 4
/*
hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"]
*/
DO CASE
CASE cFontPitch == "TINY"
::SetFontTiny()
CASE cFontPitch == "SMALL"
::SetFontSmall()
CASE cFontPitch == "MEDIUM"
::SetFontMediumBold()
CASE cFontPitch == "LARGE"
::SetFontLarge()
CASE cFontPitch == "GIANT"
::SetFontGiant()
ENDCASE
// Before sum of values to determine perentual
nMaxLabel := 0
nMax := 0
FOR EACH hElement IN aDataOfHash
IF hElement:__enumIndex() == 1
nMax := hElement["VALUE"]
ELSE
nMax := Max( nMax, hElement["VALUE"] )
ENDIF
cLabel := HGetValue( hElement, "LABEL" )
nMaxLabel := Max( nMaxLabel, Len( IIF( cLabel <> NIL, cLabel, "" ) ) )
nTot += hElement["VALUE"]
NEXT
DEFAULT nLeftLabelSpace TO nBorder + nMaxLabel * ::GetFontWidth() + nBorder
DEFAULT nRightLabelSpace TO nBorder + ( Len( LTrim( Transform( nMax, cAxisPict ) ) ) * ::GetFontWidth() / 2 )
DEFAULT nTopLabelSpace TO nBorder + ::GetFontHeight() + nBorder
DEFAULT nBottomLabelSpace TO nTopLabelSpace // nBorder + ::GetFontHeight() + nBorder
DEFAULT nMaxValue TO nMax
IF lShowAxis
IF lShowLabelLeft
x += nLeftLabelSpace
nWidth -= nLeftLabelSpace
ENDIF
IF lShowLabelRight
nWidth -= nRightLabelSpace
ENDIF
IF lShowLabelBottom
y += nBottomLabelSpace
nHeight -= nBottomLabelSpace
ENDIF
IF lShowLabelTop
nHeight -= nTopLabelSpace
ENDIF
ENDIF
nSize := nHeight / Len( aDataOfHash )
IF lShowGrid
::Rectangle( x, ::Height() - ( y + nHeight ), x + nWidth, ::Height() - y, FALSE, color )
nThick := ::SetThickness( 1 )
::ResetStyles()
::AddStyle( color )
::AddStyle( color )
::AddStyle( color )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::SetStyle()
FOR n := 10 TO 100 STEP 10
nDim := ( ( nMaxValue / 100 ) * n )
nPosX := ( nDim / nMaxValue ) * nWidth
::Line( x + nPosX, y, x + nPosX, y + nHeight, gdStyled )
NEXT
::SetThickness( nThick )
ENDIF
IF lShowAxis
// X Axis
FOR n := 0 TO 100 STEP 10
nDim := ( ( nMaxValue / 100 ) * n )
cLabel := LTrim( Transform( nDim, cAxisPict ) )
nPosX := ( nDim / nMaxValue ) * nWidth - ( ( Len( cLabel ) / 2 ) * ::GetFontWidth() )
IF lShowLabelTop
::Say( x + nPosX, y - nTopLabelSpace + nBorder, cLabel, color )
ENDIF
IF lShowLabelBottom
::Say( x + nPosX, y + nHeight + nBorder, cLabel, color )
ENDIF
NEXT
ENDIF
// Second,
FOR EACH hElement IN aDataOfHash
cLabel := HGetValue( hElement, "LABEL" )
lFilled := HGetValue( hElement, "FILLED" )
nExtrude := HGetValue( hElement, "EXTRUDE" )
pTile := HGetValue( hElement, "TILE" )
IF nExtrude <> NIL
lExtruded := TRUE
ELSE
lExtruded := FALSE
ENDIF
colorp := HGetValue( hElement, "COLOR" )
nVal := hElement["VALUE"]
nDim := ( nVal / nMaxValue ) * nWidth
//__OutDebug( "nDim", nDim )
DEFAULT lFilled TO FALSE
DEFAULT nExtrude TO 0
DEFAULT colorp TO ::SetColor( 0, 0, 0 )
nPosX := x
nPosY := y + ( nSize * ( hElement:__enumIndex() - 1 ) )
IF pTile <> NIL
::SetTile( pTile )
colorp := gdTiled
ELSE
if ISARRAY( colorp )
colorp := ::SetColor( colorp[1], colorp[2], colorp[3] )
endif
ENDIF
::Rectangle( nPosX, nPosY + nBorder, nPosX + nDim, nPosY + nSize - nBorder, lFilled, colorp )
IF lShowAxis
// Y Axis
IF lShowLabelBottom
::Say( nBorder, nPosY + nSize / 2 - ::GetFontHeight() / 2, PadL( cLabel, nMaxLabel ), color )
ENDIF
ENDIF
NEXT
RETURN Self
| gdchart.prg | 456 |
GDCHART:METHOD | LineChart() CLASS GDChart
METHOD LineChart() CLASS GDChart
LOCAL hElement
LOCAL nDegree := 0
LOCAL lFilled, lExtruded, nExtrude, pTile
LOCAL colorp
LOCAL nVal, nDim
LOCAL nPosX, nPosY
LOCAL cLabel
LOCAL nSize, nMax, nMin, nTotRange, nCeiling
LOCAL nBorder, nThick, n
LOCAL x, y, nWidth, nHeight, nMaxValue, nMinValue, color, nMaxLabel, nMinLabel
LOCAL lShowAxis, lShowGrid
LOCAL nLeftLabelSpace //:= 40
LOCAL nRightLabelSpace //:= 40
LOCAL nBottomLabelSpace //:= 40
LOCAL nTopLabelSpace := 40
LOCAL lShowLabelLeft := TRUE
LOCAL lShowLabelRight := TRUE //FALSE
LOCAL lShowLabelBottom := TRUE
LOCAL lShowLabelTop := FALSE
LOCAL cAxisPict
LOCAL cFontPitch
LOCAL aDataOfHash, hDefs, aPoints
aDataOfHash := ::aDataOfHashes
hDefs := ::hDefs
x := HGetValue( hDefs, "POSX" )
y := HGetValue( hDefs, "POSY" )
nWidth := HGetValue( hDefs, "WIDTH" )
nHeight := HGetValue( hDefs, "HEIGHT" )
nMaxValue := HGetValue( hDefs, "MAXVALUE" )
nMinValue := HGetValue( hDefs, "MINVALUE" )
color := HGetValue( hDefs, "COLOR" )
lShowAxis := HGetValue( hDefs, "SHOWAXIS" )
lShowGrid := HGetValue( hDefs, "SHOWGRID" )
cAxisPict := HGetValue( hDefs, "AXISPICT" )
cFontPitch := HGetValue( hDefs, "FONTPITCH" )
DEFAULT x TO 0
DEFAULT y TO 0
DEFAULT nWidth TO ::Width()
DEFAULT nHeight TO ::Height()
DEFAULT color TO ::GetColor()
DEFAULT lShowAxis TO TRUE
DEFAULT lShowGrid TO TRUE
DEFAULT cAxisPict TO "@E 9,999.99"
DEFAULT cFontPitch TO "TINY"
DEFAULT nBorder TO 4
/*
hData := ["TITLE"], ["VALUE"], ["FILLED"], ["COLOR"], ["TILE"], ["EXTRUDE"]
*/
DO CASE
CASE cFontPitch == "TINY"
::SetFontTiny()
CASE cFontPitch == "SMALL"
::SetFontSmall()
CASE cFontPitch == "MEDIUM"
::SetFontMediumBold()
CASE cFontPitch == "LARGE"
::SetFontLarge()
CASE cFontPitch == "GIANT"
::SetFontGiant()
ENDCASE
// Before sum of values to determine percentual
nMaxLabel := 0
nMax := 0
FOR EACH hElement IN aDataOfHash
IF hElement:__enumIndex() == 1
nMax := hElement["VALUE"]
ELSE
nMax := Max( nMax, hElement["VALUE"] )
ENDIF
cLabel := HGetValue( hElement, "LABEL" )
nMaxLabel := Max( nMaxLabel, Len( IIF( cLabel <> NIL, cLabel, "" ) ) )
NEXT
// Before sum of values to determine percentual
nMinLabel := 0
nMin := 0
FOR EACH hElement IN aDataOfHash
IF hElement:__enumIndex() == 1
nMin := hElement["VALUE"]
ELSE
nMin := Min( nMin, hElement["VALUE"] )
ENDIF
cLabel := HGetValue( hElement, "LABEL" )
nMinLabel := Max( nMinLabel, Len( IIF( cLabel <> NIL, cLabel, "" ) ) )
NEXT
DEFAULT nLeftLabelSpace TO nBorder + Max( Len( LTrim( Transform( nMax, cAxisPict ) ) ), Len( LTrim( Transform( nMin, cAxisPict ) ) ) ) * ::GetFontWidth() + nBorder
DEFAULT nRightLabelSpace TO nLeftLabelSpace
DEFAULT nBottomLabelSpace TO nBorder + nMaxLabel * ::GetFontWidth() + nBorder
DEFAULT nMaxValue TO nMax
DEFAULT nMinValue TO nMin
IF lShowAxis
IF lShowLabelLeft
x += nLeftLabelSpace
nWidth -= nLeftLabelSpace
ENDIF
IF lShowLabelRight
nWidth -= nRightLabelSpace
ENDIF
IF lShowLabelBottom
y += nBottomLabelSpace
nHeight -= nBottomLabelSpace
ENDIF
IF lShowLabelTop
nHeight -= nTopLabelSpace
ENDIF
ENDIF
nSize := Len( aDataOfHash ) - 1
if nSize > 1
nSize := nWidth / nSize
else
nSize := nWidth
endif
nTotRange := nMaxValue + iif( nMinValue < 0, abs( nMinValue ), 0 )
nCeiling := 0
do while ( nTotRange / ( 10 ^ nCeiling ) ) > 100
nCeiling++
enddo
nCeiling := 10 ^ nCeiling
nMaxValue := ceiling( nMaxValue / nCeiling ) * nCeiling
nMinValue := iif( nMinValue < 0, -ceiling( abs( nMinValue ) / nCeiling ) * nCeiling, ceiling( nMinValue / nCeiling ) * nCeiling )
nTotRange := nMaxValue + iif( nMinValue < 0, abs( nMinValue ), 0 )
IF lShowGrid
::Rectangle( x, ::Height() - ( y + nHeight ), x + nWidth, ::Height() - y, FALSE, color )
nThick := ::SetThickness( 1 )
::ResetStyles()
::AddStyle( color )
::AddStyle( color )
::AddStyle( color )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::AddStyle( gdTransparent )
::SetStyle()
FOR n := 10 TO 100 STEP 10
nDim := ( ( nTotRange / 100 ) * n )
nPosY := ( nDim / nTotRange ) * nHeight
//__OutDebug( "nDim", nDim )
::Line( x, ::Height() - ( y + nPosY), x + nWidth, ::Height() - ( y + nPosY ), gdStyled )
NEXT
FOR EACH hElement IN aDataOfHash
nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) )
::Line( nPosX, ::Height() - y, nPosX, ::Height() - ( y + nHeight ), gdStyled )
NEXT
::SetThickness( nThick )
ENDIF
IF lShowAxis
// Y Axis
FOR n := 0 TO 100 STEP 10
nDim := ( ( nTotRange / 100 ) * n )
cLabel := LTrim( Transform( nMinValue + ( nTotRange / 10 ) * ( n / 10 ), cAxisPict ) )
nPosY := ( nDim / nTotRange ) * nHeight
IF lShowLabelLeft
::Say( x - nLeftLabelSpace + nBorder, ::Height() - ( y + nPosY ), cLabel, color )
ENDIF
IF lShowLabelRight
::Say( x + nWidth + nBorder, ::Height() - ( y + nPosY ), cLabel, color )
ENDIF
NEXT
ENDIF
// Second,
aPoints := {}
FOR EACH hElement IN aDataOfHash
cLabel := HGetValue( hElement, "LABEL" )
lFilled := HGetValue( hElement, "FILLED" )
nExtrude := HGetValue( hElement, "EXTRUDE" )
pTile := HGetValue( hElement, "TILE" )
IF nExtrude <> NIL
lExtruded := TRUE
ELSE
lExtruded := FALSE
ENDIF
colorp := HGetValue( hElement, "COLOR" )
nVal := hElement["VALUE"]
nDim := ( ( nVal + abs( nMinValue ) ) / nTotRange ) * nHeight
DEFAULT lFilled TO FALSE
DEFAULT nExtrude TO 0
DEFAULT colorp TO ::SetColor( 0, 0, 0 )
nPosX := x + ( nSize * ( hElement:__enumIndex() - 1 ) )
nPosY := y
IF pTile <> NIL
::SetTile( pTile )
colorp := gdTiled
ELSE
if ISARRAY( colorp )
colorp := ::SetColor( colorp[1], colorp[2], colorp[3] )
endif
ENDIF
//::Rectangle( nPosX + nBorder, ::Height() - ( nPosY + nDim ), nPosX + nSize - nBorder, ::Height() - nPosY, lFilled, colorp )
aAdd( aPoints, { nPosX, ::Height() - ( nPosY + nDim ) } )
IF lShowAxis
// Y Axis
IF lShowLabelBottom
::SayVertical( nPosX - ::GetFontHeight() / 2, ::Height() - nBorder, PadL( cLabel, nMaxLabel ), color )
ENDIF
ENDIF
NEXT
// Draw lines
nThick := ::SetThickness( 3 )
//::ResetStyles()
//::AddStyle( color )
//::AddStyle( color )
//::AddStyle( color )
//::AddStyle( gdTransparent )
//::AddStyle( gdTransparent )
//::AddStyle( gdTransparent )
//::AddStyle( gdTransparent )
//::AddStyle( gdTransparent )
//::SetStyle()
FOR n := 1 TO Len( aPoints ) - 1
::Line( aPoints[ n ][ 1 ], aPoints[ n ][ 2 ], aPoints[ n + 1 ][ 1 ], aPoints[ n + 1 ][ 2 ], color )
NEXT
::SetThickness( nThick )
RETURN Self
| gdchart.prg | 641 |
GDCHART:METHOD | Clone() CLASS GDChart
METHOD Clone() CLASS GDChart
LOCAL oDestImage
LOCAL pImage
IF ::IsTrueColor()
oDestImage := GDChart():CreateTrueColor( ::Width, ::Height )
ELSE
oDestImage := GDChart():Create( ::Width, ::Height )
ENDIF
pImage := oDestImage:pImage
oDestImage := oDestImage:CloneDataFrom( Self )
//oDestImage := __objClone( Self )
oDestImage:pImage := pImage
::Copy( 0, 0, ::Width, ::Height, 0, 0, oDestImage )
//pImage := oDestImage:pImage
//// Signal that this image must not be destroyed
//oDestImage:lDestroy := FALSE
//oDestImage := NIL
//oDestImage:pImage := pImage
RETURN oDestImage
| gdchart.prg | 888 |
GDCHART:METHOD | CloneDataFrom( oSrc )
METHOD CloneDataFrom( oSrc )
// copy values from Source to Dest
// please update in case of new datas
::Super:CloneDataFrom( oSrc )
::cTitle := oSrc:cTitle
::cAxisX := oSrc:cAxisX
::cAxisY := oSrc:cAxisY
::nWidth := oSrc:nWidth
::nHeight := oSrc:nHeight
::nScaleX := oSrc:nScaleX
::nScaleY := oSrc:nScaleY
::aSeries := AClone( oSrc:aSeries )
::aDataOfHashes := AClone( oSrc:aDataOfHashes )
::hDefs := HB_HClone( oSrc:hDefs )
RETURN Self
| gdchart.prg | 914 |
STATIC FUNCTION | HGetValue( hHash, cKey )
STATIC FUNCTION HGetValue( hHash, cKey )
LOCAL nPos
LOCAL xVal
IF hHash <> NIL
xVal := IIF( ( nPos := HB_HPos( hHash, cKey )) == 0, NIL, HB_HValueAt( hHash, nPos) )
ENDIF
RETURN xVal
| gdchart.prg | 935 |
gdimage.prg |
Type | Function | Source | Line |
CLASS | GDImage
CLASS GDImage
PROTECTED:
DATA pImage
DATA pBrush
DATA pTile
DATA pFont
DATA pColor
DATA cFontName INIT "Arial"
DATA nFontPitch INIT 20
DATA nFontAngle INIT 0
DATA aPoints INIT {}
DATA aStyles INIT {}
DATA lDestroy INIT TRUE
EXPORTED:
DATA hFile
DATA cType
DATA cMime
METHOD New( sx, sy ) CONSTRUCTOR
| gdimage.prg | 65 |
GDIMAGE:METHOD | Create( sx, sy )
METHOD Create( sx, sy ) INLINE ::pImage := gdImageCreate( sx, sy ), Self
| gdimage.prg | 92 |
GDIMAGE:METHOD | CreateTrueColor( sx, sy )
METHOD CreateTrueColor( sx, sy ) INLINE ::pImage := gdImageCreateTrueColor( sx, sy ), Self
| gdimage.prg | 93 |
GDIMAGE:METHOD | LoadFromPng( cFile )
METHOD LoadFromPng( cFile ) INLINE ::pImage := gdImageCreateFromPng( cFile ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 96 |
GDIMAGE:METHOD | LoadFromJpeg( cFile )
METHOD LoadFromJpeg( cFile ) INLINE ::pImage := gdImageCreateFromJpeg( cFile ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 97 |
GDIMAGE:METHOD | LoadFromWBmp( cFile )
METHOD LoadFromWBmp( cFile ) INLINE ::pImage := gdImageCreateFromWBMP( cFile ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 98 |
GDIMAGE:METHOD | LoadFromGd( cFile )
METHOD LoadFromGd( cFile ) INLINE ::pImage := gdImageCreateFromGD( cFile ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 99 |
GDIMAGE:METHOD | LoadFromGif( cFile )
METHOD LoadFromGif( cFile ) INLINE ::pImage := gdImageCreateFromGif( cFile ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 100 |
GDIMAGE:METHOD | InputPng( nHandle, nSize )
METHOD InputPng( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromPng( nHandle, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 103 |
GDIMAGE:METHOD | InputJpeg( nHandle, nSize )
METHOD InputJpeg( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromJpeg( nHandle, nSize ), IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 104 |
GDIMAGE:METHOD | InputWBmp( nHandle, nSize )
METHOD InputWBmp( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromWBMP( nHandle, nSize ), IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 105 |
GDIMAGE:METHOD | InputGd( nHandle, nSize )
METHOD InputGd( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromGD( nHandle, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 106 |
GDIMAGE:METHOD | InputGif( nHandle, nSize )
METHOD InputGif( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromGif( nHandle, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 107 |
GDIMAGE:METHOD | CreateFromPng( pImage, nSize )
METHOD CreateFromPng( pImage, nSize ) INLINE ::pImage := gdImageCreateFromPng( pImage, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 110 |
GDIMAGE:METHOD | CreateFromJpeg( pImage, nSize )
METHOD CreateFromJpeg( pImage, nSize ) INLINE ::pImage := gdImageCreateFromJpeg( pImage, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 111 |
GDIMAGE:METHOD | CreateFromWBmp( pImage, nSize )
METHOD CreateFromWBmp( pImage, nSize ) INLINE ::pImage := gdImageCreateFromWBMP( pImage, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 112 |
GDIMAGE:METHOD | CreateFromGd( pImage, nSize )
METHOD CreateFromGd( pImage, nSize ) INLINE ::pImage := gdImageCreateFromGD( pImage, nSize ) , IIF( ::pImage != NIL, Self, NIL )
| gdimage.prg | 113 |
GDIMAGE:METHOD | CreateFromGif( pImage, nSize )
METHOD CreateFromGif( pImage, nSize ) INLINE ::pImage := gdImageCreateFromGif( pImage, nSize ) , IIF( ::pImage != NIL, Self, NIL )
METHOD LoadFromFile( cFile )
| gdimage.prg | 114 |
GDIMAGE:METHOD | SavePng( cFile, nLevel )
METHOD SavePng( cFile, nLevel ) INLINE gdImagePng( ::pImage, cFile, nLevel )
| gdimage.prg | 119 |
GDIMAGE:METHOD | SaveJpeg( cFile, nLevel )
METHOD SaveJpeg( cFile, nLevel ) INLINE gdImageJpeg( ::pImage, cFile, nLevel )
| gdimage.prg | 120 |
GDIMAGE:METHOD | SaveWBmp( cFile, nFG )
METHOD SaveWBmp( cFile, nFG ) INLINE gdImageWBmp( ::pImage, cFile, nFG )
| gdimage.prg | 121 |
GDIMAGE:METHOD | SaveGd( cFile )
METHOD SaveGd( cFile ) INLINE gdImageGd( ::pImage, cFile )
| gdimage.prg | 122 |
GDIMAGE:METHOD | SaveGif( cFile )
METHOD SaveGif( cFile ) INLINE gdImageGif( ::pImage, cFile )
| gdimage.prg | 123 |
GDIMAGE:METHOD | SaveToFile( cFile )
METHOD SaveToFile( cFile ) INLINE gdImageToFile( Self, cFile )
| gdimage.prg | 125 |
GDIMAGE:METHOD | OutputPng( nHandle, nLevel )
METHOD OutputPng( nHandle, nLevel ) INLINE IIF( nHandle == NIL, nHandle := 1, ), gdImagePng( ::pImage, nHandle, nLevel )
| gdimage.prg | 128 |
GDIMAGE:METHOD | OutputJpeg( nHandle, nLevel )
METHOD OutputJpeg( nHandle, nLevel ) INLINE IIF( nHandle == NIL, nHandle := 1, ), gdImageJpeg( ::pImage, nHandle, nLevel )
| gdimage.prg | 129 |
GDIMAGE:METHOD | OutputWBmp( nHandle, nFG )
METHOD OutputWBmp( nHandle, nFG ) INLINE IIF( nHandle == NIL, nHandle := 1, ), gdImageWBmp( ::pImage, nHandle, nFG )
| gdimage.prg | 130 |
GDIMAGE:METHOD | OutputGd( nHandle )
METHOD OutputGd( nHandle ) INLINE IIF( nHandle == NIL, nHandle := 1, ), gdImageGd( ::pImage, nHandle )
| gdimage.prg | 131 |
GDIMAGE:METHOD | OutputGif( nHandle )
METHOD OutputGif( nHandle ) INLINE IIF( nHandle == NIL, nHandle := 1, ), gdImageGif( ::pImage, nHandle )
| gdimage.prg | 132 |
GDIMAGE:METHOD | Output( nHandle )
METHOD Output( nHandle ) INLINE gdImageToHandle( ::pImage, nHandle )
| gdimage.prg | 134 |
GDIMAGE:METHOD | ToStringPng( nLevel )
METHOD ToStringPng( nLevel ) INLINE gdImagePng( ::pImage, NIL, nLevel )
| gdimage.prg | 137 |
GDIMAGE:METHOD | ToStringJpeg( nLevel )
METHOD ToStringJpeg( nLevel ) INLINE gdImageJpeg( ::pImage, NIL, nLevel )
| gdimage.prg | 138 |
GDIMAGE:METHOD | ToStringWBmp( nFG )
METHOD ToStringWBmp( nFG ) INLINE gdImageWBmp( ::pImage, NIL, nFG )
| gdimage.prg | 139 |
GDIMAGE:METHOD | ToStringGd()
METHOD ToStringGd() INLINE gdImageGd( ::pImage, NIL )
| gdimage.prg | 140 |
GDIMAGE:METHOD | ToStringGif()
METHOD ToStringGif() INLINE gdImageGif( ::pImage, NIL )
| gdimage.prg | 141 |
GDIMAGE:METHOD | ToString()
METHOD ToString() INLINE gdImageToString( Self )
| gdimage.prg | 143 |
GDIMAGE:METHOD | Destroy()
METHOD Destroy() INLINE gdImageDestroy( ::pImage )
DESTRUCTOR Destruct()
| gdimage.prg | 146 |
GDIMAGE:METHOD | SetPixel( x, y, color )
METHOD SetPixel( x, y, color ) INLINE DEFAULT( color, ::pColor ), gdImageSetPixel( ::pImage, x, y, color )
| gdimage.prg | 152 |
GDIMAGE:METHOD | Line( x1, y1, x2, y2, color )
METHOD Line( x1, y1, x2, y2, color ) INLINE DEFAULT( color, ::pColor ), gdImageLine( ::pImage, x1, y1, x2, y2, color )
| gdimage.prg | 153 |
GDIMAGE:METHOD | DashedLine( x1, y1, x2, y2, color )
METHOD DashedLine( x1, y1, x2, y2, color ) INLINE DEFAULT( color, ::pColor ), gdImageDashedLine( ::pImage, x1, y1, x2, y2, color )
// Functions usefull for polygons
METHOD Polygon( aPoints, lFilled, color )
#if ( GD_VERS >= 2033 )
METHOD OpenPolygon( aPoints, color )
| gdimage.prg | 154 |
GDIMAGE:METHOD | AddPoint( x, y )
METHOD AddPoint( x, y ) INLINE aAdd( ::aPoints, { x, y } )
| gdimage.prg | 161 |
GDIMAGE:METHOD | ResetPoints()
METHOD ResetPoints() INLINE ::aPoints := {}
| gdimage.prg | 162 |
GDIMAGE:METHOD | Points()
METHOD Points() INLINE Len( ::aPoints )
METHOD Rectangle( x1, y1, x2, y2, lFilled, color )
METHOD Arc( x, y, nWidth, nHeight, nStartDegree, nEndDegree, lFilled, nColor )
METHOD Ellipse( x, y, nWidth, nHeight, lFilled, nColor )
| gdimage.prg | 163 |
GDIMAGE:METHOD | Circle( x, y, nRadius, lFilled, nColor )
METHOD Circle( x, y, nRadius, lFilled, nColor ) ;
INLINE ::Ellipse( x, y, nRadius, nRadius, lFilled, nColor )
| gdimage.prg | 168 |
GDIMAGE:METHOD | Fill( x, y, color )
METHOD Fill( x, y, color ) INLINE DEFAULT( color, ::pColor ), gdImageFill( ::pImage, x, y, color )
| gdimage.prg | 171 |
GDIMAGE:METHOD | FillToBorder( x, y, border, color )
METHOD FillToBorder( x, y, border, color ) ;
INLINE DEFAULT( color, ::pColor ), gdImageFillToBorder( ::pImage, x, y, border, color )
| gdimage.prg | 172 |
GDIMAGE:METHOD | SetAntiAliased( color )
METHOD SetAntiAliased( color ) INLINE DEFAULT( color, ::pColor ), gdImageSetAntiAliased( ::pImage, color )
| gdimage.prg | 174 |
GDIMAGE:METHOD | SetAntiAliasedDontBlend( lDontBlend, color )
METHOD SetAntiAliasedDontBlend( lDontBlend, color ) ;
INLINE DEFAULT( color, ::pColor ), gdImageSetAntiAliasedDontBlend( ::pImage, color, lDontBlend )
| gdimage.prg | 175 |
GDIMAGE:METHOD | SetBrush( pBrush )
METHOD SetBrush( pBrush ) INLINE gdImageSetBrush( ::pImage, pBrush:pImage ), ::pBrush := pBrush
| gdimage.prg | 178 |
GDIMAGE:METHOD | SetTile( pTile )
METHOD SetTile( pTile ) INLINE gdImageSetTile( ::pImage, pTile:pImage ), ::pTile := pTile
| gdimage.prg | 179 |
GDIMAGE:METHOD | SetStyle( aStyle )
METHOD SetStyle( aStyle ) INLINE DEFAULT( aStyle, ::aStyles ), gdImageSetStyle( ::pImage, aStyle )
| gdimage.prg | 182 |
GDIMAGE:METHOD | AddStyle( pColor )
METHOD AddStyle( pColor ) INLINE aAdd( ::aStyles, pColor )
| gdimage.prg | 183 |
GDIMAGE:METHOD | ResetStyles()
METHOD ResetStyles() INLINE ::aStyles := {}
| gdimage.prg | 184 |
GDIMAGE:METHOD | StyleLenght()
METHOD StyleLenght() INLINE Len( ::aStyles )
| gdimage.prg | 185 |
GDIMAGE:METHOD | SetThickness( nThickness )
METHOD SetThickness( nThickness ) INLINE gdImageSetThickness( ::pImage, nThickness )
| gdimage.prg | 187 |
GDIMAGE:METHOD | SetAlphaBlending( lAlphaBlending )
METHOD SetAlphaBlending( lAlphaBlending ) INLINE gdImageAlphaBlending( ::pImage, lAlphaBlending )
| gdimage.prg | 188 |
GDIMAGE:METHOD | SetSaveAlpha( lSaveAlpha )
METHOD SetSaveAlpha( lSaveAlpha ) INLINE gdImageSaveAlpha( ::pImage, lSaveAlpha )
| gdimage.prg | 189 |
GDIMAGE:METHOD | SetClippingArea( x1, y1, x2, y2 )
METHOD SetClippingArea( x1, y1, x2, y2 ) INLINE gdImageSetClip( ::pImage, x1, y1, x2, y2 )
| gdimage.prg | 190 |
GDIMAGE:METHOD | ColorsTotal()
METHOD ColorsTotal() INLINE gdImageColorsTotal( ::pImage )
| gdimage.prg | 193 |
GDIMAGE:METHOD | Alpha( color )
METHOD Alpha( color ) INLINE DEFAULT( color, ::pColor ), gdImageAlpha( ::pImage, color )
| gdimage.prg | 194 |
GDIMAGE:METHOD | Red( color )
METHOD Red( color ) INLINE DEFAULT( color, ::pColor ), gdImageRed( ::pImage, color )
| gdimage.prg | 195 |
GDIMAGE:METHOD | Green( color )
METHOD Green( color ) INLINE DEFAULT( color, ::pColor ), gdImageGreen( ::pImage, color )
| gdimage.prg | 196 |
GDIMAGE:METHOD | Blue( color )
METHOD Blue( color ) INLINE DEFAULT( color, ::pColor ), gdImageBlue( ::pImage, color )
| gdimage.prg | 197 |
GDIMAGE:METHOD | Width()
METHOD Width() INLINE gdImageSx( ::pImage )
| gdimage.prg | 198 |
GDIMAGE:METHOD | Height()
METHOD Height() INLINE gdImageSy( ::pImage )
| gdimage.prg | 199 |
GDIMAGE:METHOD | CenterWidth()
METHOD CenterWidth() INLINE ::Width() / 2
| gdimage.prg | 200 |
GDIMAGE:METHOD | CenterHeight()
METHOD CenterHeight() INLINE ::Height() / 2
| gdimage.prg | 201 |
GDIMAGE:METHOD | GetPixel( x, y )
METHOD GetPixel( x, y ) INLINE gdImageGetPixel( ::pImage, x, y )
| gdimage.prg | 202 |
GDIMAGE:METHOD | GetColor()
METHOD GetColor() INLINE ::pColor
| gdimage.prg | 203 |
GDIMAGE:METHOD | GetImagePtr()
METHOD GetImagePtr() INLINE ::pImage
| gdimage.prg | 204 |
GDIMAGE:METHOD | GetClippingArea()
METHOD GetClippingArea() INLINE gdImageGetClip( ::pImage )
| gdimage.prg | 205 |
GDIMAGE:METHOD | IsBoundsSafe( x, y )
METHOD IsBoundsSafe( x, y ) INLINE gdImageBoundsSafe( ::pImage, x, y )
| gdimage.prg | 206 |
GDIMAGE:METHOD | IsInterlaced()
METHOD IsInterlaced() INLINE gdImageGetInterlaced( ::pImage )
| gdimage.prg | 207 |
GDIMAGE:METHOD | GetTransparent()
METHOD GetTransparent() INLINE gdImageGetTransparent( ::pImage )
| gdimage.prg | 208 |
GDIMAGE:METHOD | IsTransparent()
METHOD IsTransparent() INLINE ::GetTransparent() > 0
| gdimage.prg | 209 |
GDIMAGE:METHOD | IsTrueColor()
METHOD IsTrueColor() INLINE gdImageTrueColor( ::pImage )
| gdimage.prg | 210 |
GDIMAGE:METHOD | ConvertFromTrueColorToPalette( lDither, nColorsWanted )
METHOD ConvertFromTrueColorToPalette( lDither, nColorsWanted ) ;
INLINE gdImageTrueColorToPalette ( ::pImage, lDither, nColorsWanted )
| gdimage.prg | 212 |
GDIMAGE:METHOD | CreatePaletteFromTrueColor( lDither, nColorsWanted )
METHOD CreatePaletteFromTrueColor( lDither, nColorsWanted ) ;
INLINE gdImageCreatePaletteFromTrueColor( ::pImage, lDither, nColorsWanted )
| gdimage.prg | 214 |
GDIMAGE:METHOD | GetPalette( x, y )
METHOD GetPalette( x, y ) INLINE gdImagePalettePixel( ::pImage, x, y )
| gdimage.prg | 216 |
GDIMAGE:METHOD | GetTrueColor( x, y )
METHOD GetTrueColor( x, y ) INLINE gdImageTrueColorPixel( ::pImage, x, y )
| gdimage.prg | 217 |
GDIMAGE:METHOD | GetThickness()
METHOD GetThickness() INLINE gdImageGetThickness( ::pImage )
| gdimage.prg | 218 |
GDIMAGE:METHOD | SetFontSmall()
METHOD SetFontSmall() INLINE ::pFont := gdFontGetSmall()
| gdimage.prg | 221 |
GDIMAGE:METHOD | SetFontLarge()
METHOD SetFontLarge() INLINE ::pFont := gdFontGetLarge()
| gdimage.prg | 222 |
GDIMAGE:METHOD | SetFontMediumBold()
METHOD SetFontMediumBold() INLINE ::pFont := gdFontGetMediumBold()
| gdimage.prg | 223 |
GDIMAGE:METHOD | SetFontGiant()
METHOD SetFontGiant() INLINE ::pFont := gdFontGetGiant()
| gdimage.prg | 224 |
GDIMAGE:METHOD | SetFontTiny()
METHOD SetFontTiny() INLINE ::pFont := gdFontGetTiny()
METHOD Say( x, y, cString, color, nAlign )
| gdimage.prg | 225 |
GDIMAGE:METHOD | SayVertical( x, y, cString, color )
METHOD SayVertical( x, y, cString, color ) INLINE DEFAULT( color, ::pColor ), gdImageStringUp( ::pImage, ::pFont, x, y, cString, color )
| gdimage.prg | 227 |
GDIMAGE:METHOD | SetFontName( cFontName )
METHOD SetFontName( cFontName ) INLINE ::cFontName := cFontName
| gdimage.prg | 229 |
GDIMAGE:METHOD | SetFontPitch( nPitch )
METHOD SetFontPitch( nPitch ) INLINE ::nFontPitch := nPitch
| gdimage.prg | 230 |
GDIMAGE:METHOD | SetFontAngle( nAngle )
METHOD SetFontAngle( nAngle ) INLINE ::nFontAngle := nAngle
METHOD SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, ;
nLineSpacing, nCharMap, nResolution )
| gdimage.prg | 231 |
GDIMAGE:METHOD | SayFreeTypeCircle( x, y, cStringTop, cStringBottom, color, nRadius, nTextRadius, nFillPortion, cFontName, nPitch )
METHOD SayFreeTypeCircle( x, y, cStringTop, cStringBottom, color, nRadius, nTextRadius, nFillPortion, cFontName, nPitch ) ;
INLINE DEFAULT( color, ::pColor ), gdImageStringFTCircle( ::pImage, x, y, nRadius, ;
nTextRadius, nFillPortion, cFontName, nPitch, cStringTop, cStringBottom, color )
| gdimage.prg | 235 |
GDIMAGE:METHOD | GetFont()
METHOD GetFont() INLINE ::pFont
| gdimage.prg | 239 |
GDIMAGE:METHOD | GetFontWidth( pFont )
METHOD GetFontWidth( pFont ) INLINE DEFAULT( pFont, ::pFont ), gdFontGetWidth( pFont )
| gdimage.prg | 240 |
GDIMAGE:METHOD | GetFontHeight( pFont )
METHOD GetFontHeight( pFont ) INLINE DEFAULT( pFont, ::pFont ), gdFontGetHeight( pFont )
| gdimage.prg | 241 |
GDIMAGE:METHOD | GetFTFontWidth( cFontName, nPitch )
METHOD GetFTFontWidth( cFontName, nPitch ) INLINE DEFAULT( cFontName, ::cFontName ), ;
DEFAULT( nPitch, ::nFontPitch ) , ;
gdImageFTWidth( cFontName, nPitch )
| gdimage.prg | 243 |
GDIMAGE:METHOD | GetFTFontHeight( cFontName, nPitch )
METHOD GetFTFontHeight( cFontName, nPitch ) INLINE DEFAULT( cFontName, ::cFontName ), ;
DEFAULT( nPitch, ::nFontPitch ) , ;
gdImageFTHeight( cFontName, nPitch )
| gdimage.prg | 247 |
GDIMAGE:METHOD | GetFTStringSize( cString, cFontName, nPitch )
METHOD GetFTStringSize( cString, cFontName, nPitch ) INLINE DEFAULT( cFontName, ::cFontName ), ;
DEFAULT( nPitch, ::nFontPitch ) , ;
gdImageFTSize( cString, cFontName, nPitch )
| gdimage.prg | 251 |
GDIMAGE:METHOD | SetColor( r, g, b )
METHOD SetColor( r, g, b ) INLINE IIF( PCount() == 2, ::pColor := r, ::pColor := gdImageColorAllocate( ::pImage, r, g, b ) )
| gdimage.prg | 256 |
GDIMAGE:METHOD | DelColor( pColor )
METHOD DelColor( pColor ) INLINE ::pColor := NIL, gdImageColorDeAllocate( ::pImage, pColor )
| gdimage.prg | 257 |
GDIMAGE:METHOD | SetColorAlpha( r, g, b, a )
METHOD SetColorAlpha( r, g, b, a ) INLINE ::pColor := gdImageColorAllocateAlpha( ::pImage, r, g, b, a)
| gdimage.prg | 258 |
GDIMAGE:METHOD | SetColorClosest( r, g, b )
METHOD SetColorClosest( r, g, b ) INLINE ::pColor := gdImageColorClosest( ::pImage, r, g, b )
| gdimage.prg | 259 |
GDIMAGE:METHOD | SetColorClosestAlpha( r, g, b, a )
METHOD SetColorClosestAlpha( r, g, b, a ) INLINE ::pColor := gdImageColorClosestAlpha( ::pImage, r, g, b, a)
| gdimage.prg | 260 |
GDIMAGE:METHOD | SetColorClosestHWB( r, g, b )
METHOD SetColorClosestHWB( r, g, b ) INLINE ::pColor := gdImageColorClosestHWB( ::pImage, r, g, b )
| gdimage.prg | 261 |
GDIMAGE:METHOD | SetColorExact( r, g, b )
METHOD SetColorExact( r, g, b ) INLINE ::pColor := gdImageColorExact( ::pImage, r, g, b )
| gdimage.prg | 262 |
GDIMAGE:METHOD | SetColorResolve( r, g, b )
METHOD SetColorResolve( r, g, b ) INLINE ::pColor := gdImageColorResolve( ::pImage, r, g, b )
| gdimage.prg | 263 |
GDIMAGE:METHOD | SetColorResolveAlpha( r, g, b, a )
METHOD SetColorResolveAlpha( r, g, b, a ) INLINE ::pColor := gdImageColorResolveAlpha( ::pImage, r, g, b, a)
| gdimage.prg | 264 |
GDIMAGE:METHOD | SetTransparent( pColor )
METHOD SetTransparent( pColor ) INLINE gdImageColorTransparent( ::pImage, pColor )
| gdimage.prg | 265 |
GDIMAGE:METHOD | SetSharpen( nPerc )
METHOD SetSharpen( nPerc ) INLINE gdImageSharpen( ::pImage, nPerc )
| gdimage.prg | 266 |
GDIMAGE:METHOD | SetInterlace( lOnOff )
METHOD SetInterlace( lOnOff ) INLINE gdImageInterlace( ::pImage, lOnOff )
| gdimage.prg | 267 |
GDIMAGE:METHOD | SetInterlaceOn()
METHOD SetInterlaceOn() INLINE gdImageInterlace( ::pImage, TRUE )
| gdimage.prg | 268 |
GDIMAGE:METHOD | SetInterlaceOff()
METHOD SetInterlaceOff() INLINE gdImageInterlace( ::pImage, FALSE )
/* COPY AND RESIZING FUNCTIONS */
METHOD Copy()
METHOD CopyResized()
METHOD CopyResampled()
METHOD CopyRotated()
METHOD CopyMerge()
METHOD CopyMergeGray()
/* New implemented */
METHOD Clone()
METHOD CopyZoomed()
METHOD Crop()
METHOD Zoom()
METHOD Resize()
METHOD Rotate()
| gdimage.prg | 269 |
GDIMAGE:METHOD | RotateInside( nAngle )
METHOD RotateInside( nAngle ) INLINE ::Rotate( nAngle, .T. )
| gdimage.prg | 286 |
GDIMAGE:METHOD | PaletteCopy( oDestImage )
METHOD PaletteCopy( oDestImage ) INLINE gdImagePaletteCopy( oDestImage:pImage, ::pImage )
| gdimage.prg | 288 |
GDIMAGE:METHOD | SquareToCircle( nRadius )
METHOD SquareToCircle( nRadius ) INLINE gdImageSquareToCircle( ::pImage, nRadius )
| gdimage.prg | 289 |
GDIMAGE:METHOD | Compare( oDestImage )
METHOD Compare( oDestImage ) INLINE gdImageCompare( oDestImage:pImage, ::pImage )
| gdimage.prg | 290 |
GDIMAGE:METHOD | Radians( nAngle )
METHOD Radians( nAngle ) INLINE PI() * nAngle / 180
| gdimage.prg | 293 |
GDIMAGE:METHOD | Degres( nRadians )
METHOD Degres( nRadians ) INLINE nRadians * 180 / PI()
| gdimage.prg | 294 |
GDIMAGE:METHOD | Version()
METHOD Version() INLINE gdVersion()
PROTECTED:
METHOD CloneDataFrom()
ENDCLASS
| gdimage.prg | 296 |
GDIMAGE:METHOD | New( sx, sy ) CLASS GDImage
METHOD New( sx, sy ) CLASS GDImage
::Create( sx, sy )
RETURN Self
| gdimage.prg | 303 |
PROCEDURE | Destruct() CLASS GDImage
PROCEDURE Destruct() CLASS GDImage
//__OutDebug( "Destroyed" )
IF ::lDestroy
::Destroy()
ENDIF
RETURN
| gdimage.prg | 307 |
GDIMAGE:METHOD | Polygon( aPoints, lFilled, color ) CLASS GDImage
METHOD Polygon( aPoints, lFilled, color ) CLASS GDImage
DEFAULT aPoints TO ::aPoints
DEFAULT lFilled TO FALSE
DEFAULT color TO ::pColor
IF lFilled
gdImageFilledPolygon( ::pImage, aPoints, color )
ELSE
gdImagePolygon( ::pImage, aPoints, color )
ENDIF
RETURN Self
| gdimage.prg | 314 |
GDIMAGE:METHOD | OpenPolygon( aPoints, color ) CLASS GDImage
METHOD OpenPolygon( aPoints, color ) CLASS GDImage
DEFAULT aPoints TO ::aPoints
DEFAULT color TO ::pColor
gdImageOpenPolygon( ::pImage, aPoints, color )
RETURN Self
| gdimage.prg | 326 |
GDIMAGE:METHOD | Rectangle( x1, y1, x2, y2, lFilled, color ) CLASS GDImage
METHOD Rectangle( x1, y1, x2, y2, lFilled, color ) CLASS GDImage
DEFAULT lFilled TO FALSE
DEFAULT color TO ::pColor
IF lFilled
gdImageFilledRectangle( ::pImage, x1, y1, x2, y2, color )
ELSE
gdImageRectangle( ::pImage, x1, y1, x2, y2, color )
ENDIF
RETURN Self
| gdimage.prg | 333 |
GDIMAGE:METHOD | Arc( x, y, nWidth, nHeight, nStartDegree, nEndDegree, lFilled, color, nStyle ) CLASS GDImage
METHOD Arc( x, y, nWidth, nHeight, nStartDegree, nEndDegree, lFilled, color, nStyle ) CLASS GDImage
DEFAULT lFilled TO FALSE
DEFAULT color TO ::pColor
DEFAULT nStyle TO gdArc
IF lFilled
gdImageFilledArc( ::pImage, x, y, nWidth, nHeight, nStartDegree, nEndDegree, color, nStyle )
ELSE
gdImageArc( ::pImage, x, y, nWidth, nHeight, nStartDegree, nEndDegree, color )
ENDIF
RETURN Self
| gdimage.prg | 343 |
GDIMAGE:METHOD | Ellipse( x, y, nWidth, nHeight, lFilled, color ) CLASS GDImage
METHOD Ellipse( x, y, nWidth, nHeight, lFilled, color ) CLASS GDImage
DEFAULT lFilled TO FALSE
DEFAULT color TO ::pColor
IF lFilled
gdImageFilledEllipse( ::pImage, x, y, nWidth, nHeight, color )
ELSE
gdImageEllipse( ::pImage, x, y, nWidth, nHeight, color )
ENDIF
RETURN Self
| gdimage.prg | 354 |
GDIMAGE:METHOD | LoadFromFile( cFile ) CLASS GDImage
METHOD LoadFromFile( cFile ) CLASS GDImage
LOCAL aLoad
aLoad := gdImageFromFile( cFile )
//Self := aLoad[1]:Clone()
::Destroy()
Self := ::CloneDataFrom( aLoad[1] )
//Self := __objClone( aLoad[1] )
aLoad[1]:lDestroy := FALSE
aLoad[1] := NIL
::hFile := aLoad[2]
::cType := aLoad[3]
::cMime := aLoad[4]
RETURN Self
| gdimage.prg | 364 |
GDIMAGE:METHOD | Copy( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, oDestImage ) CLASS GDImage
METHOD Copy( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, oDestImage ) CLASS GDImage
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nWidth TO ::Width()
DEFAULT nHeight TO ::Height()
DEFAULT nDstX TO 0
DEFAULT nDstY TO 0
IF oDestImage == NIL
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nWidth, nHeight )
ELSE
oDestImage := GDImage():Create( nWidth, nHeight )
ENDIF
ENDIF
gdImageCopy( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nWidth, nHeight )
RETURN oDestImage
| gdimage.prg | 379 |
GDIMAGE:METHOD | CopyResized( nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDstX, nDstY, nDstWidth, nDstHeight, oDestImage ) CLASS GDImage
METHOD CopyResized( nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDstX, nDstY, nDstWidth, nDstHeight, oDestImage ) CLASS GDImage
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nSrcWidth TO ::Width()
DEFAULT nSrcHeight TO ::Height()
DEFAULT nDstX TO 0
DEFAULT nDstY TO 0
DEFAULT nDstWidth TO ::Width()
DEFAULT nDstHeight TO ::Height()
IF oDestImage == NIL
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nDstWidth, nDstHeight )
ELSE
oDestImage := GDImage():Create( nDstWidth, nDstHeight )
ENDIF
ENDIF
gdImageCopyResized( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nDstWidth, nDstHeight, nSrcWidth, nSrcHeight )
RETURN oDestImage
| gdimage.prg | 398 |
GDIMAGE:METHOD | CopyResampled( nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDstX, nDstY, nDstWidth, nDstHeight, oDestImage ) CLASS GDImage
METHOD CopyResampled( nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDstX, nDstY, nDstWidth, nDstHeight, oDestImage ) CLASS GDImage
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nSrcWidth TO ::Width()
DEFAULT nSrcHeight TO ::Height()
DEFAULT nDstX TO 0
DEFAULT nDstY TO 0
DEFAULT nDstWidth TO ::Width()
DEFAULT nDstHeight TO ::Height()
IF oDestImage == NIL
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nDstWidth, nDstHeight )
ELSE
oDestImage := GDImage():Create( nDstWidth, nDstHeight )
ENDIF
ENDIF
gdImageCopyResampled( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nDstWidth, nDstHeight, nSrcWidth, nSrcHeight )
RETURN oDestImage
| gdimage.prg | 418 |
GDIMAGE:METHOD | CopyRotated( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nAngle, oDestImage ) CLASS GDImage
METHOD CopyRotated( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nAngle, oDestImage ) CLASS GDImage
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nWidth TO ::Width
DEFAULT nHeight TO ::Height
DEFAULT nDstX TO nWidth / 2
DEFAULT nDstY TO nHeight / 2
DEFAULT nAngle TO 90
IF oDestImage == NIL
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nWidth, nHeight )
ELSE
oDestImage := GDImage():Create( nWidth, nHeight )
ENDIF
ENDIF
//__OutDebug( nAngle )
gdImageCopyRotated( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nWidth, nHeight, nAngle )
RETURN oDestImage
| gdimage.prg | 438 |
GDIMAGE:METHOD | CopyMerge( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nPerc, oDestImage ) CLASS GDImage
METHOD CopyMerge( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nPerc, oDestImage ) CLASS GDImage
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nWidth TO ::Width
DEFAULT nHeight TO ::Height
DEFAULT nDstX TO 0
DEFAULT nDstY TO 0
DEFAULT nPerc TO 100
IF oDestImage == NIL
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nWidth, nHeight )
ELSE
oDestImage := GDImage():Create( nWidth, nHeight )
ENDIF
ENDIF
gdImageCopyMerge( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nWidth, nHeight, nPerc )
RETURN oDestImage
| gdimage.prg | 458 |
GDIMAGE:METHOD | CopyMergeGray( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nPerc, oDestImage ) CLASS GDImage
METHOD CopyMergeGray( nSrcX, nSrcY, nWidth, nHeight, nDstX, nDstY, nPerc, oDestImage ) CLASS GDImage
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nWidth TO ::Width
DEFAULT nHeight TO ::Height
DEFAULT nDstX TO 0
DEFAULT nDstY TO 0
DEFAULT nPerc TO 100
IF oDestImage == NIL
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nWidth, nHeight )
ELSE
oDestImage := GDImage():Create( nWidth, nHeight )
ENDIF
ENDIF
gdImageCopyMergeGray( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nWidth, nHeight, nPerc )
RETURN oDestImage
| gdimage.prg | 477 |
GDIMAGE:METHOD | CopyZoomed( nPerc, nSrcX, nSrcY, nSrcWidth, nSrcHeight ) CLASS GDImage
METHOD CopyZoomed( nPerc, nSrcX, nSrcY, nSrcWidth, nSrcHeight ) CLASS GDImage
LOCAL oDestImage
LOCAL nDstX, nDstY, nDstWidth, nDstHeight
DEFAULT nPerc TO 100
DEFAULT nSrcX TO 0
DEFAULT nSrcY TO 0
DEFAULT nSrcWidth TO ::Width()
DEFAULT nSrcHeight TO ::Height()
IF nPerc < 0
nPerc := 100
ENDIF
nDstX := 0
nDstY := 0
nDstWidth := nSrcWidth * nPerc / 100
nDstHeight := nSrcHeight * nPerc / 100
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nDstWidth, nDstHeight )
ELSE
oDestImage := GDImage():Create( nDstWidth, nDstHeight )
ENDIF
gdImageCopyResampled( oDestImage:pImage, ::pImage, nDstX, nDstY, nSrcX, nSrcY, nDstWidth, nDstHeight, nSrcWidth, nSrcHeight )
RETURN oDestImage
| gdimage.prg | 496 |
GDIMAGE:METHOD | Rotate( nAngle, lInside ) CLASS GDImage
METHOD Rotate( nAngle, lInside ) CLASS GDImage
LOCAL oDestImage
LOCAL nWidth, nHeight
LOCAL nAngRad := nAngle * PI() / 180
DEFAULT lInside TO FALSE
IF !lInside
nWidth := ::Width * cos( nAngRad ) + ::Height * sin( nAngRad )
nHeight := ::Width * sin( nAngRad ) + ::Height * cos( nAngRad )
ELSE
nWidth := ::Width
nHeight := ::Height
ENDIF
//__OutDebug( ::Width, ::Height )
//__OutDebug( nWidth, nHeight )
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( nWidth, nHeight )
ELSE
oDestImage := GDImage():Create( nWidth, nHeight )
ENDIF
IF !lInside
::CopyRotated( ,,,, nWidth - nWidth/2, nHeight - nHeight/2, nAngle, oDestImage )
ELSE
::CopyRotated( ,,,,,, nAngle, oDestImage )
ENDIF
::Destroy()
Self := ::CloneDataFrom( oDestImage )
//Self := __ObjClone( oDestImage ) // non funziona
// Move new image to existing one
// Signal that this image must not be destroyed
oDestImage:lDestroy := FALSE
oDestImage := NIL
RETURN Self
| gdimage.prg | 524 |
GDIMAGE:METHOD | Crop( nX, nY, nWidth, nHeight ) CLASS GDImage
METHOD Crop( nX, nY, nWidth, nHeight ) CLASS GDImage
LOCAL oDestImage
oDestImage := ::CopyResized( nX, nY, nWidth, nHeight, 0, 0, nWidth, nHeight )
::Destroy()
Self := ::CloneDataFrom( oDestImage )
//Self := __ObjClone( oDestImage ) // non funziona
// Move new image to existing one
// Signal that this image must not be destroyed
oDestImage:lDestroy := FALSE
oDestImage := NIL
RETURN Self
| gdimage.prg | 562 |
GDIMAGE:METHOD | Resize( nWidth, nHeight ) CLASS GDImage
METHOD Resize( nWidth, nHeight ) CLASS GDImage
LOCAL oDestImage
oDestImage := ::CopyResampled( 0, 0, NIL, NIL, 0, 0, nWidth, nHeight )
::Destroy()
Self := ::CloneDataFrom( oDestImage )
//Self := __ObjClone( oDestImage ) // non funziona
// Move new image to existing one
// Signal that this image must not be destroyed
oDestImage:lDestroy := FALSE
oDestImage := NIL
RETURN Self
| gdimage.prg | 577 |
GDIMAGE:METHOD | Zoom( nPerc ) CLASS GDImage
METHOD Zoom( nPerc ) CLASS GDImage
LOCAL oDestImage
oDestImage := ::CopyZoomed( nPerc )
::Destroy()
Self := ::CloneDataFrom( oDestImage )
//Self := __ObjClone( oDestImage ) // non funziona
// Move new image to existing one
// Signal that this image must not be destroyed
oDestImage:lDestroy := FALSE
oDestImage := NIL
RETURN Self
| gdimage.prg | 592 |
GDIMAGE:METHOD | Clone() CLASS GDImage
METHOD Clone() CLASS GDImage
LOCAL oDestImage
LOCAL pImage
IF ::IsTrueColor()
oDestImage := GDImage():CreateTrueColor( ::Width, ::Height )
ELSE
oDestImage := GDImage():Create( ::Width, ::Height )
ENDIF
pImage := oDestImage:pImage
oDestImage := oDestImage:CloneDataFrom( Self )
//oDestImage := __objClone( Self )
oDestImage:pImage := pImage
::Copy( 0, 0, ::Width, ::Height, 0, 0, oDestImage )
//pImage := oDestImage:pImage
//// Signal that this image must not be destroyed
//oDestImage:lDestroy := FALSE
//oDestImage := NIL
//oDestImage:pImage := pImage
RETURN oDestImage
| gdimage.prg | 607 |
GDIMAGE:METHOD | Say( x, y, cString, color, nAlign ) CLASS GDImage
METHOD Say( x, y, cString, color, nAlign ) CLASS GDImage
LOCAL nWidth, nLen
LOCAL nPosX
DEFAULT color TO ::pColor
DEFAULT nAlign TO gdAlignLeft
IF nAlign == gdAlignCenter
nWidth := ::GetFontWidth()
nLen := Len( cString )
nPosX := x - ( nLen / 2 * nWidth )
ELSEIF nAlign == gdAlignRight
nWidth := ::GetFontWidth()
nLen := Len( cString )
nPosX := x - ( nLen * nWidth )
ELSE
nPosX := x
ENDIF
gdImageString( ::pImage, ::pFont, nPosX, y, cString, color )
RETURN Self
| gdimage.prg | 632 |
GDIMAGE:METHOD | SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, nLineSpacing, nCharMap, nResolution ) CLASS GDImage
METHOD SayFreeType( x, y, cString, cFontName, nPitch, nAngle, color, nAlign, ;
nLineSpacing, nCharMap, nResolution ) CLASS GDImage
LOCAL nWidth, nLen
LOCAL nPosX
DEFAULT nAlign TO gdAlignLeft
DEFAULT color TO ::pColor
DEFAULT cFontName TO ::cFontName
DEFAULT nPitch TO ::nFontPitch
DEFAULT nAngle TO ::nFontAngle
IF nAlign == gdAlignCenter
nWidth := nPitch //gdImageFTWidth( cFontName, nPitch )//, ::Radians( nAngle ) ) //::GetFontWidth()
//__OutDebug( "nWidth", nWidth )
nLen := Len( cString )
nPosX := x - ( (nLen / 2) * nWidth )
ELSEIF nAlign == gdAlignRight
nWidth := gdImageFTWidth( cFontName, nPitch ) //, ::Radians( nAngle ) ) //::GetFontWidth()
nLen := Len( cString )
nPosX := x - ( nLen * nWidth )
ELSE
nPosX := x
ENDIF
gdImageStringFT( ::pImage, color, cFontName, nPitch, ::Radians( nAngle ), nPosX, y, ;
cString, nLineSpacing, nCharMap, nResolution )
RETURN Self
| gdimage.prg | 654 |
GDIMAGE:METHOD | CloneDataFrom( oSrc )
METHOD CloneDataFrom( oSrc )
// copy values from Source to Dest
// please update in case of new datas
::pImage := oSrc:pImage
::pBrush := oSrc:pBrush
::pTile := oSrc:pTile
::pFont := oSrc:pFont
::pColor := oSrc:pColor
::cFontName := oSrc:cFontName
::nFontPitch := oSrc:nFontPitch
::nFontAngle := oSrc:nFontAngle
::aPoints := AClone( oSrc:aPoints )
::aStyles := AClone( oSrc:aStyles )
::lDestroy := oSrc:lDestroy
::hFile := oSrc:hFile
::cType := oSrc:cType
::cMime := oSrc:cMime
RETURN Self
| gdimage.prg | 683 |
|