Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/colormanagement.c
| Show First 20 Lines • Show All 498 Lines • ▼ Show 20 Lines | for (index = 0; index < tot_colorspace; index++) { | ||||
| name = OCIO_configGetColorSpaceNameByIndex(config, index); | name = OCIO_configGetColorSpaceNameByIndex(config, index); | ||||
| ocio_colorspace = OCIO_configGetColorSpace(config, name); | ocio_colorspace = OCIO_configGetColorSpace(config, name); | ||||
| description = OCIO_colorSpaceGetDescription(ocio_colorspace); | description = OCIO_colorSpaceGetDescription(ocio_colorspace); | ||||
| is_invertible = OCIO_colorSpaceIsInvertible(ocio_colorspace); | is_invertible = OCIO_colorSpaceIsInvertible(ocio_colorspace); | ||||
| is_data = OCIO_colorSpaceIsData(ocio_colorspace); | is_data = OCIO_colorSpaceIsData(ocio_colorspace); | ||||
| colormanage_colorspace_add(name, description, is_invertible, is_data); | ColorSpace *colorspace = colormanage_colorspace_add(name, description, is_invertible, is_data); | ||||
| colorspace->num_aliases = OCIO_colorSpaceGetNumAliases(ocio_colorspace); | |||||
| if (colorspace->num_aliases > 0) { | |||||
| colorspace->aliases = MEM_callocN(sizeof(*colorspace->aliases) * colorspace->num_aliases, | |||||
| "ColorSpace aliases"); | |||||
| for (int i = 0; i < colorspace->num_aliases; i++) { | |||||
| STRNCPY(colorspace->aliases[i], OCIO_colorSpaceGetAlias(ocio_colorspace, i)); | |||||
| } | |||||
| } | |||||
| OCIO_colorSpaceRelease(ocio_colorspace); | OCIO_colorSpaceRelease(ocio_colorspace); | ||||
| } | } | ||||
| /* load displays */ | /* load displays */ | ||||
| viewindex2 = 0; | viewindex2 = 0; | ||||
| tot_display = OCIO_configGetNumDisplays(config); | tot_display = OCIO_configGetNumDisplays(config); | ||||
| ▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | while (colorspace) { | ||||
| if (colorspace->to_scene_linear) { | if (colorspace->to_scene_linear) { | ||||
| OCIO_cpuProcessorRelease((OCIO_ConstCPUProcessorRcPtr *)colorspace->to_scene_linear); | OCIO_cpuProcessorRelease((OCIO_ConstCPUProcessorRcPtr *)colorspace->to_scene_linear); | ||||
| } | } | ||||
| if (colorspace->from_scene_linear) { | if (colorspace->from_scene_linear) { | ||||
| OCIO_cpuProcessorRelease((OCIO_ConstCPUProcessorRcPtr *)colorspace->from_scene_linear); | OCIO_cpuProcessorRelease((OCIO_ConstCPUProcessorRcPtr *)colorspace->from_scene_linear); | ||||
| } | } | ||||
| /* free color space itself */ | /* free color space itself */ | ||||
| MEM_SAFE_FREE(colorspace->aliases); | |||||
| MEM_freeN(colorspace); | MEM_freeN(colorspace); | ||||
| colorspace = colorspace_next; | colorspace = colorspace_next; | ||||
| } | } | ||||
| BLI_listbase_clear(&global_colorspaces); | BLI_listbase_clear(&global_colorspaces); | ||||
| global_tot_colorspace = 0; | global_tot_colorspace = 0; | ||||
| /* free displays */ | /* free displays */ | ||||
| ▲ Show 20 Lines • Show All 2,450 Lines • ▼ Show 20 Lines | |||||
| ColorSpace *colormanage_colorspace_get_named(const char *name) | ColorSpace *colormanage_colorspace_get_named(const char *name) | ||||
| { | { | ||||
| ColorSpace *colorspace; | ColorSpace *colorspace; | ||||
| for (colorspace = global_colorspaces.first; colorspace; colorspace = colorspace->next) { | for (colorspace = global_colorspaces.first; colorspace; colorspace = colorspace->next) { | ||||
| if (STREQ(colorspace->name, name)) { | if (STREQ(colorspace->name, name)) { | ||||
| return colorspace; | return colorspace; | ||||
| } | } | ||||
| for (int i = 0; i < colorspace->num_aliases; i++) { | |||||
| if (STREQ(colorspace->aliases[i], name)) { | |||||
| return colorspace; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ColorSpace *colormanage_colorspace_get_roled(int role) | ColorSpace *colormanage_colorspace_get_roled(int role) | ||||
| { | { | ||||
| const char *role_colorspace = IMB_colormanagement_role_colorspace_name_get(role); | const char *role_colorspace = IMB_colormanagement_role_colorspace_name_get(role); | ||||
| ▲ Show 20 Lines • Show All 995 Lines • Show Last 20 Lines | |||||