52,7 → 52,7 |
# any sane system though). |
# * FEATURE: Funky modes (more to come...) |
# * FEATURE: Polaroid funky mode (-kp) |
# * FEATURE: Reel funky mode (-kr) (rough initial version) |
# * FEATURE: Film funky mode (-kf) (rough initial version) |
# * INTERNAL: Use /dev/shm as base tempdir if possible |
# * BUGFIX: Fixed safe_rename(): Don't assume current dir, added '--' to mv |
# * Added workaround for ffmpeg arguments order |
865,10 → 865,10 |
} |
|
# Applies all global vidcap filters |
filter_all_vidcaps() { |
# TODO: Do something with "$@" |
true |
} |
#filter_all_vidcaps() { |
# # TODO: Do something with "$@" |
# true |
#} |
|
filt_resize() { |
local f="$1" t=$2 w=$3 h=$4 |
889,23 → 889,29 |
|
# Apply a Polaroid-like effect |
# Taken from <http://www.imagemagick.org/Usage/thumbnails/#polaroid> |
# filt_polaroid($1 = filename, $2 = timestamp, $3 = width, $4 = height) |
filt_polaroid() { |
local file="$1" ts=$2 w=$3 h=$4 |
# Rotation angle [-18..18] |
local angle=$(( ($RANDOM % 37) - 18 )) |
# filt_photoframe($1 = filename, $2 = timestamp, $3 = width, $4 = height) |
filt_photoframe() { |
# local file="$1" ts=$2 w=$3 h=$4 |
# Tweaking the size gives a nice effect too |
# w=$(( $w - ( $RANDOM % ( $w / 3 ) ) )) |
|
# TODO: Split softshadow in a filter |
echo -n "-bordercolor white -border 6 -bordercolor grey60 -border 1 " |
echo -n "-background none -rotate $angle " |
echo -n "-background black \( +clone -shadow 60x4+4+4 \) +swap " |
echo "-background none -flatten -trim +repage" |
} |
|
# Applies a random rotation |
# Taken from <http://www.imagemagick.org/Usage/thumbnails/#polaroid> |
# filt_randrot($1 = filename, $2 = timestamp, $3 = width, $4 = height) |
filt_randrot() { |
# Rotation angle [-18..18] |
local angle=$(( ($RANDOM % 37) - 18 )) |
echo "-background none -rotate $angle " |
} |
|
# This one requires much more work, the results are pretty rough, but ok as |
# a starting point / proof of concept |
filt_reel() { |
filt_film() { |
local file="$1" ts=$2 w=$3 h=$4 |
# Base reel dimensions |
local rw=$(rmultiply $w,0.08) # 8% width |
972,9 → 978,9 |
} |
|
# Polaroid contact sheet creator: it overlaps vidcaps with some randomness |
# csheet_polaroid($1 = columns, $2 = context, $3 = width, $4 = height, |
# csheet_overlap($1 = columns, $2 = context, $3 = width, $4 = height, |
# $5... = $vidcaps) : output |
csheet_polaroid() { |
csheet_overlap() { |
local cols=$1 ctx=$2 width=$3 height=$4 |
# globals: $VID |
shift 4 |
1006,7 → 1012,7 |
# I believe no image should ever be wider/taller than the diagonal (note the |
# ceilmultiply is there to simply round the result) |
local diagonal=$(ceilmultiply $(pyth_th $width $height) 1) |
# XXX: The width, though isn't guaranteed (e.g. using filt_reel it ends wider) |
# XXX: The width, though isn't guaranteed (e.g. using filt_film it ends wider) |
# adding 3% to the diagonal *should* be enough to compensate |
local canvasw=$(( ( $diagonal + $(rmultiply $diagonal,0.3) ) * $cols )) |
local canvash=$(( $diagonal )) |
1232,7 → 1238,7 |
capfiles+=( "$capfile" ) |
let 'n++' # $n++ |
done |
filter_all_vidcaps "${capfiles[@]}" |
#filter_all_vidcaps "${capfiles[@]}" |
|
info "Composing standard contact sheet..." |
output=$(create_contact_sheet $numcols $CTX_STD $vidcap_width $vidcap_height "${capfiles[@]}") |
1536,13 → 1542,24 |
-k <arg> |
--funky <arg> Funky modes: |
These are toy output modes in which the contact sheet |
gets a more informal look. They're random in nature |
so using the same funky mode twice will usually lead to |
quite different results. |
Currently the only "funky mode" available is |
gets a more informal look. |
Order *IS IMPORTANT*. A bad order gets a bad result :P |
They're random in nature so using the same funky mode |
twice will usually lead to quite different results. |
Currently available "funky modes": |
"overlap": Use '-ko' or '--funky overlap' |
Randomly overlap captures. |
"rotate": Use '-kr' or '--funky rotate' |
Randomly rotate each image. |
"photoframe": Use '-kf' or '--funky photoframe' |
Adds a photo-like white frame to each image. |
"polaroid": Use '-kp' or '--funky polaroid' |
Makes output look like photographs laid over a |
table. |
Combination of rotate, photoframe and overlap. |
Same as -kr -ko -kf. |
"film": Use '-ki' or '--funky film' |
Imitates filmstrip look. |
"random": Use '-kx' or '--funky random' |
Randomizes colours and fonts. |
-O|--override <arg> Use it to override a variable (see the homepage for |
more details). Format accepted is 'variable=value' (can |
also be quoted -variable="some value"- and can take an |
1769,17 → 1786,31 |
;; |
-k|--funky) # Funky modes |
case $(tolower "$2") in |
p|polaroid) |
p|polaroid) # Same as overlap + rotate + photoframe |
info "Changed to polaroid funky mode." |
FILTERS_IND+=( 'filt_polaroid' ) |
CSHEET_DELEGATE='csheet_polaroid' |
FILTERS_IND+=( 'filt_photoframe' 'filt_randrot' ) |
CSHEET_DELEGATE='csheet_overlap' |
# The timestamp must change location to be visible |
grav_timestamp=NorthWest |
;; |
r|reel) # Undocumented for good reason! |
info "Enabled reel mode." |
FILTERS_IND+=( 'filt_reel' ) |
o|overlap) # Random overlap mode |
CSHEET_DELEGATE='csheet_overlap' |
grav_timestamp=NorthWest |
;; |
r|rotate) # Random rotation |
FILTERS_IND+=( 'filt_randrot' ) |
;; |
f|photoframe) # White photo frame |
FILTERS_IND+=( 'filt_photoframe' ) |
;; |
i|film) |
info "Enabled film mode." |
FILTERS_IND+=( 'filt_film' ) |
;; |
x|random) # Random colours/fonts |
info "Enabled random colours and fonts." |
randomize_look |
;; |
*) |
error "Unknown funky mode. Got '$2'." |
exit $EX_UAGE |