A small program written in M2000 produce in a folder a sequence of png files (each image for each frame). Png files are lossless so we get the quality of the original frame.
We can use Kdenlive to process the sequence as a video clip (we have to adjust the time for each image, we can give one video frame per image).
We apply a smart blurr effect to drop some pixels....
This is the code (included in zip file with the Orguss.png)
If not Exist("Orguss.png") then Error "Orguss.png not exit"
module SetFolder (that$) {
dir user
try ok {dir that$}
' if we don't have the folder we make it
if not ok then subdir that$
'we can delete any files or we overwrite them
' we send to two commands to cmd.exe
' with ";" we don't see the window of cmd.exe
' dos statement not work if we set a named user.
' so the named user if the folder exist can:
' 1) leave it and we get overwritten files or choose another name
' 2) change the export folder name.
dos "cd "+dir$+" && del *.bmp";
}
module saveBMP (file$) {
ox=pos.x:oy=pos.y
move 0,0
that$=""
copy scale.x, scale.y to that$
image that$ Export file$+".bmp"
move ox, oy
}
module title.display (caption$, at as long=0, f$="ARIAL BLACK", sz as long=128){
module formlabel1 {
legend letter$, letter$, number, 0, number, 1
'formlabel letter$, letter$, number, number
}
move scale.x/2,at
Font.sizeY=size.y("|", f$, sz)
width 4 {
color {
formlabel1 caption$, f$, sz, 2
};
'move 0,at
'fill scale.x,Font.sizeY*2/3, 7,12, 0
move 0, Font.sizeY*2/3+at
fill scale.x, Font.sizeY/3, 11,3, 0
color {};
move scale.x/2, at
pen 0 {
color {
formlabel1 caption$, f$, sz, 2
}
}
}
}
module title.display (caption$, at as long=0, f$="ARIAL BLACK", sz as long=128){
module formlabel1 {
legend letter$, letter$, number, 0, number, 0
}
Font.sizeY=size.y("|", f$, sz)
move scale.x/2,at+Font.sizeY
width 4 {
color {
formlabel1 caption$, f$, sz, 2
};
move 0,at+Font.sizeY
fill scale.x,Font.sizeY*2/3, 7,12, 0
move 0, Font.sizeY*2/3+at
fill scale.x, Font.sizeY/3, 11,3, 0
color {};
move scale.x/2, at+Font.sizeY
pen 0 {
color {
formlabel1 caption$, f$, sz, 2
}
}
}
}
module title.displaY (caption$, at as long=0, f$="ARIAL BLACK", sz as long=128){
module formlabel1 {
legend letter$, letter$, number, 0, number, 0
}
Font.sizeY=size.y("|", f$, sz)
move scale.x/2,at+Font.sizeY/2
width 4 {
color {
formlabel1 caption$, f$, sz, 2
};
move 0,at
fill scale.x,Font.sizeY*2/3, 7,12, 0
move 0, Font.sizeY*2/3+at
fill scale.x, Font.sizeY/3, 11,3, 0
color {};
move scale.x/2, at
pen 0 {
color {
formlabel caption$, f$, sz, 2
}
}
}
}
Module SetSceenPixels (pixelsX, pixelsY) {
Layer {
font "courier new"
window 4, pixelsX*twipsX, pixelsY*twipsY;
mode 12
}
}
' here we set the current output the background layer,
' which is behind the console layer. The background layer is the form, the console window.
' Console window by default exgtend to full screen.
'window 12, 18000, 12000;
' window 12, window
oldfont$=fontname$
oldmode=mode
'SetSceenPixels 1280, 1024
SetSceenPixels 1024, 768
'SetSceenPixels 640, 480
' so now we make some loambda functions (they hide some state inside as closures)
(cX, cY, cfx, cfy, cfo)=lambda ->{
Back {
cls 0,0
MaxX=scale.x/1920/twipsX
MaxY=scale.y/1080/twipsY
OverAll=sqrt(scale.x*scale.y/1920/1080/twipsX/twipsY)
}
Data lambda MaxX (i)->{
=(8000+i*10)*MaxX
}
Data lambda MaxY (i)->{
=(5000+i*4)*MaxY
}
Data lambda MaxX (i)->{
=i*MaxX
}
Data lambda MaxY (i)->{
=i*MaxY
}
Data lambda OverAll (i)->{
=i*OverAll
}
=array([])
}() ' auto execute the lambda
' first we hide the console layer - not the form
Hide
Back {
' PREPARE BACKGROUND AND OBJECTS
' we make an emf file in a buffer (in memory only)
drawing 1920*twipsX, 1080*twipsY/2 {
title.display "ORGUSS", 0, ? ,?
title.display "Super Dimension Century Orguss", 3000, ?, 72
} as titles
' rendering emf file to a DIB in a string
t$="" : image titles to t$ (15), cfx(100) ' (15) make the not used pixel as white.
' some useful numbers
IY=Image.Y(t$)*2/3
M=100
a$=""
' now we read image orgus.png to a DIB in a string
' dib is the RGB only representation
' for this example we use Sprite statement with the simple DIB image.
' Although Sprite handle Orguss as is : Sprite Orguss, ...
image "Orguss.png" to a$
' we save the output to a temporary in memory place
' later we use Release to get it back
' so the backgroud can be restrored using Release, one statement only
' Now the background
cls 1, 0
move 0,0
fill scale.x, scale.y*3/5, 0,1,,1
move scale.x, scale.y*3/5
' we use a pen with 120/255 opacity, only for the circle
' we don't use FILL in Circle, but we use Color 14 { }
' so we get a filled circle file without outline
pen 14, 120 {color 14 {circle scale.y/1.5}}
move 0, scale.y*3/5
fill scale.x, scale.y*2/5, #aaccff, 4
hold
' now we move to standard user folder for M2000.
module SetFolder "export"
delay=1000/60
' delay 1 second for the next refresh or the next refresh statement, any came first.
refresh 1000
counter=0
i=1
' best use for animation is the every statement
every delay {
release
move scale.x/2, IY
if i>500 then sprite t$,15,,,M,1: M*=.98
move cx(i), cy(i)
sprite a$, #FF00FF, 30-i/30, cfo(i/5),,1
if i<500 then move scale.x/2, IY:Sprite t$, 15
saveBMP "frame"+str$(counter,"000")
counter++
refresh 1000
i+=8: if i>1000 then exit
}
move cx(i)-cfx(180), cy(i)+cfy(90)
' we can use a for next and wait inside.
for k=1 to 100
release
sprite a$, #FF00FF, 30-i/30, cfo((i-k*12)/5),100-k,1
saveBMP "frame"+str$(counter,"000")
counter++
step cfx(-180), cfy(90)
refresh 1000
wait delay
next
}
window 4, window
back {cls 0}
font oldfont$
Mode oldmode
dir user

Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου
You can feel free to write any suggestion, or idea on the subject.