Recent

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

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #45 on: February 12, 2011, 02:10:33 pm »
Here a new version (1.5) :
  • floodfill with tolerance 0 bug fix
  • color choice window
  • red/blue swap on mac
https://sourceforge.net/projects/lazpaint/files/lazpaint/
Conscience is the debugger of the mind

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #46 on: February 12, 2011, 11:41:49 pm »
Quote
I do not understand what could be causing this. There is no modifications about Forms or Menus. I guess it is a problem of directories. The only significative change is that I added custom cursors. If you strip ucursors in the last version, what happens ?
The error comes from cursors.lrs which is used by LCL Forms unit as well (different cursor.lrs, of course). Renaming it to something else should fix it.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #47 on: February 13, 2011, 03:08:54 am »
Ok. I've changed it on subversion. Does it work ?
« Last Edit: February 13, 2011, 04:47:19 am by circular »
Conscience is the debugger of the mind

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 255
    • Fresh sound.
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #48 on: February 13, 2011, 05:20:59 pm »
Yes, it works now. Thank you.
Linux Mint 20.3, Lazarus 2.3, Windows 10, Delphi 10.3 Rio, Delphi 11.1 Alexandria

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #49 on: February 13, 2011, 10:13:17 pm »
Thank you for the confirmation, I am putting this new version on Sourceforge as a zip file.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #50 on: February 13, 2011, 11:50:43 pm »
Hey people !

I've managed to make LazPaint load Paint.NET images. The layers are flattened, because LazPaint cannot edit layered images... yet.

By the way, to do so, I had to write a unit to read binary serialized .Net objects. If someone is interested by this, it's the unit udnetdeserial (Unit DotNet Deserialization).

Image data in Paint.NET files are compressed with gzip, so I used the zstream unit. The file format is a little bit different, so I just skip the 10 bytes of GZip header and use deflate without header (Tdecompressionstream with skipheader option).

As usual, it can be downloaded here (version 1.6) :
https://sourceforge.net/projects/lazpaint/files/lazpaint/

I've added some documentation on Lazarus wiki (in French  8)) :
http://wiki.lazarus.freepascal.org/BGRABitmap/fr
« Last Edit: February 14, 2011, 03:04:03 am by circular »
Conscience is the debugger of the mind

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #51 on: February 14, 2011, 04:16:51 pm »
@circular, sorry for the late response.
I compiled the last svn wuthout problem except umac unit needs to be replaced like this (cos it gives compiler error.)procedure

CheckSpinEdit(SpinEdit: TSpinEdit);
begin
   {$IFDEF DARWIN}
   SpinEdit.Left:=SpinEdit.Left+3;
   SpinEdit.Top:=SpinEdit.Top+3;
//   SpinEdit.Left += 3;
//   SpinEdit.Top += 3;
   {$ENDIF}
end;

Some modifications can be added:
1. Color windows shows the correct color but pen color(Shape_PenColor) does not.
2. Especially for mac, minimizing the main form doesnt minimize the others (color window, tools window)
3. New window renders wrongly which is attached.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #52 on: February 14, 2011, 04:56:22 pm »
Thank you, I will take this into account.

Quote
1. Color windows shows the correct color but pen color(Shape_PenColor) does not.
Can you explain a little more ?
Conscience is the debugger of the mind

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #53 on: February 14, 2011, 06:39:31 pm »

Quote
Can you explain a little more ?
When you select the red color in 'color window', it reflects to Shape_PenColor as blue.
I hope I can figure it out.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #54 on: February 15, 2011, 12:39:55 am »
I wonder if it was not a mistake to swap red and blue for drawing bitmaps. How do the colorcircle look like ? It should be red on the right, blue on the top left and green on the bottom left.

If it is blue on the right, red on the top left and green on the bottom left then it is not correct.

Maybe the encoding of TColor is different because of Low Endiang/Big Endian.
Conscience is the debugger of the mind

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #55 on: February 15, 2011, 11:05:43 am »

Here is the screenshot of the colorcircle in mac,it looks like this.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #56 on: February 15, 2011, 01:20:47 pm »
Ok, that's not correct. red and blue are swapped.

If you delete the swapping in DataDrawOpaque in BGRAGtkBitmap, what happens ? To do change, remove
Code: Pascal  [Select][+][-]
  1. {$IFDEF DARWIN}
  2.      RawImage.Description.Init_BPP32_R8G8B8_BIO_TTB(AWidth,AHeight);
  3.      SwapRedBlue;
  4. {$ELSE}
  5.  
and remove
Code: Pascal  [Select][+][-]
  1.      {$IFDEF DARWIN}
  2.      SwapRedBlue;
  3.      {$ENDIF}    
  4.  
and the remaining {$ENDIF}

Here is the expected screenshot.
Conscience is the debugger of the mind

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #57 on: February 15, 2011, 02:11:30 pm »

Are you sure about the unit?

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #58 on: February 15, 2011, 06:14:27 pm »
What do you mean ?
Conscience is the debugger of the mind

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #59 on: February 15, 2011, 06:36:10 pm »

I havent seen a unit like BGRAGtkBitmap in svn 13.
I have searched all the files and there is just an 2 {$IFDEF DARWIN} statement in the umac.pas

 

TinyPortal © 2005-2018