07-26-2023, 07:00 PM
(07-26-2023, 06:44 PM)RhoSigma Wrote:I was wondering why _COPYIMAGE was not used in favor of _PUTIMAGE when I was reworking the code. I'll make that change then. Thanks for the information.(07-26-2023, 02:25 PM)TerryRitchie Wrote: I modified RhoSigma's ApplyFilter& function from his Image Processing Library (imageprocess.bm) to only perform Gaussian blurs in the laser project I'm working on. Here is the result:
You made a nice compact function out of it @TerryRitchie, you could replace the _NEWIMAGE/_PUTIMAGE combo in the "Copy the source image" section with _COPYIMAGE instead.
The reason to use that combo was at the time of writing my image processing library _COPYIMAGE had a bug in conjunction with _MEMIMAGE. It simply also copied the memory lock esteblished by _MEMIMAGE to the new image. This caused a problem when you _FREEIMAGEed either the original/copied image and after that freeing the other one. Because both images shared the same memory lock, which was freed with the first image, you cause a module error when freing the second one and the memory lock did no longer exist. The _NEWIMAGE/_PUTIMAGE combo was a safe workaround, however _COPYIMAGE has been fixed in QB64 v1.4
By the way, your libraries are a wealth of knowledge. Thank you for sharing them. It wasn't until I needed your image processing library that I started snooping around in the rest of your libraries. Good stuff!