1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 #pragma once
20 
21 /** \file
22  * \ingroup bke
23  */
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct ColorBand;
30 
31 /** #ColorBand.data length. */
32 #define MAXCOLORBAND 32
33 
34 void BKE_colorband_init(struct ColorBand *coba, bool rangetype);
35 void BKE_colorband_init_from_table_rgba(struct ColorBand *coba,
36                                         const float (*array)[4],
37                                         const int array_len,
38                                         bool filter_sample);
39 struct ColorBand *BKE_colorband_add(bool rangetype);
40 bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4]);
41 void BKE_colorband_evaluate_table_rgba(const struct ColorBand *coba, float **array, int *size);
42 struct CBData *BKE_colorband_element_add(struct ColorBand *coba, float position);
43 bool BKE_colorband_element_remove(struct ColorBand *coba, int index);
44 void BKE_colorband_update_sort(struct ColorBand *coba);
45 
46 #ifdef __cplusplus
47 }
48 #endif
49