luv

Workshop wiki

terminal-cinema.lisp

captures/terminal-cinema.lisp

system luv/showcase · 21 definitions · on GitHub

in-package#:luv.showcase

A world terminal photographed through its existing display ownership. Shell fixtures cross the real PTY/Ghostty path; Film fixtures cross the existing video-screen path and remain under the terminal faceplate. #2TMUKK #TWKA93

defunterminal-cinema-look-pose
xyztarget-xtarget-ytarget-zfield-of-view

Return an unrolled camera pose looking from X/Y/Z at the target point.

let*
dx
-target-xx
dy
-target-yy
dz
-target-zz
flat
sqrt
+
*dxdx
*dzdz
luvcraft::make-camera-pose
atandxdz
atandyflat
field-of-view
defunterminal-cinema-environment-pose

The oblique shelter view shared by the shell and Film wall.

defunmake-terminal-cinema-world

Build the compact stone-and-wood shelter around one four-by-three wall.

let

Meadow floor, stone threshold, and a warm timber path pull the terminal into a place without competing with its luminous surface.

loopforxbelow16do
loopforzbelow16do
setfluvcraft::*grass-block*
loopforzfrom3to12do
loopforxfrom5to9do
setf
if
oddp
+xz
luvcraft::*stone-block*luvcraft::*bricks-block*

Back wall and deep frame. The terminal sits one cell in front so its :BACK face remains exposed toward the camera.

loopforxfrom3to11do
loopforyfrom1to6do
setf
if
or
=x3
=x11
=y1
=y6
luvcraft::*wood-block*luvcraft::*stone-block*
loopforzfrom10to14do
loopforxfrom2to12do
setfluvcraft::*planks-block*
dolist
post'
210
1210
214
1214
destructuring-bind
xz
post
loopforyfrom1to6do
setfluvcraft::*wood-block*
world
defunterminal-cinema-shell-script

Return the bounded credential-free shell program for the showcase PTY.

let
escape
code-char27
with-output-to-string
stream
formatstream"printf '~C[2J~C[H'~%"escapeescape
formatstream"printf '%s\\r\\n' '~C[48;5;24m~C[1;38;5;230m LUVCRAFT FIELD TERMINAL ~C[0m'~%"escapeescapeescape
formatstream"printf '%s\\r\\n' '~C[38;5;109mstone shelter / terminal wall~C[0m'~%"escapeescape
formatstream"printf '\\r\\n'~%"
formatstream"printf '%s\\r\\n' '~C[1;38;5;221m$ scene inspect terminal~C[0m'~%"escapeescape
formatstream"printf '%s\\r\\n' 'surface ~C[38;5;81m4 x 3 blocks~C[0m'~%"escapeescape
formatstream"printf '%s\\r\\n' 'grid ~C[38;5;120mwhole-face fitted~C[0m'~%"escapeescape
formatstream"printf '%s\\r\\n' 'renderer ~C[38;5;213mGhostty + Slug~C[0m'~%"escapeescape
formatstream"printf '%s\\r\\n' 'glass ~C[1;38;5;117mfaceplate last~C[0m'~%"escapeescape
formatstream"printf '\\r\\n'~%"
formatstream"printf '%s\\r\\n' '~C[1;38;5;221m$ printf ready~C[0m'~%"escapeescape
formatstream"printf '%s\\r\\n' '~C[1;32mready: source-owned PTY~C[0m'~%"escapeescape
formatstream"printf '%s\\r\\n' '~C[38;5;245moffline / credential-free~C[0m'~%"escapeescape
defunattach-terminal-cinema-shell-fixture
display

Run the finite styled fixture through display's owned PTY and wait for it.

luvcraft:attach-terminal-display-ptydisplay:program
or
uiop:getenv"LUV_BASH"
"/bin/sh"
:arguments:directory#P"/":environment'
"LC_ALL=C""LANG=C"
let*
device
luvcraft:terminal-display-devicedisplay
state
unless
eqstate:exited
error"Terminal cinema fixture did not exit cleanly: ~S."state
display
defuncall-with-terminal-cinema-session
function&key
shell-pnil

Call function with SESSION and its source-owned world terminal-display.

call-with-gallery-session
lambda
session
let
displaynil
unwind-protect
progn
setfdisplay
luvcraft:open-terminal-displaysession5212:back:rows-per-block5:fixture"":font-scale0.96
whenshell-p
formatt"capture terminal cinema: running PTY fixture...~%"
finish-output
formatt"capture terminal cinema: PTY fixture ready~%"
finish-output
funcallfunctionsessiondisplay
when
anddisplay
memberdisplay
luvcraft:luvcraft-session-overlayssession
:title"terminal cinema shelter":width+terminal-cinema-width+:height+terminal-cinema-height+:clean-pt:residency-radius0:world:camera:sky-clock:sky-profile:exposure0.58:bloom-gain0.20:shaft-gain0.16
defunfill-terminal-cinema-clip-frame
pixelsframeframe-count

Fill pixels with one deterministic stone-age car crossing a dusk cartoon.

let*
progress
/frame
coerce
max1
1-frame-count
'double-float
car-x
round
+-100
*progress
dotimes
dotimes
let*
sky-red
+48
floor
*y112
220
sky-green
+32
floor
*y54
220
sky-blue
-112
floor
*y48
220
sun-dx
-x382
sun-dy
-y72
hill-top
+146
floor
abs
-
mod
+x73
210
105
5
wheel-a-x
+car-x23
wheel-b-x
+car-x82
wheel-y221
wheel-a-dx
-xwheel-a-x
wheel-b-dx
-xwheel-b-x
wheel-dy
-ywheel-y
wheel-p
or
<=
+
*wheel-a-dxwheel-a-dx
*wheel-dywheel-dy
169
<=
+
*wheel-b-dxwheel-b-dx
*wheel-dywheel-dy
169
driver-dx
-x
+car-x57
driver-dy
-y174
driver-p
<=
+
*driver-dxdriver-dx
*driver-dydriver-dy
144
body-p
and
<=car-xx
+car-x105
<=187y218
body-top-p
and
<=
+car-x18
x
+car-x88
<=
+169
floor
abs
-x
+car-x54
5
y198
offset
redgreenblue
cond
wheel-p
setfred55green43blue37
driver-p
setfred239green174blue108
orbody-pbody-top-p
setfred187green153blue103
>=y220
setfred37green30blue42
>=yhill-top
setfred64green43blue73
<=
+
*sun-dxsun-dx
*sun-dysun-dy
1024
setfred255green178blue82
and
<y118
zerop
mod
+
*x17
*y31
997
setfred242green222blue184
t
setfredsky-redgreensky-greenbluesky-blue
setf
arefpixelsoffset
red
arefpixels
+offset1
green
arefpixels
+offset2
blue
arefpixels
+offset3
255
pixels
defunrender-terminal-cinema-clip
pathname

Write the small deterministic H.264 fixture played by the world wall.

let*
formatt"capture terminal cinema: generating ~D-frame wall clip...~%"frame-count
finish-output
luv:with-video-encoder
write-framepathname+terminal-cinema-clip-width++terminal-cinema-clip-height+:frame-rateframe-rate
dotimes
frameframe-count
when
zerop
modframeframe-rate
formatt"capture terminal cinema clip: second ~D/~D~%"
1+
/frameframe-rate
+terminal-cinema-film-seconds+
finish-output
write-framepixels
pathname
defuncall-with-terminal-cinema-clip

Call function with one generated clip, then remove its unique directory.

uiop:with-temporary-file
:pathnamemarker:prefix"luv-showcase-terminal-cinema-":type:unspecific
uiop:delete-file-if-existsmarker
let*
directory
uiop:ensure-directory-pathnamemarker
clip
merge-pathnames"flintstones-cinema-at-dusk.mp4"directory
ensure-directories-existdirectory
unwind-protect
when
probe-filedirectory
uiop:delete-directory-treedirectory:validatet:if-does-not-exist:ignore
defunplay-terminal-cinema-clip
displayclip

Put clip on display through the bounded software Film path.

let
screen

Chapel's RADV H.264 video queue currently loses the whole graphics device on its first decoded picture. This authored 480x270 fixture is intentionally forced through the ordinary software upload path until that backend failure has its own proof and fix; :AUTO would still try the guilty hardware path first.

when
luvcraft::video-screen-hardware-pscreen
error"Terminal cinema Film mode unexpectedly used hardware decode."
screen
luv:define-captureterminal-camp-golden-hour
:figure2tmukk:kind:image:extension"png":description"An actual styled PTY glowing obliquely inside its stone-and-wood shelter."
pathname
call-with-terminal-cinema-session
lambda
sessiondisplay
declare
ignoredisplay
luvcraft:capture-luvcraft-screenshotsessionpathname:include-hud-pnil:include-viewmodel-pnil
:day-fraction0.72:shell-pt
luv:define-captureterminal-shell-closeup
:figure2tmukk:kind:image:extension"png":description"The same styled PTY from the terminal's ordinary off-axis focus framing."
pathname
call-with-terminal-cinema-session
lambda
sessiondisplay
luvcraft:capture-luvcraft-screenshotsessionpathname:camera-pose:include-hud-pnil:include-viewmodel-pnil
:day-fraction0.72:shell-pt
luv:define-capturewall-cinema-at-dusk
:figuretwka93:kind:image:extension"png":description"An authored stone-age cartoon letterboxed inside the dusk terminal wall."
pathname
call-with-terminal-cinema-clip
lambda
clip
call-with-terminal-cinema-session
lambda
sessiondisplay
luvcraft:capture-luvcraft-screenshotsessionpathname:include-hud-pnil:include-viewmodel-pnil
:day-fraction0.76
luv:define-capturewall-cinema-at-dusk-film
:figuretwka93:kind:video:extension"mp4":description"Three seconds of authored video moving behind the terminal faceplate."
pathname
call-with-terminal-cinema-clip
lambda
clip
call-with-terminal-cinema-session
lambda
sessiondisplay
luvcraft:film-luvcraft-sessionsessionpathname:seconds+terminal-cinema-film-seconds+:frame-rate+terminal-cinema-film-frame-rate+:include-hud-pnil:include-viewmodel-pnil:before-frame
lambda
setf
luvcraft::luvcraft-session-last-frame-timesession
when
formatt"capture wall-cinema-at-dusk-film: second ~D/~D~%"+terminal-cinema-film-seconds+
finish-output
:day-fraction0.76