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 ColorManagedDisplaySettings;
35 struct ColorManagedViewSettings;
45 # define DO_INLINE __inline
46 #elif defined(__sun) || defined(__sun__)
49 # define DO_INLINE static inline
52 struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
53 void curvemapping_free(struct CurveMapping *cumap);
54 struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap);
55 void curvemapping_set_black_white(struct CurveMapping *cumap, const float black[3], const float white[3]);
57 #define CURVEMAP_SLOPE_NEGATIVE 0
58 #define CURVEMAP_SLOPE_POSITIVE 1
59 void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope);
60 void curvemap_remove(struct CurveMap *cuma, int flag);
61 void curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);
62 struct CurveMapPoint *curvemap_insert(struct CurveMap *cuma, float x, float y);
63 void curvemap_sethandle(struct CurveMap *cuma, int type);
65 void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
66 void curvemapping_changed_all(struct CurveMapping *cumap);
68 /* single curve, no table check */
69 float curvemap_evaluateF(struct CurveMap *cuma, float value);
70 /* single curve, with table check */
71 float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value);
72 void curvemapping_evaluate3F(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
73 void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
74 void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
75 void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf);
76 void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
77 int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
78 void curvemapping_initialize(struct CurveMapping *cumap);
79 void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
80 void BKE_histogram_update_sample_line(struct Histogram *hist, struct ImBuf *ibuf, const short use_color_management);
81 void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
82 void scopes_free(struct Scopes *scopes);
83 void scopes_new(struct Scopes *scopes);
85 void BKE_color_managed_display_settings_init(struct ColorManagedDisplaySettings *settings);
86 void BKE_color_managed_display_settings_copy(struct ColorManagedDisplaySettings *new_settings,
87 const struct ColorManagedDisplaySettings *settings);
89 void BKE_color_managed_view_settings_init(struct ColorManagedViewSettings *settings);
90 void BKE_color_managed_view_settings_copy(struct ColorManagedViewSettings *new_settings,
91 const struct ColorManagedViewSettings *settings);