gflConvolve

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

gflConvolve

Post by madiazg »

Hi,
I have problems with the function gflConvolve. In Delphi:

Code: Select all

var
    Filtro : PGFL_Filter;
....
begin
....
  Filtro.Size := 3; //-> ERROR
...
end;
Error in the application when I define the width of the matrix.
What is the problem?

Regards...
Miguel Angel
User avatar
xnview
Author of XnView
Posts: 44917
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: gflConvolve

Post by xnview »

What is the error?
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

Re: gflConvolve

Post by madiazg »

xnview wrote:What is the error?
The error occurs when running the application:

"Access violation at address FEFCC481. Read of address FEFCC481"

Miguel Angel
User avatar
xnview
Author of XnView
Posts: 44917
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: gflConvolve

Post by xnview »

It's not TGFL_FILTER that you must use??
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

Re: gflConvolve

Post by madiazg »

xnview wrote:It's not TGFL_FILTER that you must use??
I'm sorry but i don't understand you

Miguel Angel
User avatar
xnview
Author of XnView
Posts: 44917
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: gflConvolve

Post by xnview »

TGFL_FILTER is a pointer, no? Not the struct?
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

Re: gflConvolve

Post by madiazg »

xnview wrote:TGFL_FILTER is a pointer, no? Not the struct?
yes, PGFL_FILTER is a pointer to the structure TGFL_FILTER. In libgfl.pas:

Code: Select all

PGFL_FILTER = ^TGFL_FILTER;
  TGFL_FILTER = record
    Size: GFL_INT16;
    Matrix: array[0..15, 0..7] of GFL_INT16;
    Divisor: GFL_INT16;
    Bias: GFL_INT16;
  end;
function gflConvolve(src: PGFL_BITMAP; dst: PPGFL_BITMAP;  var filter: PGFL_FILTER): GFL_ERROR; stdcall;
Regards...
Miguel Angel
User avatar
xnview
Author of XnView
Posts: 44917
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: gflConvolve

Post by xnview »

Ok, but i don't understand why with

Code: Select all

Filtro.Size := 3;
you have a crash...
Pierre.
Mike
Posts: 3
Joined: Mon Dec 26, 2011 6:03 am

Re: gflConvolve

Post by Mike »

Hi,
Filtro is pointer. It must be defined. I.e. must point to a chunk of memory where located structure GFL_FILTER. Please use getmem() or similar function. After that, it can be used in parts of your sample. Or use TGFL_FILTER