-
-
Save toru-ver4/da122e6bd19705e08aa5f770e9048ae3 to your computer and use it in GitHub Desktop.
A debug code for examining the internal values of DaVinci Resolve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFINE_UI_PARAMS(threshold_r, R_Threshold, DCTLUI_SLIDER_FLOAT, 0.5, 0.0, 20.0, 0.01) | |
DEFINE_UI_PARAMS(threshold_g, G_Threshold, DCTLUI_SLIDER_FLOAT, 0.5, 0.0, 20.0, 0.01) | |
DEFINE_UI_PARAMS(threshold_b, B_Threshold, DCTLUI_SLIDER_FLOAT, 0.5, 0.0, 20.0, 0.01) | |
DEFINE_UI_PARAMS(rgb_all, Sync with Green, DCTLUI_CHECK_BOX, 1) | |
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B) | |
{ | |
float r, g, b; | |
if(rgb_all == 0){ | |
r = ((p_R < threshold_r) ? 0.0f : 1.0f); | |
g = ((p_G < threshold_g) ? 0.0f : 1.0f); | |
b = ((p_B < threshold_b) ? 0.0f : 1.0f); | |
} | |
else if(rgb_all == 1){ | |
r = ((p_R < threshold_g) ? 0.0f : 1.0f); | |
g = ((p_G < threshold_g) ? 0.0f : 1.0f); | |
b = ((p_B < threshold_g) ? 0.0f : 1.0f); | |
} | |
else{ | |
r = 0.5f; | |
g = 0.5f; | |
b = 0.5f; | |
} | |
return make_float3(r, g, b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment