2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2006 Blender Foundation.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL/BL DUAL LICENSE BLOCK *****
27 #ifndef __BKE_COLORTOOLS_H__
28 #define __BKE_COLORTOOLS_H__
30 /** \file BKE_colortools.h
34 struct ColorManagedViewSettings;
44 # define DO_INLINE __inline
45 #elif defined(__sun) || defined(__sun__)
48 # define DO_INLINE static inline
51 struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
52 void curvemapping_free(struct CurveMapping *cumap);
53 struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap);
54 void curvemapping_set_black_white(struct CurveMapping *cumap, const float black[3], const float white[3]);
56 #define CURVEMAP_SLOPE_NEGATIVE 0
57 #define CURVEMAP_SLOPE_POSITIVE 1
58 void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope);
59 void curvemap_remove(struct CurveMap *cuma, int flag);
60 void curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);
61 struct CurveMapPoint *curvemap_insert(struct CurveMap *cuma, float x, float y);
62 void curvemap_sethandle(struct CurveMap *cuma, int type);
64 void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
65 void curvemapping_changed_all(struct CurveMapping *cumap);
67 /* single curve, no table check */
68 float curvemap_evaluateF(struct CurveMap *cuma, float value);
69 /* single curve, with table check */
70 float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value);
71 void curvemapping_evaluate3F(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
72 void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
73 void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
74 void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf);
75 void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
76 int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
77 void curvemapping_initialize(struct CurveMapping *cumap);
78 void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
79 void BKE_histogram_update_sample_line(struct Histogram *hist, struct ImBuf *ibuf, const short use_color_management);
80 void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
81 void scopes_free(struct Scopes *scopes);
82 void scopes_new(struct Scopes *scopes);
84 void BKE_color_managed_view_settings_init(struct ColorManagedViewSettings *settings);
85 void BKE_color_managed_view_settings_copy(struct ColorManagedViewSettings *new_settings,
86 const struct ColorManagedViewSettings *settings);