28 "Do not perform any color transform on load, treat colors as in scene linear space "
30 {0,
nullptr, 0,
nullptr,
nullptr},
35# include <fmt/format.h>
73struct SeqCurveMappingUpdateData {
78static bool seq_update_modifier_curve(
Strip *strip,
void *user_data)
82 SeqCurveMappingUpdateData *
data =
static_cast<SeqCurveMappingUpdateData *
>(user_data);
99 SeqCurveMappingUpdateData
data{scene, curve};
111 if (!cumap->cm[
len].curve) {
124 iter,
ptr, cumap->cm,
sizeof(
CurveMap), rna_CurveMapping_curves_length(
ptr), 0,
nullptr);
127static void rna_CurveMapping_clip_set(
PointerRNA *
ptr,
bool value)
146static void rna_CurveMapping_black_level_set(
PointerRNA *
ptr,
const float *values)
149 cumap->black[0] = values[0];
150 cumap->black[1] = values[1];
151 cumap->black[2] = values[2];
155static void rna_CurveMapping_white_level_set(
PointerRNA *
ptr,
const float *values)
158 cumap->white[0] = values[0];
159 cumap->white[1] = values[1];
160 cumap->white[2] = values[2];
171 curve_mapping->cur = 3;
174 seq_notify_curve_update(curve_mapping,
ptr->owner_id);
179static void rna_CurveMapping_extend_update(
Main * ,
187static void rna_CurveMapping_clipminx_range(
193 *
max = cumap->clipr.xmax;
196static void rna_CurveMapping_clipminy_range(
202 *
max = cumap->clipr.ymax;
205static void rna_CurveMapping_clipmaxx_range(
210 *
min = cumap->clipr.xmin;
214static void rna_CurveMapping_clipmaxy_range(
219 *
min = cumap->clipr.ymin;
223static std::optional<std::string> rna_ColorRamp_path(
const PointerRNA *
ptr)
227 ID *
id =
ptr->owner_id;
242 return fmt::format(
"{}.color_ramp", node_path);
267static std::optional<std::string> rna_ColorRampElement_path(
const PointerRNA *
ptr)
271 std::optional<std::string> path;
278# define COLRAMP_GETPATH \
280 prop = RNA_struct_find_property(&ramp_ptr, "elements"); \
282 index = RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \
284 std::string texture_path = rna_ColorRamp_path(&ramp_ptr).value_or(""); \
285 path = fmt::format("{}.elements[{}]", texture_path, index); \
294 ID *
id =
ptr->owner_id;
335# undef COLRAMP_GETPATH
343 ID *
id =
ptr->owner_id;
391static void rna_ColorRamp_eval(
ColorBand *coba,
float position,
float color[4])
407static void rna_ColorRampElement_remove(
ColorBand *coba,
443 if (parent_ptr.
data) {
445 if (display_ptr.
type == &RNA_ColorManagedDisplaySettings) {
451 return &
reinterpret_cast<const Scene *
>(
ptr->owner_id)->display_settings;
456 return &scene->display_settings;
466 if (parent_ptr.
data) {
468 if (view_ptr.
type == &RNA_ColorManagedViewSettings) {
476static int rna_ColorManagedDisplaySettings_display_device_get(
PointerRNA *
ptr)
483static void rna_ColorManagedDisplaySettings_display_device_set(
PointerRNA *
ptr,
int value)
493static const EnumPropertyItem *rna_ColorManagedDisplaySettings_display_device_itemf(
507static void rna_display_and_view_settings_node_update(
Main *bmain,
PointerRNA *
ptr)
509 ID *
id =
ptr->owner_id;
515 node_ptr = node_ptr.
parent();
527static void rna_ColorManagedDisplaySettings_display_device_update(
Main *bmain,
531 ID *
id =
ptr->owner_id;
543 ma =
static_cast<Material *
>(ma->id.next))
558 rna_display_and_view_settings_node_update(bmain,
ptr);
562static int rna_ColorManagedViewSettings_view_transform_get(
PointerRNA *
ptr)
568static void rna_ColorManagedViewSettings_view_transform_set(
PointerRNA *
ptr,
int value)
585static const EnumPropertyItem *rna_ColorManagedViewSettings_view_transform_itemf(
601static int rna_ColorManagedViewSettings_look_get(
PointerRNA *
ptr)
608static void rna_ColorManagedViewSettings_look_set(
PointerRNA *
ptr,
int value)
635static void rna_ColorManagedViewSettings_use_curves_set(
PointerRNA *
ptr,
bool value)
642 if (view_settings->curve_mapping ==
nullptr) {
651static void rna_ColorManagedViewSettings_whitepoint_get(
PointerRNA *
ptr,
float value[3])
657static void rna_ColorManagedViewSettings_whitepoint_set(
PointerRNA *
ptr,
const float value[3])
663static bool rna_ColorManagedViewSettings_is_hdr_get(
PointerRNA *
ptr)
669 const Scene *scene =
reinterpret_cast<const Scene *
>(
ptr->owner_id);
674 view_settings->view_transform);
677static bool rna_ColorManagedViewSettings_support_emulation_get(
PointerRNA *
ptr)
683 const Scene *scene =
reinterpret_cast<const Scene *
>(
ptr->owner_id);
688 view_settings->view_transform);
691static int rna_ViewSettings_only_view_look_editable(
const PointerRNA *
ptr,
const char **r_info)
697 *r_info =
N_(
"Only view transform and look can be edited for these settings");
705static bool rna_ColorManagedColorspaceSettings_is_data_get(
PointerRNA *
ptr)
709 return STREQ(colorspace->name, data_name);
712static void rna_ColorManagedColorspaceSettings_is_data_set(
PointerRNA *
ptr,
bool value)
721static int rna_ColorManagedColorspaceSettings_colorspace_get(
PointerRNA *
ptr)
728static void rna_ColorManagedColorspaceSettings_colorspace_set(
PointerRNA *
ptr,
int value)
738static const EnumPropertyItem *rna_ColorManagedColorspaceSettings_colorspace_itemf(
752struct Seq_colorspace_cb_data {
762static bool strip_find_colorspace_settings_cb(
Strip *strip,
void *user_data)
764 Seq_colorspace_cb_data *cd = (Seq_colorspace_cb_data *)user_data;
772static void rna_ColorManagedColorspaceSettings_reload_update(
Main *bmain,
776 ID *
id =
ptr->owner_id;
810 Seq_colorspace_cb_data cb_data = {colorspace_settings,
nullptr};
819 &scene->
ed->
seqbase, strip_find_colorspace_settings_cb, &cb_data);
820 Strip *strip = cb_data.r_seq;
839static std::optional<std::string> rna_ColorManagedSequencerColorspaceSettings_path(
842 return "sequencer_colorspace_settings";
847 ID *
id =
ptr->owner_id;
857 rna_display_and_view_settings_node_update(bmain,
ptr);
862static float rna_CurveMapping_evaluateF(
CurveMapping *cumap,
867 if (&cumap->
cm[0] != cuma && &cumap->
cm[1] != cuma && &cumap->
cm[2] != cuma &&
868 &cumap->
cm[3] != cuma)
891 {0,
"AUTO", 0,
"Auto Handle",
""},
894 {0,
nullptr, 0,
nullptr,
nullptr},
909 prop,
"Handle Type",
"Curve interpolation at this point: Bézier or vector");
935 "Position to add point",
942 parm =
RNA_def_pointer(func,
"point",
"CurveMapPoint",
"",
"New point");
948 parm =
RNA_def_pointer(func,
"point",
"CurveMapPoint",
"",
"PointElement to remove");
979 "Combined curve is applied to each channel individually, which may result in a change of "
982 {0,
nullptr, 0,
nullptr,
nullptr},
986 {0,
"HORIZONTAL", 0,
"Horizontal",
""},
988 {0,
nullptr, 0,
nullptr,
nullptr},
995 "Curve mapping to map color, vector and scalar values to other values using "
996 "a user defined curve");
1042 "rna_CurveMapping_curves_begin",
1043 "rna_iterator_array_next",
1044 "rna_iterator_array_end",
1045 "rna_iterator_array_get",
1046 "rna_CurveMapping_curves_length",
1058 prop,
"Black Level",
"For RGB curves, the color that black is mapped to");
1066 prop,
"White Level",
"For RGB curves, the color that white is mapped to");
1072 func =
RNA_def_function(srna,
"reset_view",
"BKE_curvemapping_reset_view");
1081 parm =
RNA_def_pointer(func,
"curve",
"CurveMap",
"curve",
"Curve to evaluate");
1089 "Position to evaluate curve at",
1099 "Value of curve at given location",
1114 srna,
"Color Ramp Element",
"Element defining a color at a position in the color ramp");
1152 func,
"position", 0.0f, 0.0f, 1.0f,
"Position",
"Position to add element", 0.0f, 1.0f);
1155 parm =
RNA_def_pointer(func,
"element",
"ColorRampElement",
"",
"New element");
1161 parm =
RNA_def_pointer(func,
"element",
"ColorRampElement",
"",
"Element to remove");
1180 {0,
nullptr, 0,
nullptr,
nullptr},
1187 {0,
nullptr, 0,
nullptr,
nullptr},
1195 {0,
nullptr, 0,
nullptr,
nullptr},
1246 "Evaluate Color Ramp at position",
1258 "Color at given position",
1277 {0,
nullptr, 0,
nullptr,
nullptr},
1307 {0,
nullptr, 0,
nullptr,
nullptr},
1313 {0,
nullptr, 0,
nullptr,
nullptr},
1329 prop,
"Accuracy",
"Proportion of original image source pixel lines to sample");
1366 {0,
"NONE", 0,
"None",
""},
1367 {0,
nullptr, 0,
nullptr,
nullptr},
1375 "Directly output image as produced by OpenColorIO. This is not correct in general, but "
1376 "may be used when the system configuration and actual display device is known to match "
1377 "the chosen display"},
1382 "Display images consistent with most other applications, to preview images and video for "
1383 "export. A best effort is made to emulate the chosen display on the actual display "
1385 {0,
nullptr, 0,
nullptr,
nullptr},
1389 {0,
"NONE", 0,
"None",
"Do not modify image in an artistic manner"},
1390 {0,
nullptr, 0,
nullptr,
nullptr},
1398 "Do not perform any color transform on display, use old non-color managed technique for "
1400 {0,
nullptr, 0,
nullptr,
nullptr},
1404 srna =
RNA_def_struct(brna,
"ColorManagedDisplaySettings",
nullptr);
1407 srna,
"ColorManagedDisplaySettings",
"Color management specific to display device");
1412 "rna_ColorManagedDisplaySettings_display_device_get",
1413 "rna_ColorManagedDisplaySettings_display_device_set",
1414 "rna_ColorManagedDisplaySettings_display_device_itemf");
1418 "Display name. For viewing, this is the display device that will be emulated by limiting "
1419 "the gamut and HDR colors. For image and video output, this is the display space used for "
1422 prop,
NC_WINDOW,
"rna_ColorManagedDisplaySettings_display_device_update");
1428 "Display Emulation",
1429 "Control how images in the chosen display are mapped to the physical display");
1431 prop,
NC_WINDOW,
"rna_ColorManagedDisplaySettings_display_device_update");
1434 srna =
RNA_def_struct(brna,
"ColorManagedViewSettings",
nullptr);
1437 "ColorManagedViewSettings",
1438 "Color management settings used for displaying images on the display");
1443 "rna_ColorManagedViewSettings_look_get",
1444 "rna_ColorManagedViewSettings_look_set",
1445 "rna_ColorManagedViewSettings_look_itemf");
1447 prop,
"Look",
"Additional transform applied before view transform for artistic needs");
1453 "rna_ColorManagedViewSettings_view_transform_get",
1454 "rna_ColorManagedViewSettings_view_transform_set",
1455 "rna_ColorManagedViewSettings_view_transform_itemf");
1467 "Exposure (stops) applied before display transform, multiplying by 2^exposure");
1478 "Additional gamma encoding after display transform, for output with custom gamma");
1497 prop,
"Use White Balance",
"Perform chromatic adaption from a different white point");
1516 prop,
"Tint",
"Color tint of the scene's white point (the default of 10 matches daylight)");
1523 "rna_ColorManagedViewSettings_whitepoint_get",
1524 "rna_ColorManagedViewSettings_whitepoint_set",
1528 "The color which gets mapped to white "
1529 "(automatically converted to/from temperature and tint)");
1536 prop,
"Is HDR",
"The display and view transform supports high dynamic range colors");
1543 "Support Emulation",
1544 "The display and view transform supports automatic emulation for another display device, "
1545 "using the display color spaces mechanism in OpenColorIO v2 configurations");
1547 prop,
"rna_ColorManagedViewSettings_support_emulation_get",
nullptr);
1550 srna =
RNA_def_struct(brna,
"ColorManagedInputColorspaceSettings",
nullptr);
1553 srna,
"ColorManagedInputColorspaceSettings",
"Input color space settings");
1560 "rna_ColorManagedColorspaceSettings_colorspace_get",
1561 "rna_ColorManagedColorspaceSettings_colorspace_set",
1562 "rna_ColorManagedColorspaceSettings_colorspace_itemf");
1565 "Input Color Space",
1566 "Color space in the image file, to convert to and from when saving and loading the image");
1572 "rna_ColorManagedColorspaceSettings_is_data_get",
1573 "rna_ColorManagedColorspaceSettings_is_data_set");
1577 "Treat image as non-color data without color management, like normal or displacement maps");
1581 srna =
RNA_def_struct(brna,
"ColorManagedSequencerColorspaceSettings",
nullptr);
1584 srna,
"ColorManagedSequencerColorspaceSettings",
"Input color space settings");
1590 "rna_ColorManagedColorspaceSettings_colorspace_get",
1591 "rna_ColorManagedColorspaceSettings_colorspace_set",
1592 "rna_ColorManagedColorspaceSettings_colorspace_itemf");
CBData * BKE_colorband_element_add(ColorBand *coba, float position)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
bool BKE_colorband_element_remove(ColorBand *coba, int index)
Scene * CTX_data_scene(const bContext *C)
#define IMA_SIGNAL_COLORMANAGE
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
Blender kernel freestyle line style functionality.
void BKE_linestyle_modifier_list_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase)
std::optional< std::string > BKE_linestyle_path_to_color_ramp(FreestyleLineStyle *linestyle, const struct ColorBand *color_ramp)
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
#define TEX_NODE_VALTORGB
void BKE_ntree_update_tag_node_property(bNodeTree *ntree, bNode *node)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_COLOR
void DEG_id_tag_update(ID *id, unsigned int flags)
@ COLORMANAGE_VIEW_ONLY_VIEW_LOOK
@ COLORMANAGE_VIEW_USE_WHITE_BALANCE
@ COLORMANAGE_VIEW_USE_CURVES
@ CUMA_EXTEND_EXTRAPOLATE
struct CurveMapping CurveMapping
@ SCOPES_WAVEFRM_YCC_JPEG
@ SCOPES_WAVEFRM_RGB_PARADE
struct ColorManagedColorspaceSettings ColorManagedColorspaceSettings
@ COLORMANAGE_DISPLAY_EMULATION_OFF
@ COLORMANAGE_DISPLAY_EMULATION_AUTO
@ COLBAND_INTERP_CONSTANT
@ COLBAND_INTERP_B_SPLINE
@ COLBAND_INTERP_CARDINAL
Object is a sort of wrapper for general info.
@ eSeqModifierType_Curves
bool IMB_colormanagement_display_support_emulation(const ColorManagedDisplaySettings *display_settings, const char *view_name)
void IMB_colormanagement_colorspace_items_add(EnumPropertyItem **items, int *totitem)
bool IMB_colormanagement_set_whitepoint(const float whitepoint[3], float &temperature, float &tint)
const char * IMB_colormanagement_colorspace_get_indexed_name(int index)
bool IMB_colormanagement_display_is_hdr(const ColorManagedDisplaySettings *display_settings, const char *view_name)
void IMB_colormanagement_view_items_add(EnumPropertyItem **items, int *totitem, const char *display_name)
const char * IMB_colormanagement_look_get_indexed_name(int index)
const char * IMB_colormanagement_look_validate_for_view(const char *view_name, const char *look_name)
const char * IMB_colormanagement_view_get_name_by_id(int index)
void IMB_colormanagement_validate_settings(const ColorManagedDisplaySettings *display_settings, ColorManagedViewSettings *view_settings)
void IMB_colormanagement_get_whitepoint(const float temperature, const float tint, float whitepoint[3])
int IMB_colormanagement_view_get_id_by_name(const char *name)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
const char * IMB_colormanagement_display_get_indexed_name(int index)
int IMB_colormanagement_look_get_named_index(const char *name)
void IMB_colormanagement_display_items_add(EnumPropertyItem **items, int *totitem)
int IMB_colormanagement_colorspace_get_named_index(const char *name)
void IMB_colormanagement_look_items_add(EnumPropertyItem **items, int *totitem, const char *view_name)
int IMB_colormanagement_display_get_named_index(const char *name)
Read Guarded memory(de)allocation.
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const void * element
void MOV_close(MovieReader *anim)
void relations_strip_free_anim(Strip *strip)
void foreach_strip(ListBase *seqbase, ForEachFunc callback, void *user_data)
void relations_invalidate_cache(Scene *scene, Strip *strip)
void relations_invalidate_scene_strips(const Main *bmain, const Scene *scene_target)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
void relations_invalidate_movieclip_strips(Main *bmain, MovieClip *clip_target)
void cache_cleanup(Scene *scene)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
static void rna_def_curvemap(BlenderRNA *brna)
static void rna_def_curvemap_points_api(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_color(BlenderRNA *brna)
static void rna_def_curvemappoint(BlenderRNA *brna)
static void rna_def_color_ramp(BlenderRNA *brna)
static void rna_def_curvemapping(BlenderRNA *brna)
static void rna_def_histogram(BlenderRNA *brna)
static void rna_def_color_ramp_element(BlenderRNA *brna)
static void rna_def_scopes(BlenderRNA *brna)
static void rna_def_colormanage(BlenderRNA *brna)
const EnumPropertyItem rna_enum_color_space_convert_default_items[]
static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem prop_handle_type_items[]
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
std::optional< std::string > RNA_path_from_ID_to_struct(const PointerRNA *ptr)
bool RNA_path_resolve(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
struct CurveMapping curve_mapping
PointerRNA parent() const
ColorManagedViewSettings view_settings
ColorManagedColorspaceSettings sequencer_colorspace_settings
ColorManagedDisplaySettings display_settings
ColorManagedColorspaceSettings colorspace_settings
struct MovieReader * anim
void WM_main_add_notifier(uint type, void *reference)