2012-05-10 21:22:44 +02:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* operations-types.h
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2012-05-10 21:22:44 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __OPERATIONS_TYPES_H__
|
|
|
|
#define __OPERATIONS_TYPES_H__
|
|
|
|
|
|
|
|
|
2013-05-21 04:02:26 -07:00
|
|
|
#include <gegl-types.h>
|
2017-01-16 22:42:19 +01:00
|
|
|
|
2012-05-10 21:22:44 +02:00
|
|
|
#include "gegl/gimp-gegl-types.h"
|
|
|
|
|
2017-01-16 23:07:50 +01:00
|
|
|
#include "operations-enums.h"
|
|
|
|
|
2012-05-10 21:22:44 +02:00
|
|
|
|
|
|
|
/* operations */
|
|
|
|
|
|
|
|
typedef struct _GimpOperationPointFilter GimpOperationPointFilter;
|
2017-01-21 21:35:52 +01:00
|
|
|
typedef struct _GimpOperationLayerMode GimpOperationLayerMode;
|
2012-05-10 21:22:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* operation config objects */
|
|
|
|
|
app: add GimpOperationSettings
Add a new GimpOperationSettings class, to be used as a base class
for all operation-config types. The class provides options common
to all operations (namely, the clipping mode, input region, and
color options), which were previously stored in GimpFilterOptions,
and were therefore bound to the filter tool, instead of being
stored as part of the operation settings; as a result, these
options would have no effect when reapplying a filter, or when
restoring a preset.
The GimpOperationSettings options do not affect the operation
node, but rather the associated GimpDrawableFilter object. The
class provides a gimp_operation_settings_sync_drawable_filter()
function, which applies the options to the filter.
Modify all custom and auto-generated operation-config types to
derive from GimpOperationSettings, and modify the GimpConfig
functions of the former to account for the GimpOperationSettings
properties, using a set of protected functions provided by the
class.
2020-04-07 01:37:19 +03:00
|
|
|
typedef struct _GimpOperationSettings GimpOperationSettings;
|
|
|
|
|
2012-05-10 21:22:44 +02:00
|
|
|
typedef struct _GimpBrightnessContrastConfig GimpBrightnessContrastConfig;
|
|
|
|
typedef struct _GimpCageConfig GimpCageConfig;
|
|
|
|
typedef struct _GimpColorBalanceConfig GimpColorBalanceConfig;
|
|
|
|
typedef struct _GimpColorizeConfig GimpColorizeConfig;
|
|
|
|
typedef struct _GimpCurvesConfig GimpCurvesConfig;
|
|
|
|
typedef struct _GimpDesaturateConfig GimpDesaturateConfig;
|
|
|
|
typedef struct _GimpHueSaturationConfig GimpHueSaturationConfig;
|
|
|
|
typedef struct _GimpLevelsConfig GimpLevelsConfig;
|
|
|
|
typedef struct _GimpPosterizeConfig GimpPosterizeConfig;
|
|
|
|
typedef struct _GimpThresholdConfig GimpThresholdConfig;
|
|
|
|
|
|
|
|
|
|
|
|
/* non-object types */
|
|
|
|
|
|
|
|
typedef struct _GimpCagePoint GimpCagePoint;
|
|
|
|
|
2017-01-16 22:42:19 +01:00
|
|
|
|
2013-05-21 04:02:26 -07:00
|
|
|
/* functions */
|
|
|
|
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
typedef gboolean (* GimpLayerModeFunc) (GeglOperation *operation,
|
|
|
|
void *in,
|
|
|
|
void *aux,
|
|
|
|
void *mask,
|
|
|
|
void *out,
|
|
|
|
glong samples,
|
|
|
|
const GeglRectangle *roi,
|
|
|
|
gint level);
|
|
|
|
|
2019-06-09 12:29:30 +02:00
|
|
|
typedef void (* GimpLayerModeBlendFunc) (GeglOperation *operation,
|
|
|
|
const gfloat *in,
|
app: layer mode code shuffling
Commit 3635cf04ab69bafb76d7583da804f580f2d5fbf3 moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses. As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes. This is the reckoning :)
Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions. Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.
Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.
Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.) This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)
Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.
Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags. This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.
Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.
Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.
Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 10:26:49 -04:00
|
|
|
const gfloat *layer,
|
|
|
|
gfloat *out,
|
|
|
|
gint samples);
|
2017-01-16 22:42:19 +01:00
|
|
|
|
2012-05-10 21:22:44 +02:00
|
|
|
|
|
|
|
#endif /* __OPERATIONS_TYPES_H__ */
|