Hi all,
I am developing an external procedure to perform some complicated image processing. More specifically
1. I have a table (A) storing small images as BLOBs
2. Based on different criteria a number of images are selected from the table
3. These images must be combined together to produce a large image
In order to achieve this I have developed a delphi dll which exports a function (cdecl calling convention) that essentially runs the selection query, gather images together and produces a new large image.
procedure ExtractRaster(Context: Pointer);cdecl;
After creating the library and the necessary PL/SQL specs everything is ok
( Create or replace library RasterUtils as 'c:\xxx\rasterUtils.dll'
Create or replace procedure ExtractRaster as
language c
name "ExtractRaster"
library rasterUtils
PARAMETERS(CONTEXT)
with context;
)
The problem is if I want to get the large image back in PL/SQL. i.e. create a procedure in PL/SQL like this :
create or replace procedure DoSomethingWithLargeImage as
aBLOB BLOB;
begin
ExtractRaster(aBLOB);
dbms_lob.getLength(aBLOB);
etc .......
...
...
end;
where ExtractRaster must now be defined as
something like this
procedure ExtractRaster(Context: Pointer;aLocIndicator : word;var aLocator : OCILobLocator);cdecl;
begin
end;
returning the image as a LobLocator
with the pl/sql specification modified like this
Create or replace procedure ExtractRaster(aimage out BLOB) as
language c
name "ExtractRaster"
library RasterUtils
PARAMETERS(CONTEXT, aImage INDICATOR, aImage OCILobLocator)
with context;
I am not quite sure how to do it, and I am a bit confused. I gave it some attempts but none seemed to succeed.
Thanks for any suggestions
George
I am developing an external procedure to perform some complicated image processing. More specifically
1. I have a table (A) storing small images as BLOBs
2. Based on different criteria a number of images are selected from the table
3. These images must be combined together to produce a large image
In order to achieve this I have developed a delphi dll which exports a function (cdecl calling convention) that essentially runs the selection query, gather images together and produces a new large image.
procedure ExtractRaster(Context: Pointer);cdecl;
After creating the library and the necessary PL/SQL specs everything is ok
( Create or replace library RasterUtils as 'c:\xxx\rasterUtils.dll'
Create or replace procedure ExtractRaster as
language c
name "ExtractRaster"
library rasterUtils
PARAMETERS(CONTEXT)
with context;
)
The problem is if I want to get the large image back in PL/SQL. i.e. create a procedure in PL/SQL like this :
create or replace procedure DoSomethingWithLargeImage as
aBLOB BLOB;
begin
ExtractRaster(aBLOB);
dbms_lob.getLength(aBLOB);
etc .......
...
...
end;
where ExtractRaster must now be defined as
something like this
procedure ExtractRaster(Context: Pointer;aLocIndicator : word;var aLocator : OCILobLocator);cdecl;
begin
end;
returning the image as a LobLocator
with the pl/sql specification modified like this
Create or replace procedure ExtractRaster(aimage out BLOB) as
language c
name "ExtractRaster"
library RasterUtils
PARAMETERS(CONTEXT, aImage INDICATOR, aImage OCILobLocator)
with context;
I am not quite sure how to do it, and I am a bit confused. I gave it some attempts but none seemed to succeed.
Thanks for any suggestions
George