|
Blender
V2.93
|
#include <stdarg.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_context.h"#include "WM_types.h"#include "RNA_access.h"#include "UI_interface.h"#include "BLT_translation.h"#include "ED_screen.h"#include "IMB_colormanagement.h"#include "interface_intern.h"Go to the source code of this file.
Enumerations | |
| enum | ePickerType { PICKER_TYPE_RGB = 0 , PICKER_TYPE_HSV = 1 , PICKER_TYPE_HEX = 2 } |
Functions | |
Color Conversion | |
| static void | ui_color_picker_rgb_round (float rgb[3]) |
| void | ui_color_picker_rgb_to_hsv_compat (const float rgb[3], float r_cp[3]) |
| void | ui_color_picker_rgb_to_hsv (const float rgb[3], float r_cp[3]) |
| void | ui_color_picker_hsv_to_rgb (const float r_cp[3], float rgb[3]) |
| bool | ui_but_is_color_gamma (uiBut *but) |
| void | ui_scene_linear_to_perceptual_space (uiBut *but, float rgb[3]) |
| void | ui_perceptual_to_scene_linear_space (uiBut *but, float rgb[3]) |
Color Picker | |
| #define | PICKER_H (7.5f * U.widget_unit) |
| #define | PICKER_W (7.5f * U.widget_unit) |
| #define | PICKER_SPACE (0.3f * U.widget_unit) |
| #define | PICKER_BAR (0.7f * U.widget_unit) |
| #define | PICKER_TOTAL_W (PICKER_W + PICKER_SPACE + PICKER_BAR) |
| static void | ui_color_picker_update_hsv (ColorPicker *cpicker, uiBut *from_but, const float rgb_scene_linear[3]) |
| void | ui_but_hsv_set (uiBut *but) |
| static void | ui_update_color_picker_buts_rgb (uiBut *from_but, uiBlock *block, ColorPicker *cpicker, const float rgb_scene_linear[3]) |
| static void | ui_colorpicker_rgba_update_cb (bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) |
| static void | ui_colorpicker_hsv_update_cb (bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) |
| static void | ui_colorpicker_hex_rna_cb (bContext *UNUSED(C), void *bt1, void *hexcl) |
| static void | ui_popup_close_cb (bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) |
| static void | ui_colorpicker_hide_reveal (uiBlock *block, enum ePickerType colormode) |
| static void | ui_colorpicker_create_mode_cb (bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) |
| static void | ui_colorpicker_circle (uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, ColorPicker *cpicker) |
| static void | ui_colorpicker_square (uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, eButGradientType type, ColorPicker *cpicker) |
| static void | ui_block_colorpicker (uiBlock *block, uiBut *from_but, float rgba_scene_linear[4], bool show_picker) |
| static int | ui_colorpicker_small_wheel_cb (const bContext *UNUSED(C), uiBlock *block, const wmEvent *event) |
| uiBlock * | ui_block_func_COLOR (bContext *C, uiPopupBlockHandle *handle, void *arg_but) |
| ColorPicker * | ui_block_colorpicker_create (struct uiBlock *block) |
Color Picker Region & Color Utils
Definition in file interface_region_color_picker.c.
| #define PICKER_BAR (0.7f * U.widget_unit) |
Definition at line 367 of file interface_region_color_picker.c.
| #define PICKER_H (7.5f * U.widget_unit) |
Definition at line 364 of file interface_region_color_picker.c.
| #define PICKER_SPACE (0.3f * U.widget_unit) |
Definition at line 366 of file interface_region_color_picker.c.
| #define PICKER_TOTAL_W (PICKER_W + PICKER_SPACE + PICKER_BAR) |
Definition at line 369 of file interface_region_color_picker.c.
| #define PICKER_W (7.5f * U.widget_unit) |
Definition at line 365 of file interface_region_color_picker.c.
| enum ePickerType |
| Enumerator | |
|---|---|
| PICKER_TYPE_RGB | |
| PICKER_TYPE_HSV | |
| PICKER_TYPE_HEX | |
Definition at line 55 of file interface_region_color_picker.c.
|
static |
Definition at line 497 of file interface_region_color_picker.c.
References BLI_snprintf(), copy_v3_v3(), uiBut::custom_data, uiBut::hardmax, ColorPicker::hsv_scene_linear, IFACE_, IMB_colormanagement_scene_linear_to_srgb_v3(), NULL, PICKER_TOTAL_W, PICKER_TYPE_HEX, PICKER_TYPE_HSV, PICKER_TYPE_RGB, ptr, rgb_float_to_uchar(), RNA_property_float_get_array(), RNA_property_float_range(), RNA_property_float_ui_range(), uiBut::rnapoin, uiBut::rnaprop, TIP_, UI_block_align_begin(), UI_block_align_end(), ui_block_colorpicker_create(), UI_BTYPE_BUT, UI_BTYPE_LABEL, UI_BTYPE_NUM_SLIDER, UI_BTYPE_ROW, UI_BTYPE_TEXT, UI_but_drawflag_disable(), UI_but_flag_disable(), UI_but_func_set(), UI_BUT_ICON_LEFT, ui_but_is_color_gamma(), UI_BUT_TEXT_LEFT, UI_BUT_UNDO, ui_color_picker_rgb_round(), ui_color_picker_update_hsv(), ui_colorpicker_circle(), ui_colorpicker_create_mode_cb(), ui_colorpicker_hex_rna_cb(), ui_colorpicker_hide_reveal(), ui_colorpicker_hsv_update_cb(), ui_colorpicker_rgba_update_cb(), ui_colorpicker_square(), UI_GRAD_HS, UI_GRAD_HV, UI_GRAD_SV, ui_popup_close_cb(), UI_UNIT_X, UI_UNIT_Y, uiDefBut(), uiDefButC(), uiDefButF(), uiDefButR_prop(), uiDefIconButO(), UNPACK3_EX, USER_CP_CIRCLE_HSL, USER_CP_CIRCLE_HSV, USER_CP_SQUARE_HS, USER_CP_SQUARE_HV, USER_CP_SQUARE_SV, width, and WM_OP_INVOKE_DEFAULT.
Referenced by ui_block_func_COLOR().
| ColorPicker* ui_block_colorpicker_create | ( | struct uiBlock * | block | ) |
Definition at line 921 of file interface_region_color_picker.c.
References BLI_addhead(), uiBlock::color_pickers, ColorPickerData::list, and MEM_callocN.
Referenced by ui_block_colorpicker(), and uiTemplateColorPicker().
| uiBlock* ui_block_func_COLOR | ( | bContext * | C, |
| uiPopupBlockHandle * | handle, | ||
| void * | arg_but | ||
| ) |
Definition at line 885 of file interface_region_color_picker.c.
References uiBut::block, uiBlock::block_event_func, C, copy_v3_v3(), uiBlock::direction, uiBut::editvec, uiBlock::flag, uiBlock::is_color_gamma_picker, uiPopupBlockHandle::region, uiPopupBlockHandle::retvec, UI_block_begin(), UI_block_bounds_set_normal(), ui_block_colorpicker(), UI_BLOCK_KEEP_OPEN, UI_BLOCK_LOOP, UI_BLOCK_MOVEMOUSE_QUIT, UI_BLOCK_OUT_1, UI_BLOCK_POPUP, UI_BLOCK_THEME_STYLE_POPUP, UI_block_theme_style_set(), ui_but_is_color_gamma(), ui_colorpicker_small_wheel_cb(), UI_DIR_UP, UI_EMBOSS, and UI_UNIT_X.
Referenced by ui_block_open_begin().
| void ui_but_hsv_set | ( | uiBut * | but | ) |
Definition at line 187 of file interface_region_color_picker.c.
References uiBut::custom_data, ColorPicker::hsv_perceptual, ui_but_v3_set(), and ui_color_picker_hsv_to_rgb().
Referenced by ui_do_but_HSVCIRCLE().
| bool ui_but_is_color_gamma | ( | uiBut * | but | ) |
Definition at line 120 of file interface_region_color_picker.c.
References uiBut::block, uiBlock::is_color_gamma_picker, PROP_COLOR_GAMMA, RNA_property_subtype(), and uiBut::rnaprop.
Referenced by ui_block_colorpicker(), ui_block_func_COLOR(), ui_colorpicker_hex_rna_cb(), ui_draw_but_HSVCIRCLE(), ui_perceptual_to_scene_linear_space(), ui_scene_linear_to_perceptual_space(), ui_update_color_picker_buts_rgb(), and widget_swatch().
Definition at line 106 of file interface_region_color_picker.c.
References hsl_to_rgb_v(), hsv_to_rgb_v(), and USER_CP_CIRCLE_HSL.
Referenced by ui_but_hsv_set(), ui_colorpicker_hsv_update_cb(), ui_colorpicker_small_wheel_cb(), ui_do_but_HSVCIRCLE(), ui_draw_but_HSVCIRCLE(), and ui_numedit_but_HSVCIRCLE().
|
static |
Definition at line 65 of file interface_region_color_picker.c.
References fabsf.
Referenced by ui_block_colorpicker(), ui_colorpicker_hex_rna_cb(), ui_perceptual_to_scene_linear_space(), ui_scene_linear_to_perceptual_space(), and ui_update_color_picker_buts_rgb().
Definition at line 94 of file interface_region_color_picker.c.
References rgb_to_hsl_v(), rgb_to_hsv_v(), and USER_CP_CIRCLE_HSL.
Referenced by ui_color_picker_update_hsv().
Definition at line 80 of file interface_region_color_picker.c.
References rgb_to_hsl_compat_v(), rgb_to_hsv_compat_v(), and USER_CP_CIRCLE_HSL.
Referenced by ui_color_picker_update_hsv(), ui_colorpicker_small_wheel_cb(), ui_do_but_HSVCIRCLE(), ui_draw_but_HSVCIRCLE(), and ui_numedit_but_HSVCIRCLE().
|
static |
Definition at line 156 of file interface_region_color_picker.c.
References copy_v3_v3(), ColorPicker::hsv_perceptual, ColorPicker::hsv_perceptual_init, ColorPicker::hsv_scene_linear, ColorPicker::is_init, ui_color_picker_rgb_to_hsv(), ui_color_picker_rgb_to_hsv_compat(), and ui_scene_linear_to_perceptual_space().
Referenced by ui_block_colorpicker(), and ui_update_color_picker_buts_rgb().
|
static |
Definition at line 371 of file interface_region_color_picker.c.
References uiButHSVCube::but, uiBut::custom_data, uiButHSVCube::gradient_type, NULL, PICKER_BAR, PICKER_H, PICKER_SPACE, PICKER_W, ptr, TIP_, UI_BTYPE_HSVCIRCLE, UI_BTYPE_HSVCUBE, UI_but_func_set(), ui_colorpicker_rgba_update_cb(), UI_GRAD_L_ALT, UI_GRAD_V_ALT, uiDefButR_prop(), and USER_CP_CIRCLE_HSL.
Referenced by ui_block_colorpicker().
|
static |
Definition at line 357 of file interface_region_color_picker.c.
References uiBut::block, ui_but_value_get(), and ui_colorpicker_hide_reveal().
Referenced by ui_block_colorpicker().
|
static |
Definition at line 300 of file interface_region_color_picker.c.
References uiBut::block, uiBut::custom_data, uiBlock::handle, hex_to_rgb(), IMB_colormanagement_srgb_to_scene_linear_v3(), uiPopupBlockHandle::menuretval, ui_but_is_color_gamma(), ui_color_picker_rgb_round(), UI_RETURN_UPDATE, and ui_update_color_picker_buts_rgb().
Referenced by ui_block_colorpicker(), and ui_colorpicker_hide_reveal().
|
static |
Definition at line 337 of file interface_region_color_picker.c.
References uiBlock::buttons, LISTBASE_FOREACH, PICKER_TYPE_HEX, PICKER_TYPE_HSV, PICKER_TYPE_RGB, SET_FLAG_FROM_TEST, UI_BTYPE_LABEL, UI_BTYPE_NUM_SLIDER, ui_colorpicker_hex_rna_cb(), ui_colorpicker_hsv_update_cb(), ui_colorpicker_rgba_update_cb(), and UI_HIDDEN.
Referenced by ui_block_colorpicker(), and ui_colorpicker_create_mode_cb().
|
static |
Definition at line 285 of file interface_region_color_picker.c.
References uiBut::block, uiBut::custom_data, uiBlock::handle, ColorPicker::hsv_scene_linear, uiPopupBlockHandle::menuretval, ui_color_picker_hsv_to_rgb(), UI_RETURN_UPDATE, and ui_update_color_picker_buts_rgb().
Referenced by ui_block_colorpicker(), and ui_colorpicker_hide_reveal().
|
static |
Definition at line 267 of file interface_region_color_picker.c.
References uiBut::block, uiBut::custom_data, uiBlock::handle, uiPopupBlockHandle::menuretval, ptr, RNA_property_float_get_array(), uiBut::rnapoin, uiBut::rnaprop, UI_RETURN_UPDATE, and ui_update_color_picker_buts_rgb().
Referenced by ui_block_colorpicker(), ui_colorpicker_circle(), ui_colorpicker_hide_reveal(), and ui_colorpicker_square().
|
static |
Definition at line 841 of file interface_region_color_picker.c.
References add(), uiBlock::buttons, clamp_f(), uiBlock::handle, ColorPicker::hsv_perceptual, LISTBASE_FOREACH, uiPopupBlockHandle::menuretval, NULL, wmEvent::type, UI_BTYPE_HSVCUBE, ui_but_v3_get(), ui_but_v3_set(), ui_color_picker_hsv_to_rgb(), ui_color_picker_rgb_to_hsv_compat(), ui_perceptual_to_scene_linear_space(), UI_RETURN_UPDATE, ui_scene_linear_to_perceptual_space(), ui_update_color_picker_buts_rgb(), WHEELDOWNMOUSE, and WHEELUPMOUSE.
Referenced by ui_block_func_COLOR().
|
static |
Definition at line 443 of file interface_region_color_picker.c.
References BLI_assert, uiButHSVCube::but, uiBut::custom_data, uiButHSVCube::gradient_type, NULL, PICKER_BAR, PICKER_H, PICKER_SPACE, PICKER_TOTAL_W, ptr, TIP_, type, UI_BTYPE_HSVCUBE, UI_but_func_set(), ui_colorpicker_rgba_update_cb(), UI_GRAD_HS, and uiDefButR_prop().
Referenced by ui_block_colorpicker().
Definition at line 142 of file interface_region_color_picker.c.
References IMB_colormanagement_color_picking_to_scene_linear_v3(), ui_but_is_color_gamma(), and ui_color_picker_rgb_round().
Referenced by ui_colorpicker_small_wheel_cb(), ui_draw_but_HSVCIRCLE(), ui_numedit_but_HSVCIRCLE(), and ui_numedit_but_HSVCUBE().
|
static |
Definition at line 323 of file interface_region_color_picker.c.
References BLI_assert, uiBut::block, uiBut::custom_data, equals_v3v3(), uiBlock::handle, ColorPicker::hsv_perceptual, ColorPicker::hsv_perceptual_init, ColorPicker::is_init, uiPopupBlockHandle::menuretval, UI_RETURN_CANCEL, and UI_RETURN_OK.
Referenced by ui_block_colorpicker().
Definition at line 131 of file interface_region_color_picker.c.
References IMB_colormanagement_scene_linear_to_color_picking_v3(), ui_but_is_color_gamma(), and ui_color_picker_rgb_round().
Referenced by ui_color_picker_update_hsv(), ui_colorpicker_small_wheel_cb(), ui_draw_but_HSV_v(), ui_draw_but_HSVCIRCLE(), ui_draw_but_HSVCUBE(), ui_numedit_but_HSVCIRCLE(), and ui_numedit_but_HSVCUBE().
|
static |
Definition at line 200 of file interface_region_color_picker.c.
References BLI_snprintf(), uiBlock::buttons, col, copy_v3_v3(), ColorPicker::hsv_scene_linear, IMB_colormanagement_scene_linear_to_srgb_v3(), LISTBASE_FOREACH, rgb_float_to_uchar(), STREQ, UI_but_flag_disable(), ui_but_is_color_gamma(), UI_BUT_UNDO, ui_but_update(), ui_but_v3_set(), ui_but_value_set(), ui_color_picker_rgb_round(), ui_color_picker_update_hsv(), and UNPACK3_EX.
Referenced by ui_colorpicker_hex_rna_cb(), ui_colorpicker_hsv_update_cb(), ui_colorpicker_rgba_update_cb(), and ui_colorpicker_small_wheel_cb().