Blender V5.0
paint_sample_color.cc File Reference
#include <cmath>
#include <cstdlib>
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_brush_types.h"
#include "DNA_scene_types.h"
#include "BLI_listbase.h"
#include "BLI_math_color.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_vector.hh"
#include "BLI_rect.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_brush.hh"
#include "BKE_bvhutils.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_image.hh"
#include "BKE_layer.hh"
#include "BKE_material.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_sample.hh"
#include "BKE_object.hh"
#include "BKE_paint.hh"
#include "BKE_paint_types.hh"
#include "BKE_report.hh"
#include "DEG_depsgraph_query.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "IMB_imbuf_types.hh"
#include "IMB_interp.hh"
#include "ED_grease_pencil.hh"
#include "ED_image.hh"
#include "ED_screen.hh"
#include "ED_view3d.hh"
#include "ED_mesh.hh"
#include "UI_interface_types.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "IMB_colormanagement.hh"
#include "paint_intern.hh"

Go to the source code of this file.

Classes

struct  SampleColorData

Functions

Sample Color Operator
static blender::float2 imapaint_pick_uv (const Mesh *mesh_eval, Scene *scene, Object *ob_eval, const int tri_index, const blender::float3 &bary_coord)
static int imapaint_pick_face (ViewContext *vc, const int mval[2], int *r_tri_index, int *r_face_index, blender::float3 *r_bary_coord, const Mesh &mesh)
static void paint_sample_color (bContext *C, ARegion *region, int x, int y, bool texpaint_proj, bool use_palette)
static void sample_color_update_header (SampleColorData *data, bContext *C)
static wmOperatorStatus sample_color_exec (bContext *C, wmOperator *op)
static wmOperatorStatus sample_color_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus sample_color_modal (bContext *C, wmOperator *op, const wmEvent *event)
static bool sample_color_poll (bContext *C)
void PAINT_OT_sample_color (wmOperatorType *ot)

Function Documentation

◆ imapaint_pick_face()

◆ imapaint_pick_uv()

◆ PAINT_OT_sample_color()

◆ paint_sample_color()

void paint_sample_color ( bContext * C,
ARegion * region,
int x,
int y,
bool texpaint_proj,
bool use_palette )
static

Definition at line 159 of file paint_sample_color.cc.

References Palette::active_color, Geometry::attributes, BKE_brush_color_set(), BKE_image_acquire_ibuf(), BKE_image_get_tile_from_pos(), BKE_image_release_ibuf(), BKE_imageuser_default(), BKE_object_get_evaluated_mesh(), BKE_object_material_get(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paint_palette(), BKE_paint_palette_set(), BKE_palette_add(), BKE_palette_color_add(), BKE_palette_color_set(), BKE_texpaint_slot_refresh_cache(), BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), BLI_listbase_count(), ImBuf::byte_buffer, C, ImagePaintSettings::canvas, CD_PROP_FLOAT2, CLAMP, blender::math::clamp(), ImBuf::colormanage_flag, Palette::colors, ImBufByteBuffer::colorspace, Mesh::corner_data, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), CTX_wm_view3d(), CTX_wm_window(), CustomData_has_layer(), ImBufByteBuffer::data, ImBufFloatBuffer::data, DEG_get_evaluated(), depsgraph, ColorManagedDisplaySettings::display_device, Scene::display_settings, ED_space_image_color_sample(), ED_view3d_viewcontext_init(), blender::bke::Face, ImBuf::float_buffer, ImageUser::framenr, TexPaintSlot::ima, IMA_SRC_TILED, IMAGEPAINT_MODE_MATERIAL, ToolSettings::imapaint, imapaint_pick_face(), imapaint_pick_uv(), IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_colorspace_to_scene_linear_v3(), IMB_colormanagement_display_get_named(), IMB_colormanagement_display_to_scene_linear_v3(), ImagePaintSettings::interp, interp(), TexPaintSlot::interp, blender::imbuf::interpolate_bilinear_wrap_byte(), blender::imbuf::interpolate_bilinear_wrap_fl(), blender::imbuf::interpolate_nearest_wrap_byte(), blender::imbuf::interpolate_nearest_wrap_fl(), Image::lastframe, blender::bke::AttributeAccessor::lookup_or_default(), ImagePaintSettings::mode, Material::paint_active_slot, rgba_uchar_to_float(), SHD_INTERP_CLOSEST, SHD_INTERP_LINEAR, Image::source, straight_to_premul_v4(), Material::texpaintslot, ImageUser::tile, Scene::toolsettings, v, ARegion::winrct, ARegion::winx, ARegion::winy, WM_window_pixels_read_sample(), ImBuf::x, x, rcti::xmin, ImBuf::y, y, and rcti::ymin.

Referenced by sample_color_exec(), sample_color_invoke(), and sample_color_modal().

◆ sample_color_exec()

◆ sample_color_invoke()

◆ sample_color_modal()

◆ sample_color_poll()

◆ sample_color_update_header()

void sample_color_update_header ( SampleColorData * data,
bContext * C )
static