Author |
Topic |
|
spetric
Croatia
308 Posts |
|
xequte
38682 Posts |
|
spetric
Croatia
308 Posts |
Posted - Aug 07 2020 : 16:01:55
|
Hi Nigel,
Thanks a lot. Ther is no need for cdecl, as the calling convention is stdcall, not cdecl. Also, there is no need for external PSP_API.
You can delete that as complete block. External keyword comes in implementation block. I'll put corrected version on GitHub. besides you, who else needs to be credited for conversion?
Here are converted spEngine headers corrected by William Miller.
attach/spetric/202087153816_spEnginePasheaders.zip 4.76 KB
I have corrected as much as possible and upload it on GitHub (Additional/Delphi).
With best regards, Siniša
|
|
|
spetric
Croatia
308 Posts |
Posted - Aug 07 2020 : 18:17:59
|
Hi Nigel,
I thought of creating DLLs today, but I made one oversight. Unlike OpenCV image Mat which has top-down scanline orientation, ImageEn TIEBitmap and also ordinary TBitmap has bottom-up scanline orientation, which results in upside-down image in plug-in:
Not a problem, I have to add another parameter when setting image to pspiHost. I'll add it tomorrow.
BTW, complete test program in Berlin 10.1 has less then 50 lines of C++ code.
With best regards and thanks again for converting header files, Siniša |
|
|
xequte
38682 Posts |
|
spetric
Croatia
308 Posts |
Posted - Aug 08 2020 : 13:38:55
|
Hi Nigel,
Thanks for info. Anyway, I have added one API pspiSetImageOrientation and before setting image to pspiHost, user can set image orientation (ASIS or INVERTED). It needs to be called only once in application.
However, I've noticed a problem (similar to scanner preview dialog problem I posted about) and that is styling non-VCL windows from VCL-styled application. I will make a post on StackOverflow if someone can inform me about this strange behavior.
The same plug-in not only looks different but is also slow, especially when image is zoomed or panned...completely unusable, as it constantly repaints complete plug-in window.
Thanks again, Siniša
|
|
|
spetric
Croatia
308 Posts |
|
spetric
Croatia
308 Posts |
Posted - Aug 10 2020 : 04:22:18
|
Hi,
__stdcall was definitively a bad idea because of MS name decoration. Calling convention changed to cdecl, so to avoid decoration of APIs.
Delphi pas files corrected, OMF static libs (for Embarcadero C++) and release DLLs uploaded to GitHub (32 and 64 bit):
https://github.com/spetric/Photoshop-Plugin-Host/tree/master/Additional
Demo code is still the same. |
|
|
xequte
38682 Posts |
|
spetric
Croatia
308 Posts |
Posted - Aug 11 2020 : 03:16:47
|
Hi Nigel,
I've added a log in pspiSetImage API and here are results when loading an image from PspiDemo.exe you've sent me:
image type: 768 width: 800 height: 600 imageBuff: 0AA9B040 imageStride: 2400 alphaBuff: 00000000 alphaStride: 0
Width, height, buffer and stride are passed correctly, the problem is image type, which is 768 (received by API)!? As TImgType enum ranges from 0 to 5, pspiSetImage API returns PSPI_ERR_BAD_IMAGE_TYPE which is 15 (pspiGlobals.pas).
For testing purposes I forced correct type in DLL and it works fine:
Can you check what is the value in aType before it's passed to API. We just need to solve that TImgType enum/type variable passing. The rest is obviously OK.
Thanks, Siniša
|
|
|
xequte
38682 Posts |
Posted - Aug 11 2020 : 19:26:55
|
Hi Sinisa
I changed the type of the ImgType parameter to integer rather than TImgType, which seemed to resolve it.
My filters don't seem to work though (get PSPI_ERR_FILTER_INVALID). Can you forward me some filters to try.
Nigel Xequte Software www.imageen.com
|
|
|
spetric
Croatia
308 Posts |
Posted - Aug 12 2020 : 05:32:12
|
Hi Nigel,
Some older plugins may not work. I've tried some in C# PspHost application written for paint.net and it also returned an error.
Here are plugins collection that work:
http://flamingpear.com/free-trials.html#freebies
You can try Kyoto colors an Pixel trash as they have form with preview and controls.
https://www.mehdiplugins.com/
From this collection, you can try Absolute Colors 1.2, Curves 3, Edges Fx, Grain Natural 2.
This site contains some good freeware (at the bottom of the page): https://www.redfieldplugins.com/Downloads.htm
I would recommend trying 32-bit plugins first, as I did not covered some newest 64-bit plugin formats involving BigDocument structure (prepared but not yet implemented), although most 64-bit filters work OK:
NOTE: Before trying plugins, please download newest DLLs from GitHub as I've corrected some nasty bugs (writing beyond image buffer): https://github.com/spetric/Photoshop-Plugin-Host/tree/master/Additional
Also, I'll pack some working collection and upload the zip file.
I've also tried about, progress and enumerate APIs and they work correctly. On the upper image you can see how filters from given directory are enumerated: categories in one TListBox and filter names in another TListBox. When category is clicked, filters belonging to current category are put in TListBox.
With best regards, Siniša
|
|
|
xequte
38682 Posts |
Posted - Aug 13 2020 : 02:41:50
|
Hi Sinisa
Yes, now it is working well.
I have corrected pspiGlobals.pas and pspiHost.pas. Please update git with these new versions.
The updated demo now enumerates the the \PlugIns\ sub-folder, and also shows progress. You can just double-click a filter to test it.
www.imageen.com/temp/PspiDemo2.zip
Nigel Xequte Software www.imageen.com
|
|
|
spetric
Croatia
308 Posts |
Posted - Aug 13 2020 : 04:47:24
|
Hi Nigel,
Thanks for your time. Glad to see that it works.
I'll put new pas files to GitHub and also correct pspiSetMask API. Nothing special, just added default arg values to 0, so when pspiSetMask is called without arguments, mask will be cleared. Of course, not mask created in application, just shared scanline pointers inside pspiHost.
As version 0.8 had a bug with setting mask (corrupting internal image scanlines, my fault...one wrong line of code), I'll also update source code and binaries on Github.
So far I've tested masking using Selection mask. Works with SelectionFeather and also color picker call-back works (for plug-ins that have color picking feature). Only thing left is testing ROI (selection rectangle) in combination with mask. I'll also add complete NiGulp application source code (NiGulp - opposite of PlugIn) to GitHub when I finish it, so if anyone wants to create wrapper class (C++/Delphi) for TImageEn can do it with minimal efforts.
With best regards, Siniša
|
|
|
xequte
38682 Posts |
Posted - Oct 11 2020 : 23:52:00
|
Hi Sinisa
If you are happy with the current state, I will add a link to our download page.
Nigel Xequte Software www.imageen.com
|
|
|
Dimon_II
Ukraine
1 Posts |
Posted - Jan 07 2021 : 19:11:30
|
Hi I'm trying to use demo (5.0 and 6.3) version of Sattva Descreen.8bf plugin. Filter works in Photoshop, Irfanview only works fine with version 5, but NiGulp display only "Error executing filter, rc = 5". What does this mean and can it be fixed?
|
|
|
spetric
Croatia
308 Posts |
Posted - Jan 09 2021 : 14:16:50
|
Hi,
RC=5 means that filter is canceled. This return code usually means that user has interrupted filter execution.
It also may occur in the first stage of execution (filterSelectorParameters). It rarely occurs, but it seams that in this case filterSelectorParameters has failed.
This may occur for several reasons, probably because filter requires something that pspiHost.dll currently does not support (big document data, padding, etc..). |
|
|
klausdoege
Germany
389 Posts |
Posted - Feb 03 2021 : 04:16:35
|
Hi Spetric, i use nigel's pspihost Demo, but the 64bitt dll work not realy ? 32bit program With 32bit dll 64bit program with 64bit dll Can you Help ?
Klaus www.klausdoege.de |
|
|
yogiyang
India
727 Posts |
Posted - Feb 04 2021 : 06:15:15
|
Probably you are using 32bit plugins in 64bit version. This will not work.
If your app is 64bit then you will have to use 64bit plugins only.
Yogi Yang |
|
|
|
Topic |
|