Пример #1
0
static void
gimp_blend_tool_create_filter (GimpBlendTool *blend_tool,
                               GimpDrawable  *drawable)
{
  GimpBlendOptions *options = GIMP_BLEND_TOOL_GET_OPTIONS (blend_tool);
  GimpContext      *context = GIMP_CONTEXT (options);

  if (! blend_tool->graph)
    gimp_blend_tool_create_graph (blend_tool);

  blend_tool->filter = gimp_drawable_filter_new (drawable,
                                                 C_("undo-type", "Blend"),
                                                 blend_tool->graph,
                                                 GIMP_STOCK_TOOL_BLEND);

  gimp_drawable_filter_set_region (blend_tool->filter,
                                   GIMP_FILTER_REGION_DRAWABLE);
  gimp_drawable_filter_set_opacity (blend_tool->filter,
                                    gimp_context_get_opacity (context));
  gimp_drawable_filter_set_mode (blend_tool->filter,
                                 gimp_context_get_paint_mode (context));

  g_signal_connect (blend_tool->filter, "flush",
                    G_CALLBACK (gimp_blend_tool_filter_flush),
                    blend_tool);
}
Пример #2
0
static void
gimp_seamless_clone_tool_create_filter (GimpSeamlessCloneTool *sc,
                                        GimpDrawable          *drawable)
{
  if (! sc->render_node)
    gimp_seamless_clone_tool_create_render_node (sc);

  sc->filter = gimp_drawable_filter_new (drawable,
                                         _("Seamless Clone"),
                                         sc->render_node,
                                         GIMP_ICON_TOOL_SEAMLESS_CLONE);

  gimp_drawable_filter_set_region (sc->filter, GIMP_FILTER_REGION_DRAWABLE);

  g_signal_connect (sc->filter, "flush",
                    G_CALLBACK (gimp_seamless_clone_tool_filter_flush),
                    sc);
}
Пример #3
0
static void
gimp_warp_tool_create_filter (GimpWarpTool *wt,
                              GimpDrawable *drawable)
{
  if (! wt->graph)
    gimp_warp_tool_create_graph (wt);

  wt->filter = gimp_drawable_filter_new (drawable,
                                         _("Warp transform"),
                                         wt->graph,
                                         GIMP_STOCK_TOOL_WARP);

  gimp_drawable_filter_set_region (wt->filter, GIMP_FILTER_REGION_DRAWABLE);

#if 0
  g_object_set (wt->filter, "gegl-caching", TRUE, NULL);
#endif

  g_signal_connect (wt->filter, "flush",
                    G_CALLBACK (gimp_warp_tool_filter_flush),
                    wt);
}