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 ColorManagedViewSettings;
37 struct EnumPropertyItem;
41 struct PartialBufferUpdateContext;
44 /* ** Initialization / De-initialization ** */
46 void IMB_colormanagement_init(void);
47 void IMB_colormanagement_exit(void);
49 /* ** Public display buffers interfaces ** */
51 void IMB_colormanage_flags_allocate(struct ImBuf *ibuf);
52 void IMB_colormanage_flags_free(struct ImBuf *ibuf);
54 void IMB_colormanage_cache_data_free(struct ImBuf *ibuf);
56 unsigned char *IMB_display_buffer_acquire(struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings,
57 const char *display, void **cache_handle);
58 void IMB_display_buffer_release(void *cache_handle);
60 void IMB_display_buffer_invalidate(struct ImBuf *ibuf);
62 void IMB_colormanagement_check_file_config(struct Main *bmain);
64 const struct ColorManagedViewSettings *IMB_view_settings_get_effective(struct wmWindow *win,
65 const struct ColorManagedViewSettings *view_settings);
67 /* ** Display funcrions ** */
68 int IMB_colormanagement_display_get_named_index(const char *name);
69 const char *IMB_colormanagement_display_get_indexed_name(int index);
71 /* ** View funcrions ** */
72 int IMB_colormanagement_view_get_named_index(const char *name);
73 const char *IMB_colormanagement_view_get_indexed_name(int index);
75 /* ** RNA helper functions ** */
76 void IMB_colormanagement_display_items_add(struct EnumPropertyItem **items, int *totitem);
77 void IMB_colormanagement_view_items_add(struct EnumPropertyItem **items, int *totitem, const char *display_name);
79 /* Tile-based buffer management */
80 struct PartialBufferUpdateContext *IMB_partial_buffer_update_context_new(struct ImBuf *ibuf);
81 void IMB_partial_buffer_update_rect(struct PartialBufferUpdateContext *context, const float *linear_buffer, struct rcti *rect);
82 void IMB_partial_buffer_update_free(struct PartialBufferUpdateContext *context, struct ImBuf *ibuf);
84 #endif // IMB_COLORMANAGEMENT_H