GimpPaintCore

GimpPaintCore

Synopsis

                    GimpPaintCore;
struct              GimpPaintCoreClass;
void                gimp_paint_core_paint               (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *paint_options,
                                                         GimpPaintState state,
                                                         guint32 time);
gboolean            gimp_paint_core_start               (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *paint_options,
                                                         const GimpCoords *coords,
                                                         GError **error);
void                gimp_paint_core_finish              (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         gboolean push_undo);
void                gimp_paint_core_cancel              (GimpPaintCore *core,
                                                         GimpDrawable *drawable);
void                gimp_paint_core_cleanup             (GimpPaintCore *core);
void                gimp_paint_core_interpolate         (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *paint_options,
                                                         const GimpCoords *coords,
                                                         guint32 time);
void                gimp_paint_core_set_current_coords  (GimpPaintCore *core,
                                                         const GimpCoords *coords);
void                gimp_paint_core_get_current_coords  (GimpPaintCore *core,
                                                         GimpCoords *coords);
void                gimp_paint_core_set_last_coords     (GimpPaintCore *core,
                                                         const GimpCoords *coords);
void                gimp_paint_core_get_last_coords     (GimpPaintCore *core,
                                                         GimpCoords *coords);
void                gimp_paint_core_round_line          (GimpPaintCore *core,
                                                         GimpPaintOptions *options,
                                                         gboolean constrain_15_degrees);
TempBuf *           gimp_paint_core_get_paint_area      (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *options,
                                                         const GimpCoords *coords);
TempBuf *           gimp_paint_core_get_orig_image      (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);
TempBuf *           gimp_paint_core_get_orig_proj       (GimpPaintCore *core,
                                                         GimpPickable *pickable,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);
void                gimp_paint_core_paste               (GimpPaintCore *core,
                                                         PixelRegion *paint_maskPR,
                                                         GimpDrawable *drawable,
                                                         gdouble paint_opacity,
                                                         gdouble image_opacity,
                                                         GimpLayerModeEffects paint_mode,
                                                         GimpPaintApplicationMode mode);
void                gimp_paint_core_replace             (GimpPaintCore *core,
                                                         PixelRegion *paint_maskPR,
                                                         GimpDrawable *drawable,
                                                         gdouble paint_opacity,
                                                         gdouble image_opacity,
                                                         GimpPaintApplicationMode mode);
void                gimp_paint_core_validate_undo_tiles (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);
void                gimp_paint_core_validate_canvas_tiles
                                                        (GimpPaintCore *core,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);
void                gimp_paint_core_validate_saved_proj_tiles
                                                        (GimpPaintCore *core,
                                                         GimpPickable *pickable,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);
void                gimp_paint_core_smooth_coords       (GimpPaintCore *core,
                                                         GimpPaintOptions *paint_options,
                                                         GimpCoords *coords);

Object Hierarchy

  GObject
   +----GimpObject
         +----GimpPaintCore
               +----GimpBrushCore
               +----GimpInk

Properties

  "undo-desc"                gchar*                : Read / Write / Construct Only

Description

Details

GimpPaintCore

typedef struct _GimpPaintCore GimpPaintCore;


struct GimpPaintCoreClass

struct GimpPaintCoreClass {
  GimpObjectClass  parent_class;

  /*  virtual functions  */
  gboolean   (* start)          (GimpPaintCore    *core,
                                 GimpDrawable     *drawable,
                                 GimpPaintOptions *paint_options,
                                 const GimpCoords *coords,
                                 GError          **error);

  gboolean   (* pre_paint)      (GimpPaintCore    *core,
                                 GimpDrawable     *drawable,
                                 GimpPaintOptions *paint_options,
                                 GimpPaintState    paint_state,
                                 guint32           time);
  void       (* paint)          (GimpPaintCore    *core,
                                 GimpDrawable     *drawable,
                                 GimpPaintOptions *paint_options,
                                 const GimpCoords *coords,
                                 GimpPaintState    paint_state,
                                 guint32           time);
  void       (* post_paint)     (GimpPaintCore    *core,
                                 GimpDrawable     *drawable,
                                 GimpPaintOptions *paint_options,
                                 GimpPaintState    paint_state,
                                 guint32           time);

  void       (* interpolate)    (GimpPaintCore    *core,
                                 GimpDrawable     *drawable,
                                 GimpPaintOptions *paint_options,
                                 guint32           time);

  TempBuf  * (* get_paint_area) (GimpPaintCore    *core,
                                 GimpDrawable     *drawable,
                                 GimpPaintOptions *paint_options,
                                 const GimpCoords *coords);

  GimpUndo * (* push_undo)      (GimpPaintCore    *core,
                                 GimpImage        *image,
                                 const gchar      *undo_desc);
};


gimp_paint_core_paint ()

void                gimp_paint_core_paint               (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *paint_options,
                                                         GimpPaintState state,
                                                         guint32 time);


gimp_paint_core_start ()

gboolean            gimp_paint_core_start               (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *paint_options,
                                                         const GimpCoords *coords,
                                                         GError **error);


gimp_paint_core_finish ()

void                gimp_paint_core_finish              (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         gboolean push_undo);


gimp_paint_core_cancel ()

void                gimp_paint_core_cancel              (GimpPaintCore *core,
                                                         GimpDrawable *drawable);


gimp_paint_core_cleanup ()

void                gimp_paint_core_cleanup             (GimpPaintCore *core);


gimp_paint_core_interpolate ()

void                gimp_paint_core_interpolate         (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *paint_options,
                                                         const GimpCoords *coords,
                                                         guint32 time);


gimp_paint_core_set_current_coords ()

void                gimp_paint_core_set_current_coords  (GimpPaintCore *core,
                                                         const GimpCoords *coords);


gimp_paint_core_get_current_coords ()

void                gimp_paint_core_get_current_coords  (GimpPaintCore *core,
                                                         GimpCoords *coords);


gimp_paint_core_set_last_coords ()

void                gimp_paint_core_set_last_coords     (GimpPaintCore *core,
                                                         const GimpCoords *coords);


gimp_paint_core_get_last_coords ()

void                gimp_paint_core_get_last_coords     (GimpPaintCore *core,
                                                         GimpCoords *coords);


gimp_paint_core_round_line ()

void                gimp_paint_core_round_line          (GimpPaintCore *core,
                                                         GimpPaintOptions *options,
                                                         gboolean constrain_15_degrees);

Adjusts core->last_coords and core_cur_coords in preparation to drawing a straight line. If center_pixels is TRUE the endpoints get pushed to the center of the pixels. This avoids artefacts for e.g. the hard mode. The rounding of the slope to 15 degree steps if ctrl is pressed happens, as does rounding the start and end coordinates (which may be fractional in high zoom modes) to the center of pixels.

core :

the GimpPaintCore

options :

the GimpPaintOptions to use

constrain_15_degrees :

the modifier state

gimp_paint_core_get_paint_area ()

TempBuf *           gimp_paint_core_get_paint_area      (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         GimpPaintOptions *options,
                                                         const GimpCoords *coords);


gimp_paint_core_get_orig_image ()

TempBuf *           gimp_paint_core_get_orig_image      (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);


gimp_paint_core_get_orig_proj ()

TempBuf *           gimp_paint_core_get_orig_proj       (GimpPaintCore *core,
                                                         GimpPickable *pickable,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);


gimp_paint_core_paste ()

void                gimp_paint_core_paste               (GimpPaintCore *core,
                                                         PixelRegion *paint_maskPR,
                                                         GimpDrawable *drawable,
                                                         gdouble paint_opacity,
                                                         gdouble image_opacity,
                                                         GimpLayerModeEffects paint_mode,
                                                         GimpPaintApplicationMode mode);


gimp_paint_core_replace ()

void                gimp_paint_core_replace             (GimpPaintCore *core,
                                                         PixelRegion *paint_maskPR,
                                                         GimpDrawable *drawable,
                                                         gdouble paint_opacity,
                                                         gdouble image_opacity,
                                                         GimpPaintApplicationMode mode);


gimp_paint_core_validate_undo_tiles ()

void                gimp_paint_core_validate_undo_tiles (GimpPaintCore *core,
                                                         GimpDrawable *drawable,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);


gimp_paint_core_validate_canvas_tiles ()

void                gimp_paint_core_validate_canvas_tiles
                                                        (GimpPaintCore *core,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);


gimp_paint_core_validate_saved_proj_tiles ()

void                gimp_paint_core_validate_saved_proj_tiles
                                                        (GimpPaintCore *core,
                                                         GimpPickable *pickable,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);


gimp_paint_core_smooth_coords ()

void                gimp_paint_core_smooth_coords       (GimpPaintCore *core,
                                                         GimpPaintOptions *paint_options,
                                                         GimpCoords *coords);

Property Details

The "undo-desc" property

  "undo-desc"                gchar*                : Read / Write / Construct Only

Default value: "Paint"