Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r--source/blender/editors/space_image/image_ops.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 69e9c975bd1..0fa48059cdc 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3037,8 +3037,12 @@ void IMAGE_OT_unpack(wmOperatorType *ot)
* \{ */
/* Returns color in linear space, matching ED_space_node_color_sample(). */
-bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, int mval[2], float r_col[3])
+bool ED_space_image_color_sample(
+ SpaceImage *sima, ARegion *region, int mval[2], float r_col[3], bool *r_is_data)
{
+ if (r_is_data) {
+ *r_is_data = false;
+ }
if (sima->image == NULL) {
return false;
}
@@ -3076,6 +3080,10 @@ bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, int mval[2],
}
}
+ if (r_is_data) {
+ *r_is_data = (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA) != 0;
+ }
+
ED_space_image_release_buffer(sima, ibuf, lock);
return ret;
}