Blender  V2.93
IMB_colormanagement_intern.h
Go to the documentation of this file.
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) 2012 by Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 #include "BLI_sys_types.h"
27 #include "DNA_listBase.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 struct ImBuf;
34 struct OCIO_ConstCPUProcessorRcPtr;
35 
36 extern float imbuf_luma_coefficients[3];
37 extern float imbuf_xyz_to_rgb[3][3];
38 extern float imbuf_rgb_to_xyz[3][3];
39 
40 #define MAX_COLORSPACE_NAME 64
41 #define MAX_COLORSPACE_DESCRIPTION 512
42 
43 typedef struct ColorSpace {
44  struct ColorSpace *next, *prev;
45  int index;
48 
49  struct OCIO_ConstCPUProcessorRcPtr *to_scene_linear;
50  struct OCIO_ConstCPUProcessorRcPtr *from_scene_linear;
51 
53  bool is_data;
54 
55  /* Additional info computed only when needed since it's not cheap. */
56  struct {
57  bool cached;
58  bool is_srgb;
60  } info;
62 
63 typedef struct ColorManagedDisplay {
65  int index;
67  ListBase views; /* LinkData.data -> ColorManagedView */
68 
69  struct OCIO_ConstCPUProcessorRcPtr *to_scene_linear;
70  struct OCIO_ConstCPUProcessorRcPtr *from_scene_linear;
72 
73 typedef struct ColorManagedView {
75  int index;
78 
79 typedef struct ColorManagedLook {
81  int index;
86  bool is_noop;
88 
89 /* ** Initialization / De-initialization ** */
90 
91 void colormanagement_init(void);
92 void colormanagement_exit(void);
93 
94 void colormanage_cache_free(struct ImBuf *ibuf);
95 
96 const char *colormanage_display_get_default_name(void);
101 
102 const char *colormanage_view_get_default_name(const ColorManagedDisplay *display);
104 struct ColorManagedView *colormanage_view_add(const char *name);
107 struct ColorManagedView *colormanage_view_get_named_for_display(const char *display_name,
108  const char *name);
109 
110 struct ColorSpace *colormanage_colorspace_add(const char *name,
111  const char *description,
112  bool is_invertible,
113  bool is_data);
117 
118 struct ColorManagedLook *colormanage_look_add(const char *name,
119  const char *process_space,
120  bool is_noop);
123 
124 void colorspace_set_default_role(char *colorspace, int size, int role);
125 
127 void colormanage_imbuf_make_linear(struct ImBuf *ibuf, const char *from_colorspace);
128 
129 #ifdef __cplusplus
130 }
131 #endif
These structs are the foundation for all linked lists in the library system.
struct ColorManagedLook ColorManagedLook
struct ColorManagedDisplay * colormanage_display_get_default(void)
void colormanage_cache_free(struct ImBuf *ibuf)
float imbuf_luma_coefficients[3]
struct ColorSpace * colormanage_colorspace_get_roled(int role)
void colormanagement_init(void)
void colormanage_imbuf_set_default_spaces(struct ImBuf *ibuf)
#define MAX_COLORSPACE_NAME
struct ColorSpace * colormanage_colorspace_get_indexed(int index)
struct ColorManagedView * colormanage_view_get_default(const ColorManagedDisplay *display)
void colormanagement_exit(void)
const char * colormanage_view_get_default_name(const ColorManagedDisplay *display)
struct ColorManagedDisplay * colormanage_display_add(const char *name)
void colormanage_imbuf_make_linear(struct ImBuf *ibuf, const char *from_colorspace)
struct ColorManagedView * colormanage_view_add(const char *name)
struct ColorManagedLook * colormanage_look_get_named(const char *name)
struct ColorManagedView * colormanage_view_get_indexed(int index)
struct ColorManagedView * colormanage_view_get_named(const char *name)
struct ColorManagedDisplay ColorManagedDisplay
struct ColorManagedDisplay * colormanage_display_get_indexed(int index)
float imbuf_rgb_to_xyz[3][3]
void colorspace_set_default_role(char *colorspace, int size, int role)
struct ColorManagedView * colormanage_view_get_named_for_display(const char *display_name, const char *name)
struct ColorManagedLook * colormanage_look_get_indexed(int index)
const char * colormanage_display_get_default_name(void)
float imbuf_xyz_to_rgb[3][3]
struct ColorManagedView ColorManagedView
struct ColorSpace ColorSpace
struct ColorManagedDisplay * colormanage_display_get_named(const char *name)
struct ColorSpace * colormanage_colorspace_add(const char *name, const char *description, bool is_invertible, bool is_data)
struct ColorManagedLook * colormanage_look_add(const char *name, const char *process_space, bool is_noop)
struct ColorSpace * colormanage_colorspace_get_named(const char *name)
#define MAX_COLORSPACE_DESCRIPTION
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
struct ColorManagedDisplay * prev
struct OCIO_ConstCPUProcessorRcPtr * to_scene_linear
char name[MAX_COLORSPACE_NAME]
struct ColorManagedDisplay * next
struct OCIO_ConstCPUProcessorRcPtr * from_scene_linear
char ui_name[MAX_COLORSPACE_NAME]
char view[MAX_COLORSPACE_NAME]
struct ColorManagedLook * next
struct ColorManagedLook * prev
char process_space[MAX_COLORSPACE_NAME]
char name[MAX_COLORSPACE_NAME]
struct ColorManagedView * next
char name[MAX_COLORSPACE_NAME]
struct ColorManagedView * prev
struct ColorSpace * next
struct OCIO_ConstCPUProcessorRcPtr * to_scene_linear
struct ColorSpace * prev
struct OCIO_ConstCPUProcessorRcPtr * from_scene_linear
char name[MAX_COLORSPACE_NAME]
char description[MAX_COLORSPACE_DESCRIPTION]
struct ColorSpace::@669 info