feat: add isolated Liam square540 head-chest build preset

This commit is contained in:
zenord
2026-10-15 11:43:38 +08:00
parent f705c27eee
commit 2405026402
16 changed files with 379 additions and 35 deletions
+12
View File
@@ -129,6 +129,18 @@ fun dynamicBodyCheck() {
val sourceX=(displayX-zoomed.left)*720/zoomed.width
check(near(sourceX,patch.x+patch.width/2f))
}
val square=bodyFit(540,540,720,1280,32f/9f,.128125f,"square540-headchest")
fun squareNear(a: Float,b: Float)=kotlin.math.abs(a-b)<.001f
check(squareNear(square.left,-270f) && squareNear(square.top,24f))
check(squareNear(square.width,1080f) && squareNear(square.height,1920f))
// ROI corners and own-mouth source pixels undergo the same single transform.
check(squareNear((0-square.left)*720/square.width,180f))
check(squareNear((0-square.top)*1280/square.height,-16f))
check(squareNear((540-square.top)*1280/square.height,344f))
check(runCatching { bodyFit(540,540,720,1280,32f/9f,.128125f) }.isFailure)
check(runCatching { bodyFit(540,540,720,1280,3.6f,.128125f,"square540-headchest") }.isFailure)
check(runCatching { bodyFit(540,540,480,848,32f/9f,.128125f,"square540-headchest") }.isFailure)
check(runCatching { bodyFit(540,540,720,1280,1f,.5f,"unknown") }.isFailure)
for(zoom in listOf(Float.NaN,Float.POSITIVE_INFINITY,.9f,2.1f))check(runCatching { bodyFit(720,1280,720,1280,zoom) }.isFailure)
for(center in listOf(Float.NaN,.39f,.61f))check(runCatching { bodyFit(720,1280,720,1280,1.45f,center) }.isFailure)
fun render(codecW: Int,codecH: Int): Pair<List<ComposedBodyFrame>,List<String>> {