Recent

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

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: New version of BGRABitmap
« Reply #75 on: April 28, 2015, 05:13:54 pm »
So it would be possible to customize the appearance of controls with fpGUI? Or do you think about compiling the current BGRAControls with fpGUI?
Once done, fpGUI's TfpgCanvas class will use AggPas or BGRAControls to render everything. This is already possible with AggPas, but it needs some more improvements. I also plan to extend the TfpgCanvas class's interface so it is easier to take advantage of the features AggPas and BRGABitmap provides.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

lainz

  • Hero Member
  • *****
  • Posts: 3692
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #76 on: April 28, 2015, 05:49:27 pm »
Quote
Maybe replace all TBGRAColor with longword => example =>
Code: [Select]
function rgb(red, green, blue: byte): longword; {$IFDEF WINDOWS}stdcall;{$ELSE}cdecl;{$ENDIF}
  begin
    Result := BGRAPascalScript.rgb(red, green, blue);
  end;       
   
     

I know that TBGRAColor is an alias, there is a problem on using it? Or is just for readability?                 

Quote
And replace all String with PChar => example =>
Code: [Select]
procedure bgra_SaveToFile(id: integer; filename: PChar); {$IFDEF WINDOWS}stdcall;{$ELSE}cdecl;{$ENDIF}
  begin
    BGRAPascalScript.bgra_SaveToFile(id, filename);
  end;

I know, the same is for C#. The thing is I will change it with PWideChar, it works too in Java?

Quote
"_" character in exports-name is interpreted as sub-class in some language (Java,..).
Also, to avoid mangle-name   =>
Code: [Select]
exports
  bgra_GetHighestID name 'bgragethighestid',
   ...   

Ok. I will add the name alias as you suggested.

Also I have a question about using enum that in lazarus is something like:
Code: [Select]
TMedianOption = (moNone, moLowSmooth, moMediumSmooth, moHighSmooth);
in c# is like:
Code: [Select]
enum TMedianOption : byte {moNone, moLowSmooth, moMediumSmooth, moHighSmooth};
I supose that lazarus is using the byte enumeration. (I've readed it somewhere?) So they are basically alias to numbers.
moNone is 0 in both languages.

Another thing is if using struct is the same, like records.. TRect...
I've not tested, but I think it is not the same
« Last Edit: April 29, 2015, 12:23:20 am by 007 »

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #77 on: April 28, 2015, 11:06:47 pm »
Quote
The thing is I will change it with PWideChar, it works too in Java?
For a Java native library it is a other story... =>

Code: [Select]
Library javaBGRABitmap;
uses
   Jni,
   BGRABitmap
  ,BGRABitmapTypes;

procedure bgra_SaveToFile(PEnv: PJNIEnv; Obj: JObject; id: integer; filename: JString); {$IFDEF WINDOWS}stdcall;{$ELSE}cdecl;{$ENDIF}
  begin
    BGRAPascalScript.bgra_SaveToFile(id, (PEnv^^).GetStringUTFChars(PEnv, filename, nil));

     (PEnv^^).ReleaseStringUTFChars(PEnv, filename, nil);   /// to free memory
  end;
...

exports
bgra_GetHighestID name 'Java_bgra_gethighestid',
...
begin
end.

Quote
So, you will create another library, or want access to keep improving this?
No, no, you did it perfectly, i do not want to create a new one,  i only proposed my help ( i did not knew that you have already done it ).  :-[

Fre;D

« Last Edit: April 28, 2015, 11:15:31 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 3692
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #78 on: April 28, 2015, 11:59:02 pm »
Ok. Well you have sourceforge account? I can give you svn access if you want to help keep improving this.
« Last Edit: April 29, 2015, 12:23:42 am by 007 »

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #79 on: April 29, 2015, 01:30:47 am »
Quote
Well you have sourceforge account?

Yes => fredvs

PS: You may avoid mangle-name problems for all exported methods => those too =>
Code: [Select]
exports
  ...,
  rgb name 'rgb',  // why not => rgb name 'bgrargb' ?
  rgba name 'rgba',
  getBlue name 'getblue',
  getGreen name 'getgreen',
  getRed name 'getred',
  getAlpha name 'getalpha',
  setBlue name 'setblue',
  setGreen name 'setgreen',
  setRed name 'setred',
  setAlpha name 'setalpha',
...
 

Fre;D
« Last Edit: April 29, 2015, 02:05:21 am by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 3692
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #80 on: April 29, 2015, 02:13:31 am »
Quote
Well you have sourceforge account?

Yes => fredvs

PS: You may avoid mangle-name problems for all exported methods => those too =>
Code: [Select]
exports
  ...,
  rgb name 'rgb',  // why not => rgb name 'bgrargb' ?
  rgba name 'rgba',
  getBlue name 'getblue',
  getGreen name 'getgreen',
  getRed name 'getred',
  getAlpha name 'getalpha',
  setBlue name 'setblue',
  setGreen name 'setgreen',
  setRed name 'setred',
  setAlpha name 'setalpha',
...
 

Fre;D

Added. Add all the stuff you need to work in java and new functions. You have complete access so you can upload files releasing the .dll .so and headers when you want.
« Last Edit: April 29, 2015, 02:45:15 am by 007 »

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #81 on: April 29, 2015, 02:59:10 am »
Quote
Added. Add all the stuff you need to work in java and new functions. You have complete access so you can upload files releasing the .dll .so and headers when you want.

 :) OK, thanks.

PS : I do not see problems to modify it to have a Java native library.
PS2: But i do not really see how to use BGRABitmap library in Java (with what Java-widgetset or Java-canvas ?).

Fre;D
« Last Edit: April 29, 2015, 03:01:47 am by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #82 on: April 29, 2015, 03:16:29 am »
Quote
uses
  Interfaces,

Huh, you use Interfaces...

Im not sure it will work with Interfaces  :-X

I will try (but every time i have try to use Interfaces in library... i loosed).

Fre;D
« Last Edit: April 29, 2015, 03:20:38 am by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 3692
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #83 on: April 29, 2015, 03:19:03 am »
I dont know.. also i have the same problem with c# (no idea of c# graphics at all, i know that xamarin studio uses gtk and visual studio the windows native stuff)..

ok... i have no idea right now im not in the code pc but try removing it and see what happens.

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #84 on: April 29, 2015, 03:25:41 am »
Quote
I dont know.. also i have the same problem with c# (no idea of c# graphics at all, i know that xamarin studio uses gtk and visual studio the windows native stuff)..

ok... i have no idea right now im not in the code pc but try removing it and see what happens.

I have to jump into your code and study BGRABitmap.
And then see how to use BGRABitmap with Java.
=> on TODO list => ASAP.

Fre;D


I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 3692
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #85 on: April 29, 2015, 03:31:11 am »
Ok. I also dont know fully bgrabitmap, im just another contributor  :)

I will try to finish adding the filters so at least we have a dll to apply filters to bitmaps.

If you can just make it works as is now with java will be ok too.

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #86 on: April 29, 2015, 03:41:33 am »
Quote
If you can just make it works as is now with java will be ok too.

Ok, i will try (but i would prefer without Interfaces  :-X )
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 3692
  • Leandro Diaz
Re: New version of BGRABitmap
« Reply #87 on: April 29, 2015, 03:48:50 am »
removed interfaces and working.

if you need add "ifdef java" or something like that if needed or just make a copy of the library in a new folder. also if you can include the header you make.
« Last Edit: April 29, 2015, 03:52:35 am by 007 »

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #88 on: April 29, 2015, 03:52:35 am »
Quote
removed interfaces and working.

Ha, ok, perfect  ;D

I will try it tomorrow  ;)

Fre;D
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: New version of BGRABitmap
« Reply #89 on: April 29, 2015, 01:15:57 pm »
@ 007 =>

Trying to compile your bgra_pascalscript_library.lpr with Linux 64 bit =>
Quote
.../bgrabitmap/bgragtkbitmap.pas(191,24) Error: Identifier not found "TBGRAPtrBitmap"
=>

Added in uses section of BGRAGtkBitmap => bgradefaultbitmap => now it compiles but at linking =>
Quote
/usr/bin/ld: ../bgrabitmap/lib/x86_64-linux/2.6.4/bgrabitmaptypes.o: relocation R_X86_64_32S against `TC_BGRABITMAPTYPES_RESAMPLEFILTERSTR' can not be used when making a shared object; recompile with -fPIC

=> Have try to compile with -fPIC parameter but same error.   %)

=> Aaargh,  bgra_pascalscript_library.lpr needs LCL => I knew it will be problems for library  :-X



So i left (temporally) Linux and have try to compile on Windows (via wine) => ok, it works.  ;D

PS: Windows is not my workshop OS, i would highly prefer to first develop bgrabitmap java library in Linux then cross-compil (or compil via wine) to Windows .

So to test the Java library I must install Windows on Virtual Box (and all the fpc + Java stuffs) and work on bgrabitmap java library this way (but it is not my funniest way to develop)  :( .

PS2:  Have you try to compile your bgra_pascalscript_library.lpr in Linux 64 ? If yes, how did you do it ?

Thanks.

Fre;D
« Last Edit: April 29, 2015, 01:22:23 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

 

TinyPortal © 2005-2018