Commit Graph

158 Commits

Author SHA1 Message Date
Michael Natterer 49dcc3d78a app: remove obsolete include 2012-05-02 17:50:51 +02:00
Michael Natterer c5c555c834 app: add "take_ownerspip" param to gimp_temp_buf_create_buffer()
and get rid of some more intermediate buffer creation/destruction, and
some redundant temp_buf_free() plus g_object_unref().
2012-05-02 17:50:51 +02:00
Michael Natterer 7b5252ac54 app: replace GimpPaintCore::get_paint_area() by ::get_paint_buffer()
and remove the public TempBuf based get_paint_area() API.
2012-05-02 17:50:51 +02:00
Michael Natterer 12ac0bea13 app: add gimp_paint_core_get_paint_buffer()
which is the same as gimp_paint_core_get_paint_area() but returns a
GeglBuffer to paint to, not a TempBuf.
2012-05-02 17:50:47 +02:00
Michael Natterer 1dbadb772d app: rename GimpPaintCore->canvas_buf to ->paint_area
because that's what it's called in public API. This has confused me
long enough now.
2012-05-02 17:50:46 +02:00
Øyvind Kolås ee97c1f4ff app: correct usage of babl formats
GIMP was doing evil hacks lying to GEGL about it's pixels being in a linear
color space when they are not. This causes incorrect rendering, makes gaussian
blur misbehave etc.

The legacy projection modes should be implemented using the same 2.2 gamma
formats that are correct to specify for sRGB data. (for proper color
management in higher bitdepths; icc backend babl formats should be used.)

For the old image modes correct babl formats are:

R'G'B'A u8  -  8 bit RGB with 2.2 gamma (sRGB) with linear alpha component
R'G'B' u8   -  8 bit RGB with 2.2 gamma (sRGB)
Y'A u8      -  8 bit Grayscale with 2.2 gamma with linear alpha component
Y' u8       -  8 bit Grayscale with 2.2 gamma

Y u8        -  8 bit linear data, used for masks/channels
A u8        -  8 bit linear alpha

-----------------------------------------------

RGBA float  -     32bit floating point linear light RGB
RaGaBaA float  -  32bit floating point linear light RGB, premultiplied alpha
                  to be used for processing that needs to scale by the alpha,
                  (blurs, resampling etc)
R'G'B'A float  -  32bit floating point sRGB with gamma, to be used where
                  the result depends on being closer to perceptual when
                  processing, can be used a cheaper alternative to CIE Lab
                  based modes.

-----------------------------------------------

The legacy layer modes should use the formats with gamma 2.2 only for loading
and rendering legacy XCF files correctly, in the brave new world compositing
should most likely be done in linear light with "RGBA float" and even better
"RaGaBaA float" like GEGL does for porter duff and other compositing modes.

The ability to chose the legacy layer modes should probably be hidden from the
user unless an old .xcf has been opened.
2012-05-02 17:50:38 +02:00
Michael Natterer 9a09d3a762 app: drop "babl" from gimp_foo_get_babl_format[_with_alpha]() 2012-05-02 17:45:58 +02:00
Michael Natterer 92a3187571 app: optimize gimp_brush_core_paint_line_pixmap_mask() a lot
by using one single call to babl_process() for one line if the pixmap.
2012-05-02 17:45:58 +02:00
Michael Natterer 57ed75eca4 app: use Babl in gimp_brush_core_paint_line_pixmap_mask()
to convert the brush pixmap's colors. This code still needs some
love...
2012-05-02 17:45:57 +02:00
Alexia Death 4fe9955b3e app: fix some brushes not going small enough correctly
That limit may need to be removed completely some day...
2012-01-20 21:12:19 +02:00
Alexia Death 72fb271e00 app: Bug 667241 - Unable to paint after switching away from paint tool using fade tapering
Make sure we up the pixel count when we bail in interpolate on 0-sized brush.
2012-01-09 23:31:33 +02:00
Alexia Death d32fa80d1d app: Move smooth to painttool and clean up the rest 2011-09-14 20:44:45 +03:00
Alexia Death 159ee0381d app: Complete the reversal of last patch 2011-09-11 22:48:02 +03:00
Alexia Death 79dfee2c9e Revert "app: Remove obsolete way of keeping track of last painted dab"
This reverts commit 1b62a7bff3.
2011-09-11 22:47:55 +03:00
Alexia Death 8f11e8743d app: Don't mark coord done untill its actually been painted 2011-09-11 21:56:33 +03:00
Alexia Death 1b62a7bff3 app: Remove obsolete way of keeping track of last painted dab 2011-09-11 13:23:05 +03:00
Alexia Death 2528f656b5 app: remove call to possibly buggy and un-needed scale clamp
It's likely that the removed call and function were causing
random drawing artefacts, but as this was once in a blue
moon bug, I have just a guess to go by however, testing
revealed no regressions, so pushing.
2011-09-10 21:47:52 +03:00
Michael Natterer 391c74899c app: rename gimp_brush_start_use() to gimp_brush_begin_use() 2011-04-12 09:06:22 +02:00
Michael Natterer 0315f483e6 app: some general GimpPaintCore cleanup 2011-04-06 09:11:25 +02:00
Michael Natterer 21b8007b29 app: add GimpBrushCache which stores brush stuff based on transform parameters
such as masks and outlines. The cache is currently very stupid and
only cacheds the last transformed object. Add caches to GimpBrush for
its mask, its pixmap and its boundary, and remove the same caches and
a ton of members from GimpBrushCore. This involves adding lots of
const qualifiers because GimpBrush returns const pointers now for
trasnformed stuff.
2011-04-05 22:15:30 +02:00
Michael Natterer e2226e9933 app: add gimp_brush_start_use() and gimp_brush_end_use()
and use them in GimpBrushCore when setting/unsetting a brush. They
will be used for managing some caches inside GimpBrush.
2011-04-05 19:18:26 +02:00
Michael Natterer a50f668d87 app: GimpBrushCore: simplify brush and dynamics setting
by checking for an actual change in the setters. Remove the
"foo != core->foo" checks from all callers.
2011-04-05 19:05:55 +02:00
Michael Natterer d008fcd588 app: remove the entire brush boundary code from GimpBrushCore 2011-04-04 21:24:41 +02:00
Alexia Death 41b1bd36da app: Fix smooth intreaction with airbrush 2011-03-16 22:08:19 +02:00
Michael Natterer e3c0a4e549 app: move all GimpDynamics members to private 2011-03-03 18:43:56 +01:00
Alexia Death 75593c3fea app: Fix missing outline with aspect 0.0 2011-02-02 01:04:24 +02:00
Alexia Death 418632916a app: Fix outline offset 2011-02-02 00:58:09 +02:00
Alexia Death 6a89db0f53 app: Minor aspect ratio fixes 2011-02-02 00:33:08 +02:00
Alexia Death 452819143a app: half-sane aspect ratio implementation 2011-01-25 23:28:02 +02:00
Michael Natterer eb04265ce3 app: gimp_brush_core_clamp_brush_scale() -> gimp_brush_clamp_scale() 2011-01-17 23:20:49 +01:00
Alexia Death 803df9b58a app: Make smooth paint core internal 2011-01-09 22:59:01 +02:00
Michael Natterer c29aefccc2 app: fix coding style in the new smoothing code 2011-01-08 22:18:56 +01:00
Alexia Death 339deed1da app: Clean up smooth so it would be acceptable for master 2011-01-08 22:19:27 +02:00
Alexia Death 082aa272a4 app: G-Pen algorithm for GIMP trunk. Now smoothing function works for Ink and Brush tools.
Rebased/fixed to go on top of current master. Next commit will add cleanup.
Had to change author tag because gnome is not accepting random stuff
in email fields. Original author is tarai, from gimp painter project
in sourceforge.
2011-01-08 22:17:26 +02:00
Michael Natterer ae742f0920 app: some cleanup in the new brush size code 2010-10-30 19:56:24 +02:00
Alexia Death 5d42803d7f app: Expose brush size in pixels, not as ratio 2010-10-30 19:51:07 +03:00
Michael Natterer 3de4d7263a app: Bug 631619 - Drawing artifacts spread by paintbrush outline on canvas
Add a transform matrix to GimpCanvasBoundary and get rid of the whole
BoundSeg transform code in boundary.c and gimpbrushcore.c, it was
impossible to get this right on that level. Also fix te extents of
GimpCanvasBoundary os it leaves no artifacts.
2010-10-09 22:00:19 +02:00
Michael Natterer 9828f6db20 app: remove unused variables in gimp_brush_core_create_bound_segs() 2010-10-08 12:09:33 +02:00
Michael Natterer 06da10bc08 app: change boundary drawing by tools to work like the selection
- GimpCanvasBoundary takes unsorted BoundSeg arrays now and uses
  gimp_display_shell_transform_boundary() and gimp_cairo_add_boundary().
- Nobody calls boundary_sort() any longer for the purpose of displaying
  a boundary.
- gimp_display_shell_transform_boundary() got offset parameters
  so it can transform things that are not in the image's coordinate
  system.
2010-09-26 22:41:04 +02:00
Michael Natterer d921f8520b app: fix infinite recursion in gimp_brush_core_create_bound_segs()
Block the core's brush-invalidate callback while temporarily changing
the brush's aspect ratio.
2010-09-23 23:35:59 +02:00
Michael Natterer 8fc5fd6c99 app: whitespace and formatting cleanup 2010-08-24 13:43:31 +02:00
Alexia Death 256eee9850 app: Fix Outline transforming for generated brushes 2010-05-14 21:25:09 +03:00
Alexia Death b0d02666a3 app: A few more generic aspect ratio fixes 2010-05-14 20:58:27 +03:00
Alexia Death 4816a61dcb app: Aspect ratio fixes 2010-05-10 00:21:55 +03:00
Alexia Death 0cb1ada818 app: convert aspect ratio to scale_x&scale_y just before matrix transform 2010-05-10 00:11:07 +03:00
Alexia Death f53f73da19 app: Fix a typo in outline transform 2010-04-18 21:20:29 +03:00
Alexia Death 78a4cae2d5 app: Rewire the the feature formely known as harndess back to gui as force 2010-04-09 00:44:52 +03:00
Alexia Death 477b2e1a0f app: fix outline offseting at rotation 2010-03-17 20:12:12 +02:00
Alexia Death 3607a73744 app: Make sure outline and brush transform use the same kind of matrix 2010-03-17 19:49:21 +02:00
Alexia Death bd2f852ac1 app: make off-canvas changes have effect on brush outline 2010-03-16 21:53:34 +02:00