|
Blender V4.3
|
#include <cstdarg>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "WM_types.hh"#include "RNA_access.hh"#include "UI_interface.hh"#include "BLT_translation.hh"#include "IMB_colormanagement.hh"#include "interface_intern.hh"Go to the source code of this file.
Enumerations | |
| enum | ePickerType { PICKER_TYPE_RGB = 0 , PICKER_TYPE_HSV = 1 } |
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) |
| bool | ui_but_color_has_alpha (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 Region & Color Utils
Definition in file interface_region_color_picker.cc.
| #define PICKER_BAR ((8.0f * UI_SCALE_FAC) + (6 * U.pixelsize)) |
Definition at line 361 of file interface_region_color_picker.cc.
Referenced by ui_colorpicker_circle(), and ui_colorpicker_square().
Definition at line 364 of file interface_region_color_picker.cc.
Referenced by ui_colorpicker_circle(), and ui_colorpicker_square().
| #define PICKER_SPACE (8.0f * UI_SCALE_FAC) |
Definition at line 362 of file interface_region_color_picker.cc.
Referenced by ui_colorpicker_circle(), and ui_colorpicker_square().
| #define PICKER_TOTAL_W (180.0f * UI_SCALE_FAC) |
Definition at line 360 of file interface_region_color_picker.cc.
Referenced by ui_block_colorpicker(), and ui_colorpicker_square().
| #define PICKER_W (PICKER_TOTAL_W - PICKER_BAR - PICKER_SPACE) |
Definition at line 363 of file interface_region_color_picker.cc.
Referenced by ui_colorpicker_circle().
| enum ePickerType |
| Enumerator | |
|---|---|
| PICKER_TYPE_RGB | |
| PICKER_TYPE_HSV | |
Definition at line 35 of file interface_region_color_picker.cc.
|
static |
Definition at line 482 of file interface_region_color_picker.cc.
References BLT_I18NCONTEXT_COLOR, copy_v4_v4(), CTX_IFACE_, CTX_TIP_, uiBut::custom_data, FLT_MAX, uiBut::hardmax, ColorPicker::has_alpha, ColorPicker::hsv_scene_linear, IFACE_, IMB_colormanagement_scene_linear_to_srgb_v3(), PICKER_TOTAL_W, PICKER_TYPE_HSV, PICKER_TYPE_RGB, ptr, rgba_float_to_uchar(), RNA_property_float_get_array(), RNA_property_float_range(), RNA_property_float_ui_range(), uiBut::rnapoin, uiBut::rnaprop, SNPRINTF, 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_color_has_alpha(), UI_but_drawflag_disable(), UI_but_flag_disable(), UI_but_func_set(), UI_but_func_tooltip_custom_set(), UI_BUT_ICON_LEFT, ui_but_is_color_gamma(), UI_but_number_slider_precision_set(), UI_but_number_slider_step_size_set(), 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_TIP_LC_NORMAL, UI_TIP_STYLE_HEADER, UI_TIP_STYLE_NORMAL, UI_tooltip_text_field_add(), UI_UNIT_X, UI_UNIT_Y, uiDefBut(), uiDefButC(), uiDefButF(), uiDefButR_prop(), uiDefIconButO(), UNPACK3_EX, UNPACK4_EX, USER_CP_CIRCLE_HSL, USER_CP_CIRCLE_HSV, USER_CP_SQUARE_HS, USER_CP_SQUARE_HV, USER_CP_SQUARE_SV, and WM_OP_INVOKE_DEFAULT.
Referenced by ui_block_func_COLOR().
| ColorPicker * ui_block_colorpicker_create | ( | uiBlock * | block | ) |
Definition at line 908 of file interface_region_color_picker.cc.
References BLI_addhead(), uiBlock::color_pickers, and ColorPickerData::list.
Referenced by ui_block_colorpicker(), and uiTemplateColorPicker().
| uiBlock * ui_block_func_COLOR | ( | bContext * | C, |
| uiPopupBlockHandle * | handle, | ||
| void * | arg_but ) |
Definition at line 883 of file interface_region_color_picker.cc.
References uiBlock::block_event_func, copy_v3_v3(), uiBlock::direction, uiBut::editvec, uiBlock::flag, uiBlock::is_color_gamma_picker, 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_THEME_STYLE_POPUP, UI_block_theme_style_set(), ui_but_is_color_gamma(), ui_colorpicker_wheel_cb(), UI_DIR_UP, UI_EMBOSS, and UI_UNIT_X.
Referenced by ui_block_open_begin().
| bool ui_but_color_has_alpha | ( | uiBut * | but | ) |
Returns true if the button represents a color with an Alpha component.
Definition at line 108 of file interface_region_color_picker.cc.
References ELEM, PROP_COLOR, PROP_COLOR_GAMMA, RNA_property_array_length(), RNA_property_subtype(), uiBut::rnapoin, and uiBut::rnaprop.
Referenced by ui_block_colorpicker().
| void ui_but_hsv_set | ( | uiBut * | but | ) |
For picker, while editing HSV.
Definition at line 178 of file interface_region_color_picker.cc.
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 | ) |
Returns true if the button is for a color with gamma baked in, or if it's a color picker for such a button.
Definition at line 97 of file interface_region_color_picker.cc.
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_tooltip_data_from_button_or_extra_icon(), ui_update_color_picker_buts_rgba(), and widget_swatch().
Definition at line 85 of file interface_region_color_picker.cc.
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_wheel_cb(), ui_do_but_HSVCIRCLE(), ui_draw_but_HSVCIRCLE(), and ui_numedit_but_HSVCIRCLE().
|
static |
Definition at line 44 of file interface_region_color_picker.cc.
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_rgba().
Definition at line 73 of file interface_region_color_picker.cc.
References rgb_to_hsl_v(), rgb_to_hsv_v(), and USER_CP_CIRCLE_HSL.
Referenced by ui_color_picker_update_hsv().
Definition at line 59 of file interface_region_color_picker.cc.
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_wheel_cb(), ui_do_but_HSVCIRCLE(), ui_draw_but_HSVCIRCLE(), and ui_numedit_but_HSVCIRCLE().
|
static |
Definition at line 148 of file interface_region_color_picker.cc.
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_rgba().
|
static |
Definition at line 366 of file interface_region_color_picker.cc.
References BLT_I18NCONTEXT_COLOR, CTX_TIP_, uiBut::custom_data, uiButHSVCube::gradient_type, 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 353 of file interface_region_color_picker.cc.
References uiBut::block, ui_but_value_get(), and ui_colorpicker_hide_reveal().
Referenced by ui_block_colorpicker().
|
static |
Definition at line 284 of file interface_region_color_picker.cc.
References ARRAY_SIZE, uiBut::block, uiBut::custom_data, uiBlock::handle, hex_to_rgba(), IMB_colormanagement_srgb_to_scene_linear_v3(), uiPopupBlockHandle::menuretval, RNA_property_float_get_array(), uiBut::rnapoin, uiBut::rnaprop, ui_but_is_color_gamma(), ui_but_string_get(), ui_color_picker_rgb_round(), UI_RETURN_UPDATE, ui_update_color_picker_buts_rgba(), and zero_v4().
Referenced by ui_block_colorpicker().
|
static |
Definition at line 336 of file interface_region_color_picker.cc.
References uiBlock::buttons, LISTBASE_FOREACH, PICKER_TYPE_HSV, PICKER_TYPE_RGB, SET_FLAG_FROM_TEST, UI_BTYPE_NUM_SLIDER, 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 257 of file interface_region_color_picker.cc.
References uiBut::block, uiBut::custom_data, uiBlock::handle, ColorPicker::hsv_scene_linear, uiPopupBlockHandle::menuretval, RNA_property_float_get_array(), uiBut::rnapoin, uiBut::rnaprop, ui_color_picker_hsv_to_rgb(), UI_RETURN_UPDATE, ui_update_color_picker_buts_rgba(), and zero_v4().
Referenced by ui_block_colorpicker(), and ui_colorpicker_hide_reveal().
|
static |
Definition at line 237 of file interface_region_color_picker.cc.
References uiBut::block, uiBut::custom_data, uiBlock::handle, uiPopupBlockHandle::menuretval, ptr, RNA_property_float_get_array(), uiBut::rnapoin, uiBut::rnaprop, UI_RETURN_UPDATE, ui_update_color_picker_buts_rgba(), and zero_v4().
Referenced by ui_block_colorpicker(), ui_colorpicker_circle(), ui_colorpicker_hide_reveal(), and ui_colorpicker_square().
|
static |
Definition at line 432 of file interface_region_color_picker.cc.
References BLI_assert, BLT_I18NCONTEXT_COLOR, CTX_TIP_, uiBut::custom_data, uiButHSVCube::gradient_type, PICKER_BAR, PICKER_H, PICKER_SPACE, PICKER_TOTAL_W, ptr, TIP_, UI_BTYPE_HSVCUBE, UI_but_func_set(), ui_colorpicker_rgba_update_cb(), UI_GRAD_HS, and uiDefButR_prop().
Referenced by ui_block_colorpicker().
|
static |
Definition at line 833 of file interface_region_color_picker.cc.
References uiBlock::buttons, clamp_f(), uiBlock::handle, ColorPicker::hsv_perceptual, LISTBASE_FOREACH, uiPopupBlockHandle::menuretval, wmEvent::type, UI_BTYPE_HSVCUBE, ui_but_v4_get(), ui_but_v4_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_rgba(), WHEELDOWNMOUSE, and WHEELUPMOUSE.
Referenced by ui_block_func_COLOR().
Definition at line 134 of file interface_region_color_picker.cc.
References IMB_colormanagement_color_picking_to_scene_linear_v3(), ui_but_is_color_gamma(), and ui_color_picker_rgb_round().
Referenced by ui_colorpicker_wheel_cb(), ui_draw_but_HSVCIRCLE(), ui_numedit_but_HSVCIRCLE(), and ui_numedit_but_HSVCUBE().
|
static |
Definition at line 322 of file interface_region_color_picker.cc.
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 123 of file interface_region_color_picker.cc.
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_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 190 of file interface_region_color_picker.cc.
References uiBlock::buttons, col, copy_v4_v4(), ColorPicker::has_alpha, IMB_colormanagement_scene_linear_to_srgb_v3(), LISTBASE_FOREACH, rgba_float_to_uchar(), SNPRINTF_RLEN, UI_BTYPE_TEXT, UI_but_flag_disable(), ui_but_is_color_gamma(), UI_BUT_UNDO, ui_but_update(), ui_but_v4_set(), ui_color_picker_rgb_round(), ui_color_picker_update_hsv(), UNPACK3_EX, and UNPACK4_EX.
Referenced by ui_colorpicker_hex_rna_cb(), ui_colorpicker_hsv_update_cb(), ui_colorpicker_rgba_update_cb(), and ui_colorpicker_wheel_cb().