Recent

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

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #180 on: April 05, 2016, 10:46:07 am »
Oh a new version!
Thanks dear Circular.

circular

  • Hero Member
  • *****
  • Posts: 3104
    • Personal webpage
Re: New version of BGRABitmap
« Reply #181 on: April 05, 2016, 08:05:42 pm »
You're welcome. I would say that one thing that is next on my list is antialiased drawing and pen width with OpenGL.
Conscience is the debugger of the mind

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #182 on: April 05, 2016, 09:41:48 pm »
You're welcome. I would say that one thing that is next on my list is antialiased drawing and pen width with OpenGL.
Another happy news for me.
You made this day a good day for me Circular  ;)

circular

  • Hero Member
  • *****
  • Posts: 3104
    • Personal webpage
Re: New version of BGRABitmap
« Reply #183 on: April 06, 2016, 10:56:14 pm »
New version 8.8.4!

Added to BGRABitmap+ZenGL
  • BGLCanvas
  • Using FreeType fonts simply with BGLFont(...). Note that you need to add the font directory, for example using TBGLBitmap.AddFreeTypeFontFolder
  • other updates

Added to OpenGL more generally
  • BlendMode property for textures and for BGLCanvas: obmAdd will add the color like a lighting, obmMultiply will multiply the color like a mask, or like ambiant lightness
  • added examples in folder test4lcl_opengl (thanks to aradeonas)
  • added rotation to BGLCanvas
« Last Edit: April 06, 2016, 10:59:59 pm by circular »
Conscience is the debugger of the mind

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #184 on: April 09, 2016, 11:29:28 am »
Hi,

I have a problem with new OpenGL package settings.
I have a package that used BGRABitmap and its OpenGL package so I just add OpenGL package in dependencies and everything was fine but now I got this problem that my package doesn't know what package it should use and have problem on finding BGRABitmapTypes units.
I cant make  two version of my package with and without OpenGL so what should I do?

circular

  • Hero Member
  • *****
  • Posts: 3104
    • Personal webpage
Re: New version of BGRABitmap
« Reply #185 on: April 09, 2016, 11:53:04 am »
Hmm is it possible for your package to use only bgrabitmappack4lcl_opengl? This package provides TBGRABitmap as well as TBGLBitmap.
Conscience is the debugger of the mind

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #186 on: April 09, 2016, 12:48:44 pm »
No really, I need both bgrabitmappack4lcl_opengl and bgracontrols package :|
I need both BGLVirtualScreen and BGRAVirtualScreen so I can switch in one app between them. I tried many ways but no success.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #187 on: April 09, 2016, 02:11:26 pm »
Another question.
How should I use TBGRABitmap image with BGL?
Take a look at this :
Quote
    b:=TBGRABitmap.Create;
    b.TakeScreenshotOfPrimaryMonitor;
    Tex:=BGLTexture(b);   
I write this in opengltest1 and colors will be reversed but if you load it TBGLBitmap it will be OK.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #188 on: April 09, 2016, 02:45:25 pm »
You're welcome. I would say that one thing that is next on my list is antialiased drawing and pen width with OpenGL.
Antialiased drawing including images drawings? Like when you use StretchPutImage?

circular

  • Hero Member
  • *****
  • Posts: 3104
    • Personal webpage
Re: New version of BGRABitmap
« Reply #189 on: April 09, 2016, 03:38:03 pm »
Antialiased drawing including images drawings? Like when you use StretchPutImage?
Well this antialiasing is already done by OpenGL, isn't it?

No really, I need both bgrabitmappack4lcl_opengl and bgracontrols package :|
I need both BGLVirtualScreen and BGRAVirtualScreen so I can switch in one app between them. I tried many ways but no success.
I suggest to try to go in BGRAControls and change its dependency to bgrabitmappack4lcl_opengl

I write this in opengltest1 and colors will be reversed but if you load it TBGLBitmap it will be OK.
Oh that's a bug. I fixed it on SVN for you.
Conscience is the debugger of the mind

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #190 on: April 09, 2016, 03:56:22 pm »
Quote
Well this antialiasing is already done by OpenGL, isn't it?
I dont know for sure but I know it is not smooth for sure, I just resize an image with BGRABitmap with high quality and another time with OpenGL and OpenGL version is not as smooth as BGRABitmap one.
Quote
I suggest to try to go in BGRAControls and change its dependency to bgrabitmappack4lcl_opengl
Just worked, Thanks.
Quote
Oh that's a bug. I fixed it on SVN for you.
Works as it should. Thanks.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #191 on: April 09, 2016, 03:57:20 pm »
I want to try BGRABitmap with OS X, what problem we have with it and what can I test for help?

circular

  • Hero Member
  • *****
  • Posts: 3104
    • Personal webpage
Re: New version of BGRABitmap
« Reply #192 on: April 09, 2016, 05:40:55 pm »
Quote
Well this antialiasing is already done by OpenGL, isn't it?
I dont know for sure but I know it is not smooth for sure, I just resize an image with BGRABitmap with high quality and another time with OpenGL and OpenGL version is not as smooth as BGRABitmap one.
Oh I see what you're saying. For now basically you would need to call Resample to create a reduced image, and then display it, and then free it.

Quote
Quote
I suggest to try to go in BGRAControls and change its dependency to bgrabitmappack4lcl_opengl
Just worked, Thanks.
Cool  :)

Quote
I want to try BGRABitmap with OS X, what problem we have with it and what can I test for help?
That would be great. The problem is with LCL font rendering. So using the normal package, if you use TBGRABitmap.TextOut, it does not work.  :'(
Conscience is the debugger of the mind

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: New version of BGRABitmap
« Reply #193 on: April 09, 2016, 05:45:12 pm »
Quote
Oh I see what you're saying. For now basically you would need to call Resample to create a reduced image, and then display it, and then free it.
But it is slow and yes there is tricks for better result but it will be very good to have it in BGL.
Quote
That would be great. The problem is with LCL font rendering. So using the normal package, if you use TBGRABitmap.TextOut, it does not work.
Just font? I remember you talked about low speed with Lainz before.
OK I will check it.

circular

  • Hero Member
  • *****
  • Posts: 3104
    • Personal webpage
Re: New version of BGRABitmap
« Reply #194 on: April 09, 2016, 06:43:16 pm »
Quote
Oh I see what you're saying. For now basically you would need to call Resample to create a reduced image, and then display it, and then free it.
But it is slow and yes there is tricks for better result but it will be very good to have it in BGL.
Yes that's slow. The thing is that as far as I know OpenGL does not provide high quality resampling, apart from trilinear filtering, but in this case, you need to prepare the texture with different sizes.

Quote
Quote
That would be great. The problem is with LCL font rendering. So using the normal package, if you use TBGRABitmap.TextOut, it does not work.
Just font? I remember you talked about low speed with Lainz before.
OK I will check it.
Well basically it is the Canvas property that does not work. But this can be avoided most of the time, except when drawing text, because the default renderer depends on LCL rendering that is done on the Canvas. I am sometimes thinking about removing the Canvas property from TBGRABitmap, so that people would not be tempted to use it!

It is a bit slow indeed because the text is first drawn on a TBitmap.Canvas and then copied on the TBGRABitmap. And with fine resampling, this is much slower because a huge TBitmap is created to render with quality and is scaled down afterwards on a TBGRABitmap.

It would be faster to retrieve the shapes as Bezier curves instead. I know there a functions for that on Windows but that would not be cross-platform.
« Last Edit: April 09, 2016, 06:45:00 pm by circular »
Conscience is the debugger of the mind