Recent

Author Topic: New version of BGRABitmap  (Read 288917 times)

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #240 on: October 11, 2016, 02:58:18 pm »
Thank you thank you  :-[
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #241 on: October 15, 2016, 11:37:32 pm »
Hi circular, I can't compile LazPaint 6.4.1 release BGRABitmap 8.9.2 under Ubuntu 64 bits (the git 'trunk' is working fine, just that release) with Lazarus 1.6 fpc 3.0, something related with open gl stuff, I not take a note of the error and just switched to trunk because of course that old release will not be updated and that was already fixed.

I want to compile that version because an user on GitHub reported that wants a 64 bit version (https://github.com/bgrabitmap/lazpaint/issues/7). Well maybe we can do that for the next release.

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #242 on: October 15, 2016, 11:46:40 pm »
Hmmm... well there are three solutions:
- we find a way to fix this error
- you compile with an older version of BGRABitmap
- you wait for the next release

This next release has been delayed but I guess I will have more free time now.

Note: thanks to the automatic update of windows 10, I could not log on my computer anymore. I had to clear everything.  %)
« Last Edit: October 15, 2016, 11:48:45 pm by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #243 on: October 15, 2016, 11:50:31 pm »
Ok I will wait, I already seen how to create a basic package for linux (not tested but seems easy), I'm impressed how fast can run a virtual machine, I have both Ubuntu 32 and 64. Remembering that older versions of lazarus can't run on ubuntu (older ubuntu too) due to keyboard problems and other stuff, now everything works fine.

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #244 on: October 16, 2016, 12:20:28 am »
About building a Deb package, someone sent me instructions (in French) on how they did the package. I did not really understand so I am not sure how to translate.

There are also some scripts to test that it is the correct cpu (32 or 64bit) that can apparently be embedded in the package.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #245 on: October 16, 2016, 12:39:37 am »
Thankyou I will check it. That I get from internet:

- The deb contains the system structure, then you can copy the files in the desired folders where the files should be installed.
- So you have a folder for the binary, other for the application files, other for the icon, other for the documentation, a file with the description and so on.
- And must be lowercase underscore major and minor like "lazpaint_7.0"
- You can create the deb from command line

But I've not tried by myself, I will try soon. Maybe there is a deb making utility we can use instead of the command line (Ok, the document say what can we use).

Ok I see the two scripts to verify.

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #246 on: October 17, 2016, 10:22:29 pm »
@Circular

I've updated the LazPaint repository with a new folder called 'deb' that contains simple instructions on how to make a lazpaint deb with the command-line with no need of installing third party software, also includes all the stuff (except the binaries of course) needed to include in the deb package.

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #247 on: October 18, 2016, 07:38:21 pm »
Thank you for taking the time to do that.  :)
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #248 on: October 19, 2016, 05:42:17 pm »
New version 9.2.1 with:
- bug fix when using a texture with zero size
- added properties and functions to TBGRAPixel
- TBGRABitmap is now defined via class(...) so that pressing CTRL-SHIFT-C on "bmp" variable will add the correct variable type:
Code: Pascal  [Select][+][-]
  1. procedure test;
  2. begin
  3.   bmp := TBGRABitmap.Create(100,100);
  4. end;

Details of TBGRAPixel:
Code: Pascal  [Select][+][-]
  1.   TBGRAPixel = packed record
  2.   private
  3.     function GetClassIntensity: word;
  4.     function GetClassLightness: word;
  5.     procedure SetClassIntensity(AValue: word);
  6.     procedure SetClassLightness(AValue: word);
  7.   public
  8.     {$IFDEF BGRABITMAP_RGBAPIXEL}
  9.     red, green, blue, alpha: byte;
  10.     {$ELSE}
  11.     blue, green, red, alpha: byte;
  12.     {$ENDIF}
  13.     procedure FromRGB(ARed,AGreen,ABlue: Byte; AAlpha: Byte = 255);
  14.     procedure FromColor(AColor: TColor; AAlpha: Byte = 255);
  15.     procedure FromString(AStr: string);
  16.     procedure FromFPColor(AColor: TFPColor);
  17.     procedure ToRGB(out ARed,AGreen,ABlue,AAlpha: Byte); overload;
  18.     procedure ToRGB(out ARed,AGreen,ABlue: Byte); overload;
  19.     function ToColor: TColor;
  20.     function ToString: string;
  21.     function ToGrayscale(AGammaCorrection: boolean = true): TBGRAPixel;
  22.     function ToFPColor: TFPColor;
  23.     class Operator := (Source: TBGRAPixel): TColor;
  24.     class Operator := (Source: TColor): TBGRAPixel;
  25.     property Intensity: word read GetClassIntensity write SetClassIntensity;
  26.     property Lightness: word read GetClassLightness write SetClassLightness;
  27.   end;  

https://sourceforge.net/projects/lazpaint/files/src/
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #249 on: November 10, 2016, 12:28:48 am »
New version 9.2.2 with minor fixes.
- fixed zero value when using custom gamma factor like 2.2 instead of 1.7
- updated reference to BGRABitmap package in OpenGL tests
- avoid ambiguous names for color conversion functions introduced in version 9.2.1 in TBGRAPixelHelper and TExpandedPixelHelper. It is unlikely but you may need to change your code accordingly if it doesn't compile straight away, use intellisense to find the new function name. If you don't find how to fix, leave a message on this thread.

https://github.com/bgrabitmap/bgrabitmap/releases

Important note: bgrabitmap library is going to be separated tomorrow from lazpaint repository. For now, the repository "bgrabitmap/lazpaint" contains both lazpaint and bgrabitmap. After the split, the repository "bgrabitmap/bgrabitmap" will contain the library and "bgrabitmap/lazpaint" will only contain LazPaint. So if you are working from Git, after pulling latest changes, bgrabitmap will disappear. You will need to checkout the new dedicated repository.
« Last Edit: November 10, 2016, 04:53:25 pm by circular »
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #250 on: November 10, 2016, 10:24:47 am »
New repository created for bgrabitmap:

Git URL: https://github.com/bgrabitmap/bgrabitmap.git
Browse URL: https://github.com/bgrabitmap/bgrabitmap
Zip download URL: https://github.com/bgrabitmap/bgrabitmap/releases

LazPaint repository:

Git URL: https://github.com/bgrabitmap/lazpaint.git
Browse URL: https://github.com/bgrabitmap/lazpaint

BGRABitmap library will soon be deleted from this repository, so if you are using it, checkout the new repository "bgrabitmap/bgrabitmap" and open the package files you are using in Lazarus to update the reference. You may need to recompile Lazarus to update the components based on BGRABitmap.

SourceForge repository

SourceForge repository contains LazPaint but doesn't contain BGRABitmap anymore.
« Last Edit: November 11, 2016, 05:46:16 pm by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #251 on: November 10, 2016, 03:49:39 pm »
Thanks for the updates.

I recommend you that soon remove the sourceforge downloads and code repository, because people if it's there will download it, doesn't matter if outdated.

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: New version of BGRABitmap
« Reply #252 on: November 10, 2016, 05:11:26 pm »
Agreed. I have moved all bgrabitmap zip files into old folder. Now only lazpaint source and binaries remain in view.

Apparently there is a way to remove the SVN repository. But I am not sure how to do that. Instead I could remove all the files locally and commit that.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #253 on: November 10, 2016, 05:15:09 pm »
Apparently there is a way to remove the SVN repository. But I am not sure how to do that. Instead I could remove all the files locally and commit that.

Yes, there's a padlock at the right, click on it to unlock it and there will appear gears for each element in the page, click on code gear and then delete.

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: New version of BGRABitmap
« Reply #254 on: November 10, 2016, 10:51:18 pm »
Hi circular,

Thanks! I just downloaded 9.9.2 from git and am having trouble getting a basic test program compiled. On Windows 7 I get:

Code: Pascal  [Select][+][-]
  1. Compile package FCL 1.0.1: Success
  2. Compile package LazUtils 1.0: Success, Warnings: 2, Hints: 5
  3. lazfileutils.pas(109,23) Hint: Parameter "ExceptionOnError" not used
  4. lazfilecache.pas(75,65) Hint: Parameter "EmptyOnError" not used
  5. paswstring.pas(118,10) Hint: Mixing signed expressions and longwords gives a 64bit result
  6. winfileutil.inc(21,53) Warning: Symbol "UTF8ToSys" is deprecated: "Use the function in LazUTF8 unit"
  7. winfileutil.inc(21,13) Warning: Symbol "SysToUTF8" is deprecated: "Use the function in LazUTF8 unit"
  8. lazutf8sysutils.pas(32,35) Hint: Local variable "SystemTime" does not seem to be initialized
  9. ttfile.pas(374,5) Hint: User defined: workaround for fpc bug 23868 when compiling with -O2
  10. Compile package LCLBase 1.6.0.4: Success
  11. Compile package LCL 1.6.0.4: Success, Warnings: 6
  12. win32proc.pp(716,41) Warning: Symbol "Handle" is deprecated: "use Reference.Handle instead"
  13. win32int.pp(21,26) Warning: User defined: Fix implicit pointer conversions
  14. win32pagecontrol.inc(71,17) Warning: Symbol "IsUnpaged" is deprecated
  15. win32pagecontrol.inc(334,24) Warning: Symbol "IsUnpaged" is deprecated
  16. win32pagecontrol.inc(644,18) Warning: Symbol "IsUnpaged" is deprecated
  17. win32callback.inc(557,58) Warning: Local variable "BytesCount" does not seem to be initialized
  18. Compile Project, OS: win32, CPU: i386, Target: project1.exe: Exit code 1, Errors: 15, Warnings: 1, Hints: 6
  19. basiccolorspace.inc(272,9) Warning: Function result variable does not seem to initialized
  20. blendpixelinline.inc(950,25) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
  21. blendpixelinline.inc(950,67) Hint: Mixing signed expressions and longwords gives a 64bit result
  22. blendpixelinline.inc(950,67) Hint: Converting the operands to "Int64" before doing the subtract could prevent overflow errors.
  23. blendpixelinline.inc(950,92) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
  24. blendpixelinline.inc(952,25) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
  25. blendpixelinline.inc(952,31) Hint: Converting the operands to "Int64" before doing the subtract could prevent overflow errors.
  26. bgradefaultbitmap.pas(254,17) Error: There is no method in an ancestor class to be overridden: "constructor TBGRADefaultBitmap.Create(AnsiString);"
  27. bgradefaultbitmap.pas(259,17) Error: There is no method in an ancestor class to be overridden: "constructor TBGRADefaultBitmap.Create(AnsiString,Boolean);"
  28. bgradefaultbitmap.pas(260,17) Error: There is no method in an ancestor class to be overridden: "constructor TBGRADefaultBitmap.Create(AnsiString,Boolean,TBGRALoadingOptions);"
  29. bgradefaultbitmap.pas(282,14) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.NewBitmap(AnsiString):TBGRACustomBitmap;"
  30. bgradefaultbitmap.pas(287,14) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.NewBitmap(AnsiString,Boolean):TBGRACustomBitmap;"
  31. bgradefaultbitmap.pas(288,14) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.NewBitmap(AnsiString,Boolean,TBGRALoadingOptions):TBGRACustomBitmap;"
  32. bgradefaultbitmap.pas(696,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextOut(Single,Single,AnsiString,TBGRAPixel,TAlignment);"
  33. bgradefaultbitmap.pas(700,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextOut(Single,Single,AnsiString,IBGRAScanner,TAlignment);"
  34. bgradefaultbitmap.pas(703,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextOutAngle(Single,Single,LongInt,AnsiString,TBGRAPixel,TAlignment);"
  35. bgradefaultbitmap.pas(704,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextOutAngle(Single,Single,LongInt,AnsiString,IBGRAScanner,TAlignment);"
  36. bgradefaultbitmap.pas(706,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextOutCurved(TBGRACustomPathCursor,AnsiString,TBGRAPixel,TAlignment,Single);"
  37. bgradefaultbitmap.pas(707,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextOutCurved(TBGRACustomPathCursor,AnsiString,IBGRAScanner,TAlignment,Single);"
  38. bgradefaultbitmap.pas(712,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextRect(RECT,LongInt,LongInt,AnsiString,TTextStyle,TBGRAPixel);"
  39. bgradefaultbitmap.pas(713,15) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextRect(RECT,LongInt,LongInt,AnsiString,TTextStyle,IBGRAScanner);"
  40. bgradefaultbitmap.pas(717,14) Error: There is no method in an ancestor class to be overridden: "TBGRADefaultBitmap.TextSize(AnsiString):<record type>;"
  41.  

It compiles ok on Mac 10.11.6, but I was getting strange colors, that I was trying to figure out.

It is just a basic program with "bgrabitmaptypes, bgrabitmap" in the uses clause. Any thoughts on what is going on?

Cheers,
VTwin
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

 

TinyPortal © 2005-2018