Commit d67c448f authored by Sven Neumann's avatar Sven Neumann

applied a patch from Wolfgang Hofer

parent 59b038b9
2006-04-18 Wolfgang Hofer <hof@gimp.org>
applied patch provided with #338556
* gap/gap_mod_layer.c [.h]
* gap/gap_mod_layer_dialog.c
* docs/reference/txt/plug-in-gap-modify.txt
2006-04-17 Kjartan Maraas <kmaraas@gnome.org>
* configure.in: Remove obsolete entry for no_NO.
* po/no.po: And the translation.
2006-04-14 Wolfgang Hofer <hof@gimp.org>
applied patch provided with #337441
* gap/gap_base_ops.c [.h]
* gap/gap_main.c
* docs/reference/txt/plug-in-gap-reverse.txt # new file
* docs/reference/txt/plug-in-gap-shift.txt
* docs/reference/txt/plug-in-gap-storyboard-attr-prop.txt # new file
* docs/reference/txt/INTRODUCTION.txt
2006-04-12 Wolfgang Hofer <hof@gimp.org>
bugfix #337587: check version in the autogen.sh script
(using separate checks for major, minor micro version)
bugfix: on videoindex creation.
- video indexes created in normal time were droped after switch to
daylight saving time even if the videofile was not modified
since videoindex creation.
- dialogs for video index creation show wrong filename
for the index. The video track number that is part of the
vidoindex filename must use the internal
track number that starts at 0, but dialogs show the external
representation starting at 1.
(keeping the suffix .0.libavformat.gvaidx to be compatible
with already existing video indexes)
* autogen.sh
* libgapvidapi/gap_vid_api_vidindex.c
2006-04-08 Wolfgang Hofer <hof@gimp.org>
- bugfix gap_layer_clear_to_color
, restore original BG color)
- replaced private implementation p_layer_resize_to_imagesize
by gimp_layer_resize_to_image_size that does the same.
- use color range 0.0 to 1.0 for internal calculations in storyboard processing.
- storyboard dialog: added graphic views of the attributes
at start and end frame in the treansition attribute properties dialog.
* gap/gap_pview_da.c [.h]
* gap/gap_lib.c [.h]
* gap/gap_layer_copy.c [.h]
* gap/gap_vex_exec.c
* libgapvidutil/gap_gve_story.c [.h]
* gap/gap_story_att_trans_dlg.c [.h]
2006-04-06 Wolfgang Hofer <hof@gimp.org>
- storyboard processing: VID_FIT_SIZE record
is internally handled as transition attribute.
(now we have only ony type of attribute,
the attribute dialog support for fit_size is not implemented yet.)
* gap/gap_story_dialog.c [.h]
* gap/gap_story_file.c [.h]
* gap/gap_story_main.h
* libgapvidutil/gap_gve_story.c
2006-04-02 Wolfgang Hofer <hof@gimp.org>
- extract video range dialog: added labels to display
From and To Frames as time code mm:ss:ms
- added storyboard dialog icon for transition attributes
* gap/gap_vex_dialog.c
* gap/gap_vex_main.h
* images/gap-story-icon-transition-attr.png # new icon
* images/Makefile.am
2006-03-31 Wolfgang Hofer <hof@gimp.org>
- bugfix: storyboard processing changed the calculation of
layer offsets. (the old code had bugs, and assumed that
gimp_edit_paste
would center the pasted layer within the destination layer
which is not true with gimp-2.2.10)
The new calculation includes centering and scrolling
according to the MOVE_Y/MOVE_Y attribute settings of the
storyboard file and only uses this self calculated offest.
- Storyboard dialog support to edit transition attributes
(MOVE X/Y ZOOM X/Y and OPACITY) of the storyboard file.
Added menu to create a transition attribute (as last element)
Right mouse button on the transition attribute's thumbnail
also opens the new transition attributes properties dialog.
* gap/gap_story_att_trans_dlg.c [.h] # NEW files
* gap/Makefile.am
* gap/gap_story_file.c [h]
* gap_story_dialog.c
* gap/gap_story_main.h
* gap/gap_story_properties.c
* docs/reference/txt/STORYBOARD_FILE_DOC.txt
* libgapvidutil/gap_gve_story.c
* NEWS
2006-03-28 Wolfgang Hofer <hof@gimp.org>
- internal changes of the storyboard file handling and processing
(attributes MOVE X/Y ZOOM X/Y and OPACITY are now handled
as one common TRANSITION attribute,
for the planed basic GUI support of those transformations)
* gap/gap_story_file.c [h]
* libgapvidutil/gap_gve_story.c
* gap/gap_player_dialog.c
* gap/gap_story_dialog.c
2006-03-19 Wolfgang Hofer <hof@gimp.org>
player dialog: support step/backstep frame via scroll event.
(mouse wheel)
storyboard dialog: support scroll event.
* gap_player_dialog.c
* gap_story_dialog.c
2006-03-11 Wolfgang Hofer <hof@gimp.org>
- bugfix for selection handling via modify frames (#333978)
......
......@@ -2,7 +2,19 @@ Here is a short overview whats new in GIMP-GAP-2.2.1:
-----------------------------------------------------
(compared to gimp-gap release 2.2.0)
- Storyboard dialog support to edit transition attributes.
The new popup dialog allows creation and changes of the storyboard file attributes
FIT_SIZE
MOVE X/Y
ZOOM X/Y and
OPACITY
creation is invoked via menu "create transition" in the story board edit dialog,
changes are made via right mouse button click on the thumbnail of the
transition attribute.
- Modifiy Frames support of additional functions:
- set selection from alphachannel
- invert existing layermask
- apply filter on layermask
- set layermodes
......
......@@ -27,10 +27,39 @@ cd $srcdir
check_version ()
{
if expr $1 \>= $2 > /dev/null; then
echo "yes (version $1)"
VERSION_A=$1
VERSION_B=$2
save_ifs="$IFS"
IFS=.
set dummy $VERSION_A 0 0 0
MAJOR_A=$2
MINOR_A=$3
MICRO_A=$4
set dummy $VERSION_B 0 0 0
MAJOR_B=$2
MINOR_B=$3
MICRO_B=$4
IFS="$save_ifs"
if expr "$MAJOR_A" = "$MAJOR_B" > /dev/null; then
if expr "$MINOR_A" \> "$MINOR_B" > /dev/null; then
echo "yes (version $VERSION_A)"
elif expr "$MINOR_A" = "$MINOR_B" > /dev/null; then
if expr "$MICRO_A" \>= "$MICRO_B" > /dev/null; then
echo "yes (version $VERSION_A)"
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
elif expr "$MAJOR_A" \> "$MAJOR_B" > /dev/null; then
echo "Major version might be too new ($VERSION_A)"
else
echo "Too old (found version $1)!"
echo "Too old (version $VERSION_A)"
DIE=1
fi
}
......
......@@ -317,7 +317,8 @@ Internal PDB names and menu names of GIMP-GAP plug-ins
plug_in_gap_range_layer_del "<Image>/Video/Frames LayerDel"
plug_in_gap_range_to_multilayer "<Image>/Video/Frames to Image"
plug_in_gap_renumber "<Image>/Video/Frames Renumber"
plug_in_gap_shift "<Image>/Video/Framesequence Shift"
plug_in_gap_reverse "<Image>/Video/Frame Sequence Reverse"
plug_in_gap_shift "<Image>/Video/Frame Sequence Shift"
plug_in_gap_split "<Image>/Video/Split Img to Frames"
plug_in_gap_videoframes_player "<Image>/Video/Playback"
plug_in_gap_mplayer_decode "<Image>/Video/Split Video to Frames/MPlayer based extract"
......
......@@ -305,7 +305,7 @@ VID_OPACITY
VID_ZOOM_X and VID_ZOOM_Y
These records are used to define Zooming Effects
by changing the Opacity of the Videotrack slightly from one value
by scaling the Videotrack slightly from one value
to another. Zooming can be defined independet for Width (VID_ZOOM_X)
and Height (VID_ZOOM_Y).
......@@ -341,7 +341,38 @@ VID_MOVE_X and VID_MOVE_Y
DEFAULT: 0
Example:
Assume we have video master size 320x200 pixels,
+-----------+
|master |
|width: 320 |
| |
+-----------+
We use VID_ZOOM_X settings with a value of 2.0,
(also assume that automatical fit to master size is turned OFF
using VID_FIT_SIZE mode=none)
The source is an image 400 x 200 that is scaled to 800 x 200
(due to VID_ZOOM_X value of 2.0) that gives a tmp_width of 800 pixels.
Without any VID_MOVE attributes the result will be centered The normal be
+-----------+===========+-----------+
|...........|...........|...........|
|...........|.....+.....|...........|
|...........|...........|...........|
+-----------+===========+-----------+
320
|<--------->|
800
|<--------------------------------->|
We use VID_MOVE_X setting to place the image completely outside to the left border at the
first handled frame,
move_x_from = -1.0
+-----------------------------------+-----------+
......@@ -349,28 +380,26 @@ VID_MOVE_X and VID_MOVE_Y
|.................+.................|width: 320 |
|...................................| |
+-----------------------------------+-----------+
^ ^ ^
| 400 | 160 |
^ ^ 400 ^ 160 ^
| 800 |<--------------->|<--->|
|<--------------------------------->|
delta_x_offset_from_center = ((master_width /2) + (tmp_width / 2)) * move_x_from
-560 = (400 + 160) * -1.0
move_x_to = 0.5
the setting for the last handled frame places the image half outside the right border.
move_x_to = 0.5
+--+===========+--------------------+
|..|master.....|....................|
|..|width:.320.|..+.................|
|..|...........|....................|
+--+===========+--------------------+
^ ^
| 280 |
+-----+===========+-----------------+
|.....|master.....|.................|
|.....|width:.320.|.................|
|.....|...........|.................|
+-----+===========+-----------------+
^ ^ ^ ^
| | 160 | 400 |
| |<--->|<--------------->|
|<--------------------------------->|
delta_x_offset_from_center = ((master_width /2) + (tmp_width / 2)) * move_x_from
280 = (400 + 160) * 0.5
VID_FIT_SIZE
......@@ -403,10 +432,13 @@ VID_FIT_SIZE
[4] proportions ... One of the Keywords "keep_proportions" "change_proportions"
keep_proportions:
Keep proportions of the input frame at scaling.
This can lead to black stripes on top/bottom
This can lead to stripes on top/bottom
(or left/right).
especially if the resulting video is LANDSCAPE oriented
and the input frame is PORTRAIT oriented.
The stripes are transparent and show the frames
of lower video track numbers, or the black
background if there no such frames.
change_proportions:
allow proportion changes at scaling.
Stretch the image to fit the resulting
......
......@@ -61,16 +61,17 @@ Modify Frames
"Merge Layer(s) clipped to image",
"Merge Layer(s) clipped to bg-layer",
Selection
"Replace Selection",
"Add Selection",
"Subtract Selection",
"Intersect Selection",
"Selection None",
"Selection All",
"Selection Invert",
"Save Selection to Channel",
"Load Selection from Channel",
"Delete Channel (by Name)"
"Replace selection (source is the active frame)",
"Add selection (source is the active frame)",
"Subtract selection (source is the active frame)",
"Intersect selection (source is the active frame)",
"Selection none",
"Selection all",
"Selection invert",
"Selection from alpha channel (individual per frame)",
"Save selection to channel (individual per frame)",
"Load selection from channel (individual per frame)",
"Delete channel (by name)"
Layer Mask
"Add white layermask (opaque)",
"Add black layermask (transparent)",
......
"plug-in-gap-reverse"
Frame Sequence Reverse
Start from Menu:
<Image>/Video/Frame Sequence Reverse
This feature reverses the specified sequencew of frames
in the affected range.
The affected range is specified with "From Frame"
and "To Frame".
Example:
Assume tere are 10 frames:
pic_000001.xcf
pic_000002.xcf
pic_000010.xcf
After applying the Frame Sequence Reverse with settings:
From Frame: 5
To Frame: 8
the affected frames are renumbered as shown here:
old name new name
----------------------------------
pic_000005.xcf ==> pic_000008.xcf
pic_000006.xcf ==> pic_000007.xcf
pic_000007.xcf ==> pic_000006.xcf
pic_000008.xcf ==> pic_000005.xcf
......@@ -3,7 +3,7 @@
Frame Sequence Shift
Start from Menu:
<Image>/Video/Framesequence Shift
<Image>/Video/Frame Sequence Shift
This feature does cycic reordering the sequence
of the frames in the affected range.
......
"plug-in-gap-storyboard-clip-prop"
Transition Attributes (Storyboard)
The transition attributes dialog window is used to
control transitions that shall be performed on the following
clips in the same storyboard video track.
It is a popup dialog of the storyboard editor
## refere to Storyboard Dialog
## (plug-in-gap-storyboard-edit.txt)
supported transitions are:
- Opacity changes
- Moves related to the center position 0/0 (Scrolling)
- Scaling (Zoom)
The dialog has 2 previews:
The left one shows the transition effect
start settings applied on the first affected frame.
The right one shows the transition end settings applied
on the last affected frame.
The previews show the size of the resulting video (master size)
in a centered green frame and the environment around the master size
with solid grey background.
Note: the last affected frame can be different for each
single transition. In this case the preview shows only one frame
as 'last affected' using the first enabled transition.
FitSize:
Width:
Enabled: Scale width of input clips to fit into the resulting master width.
Height
Enabled: Scale height of input clips to fit into the resulting master height.
Keep Proportion
Enabled: Keep proportions of the input frame at scaling.
Opacity:
Settings for the opacity where 0 is fully transparent and 100 is fully opaque.
Move X:
Scroll settings, where 0.0 is horizontal centered, 100.0 moves the frame
entirely outside the right border of the master width.
Move Y:
Scroll settings, where 0.0 is vertical centered, 100.0 moves the frame
entirely outside the lower border of the master height.
Scale Width:
Zoom settings, where 100.0 specifies no scaling, 200.0 is scaling to double width,
50.0 is scaling down to half width.
Scale Height:
Zoom settings, where 100.0 specifies no scaling, 200.0 is scaling to double height,
50.0 is scaling dow to half height.
Frames:
Duration of the transition effect measured in frames.
Comment:
An optional comment text on the transition.
Reset
This button resets all settings to the values at opening
time of this dialog window.
......@@ -218,6 +218,8 @@ gap_storyboard_SOURCES = \
gap_story_dialog.h \
gap_story_properties.c \
gap_story_properties.h \
gap_story_att_trans_dlg.c \
gap_story_att_trans_dlg.h \
gap_player_main.h \
gap_player_dialog.c \
gap_player_dialog.h \
......
......@@ -64,6 +64,7 @@ extern int gap_debug; /* ==0 ... dont print debug infos */
#define GAP_HELP_ID_EXCHANGE "plug-in-gap-exchg"
#define GAP_HELP_ID_RENUMBER "plug-in-gap-renumber"
#define GAP_HELP_ID_SHIFT "plug-in-gap-shift"
#define GAP_HELP_ID_REVERSE "plug-in-gap-reverse"
/* ------------------------
......@@ -840,11 +841,109 @@ p_shift(GapAnimInfo *ainfo_ptr, long cnt, long range_from, long range_to)
} /* end p_shift */
/* ============================================================================
* p_reverse
*
* all frames in the given range are renumbered in reverse order
*
* example: range before 3, 4, 5, 6, 7
* range after 7, 6, 5, 4, 3
*
* return image_id (of the new loaded frame) on success
* or -1 on errors
* ============================================================================
*/
static gint32
p_reverse(GapAnimInfo *ainfo_ptr, long range_from, long range_to)
{
long l_tmp_nr;
long l_lo, l_hi, l_curr;
long l_swap;
gchar *tmp_errtxt;
gdouble l_percentage;
l_tmp_nr = ainfo_ptr->last_frame_nr + 4; /* use a free frame_nr for temp name */
if(gap_debug) fprintf(stderr, "DEBUG p_reverse fr:%d to:%d\n",
(int)range_from, (int)range_to);
if(range_from == range_to) return -1;
/* clip range */
if(range_from > ainfo_ptr->last_frame_nr) range_from = ainfo_ptr->last_frame_nr;
if(range_to > ainfo_ptr->last_frame_nr) range_to = ainfo_ptr->last_frame_nr;
if(range_from < ainfo_ptr->first_frame_nr) range_from = ainfo_ptr->first_frame_nr;
if(range_to < ainfo_ptr->first_frame_nr) range_to = ainfo_ptr->first_frame_nr;
if(range_to < range_from)
{
l_lo = range_to;
l_hi = range_from;
}
else
{
l_lo = range_from;
l_hi = range_to;
}
if(l_hi <= l_lo) return -1;
if(gap_lib_gap_check_save_needed(ainfo_ptr->image_id))
{
if(gap_lib_save_named_frame(ainfo_ptr->image_id, ainfo_ptr->old_filename) < 0)
return -1;
}
l_percentage = 0.0;
if(ainfo_ptr->run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_progress_init( _("Renumber frame sequence..."));
}
/* swap lo with high for each of the (first half of the) frames */
for(l_curr = l_lo; l_curr < l_lo + ((l_hi - l_lo + 1) / 2); l_curr++)
{
l_swap = l_hi - (l_curr - l_lo);
/* rename hi to temp */
if(0 != gap_lib_rename_frame(ainfo_ptr, l_swap, l_tmp_nr))
{
tmp_errtxt = g_strdup_printf(_("Error: could not rename frame %ld to %ld"), l_swap, l_tmp_nr);
gap_arr_msg_win(ainfo_ptr->run_mode, tmp_errtxt);
g_free(tmp_errtxt);
return -1;
}
/* rename lo to hi */
if(0 != gap_lib_rename_frame(ainfo_ptr, l_curr, l_swap))
{
tmp_errtxt = g_strdup_printf(_("Error: could not rename frame %ld to %ld"), ainfo_ptr->curr_frame_nr, l_swap);
gap_arr_msg_win(ainfo_ptr->run_mode, tmp_errtxt);
g_free(tmp_errtxt);
return -1;
}
/* rename temp to lo */
if(0 != gap_lib_rename_frame(ainfo_ptr, l_tmp_nr, l_curr))
{
tmp_errtxt = g_strdup_printf(_("Error: could not rename frame %ld to %ld"), l_tmp_nr, ainfo_ptr->curr_frame_nr);
gap_arr_msg_win(ainfo_ptr->run_mode, tmp_errtxt);
g_free(tmp_errtxt);
return -1;
}
if (ainfo_ptr->run_mode == GIMP_RUN_INTERACTIVE)
{
l_percentage = (double)((l_curr - l_lo + 1) / ((l_hi - l_lo + 1) / 2.0 ));
if (l_percentage > 1.0) l_percentage = 1.0;
gimp_progress_update (l_percentage);
}
}
/* load from the "new" current frame */
if(ainfo_ptr->new_filename != NULL) g_free(ainfo_ptr->new_filename);
ainfo_ptr->new_filename = gap_lib_alloc_fname(ainfo_ptr->basename,
ainfo_ptr->curr_frame_nr,
ainfo_ptr->extension);
return(gap_lib_load_named_frame(ainfo_ptr->image_id, ainfo_ptr->new_filename));
} /* end p_reverse */
/* ============================================================================
* gap_base_next gap_base_prev
......@@ -1629,7 +1728,58 @@ p_shift_dialog(GapAnimInfo *ainfo_ptr, long *range_from, long *range_to)
}
} /* end p_shift_dialog */
} /* end p_shift_dialog */
/* ============================================================================
* p_reverse_dialog
* returns range_to - range_from
* ============================================================================
*/
gint32
p_reverse_dialog(GapAnimInfo *ainfo_ptr, long *range_from, long *range_to)
{
static GapArrArg argv[3];
gchar *l_title;
l_title = g_strdup_printf (_("Frame Sequence reverse (%ld/%ld)")
, ainfo_ptr->curr_frame_nr
, ainfo_ptr->frame_cnt);
gap_arr_arg_init(&argv[0], GAP_ARR_WGT_INT_PAIR);
argv[0].label_txt = _("From Frame:");
argv[0].constraint = TRUE;
argv[0].int_min = (gint)ainfo_ptr->first_frame_nr;
argv[0].int_max = (gint)ainfo_ptr->last_frame_nr;
argv[0].int_ret = (gint)ainfo_ptr->curr_frame_nr;
argv[0].help_txt = _("Affected range starts at this framenumber");
gap_arr_arg_init(&argv[1], GAP_ARR_WGT_INT_PAIR);
argv[1].label_txt = _("To Frame:");
argv[1].constraint = TRUE;
argv[1].int_min = (gint)ainfo_ptr->first_frame_nr;
argv[1].int_max = (gint)ainfo_ptr->last_frame_nr;
argv[1].int_ret = (gint)ainfo_ptr->last_frame_nr;
argv[1].help_txt = _("Affected range ends at this framenumber");
gap_arr_arg_init(&argv[2], GAP_ARR_WGT_HELP_BUTTON);
argv[2].help_id = GAP_HELP_ID_REVERSE;
if(TRUE == gap_arr_ok_cancel_dialog(l_title, _("Frame Sequence Reverse"), 3, argv))
{
g_free (l_title);
*range_from = (long)(argv[0].int_ret);
*range_to = (long)(argv[1].int_ret);
return (int)((long)(argv[1].int_ret) - (long)(argv[0].int_ret));
}
else
{
g_free (l_title);
return 0;
}
} /* end p_reverse_dialog */
/* ============================================================================
......@@ -1686,9 +1836,63 @@ gap_base_shift(GimpRunMode run_mode, gint32 image_id, int nr,
return(rc);
} /* end gap_base_shift */
} /* end gap_base_shift */
/* ============================================================================
* gap_base_reverse
* ============================================================================
*/
gint32
gap_base_reverse(GimpRunMode run_mode, gint32 image_id,
long range_from, long range_to)
{
int rc;
GapAnimInfo *ainfo_ptr;
long l_cnt, l_from, l_to;
rc = -1;
ainfo_ptr = gap_lib_alloc_ainfo(image_id, run_mode);
if(ainfo_ptr != NULL)
{
if (0 == gap_lib_dir_ainfo(ainfo_ptr))
{
if(run_mode == GIMP_RUN_INTERACTIVE)
{
l_cnt = 1;
if(0 != gap_lib_chk_framechange(ainfo_ptr)) { l_cnt = 0; }
else { l_cnt = p_reverse_dialog(ainfo_ptr, &l_from, &l_to); }
/* note: 'p_reverse_dialog' returns 'to' minus 'from' */
if((0 != gap_lib_chk_framechange(ainfo_ptr)) || (l_cnt == 0))
{
l_cnt = 0;
}
}
else
{
l_from = range_from;
l_to = range_to;
l_cnt = l_to - l_from;
}
if(l_cnt != 0)
{
/* reverse framesquence
* (renames all frames in the given range on disk)
*/
rc = p_reverse(ainfo_ptr, l_from, l_to);
}
}
gap_lib_free_ainfo(&ainfo_ptr);
}
return(rc);
} /* end gap_base_reverse */
/* --------------------------------
* p_renumber_dialog
......
......@@ -47,6 +47,7 @@ gint32 gap_base_dup(GimpRunMode run_mode, gint32 image_id, int nr, long range_fr
gint32 gap_base_del(GimpRunMode run_mode, gint32 image_id, int nr);
gint32 gap_base_exchg(GimpRunMode run_mode, gint32 image_id, int nr);
gint32 gap_base_shift(GimpRunMode run_mode, gint32 image_id, int nr, long range_from, long range_to);
gint32 gap_base_reverse(GimpRunMode run_mode, gint32 image_id, long range_from, long range_to);
gint32 gap_base_renumber(GimpRunMode run_mode, gint32 image_id,
long start_frame_nr, long digits);
......
......@@ -490,21 +490,22 @@ gap_layer_new_from_buffer(gint32 image_id
/* ----------------------------------------------------
* gap_layer_clear_to_color
* ----------------------------------------------------
* set layer to unique color
* set layer to unique color
* (color channels are specified within range 0.0 up to 1.0)
*/
void
gap_layer_clear_to_color(gint32 layer_id
,guchar red
,guchar green
,guchar blue
,guchar alpha
,gdouble red
,gdouble green
,gdouble blue
,gdouble alpha
)
{
gint32 image_id;
image_id = gimp_drawable_get_image(layer_id);
if(alpha==0)
if(alpha==0.0)
{
gimp_selection_none(image_id);
gimp_edit_clear(layer_id);
......@@ -512,15 +513,32 @@ gap_layer_clear_to_color(gint32 layer_id
else
{