Skip to content

Commit 8670add

Browse files
committed
Quality of life improvements
1 parent f1346b9 commit 8670add

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

examples_tests/22.RaytracedAO/extractCubemap.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
@echo off
22

3-
set /p imgSz="Image size: "
43
set /p borderSz="Border size: "
5-
set /a extractedImgSz=imgSz-2*borderSz
64

75
set /p img="Image to extract from: "
86

@@ -13,6 +11,11 @@ set /p bottom="Bottom path: "
1311
set /p front="Front path: "
1412
set /p back="Back path: "
1513

14+
REM set extracted image size
15+
for /f "tokens=*" %%s in ('magick identify -format "%%w" %img%') do set sz=%%s
16+
set /a imgSz=sz/3
17+
set /a extractedImgSz=imgSz-2*borderSz
18+
1619
set /a x0 = borderSz
1720
set /a x1 = imgSz+borderSz
1821
set /a x2 = 2*imgSz+borderSz
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
@echo off
22

3-
set /p sz="Image size: "
4-
set /a szx2=2*sz
5-
set /p ext="Image extension: "
6-
set /a outputWidth=3*sz
7-
set /a outputHeight=2*sz
8-
93
set /p right="Right path: "
104
set /p left="Left path: "
115
set /p top="Top path: "
126
set /p bottom="Bottom path: "
137
set /p front="Front path: "
148
set /p back="Back path: "
9+
set /p output="Output image name (without extension):"
10+
11+
REM set image size
12+
for /f "tokens=*" %%s in ('magick identify -format "%%w" %right%') do set sz=%%s
13+
14+
REM set image fromat
15+
for /f "tokens=*" %%s in ('magick identify -format "%%m" %right%') do set format=%%s
16+
17+
set /a szx2=2*sz
18+
set /a outputWidth=3*sz
19+
set /a outputHeight=2*sz
1520

16-
magick convert -size %outputwidth%x%outputHeight% canvas:skyblue ^
21+
magick convert -size %outputwidth%x%outputHeight% canvas:none ^
1722
-draw "image over 0,0 0,0 '%right%'" ^
1823
-draw "image over %sz%,0 0,0 '%left%'" ^
1924
-draw "image over %szx2%,0 0,0 '%top%'" ^
2025
-draw "image over 0,%sz% 0,0 '%bottom%'" ^
2126
-draw "image over %sz%,%sz% 0,0 '%front%'" ^
2227
-draw "image over %szx2%,%sz% 0,0 '%back%'" ^
23-
output.%ext%
28+
%output%.%format%
2429

2530
PAUSE

0 commit comments

Comments
 (0)