Jump to content


Photo

Converting AHK imagesearch code to C++ for AHK_L use


  • Please log in to reply
5 replies to this topic

#1 Rseding91

Rseding91
  • Members
  • 664 posts

Posted 03 August 2012 - 11:28 PM

I'm looking for someone who would be willing to convert some AHK/C code I have written for use in AHK_L's source.

I was recently working on Tics Gdip_ImageSearch function trying to make it faster (because I love doing that kind of thing) and I found that the built in AHK imagesearch code is super slow at imagesearch with variation. I found faster methods and wrote them in AHK and C compiled to work through the MCode function inside AHK.

The code I wrote based on Tics code is volumes faster at imagesearch with variation compared to the built in AHK one (100 MS vs 40 seconds) and I was wondering if anyone decent at C++ would be interested in converting the C/AHK code I have into C++ for use in AHK_L.

The majority of the Gdip_Imagesearch code I wrote is already very basic C so it shouldn't be hard to convert into C++.

The code can be found here: http://www.autohotke...pic.php?t=76261

Just follow the first post I made onward for a description of the changes I made - the last post I made contains the most recent version and optimizations I made to the code.


I tried doing the conversion myself but I'm no good at C++ and it would take me more time then I have. If someone is willing to do the conversion I can work with them to explain what the code does and so on. That person can also take the main credit for the code if they wanted to. All I ask for is something like "Based off Tics/Rseding91's Gdip_Imagesearch code". Please don't take this as "i'm to lazy so you do the work" - i'll try this myself eventually but i'm just to busy with work and school at the moment.


Thanks,
Robert

#2 sumon

sumon
  • Moderators
  • 1307 posts

Posted 19 August 2012 - 08:02 PM

Sounds cool, but I'm afraid I don't know any C++.

#3 IsNull

IsNull
  • Fellows
  • 990 posts

Posted 21 August 2012 - 01:27 PM

C is actually compatible with C++ in almost all cases. See here for exceptions.

Looking at the current source, a refactoring would be nice anyway. Spliting up the whole pixel/image search into multiple methods, this would it make more easy to support more than one algorithm.

#4 Rseding91

Rseding91
  • Members
  • 664 posts

Posted 21 August 2012 - 08:52 PM

I've actually been working on this for the past few days and I have working AHK_L source code. So far everything i've tested works on the _L Unicode x86/x64 builds. I'm not sure how to generate the ANSI builds in visual studio but I have no reason to think the code would fail.

I am working on cleaning up the imagesearch function code (the parts I added and the old code) and then i'll post it here and PM it to Lexikos to see if he finds it acceptable.

#5 fragman

fragman
  • Members
  • 1591 posts

Posted 22 August 2012 - 07:46 AM

It's best to fork the AHK_L repository on GitHub and push your code there for direct integration of the code in the main repository.

#6 Lexikos

Lexikos
  • Administrators
  • 8839 posts

Posted 24 August 2012 - 02:47 AM

I'm not sure how to generate the ANSI builds in visual studio but I have no reason to think the code would fail.

Select one of the (mbcs) build configurations. I added a readme to github recently - it describes the various build configurations.
https://github.com/L...-configurations