Colormanagement: Fix issue with colorspaces' description too short, and reduce usage of magic numbers.

This commit is contained in:
Bastien Montagne
2013-03-11 11:15:05 +00:00
parent 28857e8c9e
commit 5b53a17bfb
3 changed files with 8 additions and 5 deletions

View File

@@ -36,11 +36,14 @@
struct OCIO_ConstProcessorRcPtr;
struct ImBuf;
#define MAX_COLORSPACE_NAME 64
#define MAX_COLORSPACE_DESCRIPTION 512
typedef struct ColorSpace {
struct ColorSpace *next, *prev;
int index;
char name[64];
char description[64];
char name[MAX_COLORSPACE_NAME];
char description[MAX_COLORSPACE_DESCRIPTION];
struct OCIO_ConstProcessorRcPtr *to_scene_linear;
struct OCIO_ConstProcessorRcPtr *from_scene_linear;
@@ -52,7 +55,7 @@ typedef struct ColorSpace {
typedef struct ColorManagedDisplay {
struct ColorManagedDisplay *next, *prev;
int index;
char name[64];
char name[MAX_COLORSPACE_NAME];
ListBase views;
struct OCIO_ConstProcessorRcPtr *to_scene_linear;
@@ -62,7 +65,7 @@ typedef struct ColorManagedDisplay {
typedef struct ColorManagedView {
struct ColorManagedView *next, *prev;
int index;
char name[64];
char name[MAX_COLORSPACE_NAME];
} ColorManagedView;
/* ** Initialization / De-initialization ** */

View File

@@ -71,7 +71,6 @@
/*********************** Global declarations *************************/
#define MAX_COLORSPACE_NAME 64
#define DISPLAY_BUFFER_CHANNELS 4
/* ** list of all supported color spaces, displays and views */

View File

@@ -993,6 +993,7 @@ static void rna_def_colormanage(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "ColorManagedSequencerColorspaceSettings", "Input color space settings");
prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
RNA_def_property_enum_items(prop, color_space_items);
RNA_def_property_enum_funcs(prop, "rna_ColorManagedColorspaceSettings_colorspace_get",
"rna_ColorManagedColorspaceSettings_colorspace_set",