Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37918396
en ru br
Репозитории ALT
S:0.02-alt1
5.1: 0.01-alt5
4.1: 0.01-alt0.M41.4
www.altlinux.org/Changes

Группа :: Графика
Пакет: multover

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

multover-0.01/000075500000000000000000000000001116125224400133035ustar00rootroot00000000000000multover-0.01/Makefile000064400000000000000000000001141116125224400147370ustar00rootroot00000000000000WORK=example* file.avi
JUNK=*~ *.bak o o.*


clean:
rm -rf $(JUNK) $(WORK)
multover-0.01/create_example000075500000000000000000000032611116125224400162110ustar00rootroot00000000000000#!/bin/sh

L="`ls /usr/share/doc/*/images/logo.jpg|tail -1`"
P="`ls /usr/share/doc/*/images/granite.png|tail -1`"
W=`identify "$L" | sed 's/.* JPEG \([0-9]*\)x.*/\1/'`
H=`identify "$L" | sed 's/.* JPEG [0-9]*x\([0-9]*\).*/\1/'`

CW="${1:-640}"
CH="${2:-480}"
CN="${3:-12}"
CD="${4:-example}"

_Random() { # [Max]
echo $((`dd if=/dev/urandom count=2 bs=1 2>/dev/null | od -An -t u4`%${1:-32768}))
}

rm -rf "$CD"
mkdir "$CD"
cd "$CD"

convert "$L" -fuzz 25% -draw "fill white color 0,0 reset fill black stroke black rectangle 75,0 $W,$H rectangle 62,28 $W,$H rectangle 36,36 $W,$H rectangle 36,27 40,$H image screen 0,0 $W,$H '$L'" -matte -depth 24 -fill none -draw "matte 0,0 floodfill" -trim -write spriteR.png -flop spriteL.png

x10=0;y10=`_Random $(($CH-$H))`;x11=$(($CW-$W));y11=`_Random $(($CH-$H))`
x21=0;y21=`_Random $(($CH-$H))`;x20=$(($CW-$W));y20=`_Random $(($CH-$H))`
x30=`_Random $(($CW-$W))`;y30=0;x31=`_Random $(($CW-$W))`;y31=$(($CH-$H))
x41=`_Random $(($CW-$W))`;y41=0;x40=`_Random $(($CW-$W))`;y40=$(($CH-$H))

n=0; while test $n -lt $CN; do
x1=$((($n*$x11+($CN-1-$n)*$x10)/$CN)); y1=$((($n*$y11+($CN-1-$n)*$y10)/$CN))
x2=$((($n*$x21+($CN-1-$n)*$x20)/$CN)); y2=$((($n*$y21+($CN-1-$n)*$y20)/$CN))
x3=$((($n*$x31+($CN-1-$n)*$x30)/$CN)); y3=$((($n*$y31+($CN-1-$n)*$y30)/$CN))
x4=$((($n*$x41+($CN-1-$n)*$x40)/$CN)); y4=$((($n*$y41+($CN-1-$n)*$y40)/$CN))
n=$(($n+1))
convert -depth 24 -size "$CW"x"$CH" tile:"$P" -draw "
image src-over $x1,$y1 $W,$H spriteL.png
image src-over $x2,$y2 $W,$H spriteR.png
image src-over $x3,$y3 $W,$H spriteL.png
image src-over $x4,$y4 $W,$H spriteR.png
" -interlace Plane frame_`printf "%02d" $n`.png
echo -n "$n "
done
echo
rm -f sprite*
multover-0.01/multover000075500000000000000000000126331116125224400151130ustar00rootroot00000000000000#!/bin/sh
. "`functions.locate`" || exit -1
_Version=0.01

test -r "$_RC" && . "$_RC" || :
export LC_ALL="${LANG%%.*}.UTF-8"

# This is for dependency elimination
if dcop > /dev/null 2> /dev/null; then
Dialog="kdialog"; isK() { true; }
else
Dialog="Xdialog"; isK() { false; }
fi

if isK; then
__Message() { # message [title]
$Dialog --title "${2:-INFO}" --msgbox "$1"
}
else
__Message() { # message [title]
$Dialog --left --cr-wrap --wrap --title "${2:-INFO}" --infobox "$1" "" "512" "30000"
}
fi

# Exit with optional message printing and return value
Exit() { # [message] [return]
_Error "${1:-п═п╟п╠п╬я┌п╟ п©я─п╣я─п╡п╟п╫п╟}" $2
exit $2
}

# Read at least Number lines displaying a progress bar from 0 to Number
if isK; then
Progress() { # Message Number
local i=0
local dProgr="$($Dialog --progressbar "$1" "$2")"
while read; do i=$((i+1)); dcop "$dProgr" setProgress "$i"; done
dcop "$dProgr" close
}
else
Progress() { # Message Number
( trap '' PIPE; while read; do echo "." 2>/dev/null; done ) |
$Dialog --progress "$1" "" "" "$2"
}
fi

if isK; then
Combo() {
local t="$1"
local s="$2"
shift; shift
$Dialog --title "$t" --combobox "$s" "$@"
}
else
Combo() { # title subtitle choice [choice ...]
local t="$1"
local s="$2"
shift; shift
$Dialog --stdout --title "$t" --combobox "$s" "" "" "$@"
}
fi

if isK; then
Range() { # title subtitle min max default
# TODO no range box here in kdialog :(
$Dialog --title "$1" --inputbox "$2 ($3 - $4)" "$5"
}
else
Range() {
$Dialog --stdout --title "$1" --rangebox "$2" "" "" "$3" "$4" "$5"
}
fi

if isK; then
Radio() { # title subtitle item label status
local t="$1"
local s="$2"
shift; shift
$Dialog --title "$t" --radiolist "$s" "$@"
}
else
Radio() {
local t="$1"
local s="$2"
shift; shift
$Dialog --stdout --title "$t" --radiolist "$s" "" "" "$((($#/3)+1))" "$@"
}
fi

# select catalog with frames or multigif
if isK; then
D=`$Dialog --title "п▓я▀п╠п╣я─п╦я┌п╣ п╨п╟я┌п╟п╩п╬пЁ я│ п╨п╟п╢я─п╟п╪п╦" --getexistingdirectory $HOME` ||
D=`$Dialog --title "п▓я▀п╠п╣я─п╦я┌п╣ п╪п╫п╬пЁп╬я│п╩п╬п╧п╫п╬п╣ п╦п╥п╬п╠я─п╟п╤п╣п╫п╦п╣" --getopenfilename $HOME "*"` || Exit
else
D=`$Dialog --stdout --title "п▓я▀п╠п╬я─ я└п╟п╧п╩п╟ п╦п╩п╦ п╨п╟я┌п╟п╩п╬пЁп╟" \
--backtitle "п▓я▀п╠п╣я─п╦я┌п╣ п╨п╟я┌п╟п╩п╬пЁ я│ п╨п╟п╢я─п╟п╪п╦ п╦п╩п╦ п╪п╫п╬пЁп╬я│п╩п╬п╧п╫п╬п╣ п╦п╥п╬п╠я─п╟п╤п╣п╫п╦п╣" \
--fselect "" "" 400 120` || Exit
fi

_TmpDir Source
if [ -d "$D" ]
then # Directory
N="`identify "$D"/*`" ||
_Error "п²п╣п╢п╬п©я┐я│я┌п╦п╪я▀п╣ я└п╟п╧п╩я▀ п╡ п╨п╟я┌п╟п╩п╬пЁп╣: `identify "$D"/* 2>&1 >/dev/null`"
test `echo "$N" | sort -u -k3,3 | wc -l` -eq 1 ||
_Msg "п п╟п╢я─я▀ я─п╟п╥п╫п╬пЁп╬ я─п╟п╥п╪п╣я─п╟:
$N"
FNum="$(ls "$D"/* | wc -l)"
cp -v "$D"/* "$Source"/ | Progress "п п╬п©п╦я─п╬п╡п╟п╫п╦п╣ я└п╟п╧п╩п╬п╡" "$FNum"
elif [ -f "$D" ]
then # File
FNum="$(identify "$D" 2>/dev/null | wc -l)"
test "$FNum" -gt 1 ||
_Error "п≤п╥п╬п╠я─п╟п╤п╣п╫п╦п╣ '$D' я│п╬п╢п╣я─п╤п╦я┌ п╪п╟п╩п╬ ($FNum) п╨п╟п╢я─п╬п╡"
convert "$D" -verbose "$Source/frame_%03d.png" |
Progress "п═п╟п╥п╠п╦п╣п╫п╦п╣ п╦п╥п╬п╠я─п╟п╤п╣п╫п╦я▐ п╫п╟ п╨п╟п╢я─я▀" "$FNum"
else
_Error "п²п╣п╡п╬п╥п╪п╬п╤п╫п╬ п©я─п╣п╬п╠я─п╟п╥п╬п╡п╟я┌я▄ '$D' п╡ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪"
fi

FNum="$(ls "$Source"/* | wc -l)"

# select output directory
if [ -w "$(dirname $D)" ]; then Target="$(dirname $D)"
elif [ -d "$HOME/Desktop"]; then Target="$HOME/Desktop"
else Target="$HOME"
fi

# select output filename
Outname="$(basename "$D")"; Outname="${Outname%.*}".avi

_TmpDir Dest
_TmpFile Preview
W=640; H=480; FPS=5
#TRY:
while true
do
# select output size
WH="$(Combo "п═п╟п╥п╪п╣я─ п╨п╟п╢я─п╟ п╡ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╣" \
"пёя│я┌п╟п╫п╬п╡п╦я┌п╣ я─п╟п╥п╪п╣я─ п╨п╟п╢я─п╟ п╡ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╣" \
"640x480" "320x200" "720x576" )" || Exit
W="${WH%%x*}"; H="${WH##*x}"
# resize all + adjust depth
# pity that ImageMagick refuses io _increase_ depth!
convert "$Source"/* -resize "$W"x"$H"'!' \
-depth 24 -quality 100 -treedepth 2 -verbose "$Dest/frame%03d.jpg" |
Progress "п÷я─п╣п╬п╠я─п╟п╥п╬п╡п╟п╫п╦п╣ п╨п╟п╢п╬я─п╡" "$FNum"
# select FPS
FPS="$(Range "п╖п╟я│я┌п╬я┌п╟ п╨п╟п╢я─п╬п╡" \
"п▓п╡п╣п╢п╦я┌п╣ я┤п╟я│я┌п╬я┌я┐ я│п╪п╣п╫я▀ п╨п╟п╢я─п╬п╡" \
"1" "25" "$FPS" )" || Exit
# create a preview and show it
# TODO hardwired aspect 4:3
# TODO Error hadnling along with progress
mencoder -o "$Preview" "mf://$Dest/frame*.jpg" -v \
-mf fps="$FPS":type=jpg -ovc lavc 2>&1 | grep "^Pos:" |
Progress "п║п╬п╥п╢п╟п╫п╦п╣ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╟" "$FNum"
# show preview until user decide to use it or to drop it
while true
do
Res="$(Radio "п÷я─п╣п╢п╡п╟я─п╦п╣я┌п╩я▄п╫я▀п╧ п©я─п╬я│п╪п╬я┌я─" \
"п÷я─п╣п╢п╡п╟я─п╦я┌п╣п╩я▄п╫я▀п╧ п©я─п╬я│п╪п╬я┌я─ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╟. п▓я▀п╠п╣я─п╦я┌п╣, я┤я┌п╬ п╢п╣п╩п╟я┌я▄ п╢п╟п╩я▄я┬п╣." \
"1" "п©п╬я│п╪п╬я┌я─п╣я┌я▄ п©я─п╣п╢п╡п╟я─п╦я┌п╣п╩я▄п╫я┐я▌ п╡п╣я─я│п╦я▌ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╟" "on" \
"2" "п©п╣я─п╣п╢п╣п╩п╟я┌я▄ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪" "" \
"3" "я│п╬п╠я─п╟я┌я▄ п╬п╨п╬п╫я┤п╟я┌п╣п╩я▄п╫я┐я▌ п╡п╣я─я│п╦я▌ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╟" "")" || Exit
case "$Res" in
1) sleep 1; mplayer "$Preview"; sleep 1;;
*) break;;
esac
done
test "$Res" -ne "3" || break
rm -f "$Dest"/*
done

# resample with 24 FPS , proper ratio etc.
# TODO hardwired aspect 4:3
# TODO Error hadnling along with progress
mencoder -o "$Target/$Outname" "mf://$Dest/frame*.jpg" -v \
-mf fps="$FPS":type=jpg -ovc lavc -ofps 25 2>&1 | grep "^Pos:" |
Progress "п║п╬п╥п╢п╟п╫п╦п╣ п╪я┐п╩я▄я┌я└п╦п╩я▄п╪п╟" "$FNum"

sleep 1; mplayer "$Target/$Outname"
multover-0.01/multover.desktop.in000064400000000000000000000003141116125224400171560ustar00rootroot00000000000000[Desktop Entry]
Name=MultOver
GenericName=Simple animation assembly tool
Comment=
Categories=Application;Graphics;
Exec=
Icon=
Type=Application
# Set this to false for simplifying workflow
Terminal=false
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin