And again, missing parameters...
Patch (I just checked stuff from previous bugreport and this one).
Code: Select all
--- libgfl.pas.orig 2007-02-06 13:42:38.000000000 +0100
+++ libgfl.pas 2007-02-14 17:41:54.000000000 +0100
@@ -134,6 +134,7 @@
Red: array[0..255] of GFL_UINT8;
Green: array[0..255] of GFL_UINT8;
Blue: array[0..255] of GFL_UINT8;
+ Alpha: array[0..255] of GFL_UINT8;
end;
// Color
@@ -286,17 +287,17 @@
CameraRawUseAutomaticBalance: GFL_UINT8;
CameraRawUseCameraBalance: GFL_UINT8;
Reserved4: GFL_UINT16;
- CameraRawGamma: GFL_UINT32;
- CameraRawBrightness: GFL_UINT32;
- CameraRawRedScaling: GFL_UINT32;
- CameraRawBlueScaling: GFL_UINT32;
- CameraRawFilterDomain: GFL_UINT32;
- CameraRawFilterRange: GFL_UINT32;
+ CameraRawGamma: Single;
+ CameraRawBrightness: Single;
+ CameraRawRedScaling: Single;
+ CameraRawBlueScaling: Single;
+ CameraRawFilterDomain: Single;
+ CameraRawFilterRange: Single;
// Own callback
Callbacks: TGFL_LoadCallbacks;
- UserParams: PChar;
+ UserParams: Pointer;
end;
@@ -335,7 +336,7 @@
// Own callback
Callbacks: TGFL_SaveCallbacks;
- UserParams: PChar;
+ UserParams: Pointer;
end;
// Color model
@@ -769,29 +770,30 @@
const GFL_LINE_STYLE_DASHDOTDOT = 4;
function gflDrawLineColor(src: PGFL_BITMAP; x0, y0, x1, y1: GFL_INT32;
- line_width: GFL_UINT32; var line_color: PGFL_COLOR;
+ line_width: GFL_UINT32; line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
dst: PPGFL_BITMAP): GFL_ERROR; stdcall;
-function gflDrawPolylineColor(src: PGFL_BITMAP; var points: PGFL_POINT; num_points: GFL_INT32;
- line_width: GFL_UINT32; var line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
+function gflDrawPolylineColor(src: PGFL_BITMAP; points: PGFL_POINT; num_points: GFL_INT32;
+ line_width: GFL_UINT32; line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
dst: PPGFL_BITMAP): GFL_ERROR; stdcall;
-function gflDrawPolygonColor(src: PGFL_BITMAP; var points: PGFL_POINT; num_points: GFL_INT32;
- var fill_color: PGFL_COLOR;
- line_width: GFL_UINT32; var line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
+function gflDrawPolygonColor(src: PGFL_BITMAP; points: PGFL_POINT; num_points: GFL_INT32;
+ fill_color: PGFL_COLOR;
+ line_width: GFL_UINT32; line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
dst: PPGFL_BITMAP): GFL_ERROR; stdcall;
function gflDrawRectangleColor(src: PGFL_BITMAP; x0, y0, width, height: GFL_INT32;
- line_width: GFL_UINT32; var line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
+ fill_color: PGFL_COLOR;
+ line_width: GFL_UINT32; line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
dst: PPGFL_BITMAP): GFL_ERROR; stdcall;
-function gflDrawPointColor(src: PGFL_BITMAP; x0, y0, width, height: GFL_INT32;
- line_width: GFL_UINT32; var line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
+function gflDrawPointColor(src: PGFL_BITMAP; x, y: GFL_INT32;
+ line_width: GFL_UINT32; line_color: PGFL_COLOR;
dst: PPGFL_BITMAP): GFL_ERROR; stdcall;
function gflDrawCircleColor(src: PGFL_BITMAP; x, y, radius: GFL_INT32;
var fill_color: PGFL_COLOR;
- line_width: GFL_UINT32; var line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
+ line_width: GFL_UINT32; line_color: PGFL_COLOR; line_style: GFL_LINE_STYLE;
dst: PPGFL_BITMAP): GFL_ERROR; stdcall;
{$ENDIF}
I extended my tiny little tool to test that functionality, and it seems to work.
(Note that I'm not a Delphi developer and actually don't like that language very much :p)
Code: Select all
program testgflsizeof;
{$APPTYPE CONSOLE}
uses
SysUtils, ShellApi,
LibGfl in 'Z:\Profile\Desktop\GflSDK-win\GflSDK\Delphi\Include\libgfl.pas';
var
bmp: PGFL_BITMAP;
params: TGFL_LOAD_PARAMS;
sparams: TGFL_SAVE_PARAMS;
info: TGFL_FILE_INFORMATION;
test: String;
color, fill: TGFL_COLOR;
begin
WriteLn('load: ' + IntToStr(SizeOf(TGFL_LOAD_PARAMS)));
WriteLn('save: ' + IntToStr(SizeOf(TGFL_SAVE_PARAMS)));
WriteLn('32 : ' + IntToStr(SizeOf(GFL_INT32)));
WriteLn('16 : ' + IntToStr(SizeOf(GFL_INT16)));
WriteLn('8 : ' + IntToStr(SizeOf(GFL_INT8)));
WriteLn('BOOL: ' + IntToStr(SizeOf(GFL_BOOL)));
WriteLn('ORIG: ' + IntToStr(SizeOf(GFL_ORIGIN)));
WriteLn('CALL: ' + IntToStr(SizeOf(TGFL_LoadCallbacks)));
gflLibraryInit();
test := 'test.jpg';
gflGetDefaultLoadParams(params);
if gflLoadBitmap(PAnsiChar(test), bmp, params, info) <> GFL_NO_ERROR then
begin
WriteLn('error');
end
else
begin
color.Red := 255;
fill.Blue := 255;
gflDrawLineColor(bmp, 0, 0, 20, 20, 10, @color, 0, nil);
gflDrawRectangleColor(bmp, 50, 50, 60, 60, @fill, 10, @color, 0, nil);
gflGetDefaultSaveParams(sparams);
sparams.FormatIndex := gflGetFormatIndexByName('bmp');
gflSaveBitmap('test.jpg.bmp', bmp, sparams);
gflFreeBitmap(bmp);
gflFreeFileInformation(info);
end;
ReadLn;
gflLibraryExit();
end.