Loading Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -80,4 +80,4 @@ COPY scripts /scripts COPY sketches /sketches COPY blends /blends COPY jslib /jslib RUN chmod +x /scripts/hash.sh /scripts/testbase.sh && ln -st / /scripts/hash.sh RUN chmod +x /scripts/hash.sh /scripts/testout.sh && ln -st / /scripts/hash.sh run.ps1 +27 −10 Original line number Diff line number Diff line param($path, [int] $width=7016, [int] $height=4960, [switch] $debug) param( [string] $path, [string] $seed, [string] $hash, [int] $width = 7016, [int] $height = 4960, [switch] $debug = $false) $inputCount = 0; if (0 -ne $path.Length) { $inputCount++ } if (0 -ne $seed.Length) { $inputCount++ } if (0 -ne $hash.Length) { $inputCount++ } if ($inputCount -ne 1) { Write-Host "Exactly one of '-Path', '-Seed', or '-Hash' options is required." exit 1 } # create './out' if (-Not (Test-Path -PathType Container -Path ./out)) { Loading @@ -10,17 +25,21 @@ if (-Not (Test-Path -PathType Container -Path ./out)) { } # get the sha256 fingerprint if ($null -eq $path) { $path = New-TemporaryFile Read-Host -Prompt "Seed" | Out-File -FilePath $path if (0 -ne $path.Length) { $hash = (Get-FileHash -Path $path -Algorithm SHA256).Hash; } $hash = (Get-FileHash -Path $path -Algorithm SHA256).Hash.ToLower() elseif (0 -ne $seed.Length) { $stream = ([IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($seed))) $hash = (Get-FileHash -InputStream $stream -Algorithm SHA256).Hash; } $hash = $hash.ToLower(); # create a container if ($debug) { $container = (docker create -it --network none ` -e WIDTH=$width -e HEIGHT=$height -e DEBUG=true hash /hash.sh $hash) } else { } else { $container = (docker create -it --network none ` -e WIDTH=$width -e HEIGHT=$height hash /hash.sh $hash) } Loading @@ -30,9 +49,7 @@ if (-Not($?)) { } # execute HASH docker cp $path ${container}:/input docker start -ai $container $out = "./out/hash_${hash}.png" docker cp ${container}:/out/hash.png $out Write-Host "Saved to '$out'" Loading scripts/effects/negate.sh +1 −1 Original line number Diff line number Diff line Loading @@ -4,5 +4,5 @@ source /scripts/preamble.sh run() { peffect "negate" runim png $1 -negate runim png $1 -channel RGB -negate } scripts/hash.sh +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ fi source /scripts/preamble.sh hashprint "Hash $HASH" hrandom && LAYOUT_DEPTH=$(($HRANDOM % 4)) hrandom && LAYOUT_DEPTH=$(( ($HRANDOM % 4) + 1)) hashprint "Depth $LAYOUT_DEPTH" runrecursive Loading scripts/libhash.sh +6 −2 Original line number Diff line number Diff line Loading @@ -88,6 +88,10 @@ playout() { hashprint "$(tput bold)$(tput setaf 4)$@$(tput sgr0)" } perror() { hashprint "$(tput bold)$(tput setaf 1)ERROR: $@$(tput sgr0)" } pdebug() { [ -n "$DEBUG" ] && hashprint "$@" } Loading Loading @@ -120,7 +124,7 @@ runpde() { PDEHASH=$HRANDOM processing-java --sketch=/sketches/$1 --run "$PDEHASH" "$WIDTH" "$HEIGHT" "/tmp" >/dev/null 2>&1 if [ $? -ne 0 ]; then pdebug Processing failed. perror Processing failed. fi OUT="/tmp/$1_$PDEHASH.png" } Loading @@ -141,7 +145,7 @@ runblend() { pdebug "Running blend '$1'" blender $BLEND --background --python $SCRIPT >/dev/null 2>&1 if [ $? -ne 0 ]; then pdebug Blender failed. perror Blender failed. fi } Loading Loading
Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -80,4 +80,4 @@ COPY scripts /scripts COPY sketches /sketches COPY blends /blends COPY jslib /jslib RUN chmod +x /scripts/hash.sh /scripts/testbase.sh && ln -st / /scripts/hash.sh RUN chmod +x /scripts/hash.sh /scripts/testout.sh && ln -st / /scripts/hash.sh
run.ps1 +27 −10 Original line number Diff line number Diff line param($path, [int] $width=7016, [int] $height=4960, [switch] $debug) param( [string] $path, [string] $seed, [string] $hash, [int] $width = 7016, [int] $height = 4960, [switch] $debug = $false) $inputCount = 0; if (0 -ne $path.Length) { $inputCount++ } if (0 -ne $seed.Length) { $inputCount++ } if (0 -ne $hash.Length) { $inputCount++ } if ($inputCount -ne 1) { Write-Host "Exactly one of '-Path', '-Seed', or '-Hash' options is required." exit 1 } # create './out' if (-Not (Test-Path -PathType Container -Path ./out)) { Loading @@ -10,17 +25,21 @@ if (-Not (Test-Path -PathType Container -Path ./out)) { } # get the sha256 fingerprint if ($null -eq $path) { $path = New-TemporaryFile Read-Host -Prompt "Seed" | Out-File -FilePath $path if (0 -ne $path.Length) { $hash = (Get-FileHash -Path $path -Algorithm SHA256).Hash; } $hash = (Get-FileHash -Path $path -Algorithm SHA256).Hash.ToLower() elseif (0 -ne $seed.Length) { $stream = ([IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($seed))) $hash = (Get-FileHash -InputStream $stream -Algorithm SHA256).Hash; } $hash = $hash.ToLower(); # create a container if ($debug) { $container = (docker create -it --network none ` -e WIDTH=$width -e HEIGHT=$height -e DEBUG=true hash /hash.sh $hash) } else { } else { $container = (docker create -it --network none ` -e WIDTH=$width -e HEIGHT=$height hash /hash.sh $hash) } Loading @@ -30,9 +49,7 @@ if (-Not($?)) { } # execute HASH docker cp $path ${container}:/input docker start -ai $container $out = "./out/hash_${hash}.png" docker cp ${container}:/out/hash.png $out Write-Host "Saved to '$out'" Loading
scripts/effects/negate.sh +1 −1 Original line number Diff line number Diff line Loading @@ -4,5 +4,5 @@ source /scripts/preamble.sh run() { peffect "negate" runim png $1 -negate runim png $1 -channel RGB -negate }
scripts/hash.sh +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ fi source /scripts/preamble.sh hashprint "Hash $HASH" hrandom && LAYOUT_DEPTH=$(($HRANDOM % 4)) hrandom && LAYOUT_DEPTH=$(( ($HRANDOM % 4) + 1)) hashprint "Depth $LAYOUT_DEPTH" runrecursive Loading
scripts/libhash.sh +6 −2 Original line number Diff line number Diff line Loading @@ -88,6 +88,10 @@ playout() { hashprint "$(tput bold)$(tput setaf 4)$@$(tput sgr0)" } perror() { hashprint "$(tput bold)$(tput setaf 1)ERROR: $@$(tput sgr0)" } pdebug() { [ -n "$DEBUG" ] && hashprint "$@" } Loading Loading @@ -120,7 +124,7 @@ runpde() { PDEHASH=$HRANDOM processing-java --sketch=/sketches/$1 --run "$PDEHASH" "$WIDTH" "$HEIGHT" "/tmp" >/dev/null 2>&1 if [ $? -ne 0 ]; then pdebug Processing failed. perror Processing failed. fi OUT="/tmp/$1_$PDEHASH.png" } Loading @@ -141,7 +145,7 @@ runblend() { pdebug "Running blend '$1'" blender $BLEND --background --python $SCRIPT >/dev/null 2>&1 if [ $? -ne 0 ]; then pdebug Blender failed. perror Blender failed. fi } Loading