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

C++ GIMP_IMAGE_MAP_TOOL函数代码示例

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

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



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

示例1: gimp_curves_tool_color_picked

static void
gimp_curves_tool_color_picked (GimpColorTool      *color_tool,
                               GimpColorPickState  pick_state,
                               gdouble             x,
                               gdouble             y,
                               const Babl         *sample_format,
                               gpointer            pixel,
                               const GimpRGB      *color)
{
  GimpCurvesTool   *tool    = GIMP_CURVES_TOOL (color_tool);
  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (color_tool);
  GimpCurvesConfig *config  = GIMP_CURVES_CONFIG (im_tool->config);
  GimpDrawable     *drawable;

  drawable = GIMP_IMAGE_MAP_TOOL (tool)->drawable;

  tool->picked_color[GIMP_HISTOGRAM_RED]   = color->r;
  tool->picked_color[GIMP_HISTOGRAM_GREEN] = color->g;
  tool->picked_color[GIMP_HISTOGRAM_BLUE]  = color->b;

  if (gimp_drawable_has_alpha (drawable))
    tool->picked_color[GIMP_HISTOGRAM_ALPHA] = color->a;
  else
    tool->picked_color[GIMP_HISTOGRAM_ALPHA] = -1;

  tool->picked_color[GIMP_HISTOGRAM_VALUE] = MAX (MAX (color->r, color->g),
                                                  color->b);

  gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
                            tool->picked_color[config->channel]);
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:31,代码来源:gimpcurvestool.c


示例2: gimp_image_map_tool_edit_as

void
gimp_image_map_tool_edit_as (GimpImageMapTool *im_tool,
                             const gchar      *new_tool_id,
                             GimpConfig       *config)
{
  GimpDisplay  *display;
  GimpContext  *user_context;
  GimpToolInfo *tool_info;
  GimpTool     *new_tool;

  g_return_if_fail (GIMP_IS_IMAGE_MAP_TOOL (im_tool));
  g_return_if_fail (new_tool_id);
  g_return_if_fail (GIMP_IS_CONFIG (config));

  display = GIMP_TOOL (im_tool)->display;

  user_context = gimp_get_user_context (display->gimp);

  tool_info = (GimpToolInfo *)
    gimp_container_get_child_by_name (display->gimp->tool_info_list,
                                      new_tool_id);

  gimp_context_set_tool (user_context, tool_info);
  tool_manager_initialize_active (display->gimp, display);

  new_tool = tool_manager_get_active (display->gimp);

  GIMP_IMAGE_MAP_TOOL (new_tool)->default_config = g_object_ref (config);

  gimp_image_map_tool_reset (GIMP_IMAGE_MAP_TOOL (new_tool));
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:31,代码来源:gimpimagemaptool.c


示例3: gimp_image_map_tool_options_notify

static void
gimp_image_map_tool_options_notify (GimpTool         *tool,
                                    GimpToolOptions  *options,
                                    const GParamSpec *pspec)
{
  GimpImageMapTool    *image_map_tool = GIMP_IMAGE_MAP_TOOL (tool);
  GimpImageMapOptions *im_options     = GIMP_IMAGE_MAP_OPTIONS (options);

  if (! strcmp (pspec->name, "preview") &&
      image_map_tool->image_map)
    {
      if (im_options->preview)
        {
          gimp_tool_control_push_preserve (tool->control, TRUE);

          gimp_image_map_tool_map (image_map_tool);

          gimp_tool_control_pop_preserve (tool->control);
        }
      else
        {
          gimp_tool_control_push_preserve (tool->control, TRUE);

          gimp_image_map_abort (image_map_tool->image_map);

          gimp_tool_control_pop_preserve (tool->control);
        }
    }
  else if (! strcmp (pspec->name, "region") &&
           image_map_tool->image_map)
    {
      gimp_image_map_set_region (image_map_tool->image_map, im_options->region);
      gimp_image_map_tool_preview (image_map_tool);
    }
}
开发者ID:K-Sonoda,项目名称:gimp,代码行数:35,代码来源:gimpimagemaptool.c


示例4: gimp_colorize_tool_config_notify

static void
gimp_colorize_tool_config_notify (GObject          *object,
                                  GParamSpec       *pspec,
                                  GimpColorizeTool *col_tool)
{
  GimpColorizeConfig *config = GIMP_COLORIZE_CONFIG (object);

  if (! col_tool->hue_data)
    return;

  if (! strcmp (pspec->name, "hue"))
    {
      gtk_adjustment_set_value (col_tool->hue_data,
                                config->hue * 360.0);
    }
  else if (! strcmp (pspec->name, "saturation"))
    {
      gtk_adjustment_set_value (col_tool->saturation_data,
                                config->saturation * 100.0);
    }
  else if (! strcmp (pspec->name, "lightness"))
    {
      gtk_adjustment_set_value (col_tool->lightness_data,
                                config->lightness * 100.0);
    }

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (col_tool));
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:28,代码来源:gimpcolorizetool.c


示例5: gimp_colorize_tool_initialize

static gboolean
gimp_colorize_tool_initialize (GimpTool     *tool,
                               GimpDisplay  *display,
                               GError      **error)
{
  GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (tool);
  GimpDrawable     *drawable = gimp_image_get_active_drawable (display->image);

  if (! drawable)
    return FALSE;

  if (! gimp_drawable_is_rgb (drawable))
    {
      g_set_error (error, 0, 0,
                   _("Colorize operates only on RGB color layers."));
      return FALSE;
    }

  gimp_config_reset (GIMP_CONFIG (col_tool->config));

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

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));

  return TRUE;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:26,代码来源:gimpcolorizetool.c


示例6: gimp_desaturate_tool_initialize

static gboolean
gimp_desaturate_tool_initialize (GimpTool     *tool,
                                GimpDisplay  *display,
                                GError      **error)
{
  GimpDesaturateTool *desaturate_tool = GIMP_DESATURATE_TOOL (tool);
  GimpDrawable       *drawable;

  drawable = gimp_image_get_active_drawable (display->image);

  if (! drawable)
    return FALSE;

  if (! gimp_drawable_is_rgb (drawable))
    {
      g_set_error (error, 0, 0,
                   _("Desaturate does only operate on RGB layers."));
      return FALSE;
    }

  gimp_config_reset (GIMP_CONFIG (desaturate_tool->config));

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

  gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (desaturate_tool->button),
                                   desaturate_tool->config->mode);

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (desaturate_tool));

  return TRUE;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:31,代码来源:gimpdesaturatetool.c


示例7: gimp_operation_tool_dialog

static void
gimp_operation_tool_dialog (GimpImageMapTool *image_map_tool)
{
  GimpOperationTool *tool = GIMP_OPERATION_TOOL (image_map_tool);
  GtkWidget         *main_vbox;

  main_vbox = gimp_image_map_tool_dialog_get_vbox (image_map_tool);

  /*  The options vbox  */
  tool->options_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_box_pack_start (GTK_BOX (main_vbox), tool->options_box,
                      FALSE, FALSE, 0);
  gtk_widget_show (tool->options_box);

  if (tool->options_table)
    {
      gtk_container_add (GTK_CONTAINER (tool->options_box),
                         tool->options_table);
      gtk_widget_show (tool->options_table);
    }

  if (tool->undo_desc)
    g_object_set (GIMP_IMAGE_MAP_TOOL (tool)->dialog,
                  "description", tool->undo_desc,
                  NULL);
}
开发者ID:AnonPower,项目名称:picman,代码行数:26,代码来源:gimpoperationtool.c


示例8: gimp_curves_tool_color_picked

static void
gimp_curves_tool_color_picked (GimpColorTool      *color_tool,
                               GimpColorPickState  pick_state,
                               GimpImageType       sample_type,
                               GimpRGB            *color,
                               gint                color_index)
{
  GimpCurvesTool *tool = GIMP_CURVES_TOOL (color_tool);
  GimpDrawable   *drawable;

  drawable = GIMP_IMAGE_MAP_TOOL (tool)->drawable;

  tool->picked_color[GIMP_HISTOGRAM_RED]   = color->r;
  tool->picked_color[GIMP_HISTOGRAM_GREEN] = color->g;
  tool->picked_color[GIMP_HISTOGRAM_BLUE]  = color->b;

  if (gimp_drawable_has_alpha (drawable))
    tool->picked_color[GIMP_HISTOGRAM_ALPHA] = color->a;

  tool->picked_color[GIMP_HISTOGRAM_VALUE] = MAX (MAX (color->r, color->g),
                                                  color->b);

  gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
                            tool->picked_color[tool->config->channel]);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:25,代码来源:gimpcurvestool.c


示例9: gimp_posterize_tool_initialize

static gboolean
gimp_posterize_tool_initialize (GimpTool     *tool,
                                GimpDisplay  *display,
                                GError      **error)
{
  GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (tool);
  GimpImage         *image          = gimp_display_get_image (display);
  GimpDrawable      *drawable;

  drawable = gimp_image_get_active_drawable (image);

  if (! drawable)
    return FALSE;

  if (gimp_drawable_is_indexed (drawable))
    {
      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
			   _("Posterize does not operate on indexed layers."));
      return FALSE;
    }

  gimp_config_reset (GIMP_CONFIG (posterize_tool->config));

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

  gtk_adjustment_set_value (posterize_tool->levels_data,
                            posterize_tool->config->levels);

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (posterize_tool));

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


示例10: brightness_contrast_config_notify

static void
brightness_contrast_config_notify (GObject                    *object,
                                   GParamSpec                 *pspec,
                                   GimpBrightnessContrastTool *bc_tool)
{
  GimpBrightnessContrastConfig *config;

  config = GIMP_BRIGHTNESS_CONTRAST_CONFIG (object);

  if (! bc_tool->brightness_data)
    return;

  if (! strcmp (pspec->name, "brightness"))
    {
      gtk_adjustment_set_value (bc_tool->brightness_data,
                                config->brightness * 127.0);
    }
  else if (! strcmp (pspec->name, "contrast"))
    {
      gtk_adjustment_set_value (bc_tool->contrast_data,
                                config->contrast * 127.0);
    }

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (bc_tool));
}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:25,代码来源:gimpbrightnesscontrasttool.c


示例11: gimp_threshold_tool_initialize

static gboolean
gimp_threshold_tool_initialize (GimpTool     *tool,
                                GimpDisplay  *display,
                                GError      **error)
{
  GimpThresholdTool *t_tool   = GIMP_THRESHOLD_TOOL (tool);
  GimpImage         *image    = gimp_display_get_image (display);
  GimpDrawable      *drawable = gimp_image_get_active_drawable (image);

  if (! drawable)
    return FALSE;

  gimp_config_reset (GIMP_CONFIG (t_tool->config));

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

  gimp_drawable_calculate_histogram (drawable, t_tool->histogram);
  gimp_histogram_view_set_histogram (t_tool->histogram_box->view,
                                     t_tool->histogram);

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (t_tool));

  return TRUE;
}
开发者ID:Bootz,项目名称:shiny-robot,代码行数:27,代码来源:gimpthresholdtool.c


示例12: gimp_levels_tool_color_picker_new

static GtkWidget *
gimp_levels_tool_color_picker_new (GimpLevelsTool *tool,
                                   guint           value)
{
  const gchar *stock_id;
  const gchar *help;

  switch (value & 0xF)
    {
    case PICK_LOW_INPUT:
      stock_id = GIMP_STOCK_COLOR_PICKER_BLACK;
      help     = _("Pick black point");
      break;
    case PICK_GAMMA:
      stock_id = GIMP_STOCK_COLOR_PICKER_GRAY;
      help     = _("Pick gray point");
      break;
    case PICK_HIGH_INPUT:
      stock_id = GIMP_STOCK_COLOR_PICKER_WHITE;
      help     = _("Pick white point");
      break;
    default:
      return NULL;
    }

  return gimp_image_map_tool_add_color_picker (GIMP_IMAGE_MAP_TOOL (tool),
                                               GUINT_TO_POINTER (value),
                                               stock_id,
                                               help);
}
开发者ID:ITfrank,项目名称:gimp,代码行数:30,代码来源:gimplevelstool.c


示例13: gimp_image_map_tool_key_press

static gboolean
gimp_image_map_tool_key_press (GimpTool    *tool,
                               GdkEventKey *kevent,
                               GimpDisplay *display)
{
  GimpImageMapTool *image_map_tool = GIMP_IMAGE_MAP_TOOL (tool);

  if (display == tool->display)
    {
      switch (kevent->keyval)
        {
        case GDK_Return:
        case GDK_KP_Enter:
        case GDK_ISO_Enter:
          gimp_image_map_tool_response (NULL, GTK_RESPONSE_OK, image_map_tool);
          return TRUE;

        case GDK_BackSpace:
          gimp_image_map_tool_response (NULL, RESPONSE_RESET, image_map_tool);
          return TRUE;

        case GDK_Escape:
          gimp_image_map_tool_response (NULL, GTK_RESPONSE_CANCEL, image_map_tool);
          return TRUE;
        }
    }

  return FALSE;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:29,代码来源:gimpimagemaptool.c


示例14: gimp_gegl_tool_config_notify

static void
gimp_gegl_tool_config_notify (GObject      *object,
                              GParamSpec   *pspec,
                              GimpGeglTool *tool)
{
  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:7,代码来源:gimpgegltool.c


示例15: gimp_operation_tool_aux_input_notify

static void
gimp_operation_tool_aux_input_notify (GimpBufferSourceBox *box,
                                      const GParamSpec    *pspec,
                                      GimpOperationTool   *tool)
{
    gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
开发者ID:davidyang5405,项目名称:gimp,代码行数:7,代码来源:gimpoperationtool.c


示例16: gimp_image_map_tool_finalize

static void
gimp_image_map_tool_finalize (GObject *object)
{
  GimpImageMapTool *image_map_tool = GIMP_IMAGE_MAP_TOOL (object);

  if (image_map_tool->operation)
    {
      g_object_unref (image_map_tool->operation);
      image_map_tool->operation = NULL;
    }

  if (image_map_tool->config)
    {
      g_object_unref (image_map_tool->config);
      image_map_tool->config = NULL;
    }

  if (image_map_tool->default_config)
    {
      g_object_unref (image_map_tool->default_config);
      image_map_tool->default_config = NULL;
    }

  if (image_map_tool->shell)
    {
      gtk_widget_destroy (image_map_tool->shell);
      image_map_tool->shell        = NULL;
      image_map_tool->main_vbox    = NULL;
      image_map_tool->settings_box = NULL;
      image_map_tool->label_group  = NULL;
    }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:34,代码来源:gimpimagemaptool.c


示例17: gimp_levels_tool_color_picked

static void
gimp_levels_tool_color_picked (GimpColorTool      *color_tool,
                               GimpColorPickState  pick_state,
                               GimpImageType       sample_type,
                               GimpRGB            *color,
                               gint                color_index)
{
  GimpLevelsTool *tool = GIMP_LEVELS_TOOL (color_tool);
  guchar          col[5];
  guint           value;

  gimp_rgba_get_uchar (color,
                       col + RED_PIX,
                       col + GREEN_PIX,
                       col + BLUE_PIX,
                       col + ALPHA_PIX);

  value = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (tool->active_picker),
                                               "pick_value"));

  if (value & ALL_CHANNELS && GIMP_IMAGE_TYPE_IS_RGB (sample_type))
    {
      GimpHistogramChannel  channel;

      /*  first reset the value channel  */
      switch (value & 0xF)
        {
        case LOW_INPUT:
          tool->levels->low_input[GIMP_HISTOGRAM_VALUE] = 0;
          break;
        case GAMMA:
          tool->levels->gamma[GIMP_HISTOGRAM_VALUE] = 1.0;
          break;
        case HIGH_INPUT:
          tool->levels->high_input[GIMP_HISTOGRAM_VALUE] = 255;
          break;
        default:
          break;
        }

      /*  then adjust all color channels  */
      for (channel = GIMP_HISTOGRAM_RED;
           channel <= GIMP_HISTOGRAM_BLUE;
           channel++)
        {
          levels_input_adjust_by_color (tool->levels,
                                        value, channel, col);
        }
    }
  else
    {
      levels_input_adjust_by_color (tool->levels,
                                    value, tool->channel, col);
    }

  levels_update (tool, ALL);

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:59,代码来源:gimplevelstool.c


示例18: gimp_desaturate_tool_init

static void
gimp_desaturate_tool_init (GimpDesaturateTool *desaturate_tool)
{
  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (desaturate_tool);

  im_tool->apply_func = (GimpImageMapApplyFunc) desaturate_region;
  im_tool->apply_data = &desaturate_tool->mode;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:8,代码来源:gimpdesaturatetool.c


示例19: gimp_levels_tool_constructed

static void
gimp_levels_tool_constructed (GObject *object)
{
  G_OBJECT_CLASS (parent_class)->constructed (object);

  g_signal_connect_object (GIMP_IMAGE_MAP_TOOL (object)->config, "notify",
                           G_CALLBACK (gimp_levels_tool_config_notify),
                           object, 0);
}
开发者ID:SHIVAPRASAD96,项目名称:gimp,代码行数:9,代码来源:gimplevelstool.c


示例20: gimp_image_map_tool_constructed

static void
gimp_image_map_tool_constructed (GObject *object)
{
  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (object);

  G_OBJECT_CLASS (parent_class)->constructed (object);

  gimp_image_map_tool_get_operation (im_tool);
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:9,代码来源:gimpimagemaptool.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GIMP_INT_COMBO_BOX函数代码示例发布时间:2022-05-30
下一篇:
C++ GIMP_DRAW_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