Vampyre Imaging Library Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Imaging 0.26.4 Released!

Author Topic: New fiter  (Read 1149 times)

jcarlos

  • Imaging User
  • *
  • Offline Offline
  • Posts: 7
    • View Profile
New fiter
« on: 22 March 2008, 17:56:39 »

Hi.
I think maybe could be included other filter to the file
ImagingCanvases.pas
I was needed to do it and I include 3 new filter, realy maybe two because the average filter for 3x3 and 5x5 is alredy included.

I send here the code for you. (I only send the segment of code that must to be put inside ImagingCanvases.pas like a methods of the "TImagingCanvas"  class)

You are free to use this code like you want. (The code is in the attach).
The code was tested in Lazarus for windows.

For make a test you can include it in the example named
LCLImager

And use the following code to call this methods.

procedure TMainForm.mnPromedioClick(Sender: TObject);
begin
 if FImage.Format in FImageCanvas.GetSupportedFormats
      then Begin
              FImageCanvas.CreateForImage(FImage);
              FImageCanvas.ApplyAverage(3);
              UpdateView;
            End;

end;
Logged

Galfar

  • Administrator
  • Imaging User
  • *****
  • Offline Offline
  • Posts: 249
    • ICQ Messenger - 327174200
    • View Profile
    • Galfar's Homepage
    • Email
Re: New fiter
« Reply #1 on: 23 March 2008, 01:32:54 »

Thanks for the great contribution Juan!
I'll add Median and Threshold filters to Canvas (I'll see about the Avg).

I've wanted to add more filters (point and non-linear) to Canvas for ages but never had the time (working on other parts of library). If you ever add some more functions to Imaging, please don't hesitate to sen them.
Logged
 

Page created in 0.071 seconds with 18 queries.