コード例 #1
0
ファイル: gimpcolorpickertool.c プロジェクト: ni1son/gimp
static void
gimp_color_picker_tool_picked (GimpColorTool      *color_tool,
                               GimpColorPickState  pick_state,
                               gdouble             x,
                               gdouble             y,
                               const Babl         *sample_format,
                               gpointer            pixel,
                               const GimpRGB      *color)
{
  GimpColorPickerTool    *picker_tool = GIMP_COLOR_PICKER_TOOL (color_tool);
  GimpColorPickerOptions *options;

  options = GIMP_COLOR_PICKER_TOOL_GET_OPTIONS (color_tool);

  if (options->use_info_window && ! picker_tool->gui)
    gimp_color_picker_tool_info_create (picker_tool);

  if (picker_tool->gui)
    gimp_color_picker_tool_info_update (picker_tool,
                                        GIMP_COLOR_OPTIONS (options)->sample_average,
                                        sample_format, pixel, color);

  GIMP_COLOR_TOOL_CLASS (parent_class)->picked (color_tool, pick_state,
                                                x, y,
                                                sample_format,
                                                pixel, color);
}
コード例 #2
0
static void
gimp_color_picker_tool_picked (GimpColorTool      *color_tool,
                               GimpColorPickState  pick_state,
                               GimpImageType       sample_type,
                               const GimpRGB      *color,
                               gint                color_index)
{
  GimpColorPickerTool    *picker_tool = GIMP_COLOR_PICKER_TOOL (color_tool);
  GimpColorPickerOptions *options;

  options = GIMP_COLOR_PICKER_TOOL_GET_OPTIONS (color_tool);

  if (options->use_info_window && ! picker_tool->dialog)
    gimp_color_picker_tool_info_create (picker_tool);

  if (picker_tool->dialog)
    gimp_color_picker_tool_info_update (picker_tool, sample_type,
                                        color, color_index);

  GIMP_COLOR_TOOL_CLASS (parent_class)->picked (color_tool, pick_state,
                                                sample_type, color,
                                                color_index);
}