38 # define UI_COLOR_RGB_FROM_U8(r, g, b, v4) \
39 ARRAY_SET_ITEMS(v4, (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, 1.0)
41 #define UI_COLOR_RGBA_FROM_U8(r, g, b, a, v4) \
42 ARRAY_SET_ITEMS(v4, (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, (float)a / 255.0f)
109 #ifdef WITH_FREESTYLE
195 gb->
sizeEdge =
U.pixelsize * (1.0f / 2.0f);
199 for (
int i = 0; i < 2; i++) {
211 float *color = gb->UBO_FIRST_COLOR;
232 ramp.
data[0].
a = 1.0f;
233 ramp.
data[0].
b = 1.0f;
235 ramp.
data[1].
a = 1.0f;
236 ramp.
data[1].
g = 1.0f;
238 ramp.
data[2].
a = 1.0f;
239 ramp.
data[2].
r = 1.0f;
276 float viewmat[4][4], winmat[4][4];
280 float viewdist = rv3d->
dist;
346 if (r_color !=
NULL) {
403 static float colors[11][4];
459 if (dim[0] == 0.0f) {
463 if (dim[1] == 0.0f) {
467 if (dim[2] == 0.0f) {
476 float ob_rot[3][3], invviewmat[4][4];
496 const float gamma = 1.5f;
497 const float hsv[3] = {(2.0f / 3.0f) * (1.0f - weight), 1.0f,
pow(0.5f + 0.5f * weight, gamma)};
501 for (
int i = 0; i < 3; i++) {
509 float pixels[256][4];
510 for (
int i = 0; i < 256; i++) {
typedef float(TangentPoint)[2]
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
void BKE_colorband_evaluate_table_rgba(const struct ColorBand *coba, float **array, int *size)
General operations, lookup, etc. for blender objects.
void BKE_object_dimensions_get(struct Object *ob, float r_vec[3])
void BKE_object_rot_to_mat3(const struct Object *ob, float r_mat[3][3], bool use_drot)
MINLINE float max_ff(float a, float b)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], const float t)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v4(float r[4])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void invert_v2(float r[2])
#define DRW_TEXTURE_FREE_SAFE(tex)
float GPU_polygon_offset_calc(const float(*winmat)[4], float viewdist, float dist)
GPUTexture * GPU_texture_create_1d(const char *name, int w, int mip_len, eGPUTextureFormat format, const float *data)
struct GPUTexture GPUTexture
@ TH_TRANSPARENT_CHECKER_PRIMARY
@ TH_TRANSPARENT_CHECKER_SECONDARY
@ TH_HANDLE_SEL_AUTOCLAMP
@ TH_TRANSPARENT_CHECKER_SIZE
void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
void UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int offset, float col[3])
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
float UI_GetThemeValuef(int colorid)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void DRW_globals_update(void)
float * DRW_color_background_blend_get(int theme_id)
int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
#define UI_COLOR_RGBA_FROM_U8(r, g, b, a, v4)
static void DRW_evaluate_weight_to_color(const float weight, float result[4])
static ColorBand weight_ramp_copy
bool DRW_object_is_flat(Object *ob, int *r_axis)
DRWView * DRW_view_create_with_zoffset(const DRWView *parent_view, const RegionView3D *rv3d, float offset)
static bool weight_ramp_custom
void DRW_globals_free(void)
bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis)
static struct GPUTexture * DRW_create_weight_colorramp_texture(void)
const float * DRW_viewport_pixelsize_get(void)
const DRWContextState * DRW_context_state_get(void)
const float * DRW_viewport_size_get(void)
const float * DRW_viewport_screenvecs_get(void)
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
DRWView * DRW_view_create_sub(const DRWView *parent_view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void(* MEM_freeN)(void *vmemh)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
bool active
all scheduled work for the GPU.
struct GPUUniformBuf * block_ubo
struct GPUTexture * weight_ramp
float colorBonePoseTarget[4]
float colorMballRadius[4]
float colorMballRadiusSelect[4]
float colorEditMeshMiddle[4]
float colorVertexMissingData[4]
float colorNurbSelUline[4]
float colorBoneIKLineSpline[4]
float colorEdgeBWeight[4]
float colorHandleAlign[4]
float colorHandleSelFree[4]
float colorGpencilVertexSelect[4]
float colorBoneIKLineNoTarget[4]
float colorGridEmphasis[4]
float colorBonePoseActive[4]
float colorHandleSelAlign[4]
float colorLightNoAlpha[4]
float colorEdgeFreestyle[4]
float colorFaceFreestyle[4]
float colorClippingBorder[4]
float colorHandleSelVect[4]
float colorBonePoseActiveUnsel[4]
float colorVertexSelect[4]
float colorBoneActiveUnsel[4]
float colorActiveSpline[4]
float colorBonePoseConstraint[4]
float colorCheckerPrimary[4]
float colorEditMeshActive[4]
float colorMballStiffness[4]
float colorGpencilVertex[4]
float colorMballStiffnessSelect[4]
float colorHandleSelAuto[4]
float colorHandleSelAutoclamp[4]
float colorLibrarySelect[4]
float colorNurbSelVline[4]
float colorEdgeFaceSelect[4]
float colorBackgroundGradient[4]
float colorBonePoseSplineIK[4]
float colorHandleAutoclamp[4]
float colorCheckerSecondary[4]
float colorDupliSelect[4]
float colorVertexUnreferenced[4]
float colorCurrentFrame[4]
float sizeLightCircleShadow