"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/core/gimpbrush.c" between
gimp-2.10.10.tar.bz2 and gimp-2.10.12.tar.bz2

About: GIMP - The GNU Image Manipulation Program.

gimpbrush.c  (gimp-2.10.10.tar.bz2):gimpbrush.c  (gimp-2.10.12.tar.bz2)
skipping to change at line 297 skipping to change at line 297
gdouble scale = MIN (ratio_x, ratio_y); gdouble scale = MIN (ratio_x, ratio_y);
if (scale != 1.0) if (scale != 1.0)
{ {
gimp_brush_begin_use (brush); gimp_brush_begin_use (brush);
if (GIMP_IS_BRUSH_GENERATED (brush)) if (GIMP_IS_BRUSH_GENERATED (brush))
{ {
GimpBrushGenerated *gen_brush = GIMP_BRUSH_GENERATED (brush); GimpBrushGenerated *gen_brush = GIMP_BRUSH_GENERATED (brush);
mask_buf = gimp_brush_transform_mask (brush, NULL, scale, mask_buf = gimp_brush_transform_mask (brush, scale,
(gimp_brush_generated_get_a spect_ratio (gen_brush) - 1.0) * 20.0 / 19.0, (gimp_brush_generated_get_a spect_ratio (gen_brush) - 1.0) * 20.0 / 19.0,
gimp_brush_generated_get_an gle (gen_brush) / 360.0, gimp_brush_generated_get_an gle (gen_brush) / 360.0,
FALSE, FALSE,
gimp_brush_generated_get_ha rdness (gen_brush)); gimp_brush_generated_get_ha rdness (gen_brush));
} }
else else
mask_buf = gimp_brush_transform_mask (brush, NULL, scale, mask_buf = gimp_brush_transform_mask (brush, scale,
0.0, 0.0, FALSE, 1.0); 0.0, 0.0, FALSE, 1.0);
if (! mask_buf) if (! mask_buf)
{ {
mask_buf = gimp_temp_buf_new (1, 1, babl_format ("Y u8")); mask_buf = gimp_temp_buf_new (1, 1, babl_format ("Y u8"));
gimp_temp_buf_data_clear ((GimpTempBuf *) mask_buf); gimp_temp_buf_data_clear ((GimpTempBuf *) mask_buf);
} }
else else
{ {
gimp_temp_buf_ref ((GimpTempBuf *) mask_buf); gimp_temp_buf_ref ((GimpTempBuf *) mask_buf);
} }
if (pixmap_buf) if (pixmap_buf)
pixmap_buf = gimp_brush_transform_pixmap (brush, NULL, scale, pixmap_buf = gimp_brush_transform_pixmap (brush, scale,
0.0, 0.0, FALSE, 1.0); 0.0, 0.0, FALSE, 1.0);
mask_width = gimp_temp_buf_get_width (mask_buf); mask_width = gimp_temp_buf_get_width (mask_buf);
mask_height = gimp_temp_buf_get_height (mask_buf); mask_height = gimp_temp_buf_get_height (mask_buf);
scaled = TRUE; scaled = TRUE;
} }
} }
return_buf = gimp_temp_buf_new (mask_width, mask_height, return_buf = gimp_temp_buf_new (mask_width, mask_height,
skipping to change at line 632 skipping to change at line 632
return; return;
} }
GIMP_BRUSH_GET_CLASS (brush)->transform_size (brush, GIMP_BRUSH_GET_CLASS (brush)->transform_size (brush,
scale, aspect_ratio, angle, refl ect, scale, aspect_ratio, angle, refl ect,
width, height); width, height);
} }
const GimpTempBuf * const GimpTempBuf *
gimp_brush_transform_mask (GimpBrush *brush, gimp_brush_transform_mask (GimpBrush *brush,
GeglNode *op,
gdouble scale, gdouble scale,
gdouble aspect_ratio, gdouble aspect_ratio,
gdouble angle, gdouble angle,
gboolean reflect, gboolean reflect,
gdouble hardness) gdouble hardness)
{ {
const GimpTempBuf *mask; const GimpTempBuf *mask;
gint width; gint width;
gint height; gint height;
gdouble effective_hardness = hardness; gdouble effective_hardness = hardness;
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL); g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
g_return_val_if_fail (scale > 0.0, NULL); g_return_val_if_fail (scale > 0.0, NULL);
gimp_brush_transform_size (brush, gimp_brush_transform_size (brush,
scale, aspect_ratio, angle, reflect, scale, aspect_ratio, angle, reflect,
&width, &height); &width, &height);
mask = gimp_brush_cache_get (brush->priv->mask_cache, mask = gimp_brush_cache_get (brush->priv->mask_cache,
op, width, height, width, height,
scale, aspect_ratio, angle, reflect, hardness); scale, aspect_ratio, angle, reflect, hardness);
if (! mask) if (! mask)
{ {
#if 0 #if 0
/* This code makes sure that brushes using blur for hardness /* This code makes sure that brushes using blur for hardness
* (all of them but generated) are blurred once and no more. * (all of them but generated) are blurred once and no more.
* It also makes hardnes dynamics not work for these brushes. * It also makes hardnes dynamics not work for these brushes.
* This is intentional. Confoliving for each stamp is too expensive.*/ * This is intentional. Confoliving for each stamp is too expensive.*/
if (! brush->priv->blurred_mask && if (! brush->priv->blurred_mask &&
skipping to change at line 689 skipping to change at line 688
} }
#endif #endif
mask = GIMP_BRUSH_GET_CLASS (brush)->transform_mask (brush, mask = GIMP_BRUSH_GET_CLASS (brush)->transform_mask (brush,
scale, scale,
aspect_ratio, aspect_ratio,
angle, angle,
reflect, reflect,
effective_hardness); effective_hardness);
if (op)
{
GeglNode *graph, *source, *target;
GeglBuffer *buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) mask
);
graph = gegl_node_new ();
source = gegl_node_new_child (graph,
"operation", "gegl:buffer-source",
"buffer", buffer,
NULL);
gegl_node_add_child (graph, op);
target = gegl_node_new_child (graph,
"operation", "gegl:write-buffer",
"buffer", buffer,
NULL);
gegl_node_link_many (source, op, target, NULL);
gegl_node_blit (target, 1.0,
GEGL_RECTANGLE (0, 0,
gegl_buffer_get_width (buffer),
gegl_buffer_get_height (buffer)),
NULL, NULL, 0, GEGL_BLIT_DEFAULT);
g_object_unref (graph);
g_object_unref (buffer);
}
gimp_brush_cache_add (brush->priv->mask_cache, gimp_brush_cache_add (brush->priv->mask_cache,
(gpointer) mask, (gpointer) mask,
op, width, height, width, height,
scale, aspect_ratio, angle, reflect, effective_hardn ess); scale, aspect_ratio, angle, reflect, effective_hardn ess);
} }
return mask; return mask;
} }
const GimpTempBuf * const GimpTempBuf *
gimp_brush_transform_pixmap (GimpBrush *brush, gimp_brush_transform_pixmap (GimpBrush *brush,
GeglNode *op,
gdouble scale, gdouble scale,
gdouble aspect_ratio, gdouble aspect_ratio,
gdouble angle, gdouble angle,
gboolean reflect, gboolean reflect,
gdouble hardness) gdouble hardness)
{ {
const GimpTempBuf *pixmap; const GimpTempBuf *pixmap;
gint width; gint width;
gint height; gint height;
gdouble effective_hardness = hardness; gdouble effective_hardness = hardness;
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL); g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
g_return_val_if_fail (brush->priv->pixmap != NULL, NULL); g_return_val_if_fail (brush->priv->pixmap != NULL, NULL);
g_return_val_if_fail (scale > 0.0, NULL); g_return_val_if_fail (scale > 0.0, NULL);
gimp_brush_transform_size (brush, gimp_brush_transform_size (brush,
scale, aspect_ratio, angle, reflect, scale, aspect_ratio, angle, reflect,
&width, &height); &width, &height);
pixmap = gimp_brush_cache_get (brush->priv->pixmap_cache, pixmap = gimp_brush_cache_get (brush->priv->pixmap_cache,
op, width, height, width, height,
scale, aspect_ratio, angle, reflect, hardness); scale, aspect_ratio, angle, reflect, hardness);
if (! pixmap) if (! pixmap)
{ {
#if 0 #if 0
if (! brush->priv->blurred_pixmap && if (! brush->priv->blurred_pixmap &&
! GIMP_IS_BRUSH_GENERATED(brush) && ! GIMP_IS_BRUSH_GENERATED(brush) &&
! GIMP_IS_BRUSH_PIPE(brush) /*Can't cache pipes. Sanely anyway*/ ! GIMP_IS_BRUSH_PIPE(brush) /*Can't cache pipes. Sanely anyway*/
&& hardness < 1.0) && hardness < 1.0)
{ {
skipping to change at line 780 skipping to change at line 751
} }
#endif #endif
pixmap = GIMP_BRUSH_GET_CLASS (brush)->transform_pixmap (brush, pixmap = GIMP_BRUSH_GET_CLASS (brush)->transform_pixmap (brush,
scale, scale,
aspect_ratio, aspect_ratio,
angle, angle,
reflect, reflect,
effective_hardnes s); effective_hardnes s);
if (op)
{
GeglNode *graph, *source, *target;
GeglBuffer *buffer = gimp_temp_buf_create_buffer ((GimpTempBuf *) pixm
ap);
graph = gegl_node_new ();
source = gegl_node_new_child (graph,
"operation", "gegl:buffer-source",
"buffer", buffer,
NULL);
gegl_node_add_child (graph, op);
target = gegl_node_new_child (graph,
"operation", "gegl:write-buffer",
"buffer", buffer,
NULL);
gegl_node_link_many (source, op, target, NULL);
gegl_node_blit (target, 1.0,
GEGL_RECTANGLE (0, 0,
gegl_buffer_get_width (buffer),
gegl_buffer_get_height (buffer)),
NULL, NULL, 0, GEGL_BLIT_DEFAULT);
g_object_unref (graph);
g_object_unref (buffer);
}
gimp_brush_cache_add (brush->priv->pixmap_cache, gimp_brush_cache_add (brush->priv->pixmap_cache,
(gpointer) pixmap, (gpointer) pixmap,
op, width, height, width, height,
scale, aspect_ratio, angle, reflect, effective_hardn ess); scale, aspect_ratio, angle, reflect, effective_hardn ess);
} }
return pixmap; return pixmap;
} }
const GimpBezierDesc * const GimpBezierDesc *
gimp_brush_transform_boundary (GimpBrush *brush, gimp_brush_transform_boundary (GimpBrush *brush,
gdouble scale, gdouble scale,
gdouble aspect_ratio, gdouble aspect_ratio,
skipping to change at line 838 skipping to change at line 782
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL); g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
g_return_val_if_fail (scale > 0.0, NULL); g_return_val_if_fail (scale > 0.0, NULL);
g_return_val_if_fail (width != NULL, NULL); g_return_val_if_fail (width != NULL, NULL);
g_return_val_if_fail (height != NULL, NULL); g_return_val_if_fail (height != NULL, NULL);
gimp_brush_transform_size (brush, gimp_brush_transform_size (brush,
scale, aspect_ratio, angle, reflect, scale, aspect_ratio, angle, reflect,
width, height); width, height);
boundary = gimp_brush_cache_get (brush->priv->boundary_cache, boundary = gimp_brush_cache_get (brush->priv->boundary_cache,
NULL, *width, *height, *width, *height,
scale, aspect_ratio, angle, reflect, hardness ); scale, aspect_ratio, angle, reflect, hardness );
if (! boundary) if (! boundary)
{ {
boundary = GIMP_BRUSH_GET_CLASS (brush)->transform_boundary (brush, boundary = GIMP_BRUSH_GET_CLASS (brush)->transform_boundary (brush,
scale, scale,
aspect_ratio, aspect_ratio,
angle, angle,
reflect, reflect,
hardness, hardness,
skipping to change at line 861 skipping to change at line 805
/* while the brush mask is always at least 1x1 pixels, its /* while the brush mask is always at least 1x1 pixels, its
* outline can correctly be NULL * outline can correctly be NULL
* *
* FIXME: make the cache handle NULL things when it is * FIXME: make the cache handle NULL things when it is
* properly implemented * properly implemented
*/ */
if (boundary) if (boundary)
gimp_brush_cache_add (brush->priv->boundary_cache, gimp_brush_cache_add (brush->priv->boundary_cache,
(gpointer) boundary, (gpointer) boundary,
NULL, *width, *height, *width, *height,
scale, aspect_ratio, angle, reflect, hardness); scale, aspect_ratio, angle, reflect, hardness);
} }
return boundary; return boundary;
} }
GimpTempBuf * GimpTempBuf *
gimp_brush_get_mask (GimpBrush *brush) gimp_brush_get_mask (GimpBrush *brush)
{ {
g_return_val_if_fail (brush != NULL, NULL); g_return_val_if_fail (brush != NULL, NULL);
 End of changes. 13 change blocks. 
67 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)