• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GIMP_TOOL_CLASS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GIMP_TOOL_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ GIMP_TOOL_CLASS函数的具体用法?C++ GIMP_TOOL_CLASS怎么用?C++ GIMP_TOOL_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GIMP_TOOL_CLASS函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gimp_rectangle_select_tool_control

static void
gimp_rectangle_select_tool_control (GimpTool       *tool,
                                    GimpToolAction  action,
                                    GimpDisplay    *display)
{
  gimp_rectangle_tool_control (tool, action, display);

  GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
}
开发者ID:Anstep,项目名称:gimp,代码行数:9,代码来源:gimprectangleselecttool.c


示例2: gimp_dodge_burn_tool_class_init

static void
gimp_dodge_burn_tool_class_init (GimpDodgeBurnToolClass *klass)
{
  GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);

  tool_class->modifier_key  = gimp_dodge_burn_tool_modifier_key;
  tool_class->cursor_update = gimp_dodge_burn_tool_cursor_update;
  tool_class->oper_update   = gimp_dodge_burn_tool_oper_update;
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:9,代码来源:gimpdodgeburntool.c


示例3: gimp_threshold_tool_initialize

static gboolean
gimp_threshold_tool_initialize (GimpTool     *tool,
                                GimpDisplay  *display,
                                GError      **error)
{
  GimpThresholdTool *t_tool      = GIMP_THRESHOLD_TOOL (tool);
  GimpFilterTool    *filter_tool = GIMP_FILTER_TOOL (tool);
  GimpImage         *image       = gimp_display_get_image (display);
  GimpDrawable      *drawable    = gimp_image_get_active_drawable (image);
  gdouble            low;
  gdouble            high;
  gint               n_bins;

  if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
    {
      return FALSE;
    }

  g_clear_object (&t_tool->histogram_async);

  g_object_get (filter_tool->config,
                "low",  &low,
                "high", &high,
                NULL);

  /* this is a hack to make sure that
   * 'gimp_histogram_n_bins (t_tool->histogram)' returns the correct value for
   * 'drawable' before the asynchronous calculation of its histogram is
   * finished.
   */
  {
    GeglBuffer *temp;

    temp = gegl_buffer_new (GEGL_RECTANGLE (0, 0, 1, 1),
                            gimp_drawable_get_format (drawable));

    gimp_histogram_calculate (t_tool->histogram,
                              temp, GEGL_RECTANGLE (0, 0, 1, 1),
                              NULL, NULL);

    g_object_unref (temp);
  }

  n_bins = gimp_histogram_n_bins (t_tool->histogram);

  t_tool->histogram_async = gimp_drawable_calculate_histogram_async (
    drawable, t_tool->histogram, FALSE);
  gimp_histogram_view_set_histogram (t_tool->histogram_box->view,
                                     t_tool->histogram);

  gimp_histogram_view_set_range (t_tool->histogram_box->view,
                                 low  * (n_bins - 0.0001),
                                 high * (n_bins - 0.0001));

  return TRUE;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:56,代码来源:gimpthresholdtool.c


示例4: gimp_bucket_fill_tool_class_init

static void
gimp_bucket_fill_tool_class_init (GimpBucketFillToolClass *klass)
{
  GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);

  tool_class->initialize     = gimp_bucket_fill_tool_initialize;
  tool_class->button_release = gimp_bucket_fill_tool_button_release;
  tool_class->modifier_key   = gimp_bucket_fill_tool_modifier_key;
  tool_class->cursor_update  = gimp_bucket_fill_tool_cursor_update;
}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:10,代码来源:gimpbucketfilltool.c


示例5: gimp_crop_tool_cursor_update

static void
gimp_crop_tool_cursor_update (GimpTool         *tool,
                              const GimpCoords *coords,
                              GdkModifierType   state,
                              GimpDisplay      *display)
{
  gimp_rectangle_tool_cursor_update (tool, coords, state, display);

  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:10,代码来源:gimpcroptool.c


示例6: gimp_mybrush_tool_class_init

static void
gimp_mybrush_tool_class_init (GimpMybrushToolClass *klass)
{
  GimpToolClass      *tool_class       = GIMP_TOOL_CLASS (klass);
  GimpPaintToolClass *paint_tool_class = GIMP_PAINT_TOOL_CLASS (klass);

  tool_class->options_notify    = gimp_mybrush_tool_options_notify;

  paint_tool_class->get_outline = gimp_mybrush_tool_get_outline;
}
开发者ID:Distrotech,项目名称:gimp,代码行数:10,代码来源:gimpmybrushtool.c


示例7: gimp_selection_tool_class_init

static void
gimp_selection_tool_class_init (GimpSelectionToolClass *klass)
{
  GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);

  tool_class->modifier_key  = gimp_selection_tool_modifier_key;
  tool_class->key_press     = gimp_edit_selection_tool_key_press;
  tool_class->oper_update   = gimp_selection_tool_oper_update;
  tool_class->cursor_update = gimp_selection_tool_cursor_update;
}
开发者ID:DevMaggio,项目名称:gimp,代码行数:10,代码来源:gimpselectiontool.c


示例8: gimp_curves_tool_button_release

static void
gimp_curves_tool_button_release (GimpTool              *tool,
                                 const GimpCoords      *coords,
                                 guint32                time,
                                 GdkModifierType        state,
                                 GimpButtonReleaseType  release_type,
                                 GimpDisplay           *display)
{
  GimpCurvesTool   *c_tool  = GIMP_CURVES_TOOL (tool);
  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (tool);
  GimpCurvesConfig *config  = GIMP_CURVES_CONFIG (im_tool->config);

  if (state & gimp_get_extend_selection_mask ())
    {
      GimpCurve *curve = config->curve[config->channel];
      gdouble    value = c_tool->picked_color[config->channel];
      gint       closest;

      closest = gimp_curve_get_closest_point (curve, value);

      gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
                                    closest);

      gimp_curve_set_point (curve, closest,
                            value, gimp_curve_map_value (curve, value));
    }
  else if (state & gimp_get_toggle_behavior_mask ())
    {
      GimpHistogramChannel channel;

      for (channel = GIMP_HISTOGRAM_VALUE;
           channel <= GIMP_HISTOGRAM_ALPHA;
           channel++)
        {
          GimpCurve *curve = config->curve[channel];
          gdouble    value = c_tool->picked_color[channel];
          gint       closest;

          if (value != -1)
            {
              closest = gimp_curve_get_closest_point (curve, value);

              gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
                                            closest);

              gimp_curve_set_point (curve, closest,
                                    value, gimp_curve_map_value (curve, value));
            }
        }
    }

  /*  chain up to halt the tool */
  GIMP_TOOL_CLASS (parent_class)->button_release (tool, coords, time, state,
                                                  release_type, display);
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:55,代码来源:gimpcurvestool.c


示例9: gimp_flip_tool_class_init

static void
gimp_flip_tool_class_init (GimpFlipToolClass *klass)
{
  GimpToolClass          *tool_class  = GIMP_TOOL_CLASS (klass);
  GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);

  tool_class->modifier_key  = gimp_flip_tool_modifier_key;
  tool_class->cursor_update = gimp_flip_tool_cursor_update;

  trans_class->transform    = gimp_flip_tool_transform;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:11,代码来源:gimpfliptool.c


示例10: gimp_sample_point_tool_class_init

static void
gimp_sample_point_tool_class_init (GimpSamplePointToolClass *klass)
{
  GimpToolClass     *tool_class      = GIMP_TOOL_CLASS (klass);
  GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);

  tool_class->button_release = gimp_sample_point_tool_button_release;
  tool_class->motion         = gimp_sample_point_tool_motion;

  draw_tool_class->draw      = gimp_sample_point_tool_draw;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:11,代码来源:gimpsamplepointtool.c


示例11: gimp_guide_tool_class_init

static void
gimp_guide_tool_class_init (GimpGuideToolClass *klass)
{
  GimpToolClass     *tool_class      = GIMP_TOOL_CLASS (klass);
  GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);

  tool_class->button_release = gimp_guide_tool_button_release;
  tool_class->motion         = gimp_guide_tool_motion;

  draw_tool_class->draw      = gimp_guide_tool_draw;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:11,代码来源:gimpguidetool.c


示例12: gimp_color_tool_cursor_update

static void
gimp_color_tool_cursor_update (GimpTool         *tool,
                               const GimpCoords *coords,
                               GdkModifierType   state,
                               GimpDisplay      *display)
{
  GimpColorTool *color_tool = GIMP_COLOR_TOOL (tool);
  GimpImage     *image      = gimp_display_get_image (display);

  if (color_tool->enabled)
    {
      if (color_tool->sample_point)
        {
          gimp_tool_set_cursor (tool, display,
                                GIMP_CURSOR_MOUSE,
                                GIMP_TOOL_CURSOR_COLOR_PICKER,
                                GIMP_CURSOR_MODIFIER_MOVE);
        }
      else
        {
          GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_BAD;

          if (gimp_image_coords_in_active_pickable (image, coords,
                                                    color_tool->options->sample_merged,
                                                    FALSE))
            {
              switch (color_tool->pick_mode)
                {
                case GIMP_COLOR_PICK_MODE_NONE:
                  modifier = GIMP_CURSOR_MODIFIER_NONE;
                  break;
                case GIMP_COLOR_PICK_MODE_FOREGROUND:
                  modifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
                  break;
                case GIMP_COLOR_PICK_MODE_BACKGROUND:
                  modifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
                  break;
                case GIMP_COLOR_PICK_MODE_PALETTE:
                  modifier = GIMP_CURSOR_MODIFIER_PLUS;
                  break;
                }
            }

          gimp_tool_set_cursor (tool, display,
                                GIMP_CURSOR_COLOR_PICKER,
                                GIMP_TOOL_CURSOR_COLOR_PICKER,
                                modifier);
        }

      return;  /*  don't chain up  */
    }

  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:54,代码来源:gimpcolortool.c


示例13: gimp_rectangle_select_tool_oper_update

static void
gimp_rectangle_select_tool_oper_update (GimpTool         *tool,
                                        const GimpCoords *coords,
                                        GdkModifierType   state,
                                        gboolean          proximity,
                                        GimpDisplay      *display)
{
  gimp_rectangle_tool_oper_update (tool, coords, state, proximity, display);

  GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
                                               display);
}
开发者ID:vidyashree,项目名称:gimp-tito,代码行数:12,代码来源:gimprectangleselecttool.c


示例14: gimp_rectangle_select_tool_active_modifier_key

static void
gimp_rectangle_select_tool_active_modifier_key (GimpTool        *tool,
                                                GdkModifierType  key,
                                                gboolean         press,
                                                GdkModifierType  state,
                                                GimpDisplay     *display)
{
  GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool, key, press, state,
                                                       display);

  gimp_rectangle_tool_active_modifier_key (tool, key, press, state, display);
}
开发者ID:vidyashree,项目名称:gimp-tito,代码行数:12,代码来源:gimprectangleselecttool.c


示例15: gimp_eraser_tool_cursor_update

static void
gimp_eraser_tool_cursor_update (GimpTool         *tool,
                                const GimpCoords *coords,
                                GdkModifierType   state,
                                GimpDisplay      *display)
{
  GimpEraserOptions *options = GIMP_ERASER_TOOL_GET_OPTIONS (tool);

  gimp_tool_control_set_toggled (tool->control, options->anti_erase);

  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:12,代码来源:gimperasertool.c


示例16: gimp_foreground_select_tool_key_press

static gboolean
gimp_foreground_select_tool_key_press (GimpTool    *tool,
                                       GdkEventKey *kevent,
                                       GimpDisplay *display)
{
  GimpForegroundSelectTool *fg_select = GIMP_FOREGROUND_SELECT_TOOL (tool);

  if (display != tool->display)
    return FALSE;

  if (fg_select->state == MATTING_STATE_PAINT_TRIMAP)
    {
      switch (kevent->keyval)
        {
        case GDK_KEY_Return:
        case GDK_KEY_KP_Enter:
        case GDK_KEY_ISO_Enter:
          gimp_foreground_select_tool_response (fg_select->gui, RESPONSE_PREVIEW, fg_select);
          return TRUE;

        case GDK_KEY_Escape:
          gimp_foreground_select_tool_response (fg_select->gui, RESPONSE_RESET, fg_select);
          return TRUE;

        default:
          return FALSE;
        }
    }
  else if (fg_select->state == MATTING_STATE_PREVIEW_MASK)
    {
      switch (kevent->keyval)
        {
        case GDK_KEY_Return:
        case GDK_KEY_KP_Enter:
        case GDK_KEY_ISO_Enter:
          gimp_foreground_select_tool_response (fg_select->gui, RESPONSE_APPLY, fg_select);
          return TRUE;

        case GDK_KEY_Escape:
          gimp_foreground_select_tool_response (fg_select->gui, RESPONSE_PREVIEW, fg_select);
          return TRUE;

        default:
          return FALSE;
        }
    }
  else
    {
      return GIMP_TOOL_CLASS (parent_class)->key_press (tool,
                                                        kevent,
                                                        display);
    }
}
开发者ID:ChristianBusch,项目名称:gimp,代码行数:53,代码来源:gimpforegroundselecttool.c


示例17: gimp_convolve_tool_cursor_update

static void
gimp_convolve_tool_cursor_update (GimpTool         *tool,
                                  const GimpCoords *coords,
                                  GdkModifierType   state,
                                  GimpDisplay      *display)
{
  GimpConvolveOptions *options = GIMP_CONVOLVE_TOOL_GET_OPTIONS (tool);

  gimp_tool_control_set_toggled (tool->control,
                                 (options->type == GIMP_SHARPEN_CONVOLVE));

  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
开发者ID:DevMaggio,项目名称:gimp,代码行数:13,代码来源:gimpconvolvetool.c


示例18: gimp_mybrush_tool_options_notify

static void
gimp_mybrush_tool_options_notify (GimpTool         *tool,
                                  GimpToolOptions  *options,
                                  const GParamSpec *pspec)
{
  GIMP_TOOL_CLASS (parent_class)->options_notify (tool, options, pspec);

  if (! strcmp (pspec->name, "radius"))
    {
      gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
      gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
    }
}
开发者ID:Distrotech,项目名称:gimp,代码行数:13,代码来源:gimpmybrushtool.c


示例19: gimp_dodge_burn_tool_cursor_update

static void
gimp_dodge_burn_tool_cursor_update (GimpTool        *tool,
                                    GimpCoords      *coords,
                                    GdkModifierType  state,
                                    GimpDisplay     *display)
{
  GimpDodgeBurnOptions *options = GIMP_DODGE_BURN_TOOL_GET_OPTIONS (tool);

  gimp_tool_control_set_toggled (tool->control, (options->type == GIMP_BURN));

  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state,
                                                 display);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:13,代码来源:gimpdodgeburntool.c


示例20: gimp_levels_tool_initialize

static gboolean
gimp_levels_tool_initialize (GimpTool     *tool,
                             GimpDisplay  *display,
                             GError      **error)
{
  GimpLevelsTool *l_tool   = GIMP_LEVELS_TOOL (tool);
  GimpDrawable   *drawable = gimp_image_get_active_drawable (display->image);

  if (! drawable)
    return FALSE;

  if (gimp_drawable_is_indexed (drawable))
    {
      g_set_error (error, 0, 0,
                   _("Levels does not operate on indexed layers."));
      return FALSE;
    }

  if (! l_tool->hist)
    l_tool->hist = gimp_histogram_new ();

  levels_init (l_tool->levels);

  l_tool->channel = GIMP_HISTOGRAM_VALUE;
  l_tool->color   = gimp_drawable_is_rgb (drawable);
  l_tool->alpha   = gimp_drawable_has_alpha (drawable);

  if (l_tool->active_picker)
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (l_tool->active_picker),
                                  FALSE);

  GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);

  gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
                                      levels_menu_sensitivity, l_tool, NULL);

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
                                 l_tool->channel);

  /* FIXME: hack */
  if (! l_tool->color)
    l_tool->channel = (l_tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;

  levels_update (l_tool, ALL);

  gimp_drawable_calculate_histogram (drawable, l_tool->hist);
  gimp_histogram_view_set_histogram (GIMP_HISTOGRAM_VIEW (l_tool->hist_view),
                                     l_tool->hist);

  return TRUE;
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:51,代码来源:gimplevelstool.c



注:本文中的GIMP_TOOL_CLASS函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GIMP_UNDO_CLASS函数代码示例发布时间:2022-05-30
下一篇:
C++ GIMP_TOOL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap