+ New version by Felipe Monteiro de Carvalho

git-svn-id: trunk@4876 -
This commit is contained in:
michael 2006-10-13 08:21:22 +00:00
parent 2979d4b68a
commit dfbef3a7cf
6 changed files with 52 additions and 31 deletions

View File

@ -16,19 +16,22 @@
ImageMagick Application Programming Interface declarations. ImageMagick Application Programming Interface declarations.
Converted from c by: Felipe Monteiro de Carvalho Dez/2005 Converted from c by: Felipe Monteiro de Carvalho Dez/2005
Bug-fixed by Ángel Eduardo García Hernández
Thanks to Marc Geldon and RuBBeR
} }
{Version 0.2} {Version 0.4}
unit ImageMagick; unit ImageMagick;
{$ifdef FPC} {$ifdef FPC}
{$mode objfpc} {$mode objfpc}
{$PACKRECORDS C}
{$endif} {$endif}
interface interface
uses SysUtils; uses SysUtils;
{$PACKRECORDS C}
{$MINENUMSIZE 1} {$MINENUMSIZE 1}
const const

View File

@ -25,7 +25,7 @@ const
MagickTrue = 1; MagickTrue = 1;
type type
MagickBooleanType = Byte; MagickBooleanType = Cardinal;
PMagickBooleanType = ^MagickBooleanType; PMagickBooleanType = ^MagickBooleanType;
@ -510,9 +510,14 @@ type
type type
ExceptionInfo = record ExceptionInfo = record
severity: ExceptionType; //severity: ExceptionType;
error_number: Shortint; //error_number: Shortint;
severity: Cardinal;
error_number: Cardinal;
reason, description: PChar; reason, description: PChar;
exceptions: Pointer;
relinquish: MagickBooleanType;
semaphore: Pointer; //PSemaphoreInfo;
signature: Cardinal; signature: Cardinal;
end; end;
@ -554,7 +559,7 @@ type
compose: CompositeOperator; compose: CompositeOperator;
dispose: DisposeType; dispose: DisposeType;
clip_mask: Pointer; // PImage clip_mask: Pointer; // PImage
scene, delay, iterations, total_colors: Cardinal; scene, delay, ticks_per_second, iterations, total_colors: Cardinal;
start_loop: Integer; start_loop: Integer;
error: ErrorInfo; error: ErrorInfo;
timer: TimerInfo; timer: TimerInfo;
@ -565,10 +570,10 @@ type
ascii85: Pointer; //_Ascii85Info_ ascii85: Pointer; //_Ascii85Info_
blob: Pointer; // _BlobInfo_ blob: Pointer; // _BlobInfo_
filename, magick_filename, magick: array[1..MaxTextExtent] of char; filename, magick_filename, magick: array[1..MaxTextExtent] of char;
magick_columns, magick_rows: Integer; magick_columns, magick_rows: Cardinal;
exception: ExceptionInfo; exception: ExceptionInfo;
debug: MagickBooleanType; debug: MagickBooleanType;
reference_count: Integer; reference_count: Longint;
semaphore: Pointer; //PSemaphoreInfo; semaphore: Pointer; //PSemaphoreInfo;
color_profile, iptc_profile: ProfileInfo; color_profile, iptc_profile: ProfileInfo;
generic_profile: PProfileInfo; generic_profile: PProfileInfo;
@ -606,7 +611,7 @@ type
colorspace: ColorspaceType; colorspace: ColorspaceType;
type_: ImageType ; type_: ImageType ;
preview_type: PreviewType; preview_type: PreviewType;
group: Integer; group: Longint;
ping, verbose: MagickBooleanType; ping, verbose: MagickBooleanType;
view, authenticate: PChar; view, authenticate: PChar;
channel: ChannelType; channel: ChannelType;

View File

@ -30,6 +30,7 @@ type
signature: Cardinal; signature: Cardinal;
end; end;
PQuantizeInfo = ^QuantizeInfo;
{extern MagickExport MagickBooleanType {extern MagickExport MagickBooleanType
GetImageQuantizeError(Image *), GetImageQuantizeError(Image *),

View File

@ -106,9 +106,9 @@ function DrawGetFontFamily(const wand: PDrawingWand): PChar; cdecl; external Wan
function DrawGetTextEncoding(const wand: PDrawingWand): PChar; cdecl; external WandExport; function DrawGetTextEncoding(const wand: PDrawingWand): PChar; cdecl; external WandExport;
function DrawGetVectorGraphics(const wand: PDrawingWand): PChar; cdecl; external WandExport; function DrawGetVectorGraphics(const wand: PDrawingWand): PChar; cdecl; external WandExport;
function DrawGetClipUnits(const wand: PDrawingWand): ClipPathUnits; external WandExport; function DrawGetClipUnits(const wand: PDrawingWand): ClipPathUnits; cdecl; external WandExport;
function DrawGetTextDecoration(const wand: PDrawingWand): DecorationType; external WandExport; function DrawGetTextDecoration(const wand: PDrawingWand): DecorationType; cdecl; external WandExport;
function DrawGetFillAlpha(const wand: PDrawingWand): double; cdecl; external WandExport; function DrawGetFillAlpha(const wand: PDrawingWand): double; cdecl; external WandExport;
function DrawGetFontSize(const wand: PDrawingWand): double; cdecl; external WandExport; function DrawGetFontSize(const wand: PDrawingWand): double; cdecl; external WandExport;
@ -122,7 +122,7 @@ function PeekDrawingWand(const wand: PDrawingWand): PDrawInfo; cdecl; external W
function CloneDrawingWand(const wand: PDrawingWand): PDrawingWand; cdecl; external WandExport; function CloneDrawingWand(const wand: PDrawingWand): PDrawingWand; cdecl; external WandExport;
function DestroyDrawingWand(wand: PDrawingWand): PDrawingWand; cdecl; external WandExport; function DestroyDrawingWand(wand: PDrawingWand): PDrawingWand; cdecl; external WandExport;
{ Sem documentação { Sem documentação
function DrawAllocateWand(const DrawInfo *,Image *): PDrawingWand; external WandExport; function DrawAllocateWand(const DrawInfo *,Image *): PDrawingWand; cdecl; external WandExport;
} }
function NewDrawingWand: PDrawingWand; cdecl; external WandExport; function NewDrawingWand: PDrawingWand; cdecl; external WandExport;

View File

@ -16,6 +16,15 @@
Magick Wand Image Methods. Magick Wand Image Methods.
} }
{ BugFix :
- MagickDrawImage(...const drawing_wand: PMagickWand...
+ MagickDrawImage(...const drawing_wand: PDrawingWand...
- MagickAffineTransformImage(...const drawing_wand: PMagickWand...
+ MagickAffineTransformImage(...const drawing_wand: PDrawingWand...
- MagickAnnotateImage(...const drawing_wand: PMagickWand...
+ MagickAnnotateImage(...const drawing_wand: PDrawingWand...
}
function MagickGetImageChannelStatistics(wand: PMagickWand): PChannelStatistics; cdecl; external WandExport; function MagickGetImageChannelStatistics(wand: PMagickWand): PChannelStatistics; cdecl; external WandExport;
function MagickGetImageAttribute(wand: PMagickWand): PChar; cdecl; external WandExport; function MagickGetImageAttribute(wand: PMagickWand): PChar; cdecl; external WandExport;
@ -48,9 +57,9 @@ function MagickAdaptiveThresholdImage(wand: PMagickWand;
function MagickAddImage(wand: PMagickWand; const add_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; function MagickAddImage(wand: PMagickWand; const add_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
function MagickAddNoiseImage(wand: PMagickWand; const noise_type: NoiseType): MagickBooleanType; cdecl; external WandExport; function MagickAddNoiseImage(wand: PMagickWand; const noise_type: NoiseType): MagickBooleanType; cdecl; external WandExport;
function MagickAffineTransformImage(wand: PMagickWand; function MagickAffineTransformImage(wand: PMagickWand;
const drawing_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; const drawing_wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
function MagickAnnotateImage(wand: PMagickWand; function MagickAnnotateImage(wand: PMagickWand;
const drawing_wand: PMagickWand; const x, y, angle: double; const drawing_wand: PDrawingWand; const x, y, angle: double;
const text: PChar): MagickBooleanType; cdecl; external WandExport; const text: PChar): MagickBooleanType; cdecl; external WandExport;
function MagickAnimateImages(wand: PMagickWand; function MagickAnimateImages(wand: PMagickWand;
const server_name: PChar): MagickBooleanType; cdecl; external WandExport; const server_name: PChar): MagickBooleanType; cdecl; external WandExport;
@ -77,7 +86,7 @@ function MagickColorizeImage(wand: PMagickWand;
function MagickCommentImage(wand: PMagickWand; function MagickCommentImage(wand: PMagickWand;
const comment: PChar): MagickBooleanType; cdecl; external WandExport; const comment: PChar): MagickBooleanType; cdecl; external WandExport;
function MagickCompositeImage(wand: PMagickWand; function MagickCompositeImage(wand: PMagickWand;
const composite_wand: MagickWand; const compose: CompositeOperator; const composite_wand: PMagickWand; const compose: CompositeOperator;
const x, y: Integer): MagickBooleanType; cdecl; external WandExport; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
function MagickConstituteImage(wand: PMagickWand; function MagickConstituteImage(wand: PMagickWand;
const columns, rows: Cardinal; const map: PChar; const columns, rows: Cardinal; const map: PChar;
@ -99,7 +108,7 @@ function MagickDisplayImage(wand: PMagickWand;
function MagickDisplayImages(wand: PMagickWand; function MagickDisplayImages(wand: PMagickWand;
const server_name: PChar): MagickBooleanType; cdecl; external WandExport; const server_name: PChar): MagickBooleanType; cdecl; external WandExport;
function MagickDrawImage(wand: PMagickWand; function MagickDrawImage(wand: PMagickWand;
const drawing_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; const drawing_wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
function MagickEdgeImage(wand: PMagickWand; function MagickEdgeImage(wand: PMagickWand;
const radius: double): MagickBooleanType; cdecl; external WandExport; const radius: double): MagickBooleanType; cdecl; external WandExport;
function MagickEmbossImage(wand: PMagickWand; function MagickEmbossImage(wand: PMagickWand;
@ -141,11 +150,11 @@ function MagickGetImageColormapColor(wand: PMagickWand;
const index: Cardinal; color: PPixelWand): MagickBooleanType; cdecl; external WandExport; const index: Cardinal; color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
function MagickGetImageExtrema(wand: PMagickWand; function MagickGetImageExtrema(wand: PMagickWand;
min, max: Cardinal): MagickBooleanType; cdecl; external WandExport; min, max: Cardinal): MagickBooleanType; cdecl; external WandExport;
function MagickGetImageGreenPrimary(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; external WandExport; function MagickGetImageGreenPrimary(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
function MagickGetImageMatteColor(wand: PMagickWand; function MagickGetImageMatteColor(wand: PMagickWand;
matte_color: PPixelWand): MagickBooleanType; cdecl; external WandExport; matte_color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
function MagickGetImagePage(wand: PMagickWand; function MagickGetImagePage(wand: PMagickWand;
width, height: PCardinal; x, y: Integer): MagickBooleanType; cdecl; external WandExport; width, height: PCardinal; x, y: PInteger): MagickBooleanType; cdecl; external WandExport;
function MagickGetImagePixelColor(wand: PMagickWand; function MagickGetImagePixelColor(wand: PMagickWand;
const x, y: Integer; color: PPixelWand): MagickBooleanType; cdecl; external WandExport; const x, y: Integer; color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
function MagickGetImagePixels(wand: PMagickWand; function MagickGetImagePixels(wand: PMagickWand;
@ -155,7 +164,7 @@ function MagickGetImageRedPrimary(wand: PMagickWand; x, y: Pdouble): MagickBoole
function MagickGetImageResolution(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport; function MagickGetImageResolution(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
function MagickGetImageWhitePoint(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport; function MagickGetImageWhitePoint(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
function MagickHasNextImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; function MagickHasNextImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
function MagickHasPreviousImage(wand: PMagickWand): MagickBooleanType; external WandExport; function MagickHasPreviousImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
function MagickImplodeImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport; function MagickImplodeImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
function MagickLabelImage(wand: PMagickWand; const _label: PChar): MagickBooleanType; cdecl; external WandExport; function MagickLabelImage(wand: PMagickWand; const _label: PChar): MagickBooleanType; cdecl; external WandExport;
function MagickLevelImage(wand: PMagickWand; function MagickLevelImage(wand: PMagickWand;
@ -183,19 +192,19 @@ function MagickNegateImageChannel(wand: PMagickWand): MagickBooleanType; externa
Documentation not found Documentation not found
} }
function MagickNewImage(wand: PMagickWand; function MagickNewImage(wand: PMagickWand;
const columns, rows: Cardinal; const background: PPixelWand): MagickBooleanType; external WandExport; const columns, rows: Cardinal; const background: PPixelWand): MagickBooleanType; cdecl; external WandExport;
function MagickNextImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; function MagickNextImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
function MagickNormalizeImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; function MagickNormalizeImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
function MagickOilPaintImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport; function MagickOilPaintImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
function MagickPaintOpaqueImage(wand: PMagickWand; function MagickPaintOpaqueImage(wand: PMagickWand;
const target, fill: PPixelWand; const fuzz: double): MagickBooleanType; external WandExport; const target, fill: PPixelWand; const fuzz: double): MagickBooleanType; cdecl; external WandExport;
function MagickPaintTransparentImage(wand: PMagickWand; function MagickPaintTransparentImage(wand: PMagickWand;
const target: PPixelWand; const opacity: Quantum; const fuzz: double): MagickBooleanType; external WandExport; const target: PPixelWand; const opacity: Quantum; const fuzz: double): MagickBooleanType; cdecl; external WandExport;
function MagickPingImage(wand: PMagickWand; function MagickPingImage(wand: PMagickWand;
const filename: PChar): MagickBooleanType; cdecl; external WandExport; const filename: PChar): MagickBooleanType; cdecl; external WandExport;
{ {
function MagickPosterizeImage(wand: PMagickWand; function MagickPosterizeImage(wand: PMagickWand;
const levels: Word; const dither: MagickBooleanType): MagickBooleanType; external WandExport; const levels: Word; const dither: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
?? ??
} }
function MagickPreviousImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; function MagickPreviousImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
@ -208,7 +217,7 @@ function MagickQuantizeImages(wand: PMagickWand;
const number_colors: Cardinal; const colorspace: ColorspaceType; const number_colors: Cardinal; const colorspace: ColorspaceType;
const treedepth: Cardinal; const dither: MagickBooleanType; const treedepth: Cardinal; const dither: MagickBooleanType;
const measure_error: MagickBooleanType): MagickBooleanType; cdecl; external WandExport; const measure_error: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
function MagickRadialBlurImage(wand: PMagickWand; const angle: double): MagickBooleanType; external WandExport; function MagickRadialBlurImage(wand: PMagickWand; const angle: double): MagickBooleanType; cdecl; external WandExport;
function MagickRadialBlurImageChannel(wand: PMagickWand; function MagickRadialBlurImageChannel(wand: PMagickWand;
const channel: ChannelType; const angle: double): MagickBooleanType; cdecl; external WandExport; const channel: ChannelType; const angle: double): MagickBooleanType; cdecl; external WandExport;
function MagickRaiseImage(wand: PMagickWand; function MagickRaiseImage(wand: PMagickWand;
@ -220,7 +229,7 @@ function MagickReadImageBlob(wand: PMagickWand;
const blob: Pointer; const length: Integer): MagickBooleanType; cdecl; external WandExport; const blob: Pointer; const length: Integer): MagickBooleanType; cdecl; external WandExport;
//function MagickReadImageFile(wand: PMagickWand; file_: file): MagickBooleanType; external WandExport; //function MagickReadImageFile(wand: PMagickWand; file_: file): MagickBooleanType; external WandExport;
function MagickReduceNoiseImage(wand: PMagickWand; const radius: double): MagickBooleanType; external WandExport; function MagickReduceNoiseImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
function MagickRemoveImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport; function MagickRemoveImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
function MagickResampleImage(wand: PMagickWand; function MagickResampleImage(wand: PMagickWand;
const x_resolution, y_resolution: double; const x_resolution, y_resolution: double;

View File

@ -16,15 +16,18 @@
ImageMagick MagickWand API. ImageMagick MagickWand API.
Converted from c by: Felipe Monteiro de Carvalho Dez/2005 Converted from c by: Felipe Monteiro de Carvalho Dez/2005
Bug-fixed by Ángel Eduardo García Hernández
Thanks to Marc Geldon and RuBBeR
} }
{Version 0.2} {Version 0.4}
unit magick_wand; unit magick_wand;
{$IFDEF FPC} {$IFDEF FPC}
{$mode objfpc} {$mode objfpc}
{$PACKRECORDS C}
{$ENDIF} {$ENDIF}
{$PACKRECORDS C}
{$MINENUMSIZE 1} {$MINENUMSIZE 1}
interface interface
@ -34,12 +37,12 @@ uses ImageMagick;
type type
MagickWand = record MagickWand = record
id: Cardinal; id: Cardinal;
name: array[0..MaxTextExtent] of Char; name: array[1..MaxTextExtent] of Char;
exception: ExceptionInfo; exception: ExceptionInfo;
image_info: PImageInfo; image_info: PImageInfo;
quantize_info: QuantizeInfo; quantize_info: PQuantizeInfo;
images: Image; images: PImage;
iterator, debug: MagickBooleanType; active, pend, debug: MagickBooleanType;
signature: Cardinal; signature: Cardinal;
end; end;