Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Unix / Re: A fairly simple sound solution? [SOLVED]
« Last post by marcov on Today at 09:07:11 pm »
Blender, Da Vinci and Lightworks are cross platform and miles ahead.

But being crossplatform is not the same as being used for the bulk of videoediting. More conclusive evidence please!
2
Graphics / Demo Scene Picture sinwave
« Last post by Gigatron on Today at 09:00:25 pm »
Hi,
Let's continue with the Bitmap.PutImagePart from BGRA component, usefull now to make
flag wave or ... under 70 lines of code running for me at 60 fps, so play with....

Picture from   by TorinoGT;

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGRAVirtualScreen,BGRABitmap, BGRABitmapTypes;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     BGRAVirtualScreen1: TBGRAVirtualScreen;
  17.     Timer1: TTimer;
  18.     procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure Timer1Timer(Sender: TObject);
  21.   private
  22.  
  23.   public
  24.  
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.   Plasma: TBGRABitmap;
  30.   acc : integer;
  31.  
  32. implementation
  33.  
  34. {$R *.lfm}
  35.  
  36. { TForm1 }
  37.  
  38. procedure TForm1.FormCreate(Sender: TObject);
  39. begin
  40.     Plasma := TBGRABitmap.Create('warrior1.png');
  41.     acc := 0;
  42.  
  43. end;
  44. // wobble or sinwave !!
  45. procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  46. var
  47.   i : integer;
  48.   w : integer;
  49. begin
  50.      i:=0;
  51.      w:=0;
  52.  
  53.      Bitmap.Fill(BGRAPixelTransparent);
  54.      acc := acc +1;
  55.  
  56.      for i:=0 to 120 do
  57.      begin
  58.      w := round(50 + (10 * sin((i+acc) * 8 * PI / 180)));
  59.      Bitmap.PutImagePart(0, i*5-4 , Plasma,  Rect(w,  i*5-4,  600*w ,i*10+4), dmDrawWithTransparency);
  60.      end;
  61. end;
  62.  
  63. procedure TForm1.Timer1Timer(Sender: TObject);
  64. begin
  65.  
  66.        BGRAVirtualScreen1.RedrawBitmap;
  67. end;
  68.  
  69. end.
  70.  
3
Suggestions / Re: add new targets to make
« Last post by marcov on Today at 08:38:42 pm »
Glad to see you are making progress!
4
Unix / Re: A fairly simple sound solution? [SOLVED]
« Last post by Thaddy on Today at 08:37:08 pm »
Blender, Da Vinci and Lightworks are cross platform and miles ahead.
Blender is even open source. And it laughs at Windows only solutions.
(and yes you can edit video with blender, before you squick)
5
General / Re: how to tweek fpmake to compile RTL?
« Last post by marcov on Today at 08:29:16 pm »
Expanding fpmake to the RTL has been held off for practical reasons (RTL makefiles are more diverse) and fundamental reasons (fpmake, like any FPC program depends on RTL).

6
Unix / Re: A fairly simple sound solution? [SOLVED]
« Last post by VisualLab on Today at 07:46:18 pm »
@Videolab
your statements are simply not true. Most professional video editing is done under unix OS's.

To confirm this, some public and trustworthy reports would be needed. Probably no one keeps such lists (because it won't be of any use to anyone anyway). I agree that Unix computers are used to perform video (and 3D) rendering (and I didn't deny it). However, it works in batch mode (which is obvious because it is a time-consuming process). And this applies mainly to rendering, rather than editing (apart from "raisins" such as DaVinci Resolve Blackmagic Design, which I mentioned earlier).

More in general, we lack a simple sound interface like python has and that is perfectly capable for educational purposes, including synthesizers. It is just that nobody bothers to write that in FPC. But that can be done. Just like the Raspberry Pi community has proven for python, we can do that in FPC. It has simply not been done yet.
But if playng a simple wav is enough? There are better examples on this forum.

Yes. Agreement.

My entry, however, concerned problems (chaos) with multimedia support in Linux. Because no matter what, the emphasis in Linux development is mainly on the network and servers. And multimedia is more the domain of workstations and desktops. In this respect, Linux is a mess and makeshift solutions (DE fragmentation, lack of agreed solutions at the system level). And the root cause is the disagreement between programmers of different DEs, their stubborn stubbornness towards the adopted solutions, ill-considered decisions, reluctance and laziness to develop and maintain stable APIs, etc. (i.e.: the human factor failed, as usual). This translates into quite real problems for end users, including people who are just starting to learn programming. And the fact that Lazarus does not support multimedia (classes, APIs, etc.) well in Linux is largely a secondary problem (because it is platform dependent).
7
General / Re: how to tweek fpmake to compile RTL?
« Last post by Key-Real on Today at 07:45:37 pm »
@paule32:
Hello my Friend :)
no 4k but Play Station 1 Demo.
atm. I'm porting the compiler....
8
General / Re: how to tweek fpmake to compile RTL?
« Last post by paule32 on Today at 07:10:34 pm »
Hello key-real, my friend - long not seeing ...
How are you ?
You already on the 4K Intro Road ?

If so, take a look to my github.com project:
https://github.com/paule32/Qt_FPC

It is optimized for the Microsoft Windows 11 Command Console.
9
Other / Re: Quirky windows
« Last post by ASerge on Today at 07:07:16 pm »
10
General / Re: Parameter passing oddities
« Last post by ASerge on Today at 06:59:05 pm »
break the "const" contract; C1 will be changed although declared as const. It works, the compiler does not care, but it gives me doubts. This is not clean.
The "const" contract is valid only within the procedure.
Quote
Well, then let's pass by value instead...
WTF, this is FACTOR 50 slower! Impressive, REP MOVSL hitting hard. Forget it!
...
we could check for identical addresses in the argument...Nice, and less than 10% overhead for checking the assertion...the assertion fails...But I need such calls.
...
What shall I do ? I went back to the original version, ignoring that the const parameters may in fact change, and hoping that the compiler will not stumble across it one day.
Check without assertion:
Code: Pascal  [Select][+][-]
  1. {$APPTYPE CONSOLE}
  2. {$MODE OBJFPC}
  3.  
  4. type
  5.   TComplex = record
  6.     Im, Re: ValReal;
  7.   end;
  8.  
  9. procedure AddNotSafe(constref A, B: TComplex; out C: TComplex);
  10. begin
  11.   begin // Just for an example, in this case, the extra code
  12.     C.Im := 0; // Sloppy code that does not consider the possibility of parameter identity
  13.     C.Re := 0;
  14.   end;
  15.   C.Im := A.Im + B.Im;
  16.   C.Re := A.Re + B.Re;
  17. end;
  18.  
  19. procedure AddSlow(A, B: TComplex; out C: TComplex);
  20. begin
  21.   begin // Just for an example, in this case, the extra code
  22.     C.Im := 0; // In this case safe, becase full copy, but slow
  23.     C.Re := 0;
  24.   end;
  25.   C.Im := A.Im + B.Im;
  26.   C.Re := A.Re + B.Re;
  27. end;
  28.  
  29. procedure AddSafe(constref A, B: TComplex; out C: TComplex);
  30. begin
  31.   begin // Just for an example, in this case, the extra code
  32.     if (@A <> @C) and (@B <> @C) then // Smart code
  33.     begin
  34.       C.Im := 0;
  35.       C.Re := 0;
  36.     end;
  37.   end;
  38.   C.Im := A.Im + B.Im;
  39.   C.Re := A.Re + B.Re;
  40. end;
  41.  
  42. procedure Print(const C: TComplex);
  43. begin
  44.   Writeln('Im: ', C.Im:0:2, ', Re: ', C.Re:0:2);
  45. end;
  46.  
  47. procedure Test;
  48. var
  49.   A: TComplex = (Im:2; Re:2);
  50.   B: TComplex = (Im:1; Re:1);
  51.   C: TComplex;
  52. begin
  53.   Writeln('AddNotSafe:');
  54.   C := A;
  55.   AddNotSafe(C, B, C);
  56.   Print(C);
  57.   Writeln('AddSlow:');
  58.   C := A;
  59.   AddSlow(C, B, C);
  60.   Print(C);
  61.   Writeln('AddSafe:');
  62.   C := A;
  63.   AddSafe(C, B, C);
  64.   Print(C);
  65. end;
  66.  
  67. begin
  68.   Test;
  69.   Readln;
  70. end.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018