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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2018-04-30 01:00:45 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2018-04-30 01:00:45 +0300
commit128506eeb1a2d87393061b4c9783289a5e4b3275 (patch)
tree2b2fd7159489c128f420c949ad24fa6cfd3fefc3 /source/blender/editors
parent16c05161e76621a1943f27abd6bd9f7ee5564efd (diff)
BLI Color: YUV to/from rgb colorspace option
This commit does two things: - Adds an option to do the calculation in different color spaces (BT601 or BT709). - Changes the default caluclation from legacy BT601 to BT709. This affects several areas: - UI areas (mainly scopes) - ViewLevelsNode - Several other nodes that use `COM_ConvertOperation.h`
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_draw.c2
-rw-r--r--source/blender/editors/space_image/image_draw.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 9a05c12e00a..7583dc654bb 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -831,7 +831,7 @@ static void vectorscope_draw_target(float centerx, float centery, float diam, co
float tangle = 0.f, tampli;
float dangle, dampli, dangle2, dampli2;
- rgb_to_yuv(colf[0], colf[1], colf[2], &y, &u, &v);
+ rgb_to_yuv(colf[0], colf[1], colf[2], &y, &u, &v, BLI_YUV_ITU_BT709);
if (u > 0 && v >= 0) tangle = atanf(v / u);
else if (u > 0 && v < 0) tangle = atanf(v / u) + 2.0f * (float)M_PI;
else if (u < 0) tangle = atanf(v / u) + (float)M_PI;
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 4d4beb07f00..594938b82aa 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -360,11 +360,11 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d
if (channels == 1) {
if (fp) {
rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
- rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v);
+ rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v, BLI_YUV_ITU_BT709);
}
else if (cp) {
rgb_to_hsv((float)cp[0] / 255.0f, (float)cp[0] / 255.0f, (float)cp[0] / 255.0f, &hue, &sat, &val);
- rgb_to_yuv((float)cp[0] / 255.0f, (float)cp[0] / 255.0f, (float)cp[0] / 255.0f, &lum, &u, &v);
+ rgb_to_yuv((float)cp[0] / 255.0f, (float)cp[0] / 255.0f, (float)cp[0] / 255.0f, &lum, &u, &v, BLI_YUV_ITU_BT709);
}
BLI_snprintf(str, sizeof(str), "V:%-.4f", val);
@@ -379,7 +379,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d
}
else if (channels >= 3) {
rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
- rgb_to_yuv(finalcol[0], finalcol[1], finalcol[2], &lum, &u, &v);
+ rgb_to_yuv(finalcol[0], finalcol[1], finalcol[2], &lum, &u, &v, BLI_YUV_ITU_BT709);
BLI_snprintf(str, sizeof(str), "H:%-.4f", hue);
BLF_position(blf_mono_font, dx, dy, 0);