Recent

Author Topic: LazPaint (alpha-blending, antialiasing, filters)  (Read 527000 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #150 on: March 12, 2011, 05:52:49 pm »
Ok, I found it. My component package did not have "LCL" package in require section. Now everything works :) . I publish this components soon.

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #151 on: March 12, 2011, 08:31:11 pm »
Cool. If I understand, it's a replacement for TImageList. But does it change the rendering of toolbars ?
Conscience is the debugger of the mind

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #152 on: March 13, 2011, 03:59:16 pm »
Exactly. Teeview too.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #153 on: March 13, 2011, 04:21:02 pm »
Ok. I created patch in bugtracker. I publish component when patch will be accepted. Sneak peak in attachments (before / after)

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #154 on: March 13, 2011, 08:42:50 pm »
Nice  :)
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #155 on: March 21, 2011, 05:45:33 pm »
Hello people, here is a new version (2.6) of LazPaint :
- fast blur and other blurs optimization
- water and perlin noise in filter menu

It is available as a zip file and on subversion.
https://sourceforge.net/projects/lazpaint/files/lazpaint/

I'm thinking about adding phong shading as a tool in LazPaint.
Conscience is the debugger of the mind

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #156 on: March 21, 2011, 06:33:37 pm »
I'm wondering, maybe you can create BGRABitmap classes as external lazarus package? I must always include BGRABitmap files into my BGRAImageList component. If I don't include then user must select path to lazapaint folder in BGRAImageList package options.
If BGRABitmap will be as lazarus package then I could add it as requied package in my package and don't need copy sources. It will make BGRABitmap more accessible for other components.

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #157 on: March 21, 2011, 07:17:27 pm »
Ok, I only need to create a lpk file ?
Conscience is the debugger of the mind

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #158 on: March 21, 2011, 07:55:08 pm »
I guess so. I crated my like in this article:
http://wiki.lazarus.freepascal.org/How_To_Write_Lazarus_Component

Chronos

  • Full Member
  • ***
  • Posts: 214
    • PascalClassLibrary
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #159 on: March 21, 2011, 08:07:24 pm »
Definitely it should be distributed as lazarus package. If someone want to include files itself in it's project it can.

This graphics library is impressive as I was digging deeper to it's internals I found many interesting algorithms.  

But recently I was trying to squeeze bitmap on screen rendering to the max and Drawing to visual component Canvas is fastest method. I would rather see direct copy internal data to target bitmap rawimage. As FBitmap with RawImage is already contained in TBGRADefaultBitmap it could be redirected directly to TImage.Picture.Bitmap and keep internal bitmap data associated with external component. It would be better to eliminate unnecessary copy operations.

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #160 on: March 21, 2011, 08:27:52 pm »
Definitely it should be distributed as lazarus package. If someone want to include files itself in it's project it can.
Ok. I found how to make a runtime package, so it can be used without compiling Lazarus. But, is it necessary to make a design package in order to use it on components ?

Quote
But recently I was trying to squeeze bitmap on screen rendering to the max and Drawing to visual component Canvas is fastest method.
I don't understand.

Quote
I would rather see direct copy internal data to target bitmap rawimage.
What code do you suggest ? Which methods would be changed ?
Conscience is the debugger of the mind

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #161 on: March 21, 2011, 10:13:57 pm »
Ok. I found how to make a runtime package, so it can be used without compiling Lazarus. But, is it necessary to make a design package in order to use it on components ?
I have no such knowledge about lazarus packages but there is a lot of packages which have no components on components palette (e.g. dcpcrypt, manualdock) so I think this is acceptable practice to create package without components.

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #162 on: March 22, 2011, 01:36:23 am »
Yes, and it works. It's on subversion. But I wonder if I should check "Design and runtime package".

Now, only "Runtime package" is checked so it cannot be compiled into Lazarus. It is faster thus to update. But I do not know what happens if you want to use it with a component.
Conscience is the debugger of the mind

Chronos

  • Full Member
  • ***
  • Posts: 214
    • PascalClassLibrary
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #163 on: March 22, 2011, 07:13:14 am »
I referred to wiki page http://wiki.freepascal.org/Fast_direct_pixel_access#TBitmap.RawImage where TImage can be used on form instead of Form canvas or PaintBox canvas which needs to be repainted by OnPaint event. It would be even faster you would store bitmap data in same format in your internal data and in on screen image bitmap data. Then simple Move would be used instead of slow for cycle. But in this case you can directly map TImage bitmap rawimage data as your internal data and then your class would work like wrapper. But rawimage data is platform dependent so it needs to be tested and properly handled.

Question is for what purpose you have FBitmap and LoadFromBitmapIfNeeded if it is not possible to use own bitmap in place (no setter for Bitmap property). You have already FData, FWidth, FHeight and BGRA pixel format.

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #164 on: March 22, 2011, 01:06:39 pm »
The base data structure is BGRA data. When you access to the Bitmap property, it is converted to a TBitmap for convenience. You can make changes to the Bitmap canvas, but then it must be updated to the BGRA data.

There are two possibilites :
- either a DIB section is possible which means that a TBitmap can be mapped directly to the BGRA data.
- or it's not possible or not implemented, then there is a copy between BGRA data and Bitmap handle. In this case, LoadFromBitmapIfNeeded loads the data from the Bitmap handle. And InvalidateBitmap signals that the TBitmap object must be built again, that the Bitmap handle is no longer updated.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018