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) 2012 by Blender Foundation.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): Xavier Thomas,
27 * ***** END GPL LICENSE BLOCK *****
31 #ifndef IMB_COLORMANAGEMENT_H
32 #define IMB_COLORMANAGEMENT_H
34 #define BCM_CONFIG_FILE "config.ocio"
36 struct ColorManagedDisplaySettings;
37 struct ColorManagedViewSettings;
38 struct EnumPropertyItem;
42 struct PartialBufferUpdateContext;
45 /* ** Initialization / De-initialization ** */
47 void IMB_colormanagement_init(void);
48 void IMB_colormanagement_exit(void);
50 /* ** Public display buffers interfaces ** */
52 void IMB_colormanage_flags_allocate(struct ImBuf *ibuf);
53 void IMB_colormanage_flags_free(struct ImBuf *ibuf);
55 void IMB_colormanage_cache_data_free(struct ImBuf *ibuf);
57 unsigned char *IMB_display_buffer_acquire(struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings,
58 const struct ColorManagedDisplaySettings *display_settings, void **cache_handle);
59 void IMB_display_buffer_release(void *cache_handle);
61 void IMB_display_buffer_invalidate(struct ImBuf *ibuf);
63 void IMB_colormanagement_check_file_config(struct Main *bmain);
65 const struct ColorManagedViewSettings *IMB_view_settings_get_effective(struct wmWindow *win,
66 const struct ColorManagedViewSettings *view_settings);
68 /* ** Display funcrions ** */
69 int IMB_colormanagement_display_get_named_index(const char *name);
70 const char *IMB_colormanagement_display_get_indexed_name(int index);
71 const char *IMB_colormanagement_display_get_default_name(void);
73 /* ** View funcrions ** */
74 int IMB_colormanagement_view_get_named_index(const char *name);
75 const char *IMB_colormanagement_view_get_indexed_name(int index);
77 /* ** RNA helper functions ** */
78 void IMB_colormanagement_display_items_add(struct EnumPropertyItem **items, int *totitem);
79 void IMB_colormanagement_view_items_add(struct EnumPropertyItem **items, int *totitem, const char *display_name);
81 /* Tile-based buffer management */
82 struct PartialBufferUpdateContext *IMB_partial_buffer_update_context_new(struct ImBuf *ibuf);
83 void IMB_partial_buffer_update_rect(struct PartialBufferUpdateContext *context, const float *linear_buffer, struct rcti *rect);
84 void IMB_partial_buffer_update_free(struct PartialBufferUpdateContext *context, struct ImBuf *ibuf);
86 #endif // IMB_COLORMANAGEMENT_H