* removed old gd headers (were alread disabled)

git-svn-id: trunk@12586 -
This commit is contained in:
ivost 2009-01-24 01:29:28 +00:00
parent 6e700b38a4
commit f62780694e
6 changed files with 64 additions and 485 deletions

3
.gitattributes vendored
View File

@ -3115,8 +3115,7 @@ packages/libgd/examples/Makefile.fpc svneol=native#text/plain
packages/libgd/examples/gdtest.pp svneol=native#text/plain
packages/libgd/examples/gdtestcgi.pp svneol=native#text/plain
packages/libgd/fpmake.pp svneol=native#text/plain
packages/libgd/src/gd.pp svneol=native#text/plain
packages/libgd/src/libgd.pas svneol=native#text/plain
packages/libgd/src/gd.pas svneol=native#text/plain
packages/libndsfpc/Makefile svneol=native#text/plain
packages/libndsfpc/Makefile.fpc svneol=native#text/plain
packages/libndsfpc/examples/devkitPro/Graphics/2D/16bit_color_bmp/data/drunkenlogo.git svneol=native#text/plain

View File

@ -1,5 +1,5 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/01/04]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/01/18]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@ -265,178 +265,178 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(F
override PACKAGE_NAME=libgd
override PACKAGE_VERSION=2.2.2
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-go32v2)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-win32)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-os2)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-freebsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-beos)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-haiku)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-netbsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-solaris)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-qnx)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-netware)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-openbsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-wdosx)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-darwin)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-emx)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-watcom)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-freebsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-amiga)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-atari)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-openbsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-amiga)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-macos)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-palmos)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-darwin)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-wince)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc64-darwin)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),avr-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),armeb-linux)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),armeb-embedded)
override TARGET_UNITS+=libgd
override TARGET_UNITS+=gd
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_EXAMPLEDIRS+=examples

View File

@ -10,7 +10,7 @@ version=2.2.2
libc=y
[target]
units=libgd
units=gd
exampledirs=examples
[install]

View File

@ -12,14 +12,14 @@ begin
begin
{$endif ALLPACKAGES}
P:=AddPackage('libgd');
P:=AddPackage('gd');
{$ifdef ALLPACKAGES}
P.Directory:='libgd';
{$endif ALLPACKAGES}
P.Version:='2.2.2-0';
P.SourcePath.Add('src');
T:=P.Targets.AddUnit('gd.pp');
T:=P.Targets.AddUnit('gd.pas');
P.ExamplePath.Add('tests');
P.Targets.AddExampleProgram('gdtestcgi.pp');

View File

@ -3,7 +3,7 @@
Copyright(C) 2009 by Ivo Steinmann
}
unit libgd;
unit gd;
{$mode objfpc}
{$macro on}

View File

@ -1,420 +0,0 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt, member of
the Free Pascal development team
This file implements an interface to the gd library.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
unit gd;
interface
{$if defined(FPC_HAS_FEATURE_DYNLIBS) and (not defined(go32v2))}
{$define DYNLINK}
{$endif}
{$linklib c}
{$linklib m}
{$linklib png}
{$linklib gd}
{$ifdef hasttf}
{$linklib ttf}
{$endif hasttf}
{$PACKRECORDS C}
const
libgd = 'gd';
libc = 'c';
GD_H = 1;
DEFAULT_FONTPATH = '/usr/share/fonts/truetype';
PATHSEPARATOR = ':';
gdMaxColors = 256;
type
PByte = ^Byte;
PPByte = ^PByte;
PVoid = Pointer;
PFile = Pointer;
PGDIMAGESTRUCT = ^gdImage;
gdImage = record
pixels : PPbyte;
sx : longint;
sy : longint;
colorsTotal : longint;
red : array[0..(gdMaxColors)-1] of longint;
green : array[0..(gdMaxColors)-1] of longint;
blue : array[0..(gdMaxColors)-1] of longint;
open : array[0..(gdMaxColors)-1] of longint;
transparent : longint;
polyInts : Plongint;
polyAllocated : longint;
brush : PgdImageStruct;
tile : PgdImageStruct;
brushColorMap : array[0..(gdMaxColors)-1] of longint;
tileColorMap : array[0..(gdMaxColors)-1] of longint;
styleLength : longint;
stylePos : longint;
style : Plongint;
interlace : longint;
end;
gdImageStruct = gdImage;
pgdImage = ^gdImage;
gdImagePtr = PgdImage;
gdFont = record
nchars : longint;
offset : longint;
w : longint;
h : longint;
data : Pchar;
end;
pgdFont = ^gdFont;
gdFontPtr = PgdFont;
var
{$ifndef darwin}
gdFontLarge : gdFontPtr; cvar; external;
gdFontSmall : gdFontPtr; cvar; external;
gdFontGiant : gdFontPtr; cvar; external;
gdFontMediumBold : gdFontPtr; cvar; external;
gdFontTiny : gdFontPtr; cvar; external;
{$else darwin}
gdFontLarge : gdFontPtr; external {$ifdef DYNLINK} libgd {$endif} name 'gdFontLarge';
gdFontSmall : gdFontPtr; external {$ifdef DYNLINK} libgd {$endif} name 'gdFontSmall';
gdFontGiant : gdFontPtr; external {$ifdef DYNLINK} libgd {$endif} name 'gdFontGiant';
gdFontMediumBold : gdFontPtr; external {$ifdef DYNLINK} libgd {$endif} name 'gdFontMediumBold';
gdFontTiny : gdFontPtr; external {$ifdef DYNLINK} libgd {$endif} name 'gdFontTiny';
{$endif darwin}
const
gdDashSize = 4;
gdStyled = -(2);
gdBrushed = -(3);
gdStyledBrushed = -(4);
gdTiled = -(5);
gdTransparent = -(6);
type
gdSource = record
source : function (context:Pointer; buffer:Pchar; len:longint):longint;cdecl;
context : pointer;
end;
pgdSource = ^gdSource;
gdSourcePtr = PgdSource;
gdSink = record
sink : function (context:Pvoid; buffer:Pchar; len:longint):longint;cdecl;
context : pointer;
end;
pgdSink = ^gdSink;
gdSinkPtr = PgdSink;
gdPoint = record
x : longint;
y : longint;
end;
pgdPoint = ^gdPoint;
gdPointPtr = PgdPoint;
pgdIOCtx = ^gdIOCtx;
gdIOCtx = record
getC : function (_para1:PgdIOCtx):longint;cdecl;
getBuf : function (_para1:PgdIOCtx; _para2:pointer; _para3:longint):longint;
putC : procedure (_para1:PgdIOCtx; _para2:longint);
putBuf : function (_para1:PgdIOCtx; _para2:pointer; _para3:longint):longint;
seek : function (_para1:PgdIOCtx; _para2:longint):longint;
tell : function (_para1:PgdIOCtx):longint;
free : procedure (_para1:PgdIOCtx);
end;
GDIOCTXPTR = pgdIOCtx;
{ Translated from gd_io.h}
function fopen(a,b:pchar):pFile; cdecl;external {$ifdef DYNLINK} libc {$endif};
procedure fclose(a:pFile); cdecl;external {$ifdef DYNLINK} libc {$endif};
procedure Putword(w:longint; ctx:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure Putchar(c:longint; ctx:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdPutC(c:byte; ctx:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdPutBuf(_para1:pointer; _para2:longint; _para3:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdPutWord(w:longint; ctx:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdPutInt(w:longint; ctx:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdGetC(ctx:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdGetBuf(_para1:pointer; _para2:longint; _para3:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdGetByte(result:Plongint; ctx:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdGetWord(result:Plongint; ctx:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdGetInt(result:Plongint; ctx:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdSeek(ctx:PgdIOCtx; _para2:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdTell(ctx:PgdIOCtx):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreate(sx:longint; sy:longint):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromPng(fd:PFILE):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromPngCtx(inIO:gdIOCtxPtr):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromWBMP(inFile:PFILE):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromWBMPCtx(infile:PgdIOCtx):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromJpeg(infile:PFILE):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromJpegCtx(infile:PgdIOCtx):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromPngSource(infile:gdSourcePtr):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromGd(infile:PFILE):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromGdCtx(infile:gdIOCtxPtr):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromGd2(infile:PFILE):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromGd2Ctx(infile:gdIOCtxPtr):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromGd2Part(infile:PFILE; srcx:longint; srcy:longint; w:longint; h:longint):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromGd2PartCtx(infile:gdIOCtxPtr; srcx:longint; srcy:longint; w:longint; h:longint):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageCreateFromXbm(fd:PFILE):gdImagePtr; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageDestroy(im:gdImagePtr); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageSetPixel(im:gdImagePtr; x:longint; y:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageGetPixel(im:gdImagePtr; x:longint; y:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageLine(im:gdImagePtr; x1:longint; y1:longint; x2:longint; y2:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageDashedLine(im:gdImagePtr; x1:longint; y1:longint; x2:longint; y2:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageRectangle(im:gdImagePtr; x1:longint; y1:longint; x2:longint; y2:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageFilledRectangle(im:gdImagePtr; x1:longint; y1:longint; x2:longint; y2:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageBoundsSafe(im:gdImagePtr; x:longint; y:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageChar(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageCharUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageString(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:Pbyte; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageStringUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:Pbyte; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageString16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:Pword; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageStringUp16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:Pword; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
{$ifdef HasTTF}
function gdImageStringTTF(im:PgdImage; brect:Plongint; fg:longint; fontlist:Pchar; ptsize:double; angle:double; x:longint; y:longint; astring:Pchar):Pchar; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageStringFT(im:PgdImage; brect:Plongint; fg:longint; fontlist:Pchar; ptsize:double; angle:double; x:longint; y:longint; astring:Pchar):Pchar; cdecl; external {$ifdef DYNLINK} libgd {$endif};
{$endif hasTTF}
procedure gdImagePolygon(im:gdImagePtr; p:gdPointPtr; n:longint; c:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageFilledPolygon(im:gdImagePtr; p:gdPointPtr; n:longint; c:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageColorAllocate(im:gdImagePtr; r:longint; g:longint; b:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageColorClosest(im:gdImagePtr; r:longint; g:longint; b:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageColorExact(im:gdImagePtr; r:longint; g:longint; b:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageColorResolve(im:gdImagePtr; r:longint; g:longint; b:longint):longint; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageColorDeallocate(im:gdImagePtr; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageColorTransparent(im:gdImagePtr; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImagePaletteCopy(dst:gdImagePtr; src:gdImagePtr); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImagePng(im:gdImagePtr; _out:PFILE); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImagePngCtx(im:gdImagePtr; _out:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageWBMP(image:gdImagePtr; fg:longint; _out:PFILE); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageWBMPCtx(image:gdImagePtr; fg:longint; _out:PgdIOCtx); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdFree(m:Pvoid); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageWBMPPtr(im:gdImagePtr; size:Plongint; fg:longint):pointer; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageJpeg(im:gdImagePtr; _out:PFILE; quality:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageJpegCtx(im:gdImagePtr; _out:PgdIOCtx; quality:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageJpegPtr(im:gdImagePtr; size:Plongint; quality:longint):pointer; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImagePngToSink(im:gdImagePtr; _out:gdSinkPtr); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageGd(im:gdImagePtr; _out:PFILE); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageGd2(im:gdImagePtr; _out:PFILE; cs:longint; fmt:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImagePngPtr(im:gdImagePtr; size:Plongint):pointer; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageGdPtr(im:gdImagePtr; size:Plongint):pointer; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdImageGd2Ptr(im:gdImagePtr; cs:longint; fmt:longint; size:Plongint):pointer; cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageArc(im:gdImagePtr; cx:longint; cy:longint; w:longint; h:longint; s:longint; e:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageFillToBorder(im:gdImagePtr; x:longint; y:longint; border:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageFill(im:gdImagePtr; x:longint; y:longint; color:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageCopy(dst:gdImagePtr; src:gdImagePtr; dstX:longint; dstY:longint; srcX:longint; srcY:longint; w:longint; h:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageCopyMerge(dst:gdImagePtr; src:gdImagePtr; dstX:longint; dstY:longint; srcX:longint; srcY:longint; w:longint; h:longint; pct:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageCopyMergeGray(dst:gdImagePtr; src:gdImagePtr; dstX:longint; dstY:longint; srcX:longint; srcY:longint; w:longint; h:longint; pct:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageCopyResized(dst:gdImagePtr; src:gdImagePtr; dstX:longint; dstY:longint; srcX:longint; srcY:longint; dstW:longint; dstH:longint; srcW:longint; srcH:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageSetBrush(im:gdImagePtr; brush:gdImagePtr); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageSetTile(im:gdImagePtr; tile:gdImagePtr); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageSetStyle(im:gdImagePtr; style:Plongint; noOfPixels:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
procedure gdImageInterlace(im:gdImagePtr; interlaceArg:longint); cdecl; external {$ifdef DYNLINK} libgd {$endif};
{ Translated macros }
function gdImageSX(im : pgdimage) : longint;
function gdImageSY(im : pgdimage) : longint;
function gdImageColorsTotal(im : pgdimage) : longint;
function gdImageRed(im : pgdimage; c : longint): longint;
function gdImageGreen(im : pgdimage; c : longint): longint;
function gdImageBlue(im : pgdimage; c : longint): longint;
function gdImageGetTransparent(im : pgdimage) : longint;
function gdImageGetInterlaced(im : pgdimage) : longint;
function gdNewFileCtx(_para1:PFILE):PgdIOCtx; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdNewDynamicCtx(_para1:longint; _para2:pointer):PgdIOCtx; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdNewSSCtx(infile:gdSourcePtr; _out:gdSinkPtr):PgdIOCtx; cdecl; external {$ifdef DYNLINK} libgd {$endif};
function gdDPExtractData(ctx:pointer; size:Plongint):pointer; cdecl; external {$ifdef DYNLINK} libgd {$endif};
{overloaded pascal functions}
function fopen(a,b:string):pFile;
procedure gdImageChar(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);
procedure gdImageCharUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);
procedure gdImageString(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
procedure gdImageStringUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
procedure gdImageString16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
procedure gdImageStringUp16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
{$ifdef hasttf}
function gdImageStringTTF(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string): string;
function gdImageStringFT(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string):string;
{$endif}
const
GD2_CHUNKSIZE = 128;
GD2_CHUNKSIZE_MIN = 64;
GD2_CHUNKSIZE_MAX = 4096;
GD2_VERS = 1;
GD2_ID = 'gd2';
GD2_FMT_RAW = 1;
GD2_FMT_COMPRESSED = 2;
function gdImageCompare(im1:gdImagePtr; im2:gdImagePtr):longint;cdecl; external {$ifdef DYNLINK} libgd {$endif};
const
GD_CMP_IMAGE = 1;
GD_CMP_NUM_COLORS = 2;
GD_CMP_COLOR = 4;
GD_CMP_SIZE_X = 8;
GD_CMP_SIZE_Y = 16;
GD_CMP_TRANSPARENT = 32;
GD_CMP_BACKGROUND = 64;
GD_CMP_INTERLACE = 128;
GD_RESOLUTION = 96;
implementation
function gdImageSX(im : pgdimage) : longint;
begin
gdImageSX:=im^.sx;
end;
function gdImageSY(im : pgdimage) : longint;
begin
gdImageSY:=im^.sy;
end;
function gdImageColorsTotal(im : pgdimage) : longint;
begin
gdImageColorsTotal:=im^.colorsTotal;
end;
function gdImageGetTransparent(im : pgdimage) : longint;
begin
gdImageGetTransparent:=im^.transparent;
end;
function gdImageGetInterlaced(im : pgdimage) : longint;
begin
gdImageGetInterlaced:=im^.interlace;
end;
function gdImageRed(im : pgdimage; c : longint): longint;
begin
gdImageRed:=im^.red[c];
end;
function gdImageGreen(im : pgdimage; c : longint): longint;
begin
gdImageGreen := im^.green[c];
end;
function gdImageBlue(im : pgdimage; c : longint): longint;
begin
gdImageBlue := im^.blue[c];
end;
function fopen(a,b:string):pFile;
begin
{$ifopt h+}
fopen:=fopen(pchar(a),pchar(b));
{$else}
a:=a+#0;
b:=b+#0;
fopen:=fopen(@a[1],@b[1]);
{$endif}
end;
procedure gdImageChar(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);
begin
gdimagechar(im,f,x,y,ord(c),color);
end;
procedure gdImageCharUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);
begin
gdimagecharup(im,f,x,y,ord(c),color);
end;
procedure gdImageString(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
begin
{$ifopt h+}
gdImageString(im,f,x,y,pbyte(pchar(s)),color);
{$else}
s:=s+#0;
gdImageString(im,f,x,y,@s[1],color);
{$endif}
end;
procedure gdImageStringUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
begin
{$ifopt h+}
gdImageStringUp(im,f,x,y,pbyte(pchar(s)),color);
{$else}
s:=s+#0;
gdImageStringUp(im,f,x,y,pbyte(@s[1]),color);
{$endif}
end;
procedure gdImageString16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
begin
{$ifopt h+}
gdImageString16(im,f,x,y,pword(pchar(s)),color);
{$else}
s:=s+#0;
gdImageString16(im,f,x,y,pword(@s[1]),color);
{$endif}
end;
procedure gdImageStringUp16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
begin
{$ifopt h+}
gdImageStringUp16(im,f,x,y,pword(pchar(s)),color);
{$else}
s:=s+#0;
gdImageStringUp16(im,f,x,y,pword(@s[1]),color);
{$endif}
end;
{$ifdef hasttf}
function gdImageStringTTF(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string): string;
begin
{$ifopt h+}
gdImageStringTTF:=strpas(gdImageStringTTF(im,brect,fg,pchar(fontlist),ptsize,angle,x,y,pchar(astring)));
{$else}
fontlist:=fornlist+#0;
astring:=astring+#0;
gdImageStringTTF:=strpas(gdImageStringTTF(im,brect,fg,@fontlist[1],ptsize,angle,x,y,@astring[1]));
{$endif}
end;
function gdImageStringFT(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string):string;
begin
{$ifopt h+}
gdImageStringFT:=strpas(gdImageStringFT(im,brect,fg,pchar(fontlist),ptsize,angle,x,y,pchar(astring)));
{$else}
fontlist:=fornlist+#0;
astring:=astring+#0;
gdImageStringFT:=strpas(gdImageStringFT(im,brect,fg,@fontlist[1],ptsize,angle,x,y,@astring[1]));
{$endif}
end;
{$endif}
end.