Blender V2.61 - r43446
|
#include <float.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_linklist.h"
#include "BLI_memarena.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "PIL_time.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "DNA_brush_types.h"
#include "DNA_camera_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
#include "BKE_idprop.h"
#include "BKE_brush.h"
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "UI_view2d.h"
#include "ED_image.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "GPU_draw.h"
#include "paint_intern.h"
Go to the source code of this file.
Classes | |
struct | ImagePaintState |
struct | ImagePaintPartialRedraw |
struct | ImagePaintRegion |
struct | ProjPaintImage |
struct | ProjPaintState |
union | pixelPointer |
union | pixelStore |
struct | ProjPixel |
struct | ProjPixelClone |
struct | UndoImageTile |
struct | ProjectHandle |
struct | PaintOperation |
struct | GrabClone |
Defines | |
#define | IMAPAINT_CHAR_TO_FLOAT(c) ((c)/255.0f) |
#define | IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) |
#define | IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) |
#define | IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) |
#define | IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) |
#define | IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b) |
#define | IMAPAINT_TILE_BITS 6 |
#define | IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS) |
#define | IMAPAINT_TILE_NUMBER(size) (((size)+IMAPAINT_TILE_SIZE-1) >> IMAPAINT_TILE_BITS) |
#define | PROJ_BUCKET_BRUSH_DIV 4 |
#define | PROJ_BUCKET_RECT_MIN 4 |
#define | PROJ_BUCKET_RECT_MAX 256 |
#define | PROJ_BOUNDBOX_DIV 8 |
#define | PROJ_BOUNDBOX_SQUARED (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV) |
#define | PROJ_DEBUG_WINCLIP 1 |
#define | PROJ_FACE_SEAM1 (1<<0) |
#define | PROJ_FACE_SEAM2 (1<<1) |
#define | PROJ_FACE_SEAM3 (1<<2) |
#define | PROJ_FACE_SEAM4 (1<<3) |
#define | PROJ_FACE_NOSEAM1 (1<<4) |
#define | PROJ_FACE_NOSEAM2 (1<<5) |
#define | PROJ_FACE_NOSEAM3 (1<<6) |
#define | PROJ_FACE_NOSEAM4 (1<<7) |
#define | PROJ_SRC_VIEW 1 |
#define | PROJ_SRC_IMAGE_CAM 2 |
#define | PROJ_SRC_IMAGE_VIEW 3 |
#define | PROJ_VIEW_DATA_ID "view_data" |
#define | PROJ_VIEW_DATA_SIZE (4*4 + 4*4 + 3) |
#define | PROJ_FACE_SCALE_SEAM 0.99f |
#define | PROJ_BUCKET_NULL 0 |
#define | PROJ_BUCKET_INIT (1<<0) |
#define | PROJ_GEOM_TOLERANCE 0.00075f |
#define | PROJ_VERT_CULL 1 |
#define | PI_80_DEG ((M_PI_2 / 9) * 8) |
#define | ISECT_TRUE 1 |
#define | ISECT_TRUE_P1 2 |
#define | ISECT_TRUE_P2 3 |
#define | ISECT_1 (1) |
#define | ISECT_2 (1<<1) |
#define | ISECT_3 (1<<2) |
#define | ISECT_4 (1<<3) |
#define | ISECT_ALL3 ((1<<3)-1) |
#define | ISECT_ALL4 ((1<<4)-1) |
#define | PX_SIZE_FADE_MAX 12.0f |
#define | PX_SIZE_FADE_MIN 4.0f |
Typedefs | |
typedef struct ImagePaintState | ImagePaintState |
typedef struct ImagePaintPartialRedraw | ImagePaintPartialRedraw |
typedef struct ImagePaintRegion | ImagePaintRegion |
typedef struct ProjPaintImage | ProjPaintImage |
typedef struct ProjPaintState | ProjPaintState |
typedef union pixelPointer | PixelPointer |
typedef union pixelStore | PixelStore |
typedef struct ProjPixel | ProjPixel |
typedef struct ProjPixelClone | ProjPixelClone |
typedef struct UndoImageTile | UndoImageTile |
typedef struct ProjectHandle | ProjectHandle |
typedef enum PaintMode | PaintMode |
typedef struct PaintOperation | PaintOperation |
typedef struct GrabClone | GrabClone |
Enumerations | |
enum | PaintMode { PAINT_MODE_2D, PAINT_MODE_3D, PAINT_MODE_3D_PROJECT } |
Functions | |
static void | imapaint_image_update (SpaceImage *sima, Image *image, ImBuf *ibuf, short texpaint) |
static void | undo_copy_tile (UndoImageTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, int restore) |
static void * | image_undo_push_tile (Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int x_tile, int y_tile) |
static void | image_undo_restore (bContext *C, ListBase *lb) |
static void | image_undo_free (ListBase *lb) |
static Image * | imapaint_face_image (const ImagePaintState *s, int face_index) |
static Image * | project_paint_face_image (const ProjPaintState *ps, MTFace *dm_mtface, int face_index) |
static int | project_bucket_offset (const ProjPaintState *ps, const float projCoSS[2]) |
static int | project_bucket_offset_safe (const ProjPaintState *ps, const float projCoSS[2]) |
static void | barycentric_weights_v2_persp (float v1[4], float v2[4], float v3[4], float co[2], float w[3]) |
static float | VecZDepthOrtho (float pt[2], float v1[3], float v2[3], float v3[3], float w[3]) |
static float | VecZDepthPersp (float pt[2], float v1[4], float v2[4], float v3[4], float w[3]) |
static int | project_paint_PickFace (const ProjPaintState *ps, float pt[2], float w[3], int *side) |
static void | uvco_to_wrapped_pxco (float uv[2], int ibuf_x, int ibuf_y, float *x, float *y) |
static int | project_paint_PickColor (const ProjPaintState *ps, float pt[2], float *rgba_fp, unsigned char *rgba, const int interp) |
static int | project_paint_occlude_ptv (float pt[3], float v1[4], float v2[4], float v3[4], float w[3], int is_ortho) |
static int | project_paint_occlude_ptv_clip (const ProjPaintState *ps, const MFace *mf, float pt[3], float v1[4], float v2[4], float v3[4], const int side) |
static int | project_bucket_point_occluded (const ProjPaintState *ps, LinkNode *bucketFace, const int orig_face, float pixelScreenCo[4]) |
static int | line_isect_y (const float p1[2], const float p2[2], const float y_level, float *x_isect) |
static int | line_isect_x (const float p1[2], const float p2[2], const float x_level, float *y_isect) |
static int | cmp_uv (const float vec2a[2], const float vec2b[2]) |
static int | pixel_bounds_uv (const float uv1[2], const float uv2[2], const float uv3[2], const float uv4[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int is_quad) |
static int | pixel_bounds_array (float(*uv)[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int tot) |
static int | check_seam (const ProjPaintState *ps, const int orig_face, const int orig_i1_fidx, const int orig_i2_fidx, int *other_face, int *orig_fidx) |
static void | uv_image_outset (float(*orig_uv)[2], float(*outset_uv)[2], const float scaler, const int ibuf_x, const int ibuf_y, const int is_quad) |
static void | project_face_seams_init (const ProjPaintState *ps, const int face_index, const int is_quad) |
static void | screen_px_from_ortho (float uv[2], float v1co[3], float v2co[3], float v3co[3], float uv1co[2], float uv2co[2], float uv3co[2], float pixelScreenCo[4], float w[3]) |
static void | screen_px_from_persp (float uv[2], float v1co[4], float v2co[4], float v3co[4], float uv1co[2], float uv2co[2], float uv3co[2], float pixelScreenCo[4], float w[3]) |
static void | project_face_pixel (const MTFace *tf_other, ImBuf *ibuf_other, const float w[3], int side, unsigned char rgba_ub[4], float rgba_f[4]) |
static float | project_paint_uvpixel_mask (const ProjPaintState *ps, const int face_index, const int side, const float w[3]) |
static ProjPixel * | project_paint_uvpixel_init (const ProjPaintState *ps, MemArena *arena, const ImBuf *ibuf, short x_px, short y_px, const float mask, const int face_index, const int image_index, const float pixelScreenCo[4], const int side, const float w[3]) |
static int | line_clip_rect2f (rctf *rect, const float l1[2], const float l2[2], float l1_clip[2], float l2_clip[2]) |
static void | scale_quad (float insetCos[4][3], float *origCos[4], const float inset) |
static void | scale_tri (float insetCos[4][3], float *origCos[4], const float inset) |
static float | len_squared_v2v2_alt (const float *v1, const float v2_1, const float v2_2) |
static int | project_bucket_isect_circle (const float cent[2], const float radius_squared, rctf *bucket_bounds) |
static void | rect_to_uvspace_ortho (rctf *bucket_bounds, float *v1coSS, float *v2coSS, float *v3coSS, float *uv1co, float *uv2co, float *uv3co, float bucket_bounds_uv[4][2], const int flip) |
static void | rect_to_uvspace_persp (rctf *bucket_bounds, float *v1coSS, float *v2coSS, float *v3coSS, float *uv1co, float *uv2co, float *uv3co, float bucket_bounds_uv[4][2], const int flip) |
static int | IsectPT2Df_limit (float pt[2], float v1[2], float v2[2], float v3[2], float limit) |
static int | float_z_sort_flip (const void *p1, const void *p2) |
static int | float_z_sort (const void *p1, const void *p2) |
static void | project_bucket_clip_face (const int is_ortho, rctf *bucket_bounds, float *v1coSS, float *v2coSS, float *v3coSS, float *uv1co, float *uv2co, float *uv3co, float bucket_bounds_uv[8][2], int *tot) |
static int | IsectPoly2Df (const float pt[2], float uv[][2], const int tot) |
static int | IsectPoly2Df_twoside (const float pt[2], float uv[][2], const int tot) |
static void | project_paint_face_init (const ProjPaintState *ps, const int thread_index, const int bucket_index, const int face_index, const int image_index, rctf *bucket_bounds, const ImBuf *ibuf, const short clamp_u, const short clamp_v) |
static void | project_paint_bucket_bounds (const ProjPaintState *ps, const float min[2], const float max[2], int bucketMin[2], int bucketMax[2]) |
static void | project_bucket_bounds (const ProjPaintState *ps, const int bucket_x, const int bucket_y, rctf *bucket_bounds) |
static void | project_bucket_init (const ProjPaintState *ps, const int thread_index, const int bucket_index, rctf *bucket_bounds) |
static int | project_bucket_face_isect (ProjPaintState *ps, int bucket_x, int bucket_y, const MFace *mf) |
static void | project_paint_delayed_face_init (ProjPaintState *ps, const MFace *mf, const int face_index) |
static int | project_paint_view_clip (View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend) |
static void | project_paint_begin (ProjPaintState *ps) |
static void | project_paint_begin_clone (ProjPaintState *ps, int mouse[2]) |
static void | project_paint_end (ProjPaintState *ps) |
static void | partial_redraw_array_init (ImagePaintPartialRedraw *pr) |
static int | partial_redraw_array_merge (ImagePaintPartialRedraw *pr, ImagePaintPartialRedraw *pr_other, int tot) |
static int | project_image_refresh_tagged (ProjPaintState *ps) |
static int | project_bucket_iter_init (ProjPaintState *ps, const float mval_f[2]) |
static int | project_bucket_iter_next (ProjPaintState *ps, int *bucket_index, rctf *bucket_bounds, const float mval[2]) |
static void | blend_color_mix (unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac) |
static void | blend_color_mix_float (float *cp, const float *cp1, const float *cp2, const float fac) |
static void | blend_color_mix_accum (unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac) |
static void | do_projectpaint_clone (ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask) |
static void | do_projectpaint_clone_f (ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask) |
static void | do_projectpaint_smear (ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels, float co[2]) |
static void | do_projectpaint_smear_f (ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels_f, float co[2]) |
static void | do_projectpaint_draw (ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) |
static void | do_projectpaint_draw_f (ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, int use_color_correction) |
static void * | do_projectpaint_thread (void *ph_v) |
static int | project_paint_op (void *state, ImBuf *UNUSED(ibufb), float *lastpos, float *pos) |
static int | project_paint_sub_stroke (ProjPaintState *ps, BrushPainter *painter, const int UNUSED(prevmval_i[2]), const int mval_i[2], double time, float pressure) |
static int | project_paint_stroke (ProjPaintState *ps, BrushPainter *painter, const int prevmval_i[2], const int mval_i[2], double time, float pressure) |
static void | imapaint_clear_partial_redraw (void) |
static void | imapaint_dirty_region (Image *ima, ImBuf *ibuf, int x, int y, int w, int h) |
static void | imapaint_ibuf_get_set_rgb (ImBuf *ibuf, int x, int y, short torus, short set, float *rgb) |
static int | imapaint_ibuf_add_if (ImBuf *ibuf, unsigned int x, unsigned int y, float *outrgb, short torus) |
static void | imapaint_lift_soften (ImBuf *ibuf, ImBuf *ibufb, int *pos, short torus) |
static void | imapaint_set_region (ImagePaintRegion *region, int destx, int desty, int srcx, int srcy, int width, int height) |
static int | imapaint_torus_split_region (ImagePaintRegion region[4], ImBuf *dbuf, ImBuf *sbuf) |
static void | imapaint_lift_smear (ImBuf *ibuf, ImBuf *ibufb, int *pos) |
static ImBuf * | imapaint_lift_clone (ImBuf *ibuf, ImBuf *ibufb, int *pos) |
static void | imapaint_convert_brushco (ImBuf *ibufb, float *pos, int *ipos) |
static int | imapaint_paint_op (void *state, ImBuf *ibufb, float *lastpos, float *pos) |
static int | texpaint_break_stroke (float *prevuv, float *fwuv, float *bkuv, float *uv) |
static int | imapaint_canvas_set (ImagePaintState *s, Image *ima) |
static void | imapaint_canvas_free (ImagePaintState *s) |
static int | imapaint_paint_sub_stroke (ImagePaintState *s, BrushPainter *painter, Image *image, short texpaint, float *uv, double time, int update, float pressure) |
static int | imapaint_paint_stroke (ViewContext *vc, ImagePaintState *s, BrushPainter *painter, short texpaint, const int prevmval[2], const int mval[2], double time, float pressure) |
static Brush * | image_paint_brush (bContext *C) |
static int | image_paint_poll (bContext *C) |
static int | image_paint_3d_poll (bContext *C) |
static int | image_paint_2d_clone_poll (bContext *C) |
static void | paint_redraw (bContext *C, ImagePaintState *s, int final) |
static void | project_state_init (bContext *C, Object *ob, ProjPaintState *ps) |
static void | paint_brush_init_tex (Brush *brush) |
static int | texture_paint_init (bContext *C, wmOperator *op) |
static void | paint_apply (bContext *C, wmOperator *op, PointerRNA *itemptr) |
static void | paint_brush_exit_tex (Brush *brush) |
static void | paint_exit (bContext *C, wmOperator *op) |
static int | paint_exec (bContext *C, wmOperator *op) |
static void | paint_apply_event (bContext *C, wmOperator *op, wmEvent *event) |
static int | paint_invoke (bContext *C, wmOperator *op, wmEvent *event) |
static int | paint_modal (bContext *C, wmOperator *op, wmEvent *event) |
static int | paint_cancel (bContext *C, wmOperator *op) |
void | PAINT_OT_image_paint (wmOperatorType *ot) |
static int | get_imapaint_zoom (bContext *C, float *zoomx, float *zoomy) |
static void | brush_drawcursor (bContext *C, int x, int y, void *UNUSED(customdata)) |
static void | toggle_paint_cursor (bContext *C, int enable) |
void | ED_space_image_paint_update (wmWindowManager *wm, ToolSettings *settings) |
static void | grab_clone_apply (bContext *C, wmOperator *op) |
static int | grab_clone_exec (bContext *C, wmOperator *op) |
static int | grab_clone_invoke (bContext *C, wmOperator *op, wmEvent *event) |
static int | grab_clone_modal (bContext *C, wmOperator *op, wmEvent *event) |
static int | grab_clone_cancel (bContext *UNUSED(C), wmOperator *op) |
void | PAINT_OT_grab_clone (wmOperatorType *ot) |
static int | sample_color_exec (bContext *C, wmOperator *op) |
static int | sample_color_invoke (bContext *C, wmOperator *op, wmEvent *event) |
static int | sample_color_modal (bContext *C, wmOperator *op, wmEvent *event) |
static int | image_paint_sample_color_poll (bContext *C) |
void | PAINT_OT_sample_color (wmOperatorType *ot) |
static int | set_clone_cursor_exec (bContext *C, wmOperator *op) |
static int | set_clone_cursor_invoke (bContext *C, wmOperator *op, wmEvent *event) |
void | PAINT_OT_clone_cursor_set (wmOperatorType *ot) |
static int | texture_paint_toggle_poll (bContext *C) |
static int | texture_paint_toggle_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_texture_paint_toggle (wmOperatorType *ot) |
static int | texture_paint_poll (bContext *C) |
int | image_texture_paint_poll (bContext *C) |
int | facemask_paint_poll (bContext *C) |
int | vert_paint_poll (bContext *C) |
int | mask_paint_poll (bContext *C) |
static int | texture_paint_camera_project_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_project_image (wmOperatorType *ot) |
static int | texture_paint_image_from_view_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_image_from_view (wmOperatorType *ot) |
Variables | |
static ImagePaintPartialRedraw | imapaintpartial = {0, 0, 0, 0, 0} |
Definition in file paint_image.c.
#define IMAPAINT_CHAR_RGB_TO_FLOAT | ( | f, | |
c | |||
) |
{ \ (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ }
Definition at line 121 of file paint_image.c.
Referenced by imapaint_ibuf_get_set_rgb().
#define IMAPAINT_CHAR_RGBA_TO_FLOAT | ( | f, | |
c | |||
) |
{ \ (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \ (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \ (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \ (f)[3]= IMAPAINT_CHAR_TO_FLOAT((c)[3]); \ }
Definition at line 126 of file paint_image.c.
Referenced by do_projectpaint_thread(), project_paint_PickColor(), and project_paint_uvpixel_init().
#define IMAPAINT_CHAR_TO_FLOAT | ( | c | ) | ((c)/255.0f) |
Definition at line 108 of file paint_image.c.
#define IMAPAINT_FLOAT_RGB_COPY | ( | a, | |
b | |||
) | copy_v3_v3(a, b) |
Definition at line 133 of file paint_image.c.
Referenced by imapaint_ibuf_get_set_rgb().
#define IMAPAINT_FLOAT_RGB_TO_CHAR | ( | c, | |
f | |||
) |
Definition at line 110 of file paint_image.c.
Referenced by do_projectpaint_draw(), and imapaint_ibuf_get_set_rgb().
#define IMAPAINT_FLOAT_RGBA_TO_CHAR | ( | c, | |
f | |||
) |
{ \ (c)[0]= FTOCHAR((f)[0]); \ (c)[1]= FTOCHAR((f)[1]); \ (c)[2]= FTOCHAR((f)[2]); \ (c)[3]= FTOCHAR((f)[3]); \ }
Definition at line 115 of file paint_image.c.
Referenced by do_projectpaint_smear_f(), project_paint_PickColor(), and project_paint_uvpixel_init().
#define IMAPAINT_TILE_BITS 6 |
Definition at line 135 of file paint_image.c.
Referenced by imapaint_dirty_region(), and project_paint_end().
#define IMAPAINT_TILE_NUMBER | ( | size | ) | (((size)+IMAPAINT_TILE_SIZE-1) >> IMAPAINT_TILE_BITS) |
Definition at line 137 of file paint_image.c.
Referenced by project_paint_end().
#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS) |
Definition at line 136 of file paint_image.c.
Referenced by image_undo_push_tile(), image_undo_restore(), project_paint_end(), and undo_copy_tile().
#define ISECT_1 (1) |
Definition at line 1930 of file paint_image.c.
Referenced by project_bucket_clip_face().
#define ISECT_2 (1<<1) |
Definition at line 1931 of file paint_image.c.
Referenced by project_bucket_clip_face().
#define ISECT_3 (1<<2) |
Definition at line 1932 of file paint_image.c.
Referenced by project_bucket_clip_face().
#define ISECT_4 (1<<3) |
Definition at line 1933 of file paint_image.c.
Referenced by project_bucket_clip_face().
#define ISECT_ALL3 ((1<<3)-1) |
Definition at line 1934 of file paint_image.c.
Referenced by project_bucket_clip_face().
#define ISECT_ALL4 ((1<<4)-1) |
Definition at line 1935 of file paint_image.c.
Referenced by project_bucket_clip_face().
#define ISECT_TRUE 1 |
Definition at line 909 of file paint_image.c.
Referenced by line_isect_x(), and line_isect_y().
#define ISECT_TRUE_P1 2 |
Definition at line 910 of file paint_image.c.
Referenced by line_isect_x(), and line_isect_y().
#define ISECT_TRUE_P2 3 |
Definition at line 911 of file paint_image.c.
Referenced by line_isect_x(), and line_isect_y().
#define PI_80_DEG ((M_PI_2 / 9) * 8) |
Definition at line 232 of file paint_image.c.
#define PROJ_BOUNDBOX_DIV 8 |
Definition at line 188 of file paint_image.c.
Referenced by project_paint_uvpixel_init().
#define PROJ_BOUNDBOX_SQUARED (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV) |
Definition at line 189 of file paint_image.c.
Referenced by partial_redraw_array_init(), project_image_refresh_tagged(), project_paint_begin(), and project_paint_op().
#define PROJ_BUCKET_BRUSH_DIV 4 |
Definition at line 183 of file paint_image.c.
Referenced by project_paint_begin().
#define PROJ_BUCKET_INIT (1<<0) |
Definition at line 223 of file paint_image.c.
Referenced by project_bucket_init().
#define PROJ_BUCKET_NULL 0 |
Definition at line 222 of file paint_image.c.
Referenced by do_projectpaint_thread().
#define PROJ_BUCKET_RECT_MAX 256 |
Definition at line 186 of file paint_image.c.
Referenced by project_paint_begin().
#define PROJ_BUCKET_RECT_MIN 4 |
Definition at line 185 of file paint_image.c.
Referenced by project_paint_begin().
#define PROJ_DEBUG_WINCLIP 1 |
Definition at line 194 of file paint_image.c.
#define PROJ_FACE_NOSEAM1 (1<<4) |
Definition at line 204 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_NOSEAM2 (1<<5) |
Definition at line 205 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_NOSEAM3 (1<<6) |
Definition at line 206 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_NOSEAM4 (1<<7) |
Definition at line 207 of file paint_image.c.
Referenced by project_paint_delayed_face_init(), and project_paint_face_init().
#define PROJ_FACE_SCALE_SEAM 0.99f |
Definition at line 220 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_SEAM1 (1<<0) |
Definition at line 199 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_SEAM2 (1<<1) |
Definition at line 200 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_SEAM3 (1<<2) |
Definition at line 201 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_FACE_SEAM4 (1<<3) |
Definition at line 202 of file paint_image.c.
Referenced by project_paint_face_init().
#define PROJ_GEOM_TOLERANCE 0.00075f |
Definition at line 227 of file paint_image.c.
Referenced by cmp_uv(), line_clip_rect2f(), project_bucket_clip_face(), and project_paint_face_init().
#define PROJ_SRC_IMAGE_CAM 2 |
Definition at line 210 of file paint_image.c.
Referenced by project_paint_begin(), and texture_paint_camera_project_exec().
#define PROJ_SRC_IMAGE_VIEW 3 |
Definition at line 211 of file paint_image.c.
Referenced by project_paint_begin(), and texture_paint_camera_project_exec().
#define PROJ_SRC_VIEW 1 |
Definition at line 209 of file paint_image.c.
Referenced by do_projectpaint_thread(), project_bucket_iter_init(), project_bucket_iter_next(), project_paint_begin(), and texture_paint_init().
#define PROJ_VERT_CULL 1 |
Definition at line 230 of file paint_image.c.
Referenced by project_paint_begin().
#define PROJ_VIEW_DATA_ID "view_data" |
Definition at line 213 of file paint_image.c.
Referenced by project_paint_begin(), texture_paint_camera_project_exec(), and texture_paint_image_from_view_exec().
#define PROJ_VIEW_DATA_SIZE (4*4 + 4*4 + 3) |
Definition at line 214 of file paint_image.c.
Referenced by texture_paint_camera_project_exec(), and texture_paint_image_from_view_exec().
#define PX_SIZE_FADE_MAX 12.0f |
Referenced by brush_drawcursor().
#define PX_SIZE_FADE_MIN 4.0f |
Referenced by brush_drawcursor().
typedef struct ImagePaintPartialRedraw ImagePaintPartialRedraw |
typedef struct ImagePaintRegion ImagePaintRegion |
typedef struct ImagePaintState ImagePaintState |
typedef struct PaintOperation PaintOperation |
typedef union pixelPointer PixelPointer |
typedef union pixelStore PixelStore |
typedef struct ProjectHandle ProjectHandle |
typedef struct ProjPaintImage ProjPaintImage |
typedef struct ProjPaintState ProjPaintState |
typedef struct ProjPixelClone ProjPixelClone |
typedef struct UndoImageTile UndoImageTile |
enum PaintMode |
Definition at line 4655 of file paint_image.c.
static void barycentric_weights_v2_persp | ( | float | v1[4], |
float | v2[4], | ||
float | v3[4], | ||
float | co[2], | ||
float | w[3] | ||
) | [static] |
Definition at line 576 of file paint_image.c.
References area_tri_signed_v2().
Referenced by project_bucket_clip_face(), project_paint_occlude_ptv_clip(), rect_to_uvspace_persp(), and VecZDepthPersp().
static void blend_color_mix | ( | unsigned char * | cp, |
const unsigned char * | cp1, | ||
const unsigned char * | cp2, | ||
const int | fac | ||
) | [static] |
Definition at line 3668 of file paint_image.c.
Referenced by do_projectpaint_clone(), do_projectpaint_draw(), do_projectpaint_smear(), and do_projectpaint_smear_f().
static void blend_color_mix_accum | ( | unsigned char * | cp, |
const unsigned char * | cp1, | ||
const unsigned char * | cp2, | ||
const int | fac | ||
) | [static] |
Definition at line 3690 of file paint_image.c.
Referenced by do_projectpaint_thread().
static void blend_color_mix_float | ( | float * | cp, |
const float * | cp1, | ||
const float * | cp2, | ||
const float | fac | ||
) | [static] |
Definition at line 3681 of file paint_image.c.
Referenced by do_projectpaint_clone_f(), and do_projectpaint_draw_f().
static void brush_drawcursor | ( | bContext * | C, |
int | x, | ||
int | y, | ||
void * | UNUSEDcustomdata | ||
) | [static] |
Definition at line 5109 of file paint_image.c.
References Brush::add_col, brush_size(), CTX_data_scene(), Paint::flags, get_imapaint_zoom(), glutil_draw_lined_arc(), image_paint_brush(), M_PI, MAX2, paint_get_active(), PAINT_SHOW_BRUSH, PX_SIZE_FADE_MAX, PX_SIZE_FADE_MIN, and size().
Referenced by ED_space_image_paint_update(), and toggle_paint_cursor().
static int check_seam | ( | const ProjPaintState * | ps, |
const int | orig_face, | ||
const int | orig_i1_fidx, | ||
const int | orig_i2_fidx, | ||
int * | other_face, | ||
int * | orig_fidx | ||
) | [static] |
Definition at line 1065 of file paint_image.c.
References cmp_uv(), ProjPaintState::dm_mface, ProjPaintState::dm_mtface, GET_INT_FROM_POINTER, LinkNode::link, LinkNode::next, project_paint_face_image(), MTFace::uv, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and ProjPaintState::vertFaces.
Referenced by project_face_seams_init().
static int cmp_uv | ( | const float | vec2a[2], |
const float | vec2b[2] | ||
) | [static] |
Definition at line 983 of file paint_image.c.
References fabsf, fmodf, and PROJ_GEOM_TOLERANCE.
Referenced by check_seam().
static void do_projectpaint_clone | ( | ProjPaintState * | ps, |
ProjPixel * | projPixel, | ||
float | alpha, | ||
float | mask | ||
) | [static] |
Definition at line 3704 of file paint_image.c.
References ProjPaintState::blend, blend_color_mix(), IMB_blend_color(), ProjPaintState::is_airbrush, ProjPixel::newColor, ProjPixel::pixel, pixelStore::uint, and pixelPointer::uint_pt.
Referenced by do_projectpaint_thread().
static void do_projectpaint_clone_f | ( | ProjPaintState * | ps, |
ProjPixel * | projPixel, | ||
float | alpha, | ||
float | mask | ||
) | [static] |
Definition at line 3715 of file paint_image.c.
References ProjPaintState::blend, blend_color_mix_float(), pixelStore::f, pixelPointer::f_pt, IMB_blend_color_float(), ProjPaintState::is_airbrush, ProjPixel::newColor, and ProjPixel::pixel.
Referenced by do_projectpaint_thread().
static void do_projectpaint_draw | ( | ProjPaintState * | ps, |
ProjPixel * | projPixel, | ||
float * | rgba, | ||
float | alpha, | ||
float | mask | ||
) | [static] |
Definition at line 3757 of file paint_image.c.
References ProjPaintState::blend, blend_color_mix(), ProjPaintState::brush, pixelStore::ch, pixelPointer::ch_pt, FTOCHAR, IMAPAINT_FLOAT_RGB_TO_CHAR, IMB_blend_color(), ProjPaintState::is_airbrush, ProjPaintState::is_texbrush, ProjPixel::newColor, ProjPixel::origColor, ProjPixel::pixel, Brush::rgb, pixelStore::uint, and pixelPointer::uint_pt.
Referenced by do_projectpaint_thread().
static void do_projectpaint_draw_f | ( | ProjPaintState * | ps, |
ProjPixel * | projPixel, | ||
float * | rgba, | ||
float | alpha, | ||
float | mask, | ||
int | use_color_correction | ||
) | [static] |
Definition at line 3781 of file paint_image.c.
References ProjPaintState::blend, blend_color_mix_float(), ProjPaintState::brush, copy_v3_v3(), pixelStore::f, pixelPointer::f_pt, IMB_blend_color_float(), ProjPaintState::is_airbrush, ProjPaintState::is_texbrush, mul_v3_v3(), ProjPixel::newColor, ProjPixel::origColor, ProjPixel::pixel, Brush::rgb, and srgb_to_linearrgb_v3_v3().
Referenced by do_projectpaint_thread().
static void do_projectpaint_smear | ( | ProjPaintState * | ps, |
ProjPixel * | projPixel, | ||
float | alpha, | ||
float | mask, | ||
MemArena * | smearArena, | ||
LinkNode ** | smearPixels, | ||
float | co[2] | ||
) | [static] |
Definition at line 3732 of file paint_image.c.
References blend_color_mix(), BLI_linklist_prepend_arena(), NULL, and project_paint_PickColor().
Referenced by do_projectpaint_thread().
static void do_projectpaint_smear_f | ( | ProjPaintState * | ps, |
ProjPixel * | projPixel, | ||
float | alpha, | ||
float | mask, | ||
MemArena * | smearArena, | ||
LinkNode ** | smearPixels_f, | ||
float | co[2] | ||
) | [static] |
Definition at line 3743 of file paint_image.c.
References blend_color_mix(), BLI_linklist_prepend_arena(), pixelPointer::f_pt, IMAPAINT_FLOAT_RGBA_TO_CHAR, NULL, ProjPixel::pixel, and project_paint_PickColor().
Referenced by do_projectpaint_thread().
static void* do_projectpaint_thread | ( | void * | ph_v | ) | [static] |
Definition at line 3816 of file paint_image.c.
References ProjPixel::bb_cell_index, bicubic_interpolation_color(), Brush::blend, blend_color_mix_accum(), BLI_memarena_free(), BLI_memarena_new(), ProjPaintState::brush, brush_alpha(), brush_curve_strength_clamp(), BRUSH_LOCK_ALPHA, brush_sample_tex(), brush_size(), ProjPaintState::bucketFlags, ProjPaintState::bucketRect, pixelStore::ch, pixelPointer::ch_pt, co, do_projectpaint_clone(), do_projectpaint_clone_f(), do_projectpaint_draw(), do_projectpaint_draw_f(), do_projectpaint_smear(), do_projectpaint_smear_f(), ELEM, pixelStore::f, pixelPointer::f_pt, Brush::flag, IB_PROFILE_LINEAR_RGB, ProjPaintImage::ibuf, ProjPixel::image_index, IMAPAINT_CHAR_RGBA_TO_FLOAT, IMB_BLEND_ADD_ALPHA, IMB_BLEND_ERASE_ALPHA, ProjPaintState::is_airbrush, ProjPaintState::is_texbrush, len_squared_v2v2(), LinkNode::link, ProjPixel::mask, ProjPixel::mask_max, MAX2, MIN2, ProjPixel::newColor, LinkNode::next, NULL, ProjPixel::origColor, PAINT_TOOL_CLONE, PAINT_TOOL_SMEAR, ProjPaintImage::partRedrawRect, ProjPixel::pixel, ImBuf::profile, PROJ_BUCKET_NULL, PROJ_SRC_VIEW, ProjPixel::projCoSS, project_bucket_init(), project_bucket_iter_next(), ImBuf::rect_float, ProjPaintState::reproject_ibuf, ProjPaintState::scene, ProjPaintState::source, sqrtf, sub_v2_v2v2(), ProjPaintState::tool, ProjPaintImage::touch, pixelPointer::uint_pt, ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, ProjPixel::x_px, ImagePaintPartialRedraw::y1, ImagePaintPartialRedraw::y2, and ProjPixel::y_px.
Referenced by project_paint_op().
void ED_space_image_paint_update | ( | wmWindowManager * | wm, |
ToolSettings * | settings | ||
) |
Definition at line 5170 of file paint_image.c.
References brush_drawcursor(), image_paint_poll(), ToolSettings::imapaint, NULL, ImagePaintSettings::paintcursor, and WM_paint_cursor_activate().
int facemask_paint_poll | ( | bContext * | C | ) |
Definition at line 5502 of file paint_image.c.
References CTX_data_active_object(), and paint_facesel_test().
Referenced by ED_keymap_paint(), PAINT_OT_face_select_all(), PAINT_OT_face_select_hide(), PAINT_OT_face_select_inverse(), PAINT_OT_face_select_linked(), PAINT_OT_face_select_linked_pick(), and PAINT_OT_face_select_reveal().
static int float_z_sort | ( | const void * | p1, |
const void * | p2 | ||
) | [static] |
Definition at line 1951 of file paint_image.c.
Referenced by project_bucket_clip_face().
static int float_z_sort_flip | ( | const void * | p1, |
const void * | p2 | ||
) | [static] |
Definition at line 1946 of file paint_image.c.
Referenced by project_bucket_clip_face().
static int get_imapaint_zoom | ( | bContext * | C, |
float * | zoomx, | ||
float * | zoomy | ||
) | [static] |
Definition at line 5089 of file paint_image.c.
References CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_space_image(), and ED_space_image_zoom().
Referenced by brush_drawcursor().
static void grab_clone_apply | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5188 of file paint_image.c.
References add_v2_v2(), Brush::clone, CTX_wm_region(), ED_region_tag_redraw(), image_paint_brush(), BrushClone::offset, wmOperator::ptr, and RNA_float_get_array().
Referenced by grab_clone_exec(), and grab_clone_modal().
static int grab_clone_cancel | ( | bContext * | UNUSEDC, |
wmOperator * | op | ||
) | [static] |
Definition at line 5253 of file paint_image.c.
References wmOperator::customdata, MEM_freeN(), and OPERATOR_CANCELLED.
Referenced by PAINT_OT_grab_clone().
static int grab_clone_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5198 of file paint_image.c.
References grab_clone_apply(), and OPERATOR_FINISHED.
Referenced by PAINT_OT_grab_clone().
static int grab_clone_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5205 of file paint_image.c.
References Brush::clone, copy_v2_v2(), wmOperator::customdata, image_paint_brush(), MEM_callocN(), BrushClone::offset, OPERATOR_RUNNING_MODAL, GrabClone::startoffset, GrabClone::startx, GrabClone::starty, and WM_event_add_modal_handler().
Referenced by PAINT_OT_grab_clone().
static int grab_clone_modal | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5221 of file paint_image.c.
References Brush::clone, copy_v2_v2(), CTX_wm_region(), wmOperator::customdata, grab_clone_apply(), image_paint_brush(), LEFTMOUSE, MEM_freeN(), MIDDLEMOUSE, MOUSEMOVE, BrushClone::offset, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RIGHTMOUSE, RNA_float_set_array(), GrabClone::startoffset, GrabClone::startx, GrabClone::starty, wmEvent::type, UI_view2d_region_to_view(), ARegion::v2d, ARegion::winrct, wmEvent::x, rcti::xmin, wmEvent::y, and rcti::ymin.
Referenced by PAINT_OT_grab_clone().
static int image_paint_2d_clone_poll | ( | bContext * | C | ) | [static] |
Definition at line 4641 of file paint_image.c.
References Brush::clone, CTX_wm_region_view3d(), BrushClone::image, image_paint_brush(), image_paint_poll(), Brush::imagepaint_tool, and PAINT_TOOL_CLONE.
Referenced by PAINT_OT_grab_clone().
static int image_paint_3d_poll | ( | bContext * | C | ) | [static] |
Definition at line 4633 of file paint_image.c.
References CTX_wm_region_view3d(), and image_paint_poll().
Referenced by PAINT_OT_clone_cursor_set().
Definition at line 4601 of file paint_image.c.
References CTX_data_scene(), ToolSettings::imapaint, ImagePaintSettings::paint, paint_brush(), and Scene::toolsettings.
Referenced by brush_drawcursor(), grab_clone_apply(), grab_clone_invoke(), grab_clone_modal(), image_paint_2d_clone_poll(), image_paint_poll(), and sample_color_exec().
static int image_paint_poll | ( | bContext * | C | ) | [static] |
Definition at line 4609 of file paint_image.c.
References CTX_data_active_object(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_space_image(), SpaceImage::flag, image_paint_brush(), Object::mode, OB_MODE_TEXTURE_PAINT, ARegion::regiontype, RGN_TYPE_WINDOW, and SI_DRAWTOOL.
Referenced by ED_space_image_paint_update(), image_paint_2d_clone_poll(), image_paint_3d_poll(), image_paint_sample_color_poll(), image_texture_paint_poll(), PAINT_OT_image_paint(), and toggle_paint_cursor().
static int image_paint_sample_color_poll | ( | bContext * | C | ) | [static] |
Definition at line 5322 of file paint_image.c.
References CTX_data_active_object(), CTX_wm_view3d(), Mesh::editflag, get_mesh(), image_paint_poll(), ME_EDIT_PAINT_MASK, Object::mode, and OB_MODE_TEXTURE_PAINT.
Referenced by PAINT_OT_sample_color().
int image_texture_paint_poll | ( | bContext * | C | ) |
Definition at line 5497 of file paint_image.c.
References image_paint_poll(), and texture_paint_poll().
Referenced by ED_keymap_paint().
static void image_undo_free | ( | ListBase * | lb | ) | [static] |
Definition at line 505 of file paint_image.c.
References ListBase::first, MEM_freeN(), UndoImageTile::next, and UndoImageTile::rect.
Referenced by texture_paint_camera_project_exec(), and texture_paint_init().
static void* image_undo_push_tile | ( | Image * | ima, |
ImBuf * | ibuf, | ||
ImBuf ** | tmpibuf, | ||
int | x_tile, | ||
int | y_tile | ||
) | [static] |
Definition at line 411 of file paint_image.c.
References BLI_addtail(), BLI_strncpy(), ListBase::first, UndoImageTile::gen_type, Image::gen_type, IB_rect, IB_rectfloat, UndoImageTile::ibufname, Image::id, UndoImageTile::idname, IMAPAINT_TILE_SIZE, IMB_allocImBuf(), MEM_callocN(), MEM_mapallocN(), ImBuf::name, ID::name, UndoImageTile::next, NULL, UndoImageTile::rect, ImBuf::rect_float, UndoImageTile::source, Image::source, undo_copy_tile(), UNDO_PAINT_IMAGE, undo_paint_push_count_alloc(), undo_paint_push_get_list(), UndoImageTile::use_float, UndoImageTile::x, and UndoImageTile::y.
Referenced by imapaint_dirty_region(), and project_paint_end().
Definition at line 450 of file paint_image.c.
References BKE_image_get_ibuf(), BLI_findstring(), CTX_data_main(), ListBase::first, UndoImageTile::gen_type, Image::gen_type, GPU_free_image(), IB_MIPMAP_INVALID, IB_rect, IB_RECT_INVALID, IB_rectfloat, UndoImageTile::ibufname, Image::ibufs, Image::id, UndoImageTile::idname, Main::image, IMAPAINT_TILE_SIZE, IMB_allocImBuf(), IMB_freeImBuf(), ImBuf::mipmap, ImBuf::name, ID::name, UndoImageTile::next, NULL, ImBuf::rect, ImBuf::rect_float, UndoImageTile::source, Image::source, undo_copy_tile(), UndoImageTile::use_float, and ImBuf::userflags.
Referenced by texture_paint_camera_project_exec(), and texture_paint_init().
static void imapaint_canvas_free | ( | ImagePaintState * | s | ) | [static] |
Definition at line 4492 of file paint_image.c.
References ImagePaintState::clonecanvas, ImagePaintState::clonefreefloat, and imb_freerectfloatImBuf().
Referenced by paint_exit().
static int imapaint_canvas_set | ( | ImagePaintState * | s, |
Image * | ima | ||
) | [static] |
Definition at line 4441 of file paint_image.c.
References BKE_image_get_ibuf(), ImagePaintState::brush, ImagePaintState::canvas, ImBuf::channels, Brush::clone, ImagePaintState::clonecanvas, ImagePaintState::clonefreefloat, IB_PROFILE_NONE, Image::id, BrushClone::image, ImagePaintState::image, IMB_float_from_rect(), IMB_rect_from_float(), SpaceImage::iuser, ID::name, NULL, Image::packedfile, PAINT_TOOL_CLONE, ImBuf::profile, ImBuf::rect, ImBuf::rect_float, Image::rr, ImagePaintState::sima, SWAP, ImagePaintState::tool, ImagePaintState::warnmultifile, and ImagePaintState::warnpackedfile.
Referenced by imapaint_paint_stroke(), and texture_paint_init().
static void imapaint_clear_partial_redraw | ( | void | ) | [static] |
Definition at line 4114 of file paint_image.c.
Referenced by imapaint_paint_stroke().
static void imapaint_convert_brushco | ( | ImBuf * | ibufb, |
float * | pos, | ||
int * | ipos | ||
) | [static] |
Definition at line 4355 of file paint_image.c.
References floorf, ImBuf::x, and ImBuf::y.
Referenced by imapaint_paint_op().
static void imapaint_dirty_region | ( | Image * | ima, |
ImBuf * | ibuf, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) | [static] |
Definition at line 4119 of file paint_image.c.
References ImagePaintPartialRedraw::enabled, IB_BITMAPDIRTY, image_undo_push_tile(), IMAPAINT_TILE_BITS, IMB_freeImBuf(), IMB_rectclip(), MAX2, MIN2, NULL, ImBuf::userflags, simple_enum_gen::w, ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, ImagePaintPartialRedraw::y1, and ImagePaintPartialRedraw::y2.
Referenced by imapaint_paint_op().
static Image* imapaint_face_image | ( | const ImagePaintState * | s, |
int | face_index | ||
) | [static] |
Definition at line 515 of file paint_image.c.
References ED_object_get_active_image(), MFace::mat_nr, ImagePaintState::me, Mesh::mface, Mesh::mtface, NULL, ImagePaintState::ob, ImagePaintState::scene, scene_use_new_shading_nodes(), and MTFace::tpage.
Referenced by imapaint_paint_stroke().
static int imapaint_ibuf_add_if | ( | ImBuf * | ibuf, |
unsigned int | x, | ||
unsigned int | y, | ||
float * | outrgb, | ||
short | torus | ||
) | [static] |
Definition at line 4205 of file paint_image.c.
References imapaint_ibuf_get_set_rgb(), ImBuf::x, and ImBuf::y.
Referenced by imapaint_lift_soften().
static void imapaint_ibuf_get_set_rgb | ( | ImBuf * | ibuf, |
int | x, | ||
int | y, | ||
short | torus, | ||
short | set, | ||
float * | rgb | ||
) | [static] |
Definition at line 4176 of file paint_image.c.
References IMAPAINT_CHAR_RGB_TO_FLOAT, IMAPAINT_FLOAT_RGB_COPY, IMAPAINT_FLOAT_RGB_TO_CHAR, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by imapaint_ibuf_add_if(), and imapaint_lift_soften().
static void imapaint_image_update | ( | SpaceImage * | sima, |
Image * | image, | ||
ImBuf * | ibuf, | ||
short | texpaint | ||
) | [static] |
Definition at line 4158 of file paint_image.c.
References GPU_paint_update_image(), IB_MIPMAP_INVALID, IB_RECT_INVALID, SpaceImage::lock, ImBuf::mipmap, ImBuf::rect_float, ImBuf::userflags, simple_enum_gen::w, ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, ImagePaintPartialRedraw::y1, and ImagePaintPartialRedraw::y2.
Referenced by imapaint_paint_sub_stroke(), and project_image_refresh_tagged().
Definition at line 4339 of file paint_image.c.
References ImBuf::flags, IMB_allocImBuf(), IMB_BLEND_COPY_ALPHA, IMB_BLEND_COPY_RGB, IMB_rectblend(), IMB_rectclip(), ImBuf::planes, simple_enum_gen::w, ImBuf::x, and ImBuf::y.
Referenced by imapaint_paint_op().
Definition at line 4325 of file paint_image.c.
References imapaint_set_region(), imapaint_torus_split_region(), IMB_BLEND_COPY_RGB, IMB_rectblend(), ImBuf::x, and ImBuf::y.
Referenced by imapaint_paint_op().
Definition at line 4223 of file paint_image.c.
References imapaint_ibuf_add_if(), imapaint_ibuf_get_set_rgb(), IMB_rectclip(), ImBuf::x, and ImBuf::y.
Referenced by imapaint_paint_op().
static int imapaint_paint_op | ( | void * | state, |
ImBuf * | ibufb, | ||
float * | lastpos, | ||
float * | pos | ||
) | [static] |
Definition at line 4363 of file paint_image.c.
References ImagePaintState::blend, blend(), ImagePaintState::brush, BRUSH_TORUS, ImagePaintState::canvas, Brush::clone, ImagePaintState::clonecanvas, ImagePaintRegion::destx, ImagePaintRegion::desty, Brush::flag, ImagePaintRegion::height, ImagePaintState::image, imapaint_convert_brushco(), imapaint_dirty_region(), imapaint_lift_clone(), imapaint_lift_smear(), imapaint_lift_soften(), imapaint_set_region(), imapaint_torus_split_region(), IMB_freeImBuf(), IMB_rectblend(), NULL, BrushClone::offset, PAINT_TOOL_CLONE, PAINT_TOOL_SMEAR, PAINT_TOOL_SOFTEN, ImagePaintRegion::srcx, ImagePaintRegion::srcy, ImagePaintState::tool, ImagePaintRegion::width, ImBuf::x, and ImBuf::y.
Referenced by imapaint_paint_sub_stroke().
static int imapaint_paint_stroke | ( | ViewContext * | vc, |
ImagePaintState * | s, | ||
BrushPainter * | painter, | ||
short | texpaint, | ||
const int | prevmval[2], | ||
const int | mval[2], | ||
double | time, | ||
float | pressure | ||
) | [static] |
Definition at line 4519 of file paint_image.c.
References BKE_image_get_ibuf(), brush_painter_break_stroke(), Mesh::editflag, ImagePaintState::faceindex, ImagePaintState::image, imapaint_canvas_set(), imapaint_clear_partial_redraw(), imapaint_face_image(), imapaint_paint_sub_stroke(), imapaint_pick_face(), imapaint_pick_uv(), SpaceImage::iuser, ImagePaintState::me, ME_EDIT_PAINT_MASK, ME_FACE_SEL, Mesh::mface, NULL, ImagePaintState::ob, ImBuf::rect, ImagePaintState::scene, ImagePaintState::sima, texpaint_break_stroke(), UI_view2d_region_to_view(), ImagePaintState::uv, and ImagePaintState::v2d.
Referenced by paint_apply().
static int imapaint_paint_sub_stroke | ( | ImagePaintState * | s, |
BrushPainter * | painter, | ||
Image * | image, | ||
short | texpaint, | ||
float * | uv, | ||
double | time, | ||
int | update, | ||
float | pressure | ||
) | [static] |
Definition at line 4498 of file paint_image.c.
References BKE_image_get_ibuf(), brush_painter_paint(), brush_painter_require_imbuf(), IB_PROFILE_LINEAR_RGB, imapaint_image_update(), imapaint_paint_op(), SpaceImage::iuser, NULL, ImBuf::profile, ImBuf::rect_float, ImagePaintState::sima, ImBuf::x, and ImBuf::y.
Referenced by imapaint_paint_stroke().
static void imapaint_set_region | ( | ImagePaintRegion * | region, |
int | destx, | ||
int | desty, | ||
int | srcx, | ||
int | srcy, | ||
int | width, | ||
int | height | ||
) | [static] |
Definition at line 4275 of file paint_image.c.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, ImagePaintRegion::srcx, ImagePaintRegion::srcy, and ImagePaintRegion::width.
Referenced by imapaint_lift_smear(), imapaint_paint_op(), and imapaint_torus_split_region().
static int imapaint_torus_split_region | ( | ImagePaintRegion | region[4], |
ImBuf * | dbuf, | ||
ImBuf * | sbuf | ||
) | [static] |
Definition at line 4285 of file paint_image.c.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, imapaint_set_region(), IMB_rectclip(), ImagePaintRegion::srcx, ImagePaintRegion::srcy, simple_enum_gen::w, ImagePaintRegion::width, ImBuf::x, and ImBuf::y.
Referenced by imapaint_lift_smear(), and imapaint_paint_op().
static int IsectPoly2Df | ( | const float | pt[2], |
float | uv[][2], | ||
const int | tot | ||
) | [static] |
Definition at line 2249 of file paint_image.c.
References i, and line_point_side_v2().
Referenced by project_paint_face_init().
static int IsectPoly2Df_twoside | ( | const float | pt[2], |
float | uv[][2], | ||
const int | tot | ||
) | [static] |
Definition at line 2263 of file paint_image.c.
References i, and line_point_side_v2().
Referenced by project_paint_face_init().
static int IsectPT2Df_limit | ( | float | pt[2], |
float | v1[2], | ||
float | v2[2], | ||
float | v3[2], | ||
float | limit | ||
) | [static] |
Definition at line 1938 of file paint_image.c.
References area_tri_v2().
Referenced by project_bucket_clip_face().
static float len_squared_v2v2_alt | ( | const float * | v1, |
const float | v2_1, | ||
const float | v2_2 | ||
) | [static] |
Definition at line 1787 of file paint_image.c.
References UndoImageTile::x, and UndoImageTile::y.
Referenced by project_bucket_isect_circle().
static int line_clip_rect2f | ( | rctf * | rect, |
const float | l1[2], | ||
const float | l2[2], | ||
float | l1_clip[2], | ||
float | l2_clip[2] | ||
) | [static] |
Definition at line 1583 of file paint_image.c.
References BLI_in_rctf(), CLAMP(), copy_v2_v2(), fabsf, line_isect_x(), line_isect_y(), PROJ_GEOM_TOLERANCE, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face(), and project_paint_face_init().
static int line_isect_x | ( | const float | p1[2], |
const float | p2[2], | ||
const float | x_level, | ||
float * | y_isect | ||
) | [static] |
Definition at line 945 of file paint_image.c.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.
Referenced by line_clip_rect2f().
static int line_isect_y | ( | const float | p1[2], |
const float | p2[2], | ||
const float | y_level, | ||
float * | x_isect | ||
) | [static] |
Definition at line 912 of file paint_image.c.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.
Referenced by line_clip_rect2f().
int mask_paint_poll | ( | bContext * | C | ) |
Definition at line 5512 of file paint_image.c.
References CTX_data_active_object(), paint_facesel_test(), and paint_vertsel_test().
Referenced by PAINT_OT_weight_set().
static void paint_apply | ( | bContext * | C, |
wmOperator * | op, | ||
PointerRNA * | itemptr | ||
) | [static] |
Definition at line 4860 of file paint_image.c.
References wmOperator::customdata, PaintOperation::first, imapaint_paint_stroke(), PaintOperation::mode, PAINT_MODE_3D, PAINT_MODE_3D_PROJECT, paint_redraw(), PaintOperation::painter, PaintOperation::prevmouse, project_paint_begin_clone(), project_paint_stroke(), PaintOperation::ps, RNA_float_get(), RNA_float_get_array(), PaintOperation::s, PaintOperation::vc, and view3d_operator_needs_opengl().
Referenced by paint_apply_event(), and paint_exec().
static void paint_apply_event | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 4959 of file paint_image.c.
References wmTabletData::Active, Brush::blend, ImagePaintState::blend, ImagePaintState::brush, BRUSH_SPACING_PRESSURE, brush_use_alpha_pressure(), brush_use_size_pressure(), CTX_data_scene(), wmEvent::custom, wmOperator::customdata, EVT_DATA_TABLET, EVT_TABLET_ERASER, EVT_TABLET_NONE, PaintOperation::first, Brush::flag, IMB_BLEND_ERASE_ALPHA, wmEvent::mval, paint_apply(), PIL_check_seconds_timer(), wmTabletData::Pressure, PaintOperation::prev_pressure, PaintOperation::prevmouse, wmOperator::ptr, RNA_collection_add(), RNA_float_set(), RNA_float_set_array(), PaintOperation::s, and PaintOperation::starttime.
Referenced by paint_invoke(), and paint_modal().
static void paint_brush_exit_tex | ( | Brush * | brush | ) | [static] |
Definition at line 4897 of file paint_image.c.
References bNodeTree::execdata, Brush::mtex, Tex::nodetree, ntreeTexEndExecTree(), and MTex::tex.
Referenced by paint_exit().
static void paint_brush_init_tex | ( | Brush * | brush | ) | [static] |
Definition at line 4754 of file paint_image.c.
References Brush::mtex, Tex::nodetree, ntreeTexBeginExecTree(), and MTex::tex.
Referenced by texture_paint_init().
static int paint_cancel | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5062 of file paint_image.c.
References OPERATOR_CANCELLED, and paint_exit().
Referenced by PAINT_OT_image_paint().
static int paint_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 4942 of file paint_image.c.
References wmOperator::customdata, MEM_freeN(), OPERATOR_CANCELLED, OPERATOR_FINISHED, paint_apply(), paint_exit(), wmOperator::ptr, RNA_BEGIN, RNA_END, and texture_paint_init().
Referenced by PAINT_OT_image_paint().
static void paint_exit | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 4906 of file paint_image.c.
References BKE_reportf(), ProjPaintState::brush, ImagePaintState::brush, brush_painter_free(), brush_set_size(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_window(), wmOperator::customdata, ImagePaintSettings::flag, IMAGEPAINT_DRAWING, IMAGEPAINT_PROJECT_DISABLE, ToolSettings::imapaint, imapaint_canvas_free(), MEM_freeN(), PaintOperation::mode, PaintOperation::orig_brush_size, paint_brush_exit_tex(), PAINT_MODE_3D_PROJECT, paint_redraw(), PaintOperation::painter, project_paint_end(), PaintOperation::ps, wmOperator::reports, PaintOperation::restore_projection, RPT_WARNING, PaintOperation::s, PaintOperation::timer, Scene::toolsettings, UNDO_PAINT_IMAGE, undo_paint_push_end(), ImagePaintState::warnmultifile, ImagePaintState::warnpackedfile, and WM_event_remove_timer().
Referenced by paint_cancel(), paint_exec(), and paint_modal().
static int paint_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5019 of file paint_image.c.
References ImagePaintState::brush, BRUSH_AIRBRUSH, CTX_wm_manager(), CTX_wm_window(), wmOperator::customdata, Brush::flag, MEM_freeN(), OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, paint_apply_event(), PaintOperation::s, texture_paint_init(), TIMER, PaintOperation::timer, WM_event_add_modal_handler(), and WM_event_add_timer().
Referenced by PAINT_OT_image_paint().
static int paint_modal | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5039 of file paint_image.c.
References wmOperator::customdata, wmEvent::customdata, INBETWEEN_MOUSEMOVE, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, paint_apply_event(), paint_exit(), RIGHTMOUSE, TIMER, PaintOperation::timer, and wmEvent::type.
Referenced by PAINT_OT_image_paint().
void PAINT_OT_clone_cursor_set | ( | wmOperatorType * | ot | ) |
Definition at line 5392 of file paint_image.c.
References wmOperatorType::exec, wmOperatorType::flag, FLT_MAX, wmOperatorType::idname, image_paint_3d_poll(), wmOperatorType::invoke, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_float_vector(), set_clone_cursor_exec(), set_clone_cursor_invoke(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_grab_clone | ( | wmOperatorType * | ot | ) |
Definition at line 5259 of file paint_image.c.
References wmOperatorType::cancel, wmOperatorType::exec, wmOperatorType::flag, FLT_MAX, grab_clone_cancel(), grab_clone_exec(), grab_clone_invoke(), grab_clone_modal(), wmOperatorType::idname, image_paint_2d_clone_poll(), wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_float_vector(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_image_from_view | ( | wmOperatorType * | ot | ) |
Definition at line 5698 of file paint_image.c.
References wmOperatorType::description, ED_operator_region_view3d_active(), wmOperatorType::exec, FILE_MAX, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, wmOperatorType::poll, RNA_def_string_file_name(), wmOperatorType::srna, and texture_paint_image_from_view_exec().
Referenced by ED_operatortypes_paint().
void PAINT_OT_image_paint | ( | wmOperatorType * | ot | ) |
Definition at line 5069 of file paint_image.c.
References wmOperatorType::cancel, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, image_paint_poll(), wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, paint_cancel(), paint_exec(), paint_invoke(), paint_modal(), wmOperatorType::poll, RNA_def_collection_runtime(), RNA_OperatorStrokeElement, and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_project_image | ( | wmOperatorType * | ot | ) |
Definition at line 5617 of file paint_image.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::prop, RNA_def_enum(), RNA_def_enum_funcs(), RNA_image_itemf(), wmOperatorType::srna, texture_paint_camera_project_exec(), and WM_enum_search_invoke().
Referenced by ED_operatortypes_paint().
void PAINT_OT_sample_color | ( | wmOperatorType * | ot | ) |
Definition at line 5341 of file paint_image.c.
References wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, image_paint_sample_color_poll(), wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_int_vector(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_texture_paint_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 5474 of file paint_image.c.
References wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, texture_paint_toggle_exec(), and texture_paint_toggle_poll().
Referenced by ED_operatortypes_paint().
static void paint_redraw | ( | bContext * | C, |
ImagePaintState * | s, | ||
int | final | ||
) | [static] |
Definition at line 4680 of file paint_image.c.
References CTX_wm_region(), ED_region_tag_redraw(), GPU_free_image(), ImagePaintState::image, SpaceImage::lock, NA_EDITED, NC_IMAGE, ImagePaintState::sima, and WM_event_add_notifier().
Referenced by paint_apply(), and paint_exit().
static void partial_redraw_array_init | ( | ImagePaintPartialRedraw * | pr | ) | [static] |
Definition at line 3514 of file paint_image.c.
References ImagePaintPartialRedraw::enabled, PROJ_BOUNDBOX_SQUARED, ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, ImagePaintPartialRedraw::y1, and ImagePaintPartialRedraw::y2.
Referenced by project_paint_stroke(), and texture_paint_camera_project_exec().
static int partial_redraw_array_merge | ( | ImagePaintPartialRedraw * | pr, |
ImagePaintPartialRedraw * | pr_other, | ||
int | tot | ||
) | [static] |
Definition at line 3531 of file paint_image.c.
References MAX2, MIN2, ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, ImagePaintPartialRedraw::y1, and ImagePaintPartialRedraw::y2.
Referenced by project_paint_op().
static int pixel_bounds_array | ( | float(*) | uv[2], |
rcti * | bounds_px, | ||
const int | ibuf_x, | ||
const int | ibuf_y, | ||
int | tot | ||
) | [static] |
Definition at line 1034 of file paint_image.c.
References DO_MINMAX2, INIT_MINMAX2, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by project_paint_face_init().
static int pixel_bounds_uv | ( | const float | uv1[2], |
const float | uv2[2], | ||
const float | uv3[2], | ||
const float | uv4[2], | ||
rcti * | bounds_px, | ||
const int | ibuf_x, | ||
const int | ibuf_y, | ||
int | is_quad | ||
) | [static] |
Definition at line 1005 of file paint_image.c.
References DO_MINMAX2, INIT_MINMAX2, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by project_paint_face_init().
static void project_bucket_bounds | ( | const ProjPaintState * | ps, |
const int | bucket_x, | ||
const int | bucket_y, | ||
rctf * | bucket_bounds | ||
) | [static] |
Definition at line 2715 of file paint_image.c.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenMin, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_face_isect(), and project_bucket_iter_next().
static void project_bucket_clip_face | ( | const int | is_ortho, |
rctf * | bucket_bounds, | ||
float * | v1coSS, | ||
float * | v2coSS, | ||
float * | v3coSS, | ||
float * | uv1co, | ||
float * | uv2co, | ||
float * | uv3co, | ||
float | bucket_bounds_uv[8][2], | ||
int * | tot | ||
) | [static] |
Definition at line 1956 of file paint_image.c.
References atan2f, barycentric_weights_v2(), barycentric_weights_v2_persp(), BLI_in_rctf(), copy_v2_v2(), fabsf, FALSE, float_z_sort(), float_z_sort_flip(), i, interp_v2_v2v2v2(), ISECT_1, ISECT_2, ISECT_3, ISECT_4, ISECT_ALL3, ISECT_ALL4, IsectPT2Df_limit(), line_clip_rect2f(), line_point_side_v2(), PROJ_GEOM_TOLERANCE, rect_to_uvspace_ortho(), rect_to_uvspace_persp(), TRUE, simple_enum_gen::w, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_paint_face_init().
static int project_bucket_face_isect | ( | ProjPaintState * | ps, |
int | bucket_x, | ||
int | bucket_y, | ||
const MFace * | mf | ||
) | [static] |
Definition at line 2779 of file paint_image.c.
References BLI_in_rctf(), isect_line_line_v2(), isect_point_quad_v2(), isect_point_tri_v2(), NULL, project_bucket_bounds(), ProjPaintState::screenCoords, MFace::v1, MFace::v2, MFace::v3, MFace::v4, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_paint_delayed_face_init().
static void project_bucket_init | ( | const ProjPaintState * | ps, |
const int | thread_index, | ||
const int | bucket_index, | ||
rctf * | bucket_bounds | ||
) | [static] |
Definition at line 2727 of file paint_image.c.
References ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::dm_mtface, GET_INT_FROM_POINTER, ProjPaintImage::ibuf, ProjPaintImage::ima, IMA_CLAMP_U, IMA_CLAMP_V, ProjPaintState::image_tot, LinkNode::link, LinkNode::next, NULL, PROJ_BUCKET_INIT, project_paint_face_image(), project_paint_face_init(), ProjPaintState::projImages, and Image::tpageflag.
Referenced by do_projectpaint_thread().
static int project_bucket_isect_circle | ( | const float | cent[2], |
const float | radius_squared, | ||
rctf * | bucket_bounds | ||
) | [static] |
Definition at line 1799 of file paint_image.c.
References len_squared_v2v2_alt(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_iter_next().
static int project_bucket_iter_init | ( | ProjPaintState * | ps, |
const float | mval_f[2] | ||
) | [static] |
Definition at line 3579 of file paint_image.c.
References ProjPaintState::brush, brush_size(), ProjPaintState::bucketMax, ProjPaintState::bucketMin, ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::context_bucket_x, ProjPaintState::context_bucket_y, PROJ_SRC_VIEW, project_paint_bucket_bounds(), ProjPaintState::scene, and ProjPaintState::source.
Referenced by project_paint_op().
static int project_bucket_iter_next | ( | ProjPaintState * | ps, |
int * | bucket_index, | ||
rctf * | bucket_bounds, | ||
const float | mval[2] | ||
) | [static] |
Definition at line 3619 of file paint_image.c.
References BLI_lock_thread(), BLI_unlock_thread(), ProjPaintState::brush, brush_size(), ProjPaintState::bucketMax, ProjPaintState::bucketMin, ProjPaintState::buckets_x, ProjPaintState::context_bucket_x, ProjPaintState::context_bucket_y, LOCK_CUSTOM1, PROJ_SRC_VIEW, project_bucket_bounds(), project_bucket_isect_circle(), ProjPaintState::scene, ProjPaintState::source, and ProjPaintState::thread_tot.
Referenced by do_projectpaint_thread().
static int project_bucket_offset | ( | const ProjPaintState * | ps, |
const float | projCoSS[2] | ||
) | [static] |
Definition at line 547 of file paint_image.c.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.
Referenced by project_bucket_offset_safe().
static int project_bucket_offset_safe | ( | const ProjPaintState * | ps, |
const float | projCoSS[2] | ||
) | [static] |
Definition at line 563 of file paint_image.c.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, and project_bucket_offset().
Referenced by project_paint_PickFace().
static int project_bucket_point_occluded | ( | const ProjPaintState * | ps, |
LinkNode * | bucketFace, | ||
const int | orig_face, | ||
float | pixelScreenCo[4] | ||
) | [static] |
Definition at line 869 of file paint_image.c.
References ProjPaintState::dm_mface, GET_INT_FROM_POINTER, ProjPaintState::is_ortho, LinkNode::link, LinkNode::next, project_paint_occlude_ptv(), project_paint_occlude_ptv_clip(), RegionView3D::rflag, ProjPaintState::rv3d, RV3D_CLIPPING, ProjPaintState::screenCoords, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and simple_enum_gen::w.
Referenced by project_paint_face_init().
static void project_face_pixel | ( | const MTFace * | tf_other, |
ImBuf * | ibuf_other, | ||
const float | w[3], | ||
int | side, | ||
unsigned char | rgba_ub[4], | ||
float | rgba_f[4] | ||
) | [static] |
Definition at line 1318 of file paint_image.c.
References bilinear_interpolation_color_wrap(), if(), interp_v2_v2v2v2(), NULL, ImBuf::rect_float, MTFace::uv, uvco_to_wrapped_pxco(), ImBuf::x, UndoImageTile::x, ImBuf::y, and UndoImageTile::y.
Referenced by project_paint_uvpixel_init(), and project_paint_uvpixel_mask().
static void project_face_seams_init | ( | const ProjPaintState * | ps, |
const int | face_index, | ||
const int | is_quad | ||
) | [static] |
Definition at line 1243 of file paint_image.c.
References check_seam(), ProjPaintState::faceSeamFlags, and other_face().
Referenced by project_paint_face_init().
static int project_image_refresh_tagged | ( | ProjPaintState * | ps | ) | [static] |
Definition at line 3551 of file paint_image.c.
References i, ProjPaintImage::ibuf, ProjPaintImage::ima, imapaint_image_update(), NULL, ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, ProjPaintState::projImages, ProjPaintImage::touch, and ImagePaintPartialRedraw::x2.
Referenced by project_paint_stroke(), and texture_paint_camera_project_exec().
static void project_paint_begin | ( | ProjPaintState * | ps | ) | [static] |
Definition at line 2913 of file paint_image.c.
References add_v3_v3(), angle_normalized_v3v3(), ProjPaintState::ar, ProjPaintState::arena_mt, BKE_image_get_ibuf(), BLI_linklist_append(), BLI_linklist_free(), BLI_linklist_index(), BLI_linklist_prepend_arena(), BLI_memarena_alloc(), BLI_memarena_new(), BLI_system_thread_count(), ProjPaintState::brush, brush_size(), ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, ProjPaintState::buckets_x, ProjPaintState::buckets_y, Scene::camera, camera_params_compute_matrix(), camera_params_compute_viewplane(), camera_params_from_object(), camera_params_init(), CD_MASK_MTFACE, CD_MTFACE, CLAMP(), CameraParams::clipend, ProjPaintState::clipend, CameraParams::clipsta, ProjPaintState::clipsta, MVert::co, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), CustomData_get_clone_layer(), CustomData_get_layer_n(), CustomData_get_stencil_layer(), CustomData_has_layer(), Scene::customdata_mask, Object::data, Object::derivedFinal, ProjPaintState::dm, ProjPaintState::dm_mface, ProjPaintState::dm_mtface, ProjPaintState::dm_mtface_clone, ProjPaintState::dm_mtface_stencil, ProjPaintState::dm_mvert, ProjPaintState::dm_release, ProjPaintState::dm_totface, ProjPaintState::dm_totvert, DM_TYPE_CDDM, ProjPaintState::do_backfacecull, ProjPaintState::do_layer_clone, ProjPaintState::do_layer_stencil, ProjPaintState::do_mask_normal, DO_MINMAX2, ED_view3d_local_clipping(), ED_view3d_ob_project_mat_get(), DerivedMesh::faceData, ProjPaintState::faceSeamFlags, ProjPaintState::faceSeamUVs, FALSE, MFace::flag, FLT_MAX, DerivedMesh::getFaceArray, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVertArray, i, ProjPaintImage::ibuf, Image::id, IDP_Array, IDP_GetProperties(), IDP_GetPropertyFromGroup(), ProjPaintImage::ima, ProjPaintState::image_tot, Object::imat, INIT_MINMAX2, invert_m4_m4(), CameraParams::is_ortho, ProjPaintState::is_ortho, line_point_side_v2(), LinkNode::link, ME_EDIT_PAINT_MASK, ME_FACE_SEL, MEM_callocN(), MEM_dupallocN(), MEM_mallocN(), mesh_create_derived_render(), mesh_get_derived_final(), RenderData::mode, mul_m3_v3(), mul_m4_v4(), mul_v3_m4v3(), mult_m4_m4m4(), LinkNode::next, MVert::no, ProjPaintState::normal_angle, normal_short_to_float_v3(), normalize_m4(), normalize_v3(), NULL, ProjPaintState::ob, Object::obmat, ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, PROJ_BUCKET_BRUSH_DIV, PROJ_BUCKET_RECT_MAX, PROJ_BUCKET_RECT_MIN, PROJ_SRC_IMAGE_CAM, PROJ_SRC_IMAGE_VIEW, PROJ_SRC_VIEW, PROJ_VERT_CULL, PROJ_VIEW_DATA_ID, project_paint_delayed_face_init(), project_paint_face_image(), project_paint_view_clip(), ProjPaintState::projectMat, ProjPaintState::projImages, Scene::r, R_FIXED_THREADS, DerivedMesh::release, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_image, ProjPaintState::rv3d, ProjPaintState::scene, ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenCoords, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::seam_bleed_px, SET_INT_IN_POINTER, ProjPaintState::source, sub_v3_v3v3(), ProjPaintState::thread_tot, RenderData::threads, ProjPaintImage::touch, TRUE, DerivedMesh::type, MFace::v1, MFace::v2, MFace::v3, ProjPaintState::v3d, MFace::v4, ProjPaintState::vertFaces, ProjPaintState::vertFlags, ProjPaintState::viewDir, RegionView3D::viewinv, RegionView3D::viewmat, ProjPaintState::viewPos, CameraParams::winmat, ARegion::winx, ProjPaintState::winx, ARegion::winy, ProjPaintState::winy, ImBuf::x, and ImBuf::y.
Referenced by texture_paint_camera_project_exec(), and texture_paint_init().
static void project_paint_begin_clone | ( | ProjPaintState * | ps, |
int | mouse[2] | ||
) | [static] |
Definition at line 3372 of file paint_image.c.
References ProjPaintState::cloneOffset, copy_v3_v3(), give_cursor(), Object::imat, mul_m4_v3(), mul_m4_v4(), ProjPaintState::ob, PAINT_TOOL_CLONE, ProjPaintState::projectMat, ProjPaintState::scene, ProjPaintState::tool, ProjPaintState::v3d, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by paint_apply().
static void project_paint_bucket_bounds | ( | const ProjPaintState * | ps, |
const float | min[2], | ||
const float | max[2], | ||
int | bucketMin[2], | ||
int | bucketMax[2] | ||
) | [static] |
Definition at line 2696 of file paint_image.c.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, CLAMP(), ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.
Referenced by project_bucket_iter_init(), and project_paint_delayed_face_init().
static void project_paint_delayed_face_init | ( | ProjPaintState * | ps, |
const MFace * | mf, | ||
const int | face_index | ||
) | [static] |
Definition at line 2846 of file paint_image.c.
References ProjPaintState::arena_mt, BLI_linklist_prepend_arena(), ProjPaintState::bucketFaces, ProjPaintState::buckets_x, DO_MINMAX2, ProjPaintState::faceSeamFlags, ProjPaintState::faceSeamUVs, FLT_MAX, INIT_MINMAX2, max, min, PROJ_FACE_NOSEAM4, project_bucket_face_isect(), project_paint_bucket_bounds(), ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, SET_INT_IN_POINTER, MFace::v1, and MFace::v4.
Referenced by project_paint_begin().
static void project_paint_end | ( | ProjPaintState * | ps | ) | [static] |
Definition at line 3387 of file paint_image.c.
References ProjPaintState::arena_mt, BLI_memarena_alloc(), BLI_memarena_free(), ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, ProjPaintState::buckets_x, ProjPaintState::buckets_y, copy_v4_v4(), ProjPaintState::dm, ProjPaintState::dm_mface, ProjPaintState::dm_mvert, ProjPaintState::dm_release, DM_TYPE_CDDM, pixelStore::f, pixelPointer::f_pt, ProjPaintState::faceSeamFlags, ProjPaintState::faceSeamUVs, IB_BITMAPDIRTY, ProjPaintImage::ibuf, if(), ProjPaintImage::ima, ProjPixel::image_index, image_undo_push_tile(), IMAPAINT_TILE_BITS, IMAPAINT_TILE_NUMBER, IMAPAINT_TILE_SIZE, IMB_freeImBuf(), LinkNode::link, MEM_freeN(), LinkNode::next, NULL, ProjPixel::origColor, ProjPixel::pixel, ProjPaintState::projImages, ImBuf::rect_float, DerivedMesh::release, ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, size(), ProjPaintState::thread_tot, DerivedMesh::type, U, UserDef::uiflag, pixelStore::uint, pixelPointer::uint_pt, ProjPaintImage::undoRect, USER_GLOBALUNDO, ImBuf::userflags, ProjPaintState::vertFaces, ProjPaintState::vertFlags, ImBuf::x, ProjPixel::x_px, ImBuf::y, and ProjPixel::y_px.
Referenced by paint_exit(), and texture_paint_camera_project_exec().
static Image* project_paint_face_image | ( | const ProjPaintState * | ps, |
MTFace * | dm_mtface, | ||
int | face_index | ||
) | [static] |
Definition at line 531 of file paint_image.c.
References ProjPaintState::dm_mface, ProjPaintState::do_new_shading_nodes, ED_object_get_active_image(), MFace::mat_nr, NULL, ProjPaintState::ob, and MTFace::tpage.
Referenced by check_seam(), project_bucket_init(), project_paint_begin(), project_paint_PickColor(), project_paint_uvpixel_init(), and project_paint_uvpixel_mask().
static void project_paint_face_init | ( | const ProjPaintState * | ps, |
const int | thread_index, | ||
const int | bucket_index, | ||
const int | face_index, | ||
const int | image_index, | ||
rctf * | bucket_bounds, | ||
const ImBuf * | ibuf, | ||
const short | clamp_u, | ||
const short | clamp_v | ||
) | [static] |
Definition at line 2279 of file paint_image.c.
References ProjPaintState::arena_mt, barycentric_weights_v2(), BLI_linklist_prepend_arena(), BLI_lock_thread(), BLI_unlock_thread(), ProjPaintState::bucketFaces, ProjPaintState::bucketRect, CLAMP(), closest_to_line_v2(), MVert::co, copy_v2_v2(), copy_v3_v3(), ProjPaintState::dm_mface, ProjPaintState::dm_mtface, ProjPaintState::dm_mtface_clone, ProjPaintState::dm_mvert, ProjPaintState::do_backfacecull, ProjPaintState::do_mask_normal, ProjPaintState::do_occlude, ED_view3d_test_clipping(), ProjPaintState::faceSeamFlags, ProjPaintState::faceSeamUVs, FLT_MAX, interp_v2_v2v2(), interp_v3_v3v3(), interp_v3_v3v3v3(), ProjPaintState::is_ortho, isect_point_quad_v2(), IsectPoly2Df(), IsectPoly2Df_twoside(), len_v2v2(), line_clip_rect2f(), line_point_factor_v2(), LOCK_CUSTOM1, mul_m4_v4(), pixel_bounds_array(), pixel_bounds_uv(), PROJ_FACE_NOSEAM1, PROJ_FACE_NOSEAM2, PROJ_FACE_NOSEAM3, PROJ_FACE_NOSEAM4, PROJ_FACE_SCALE_SEAM, PROJ_FACE_SEAM1, PROJ_FACE_SEAM2, PROJ_FACE_SEAM3, PROJ_FACE_SEAM4, PROJ_GEOM_TOLERANCE, project_bucket_clip_face(), project_bucket_point_occluded(), project_face_seams_init(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ProjPaintState::projectMat, RegionView3D::rflag, ProjPaintState::rv3d, RV3D_CLIPPING, scale_quad(), scale_tri(), screen_px_from_ortho(), screen_px_from_persp(), ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, ProjPaintState::thread_tot, MTFace::uv, uv_image_outset(), MFace::v1, MFace::v2, MFace::v3, MFace::v4, simple_enum_gen::w, ProjPaintState::winx, ProjPaintState::winy, ImBuf::x, UndoImageTile::x, rcti::xmax, rcti::xmin, ImBuf::y, UndoImageTile::y, rcti::ymax, and rcti::ymin.
Referenced by project_bucket_init().
static int project_paint_occlude_ptv | ( | float | pt[3], |
float | v1[4], | ||
float | v2[4], | ||
float | v3[4], | ||
float | w[3], | ||
int | is_ortho | ||
) | [static] |
Definition at line 808 of file paint_image.c.
References isect_point_tri_v2(), VecZDepthOrtho(), and VecZDepthPersp().
Referenced by project_bucket_point_occluded(), and project_paint_occlude_ptv_clip().
static int project_paint_occlude_ptv_clip | ( | const ProjPaintState * | ps, |
const MFace * | mf, | ||
float | pt[3], | ||
float | v1[4], | ||
float | v2[4], | ||
float | v3[4], | ||
const int | side | ||
) | [static] |
Definition at line 838 of file paint_image.c.
References barycentric_weights_v2(), barycentric_weights_v2_persp(), MVert::co, ProjPaintState::dm_mvert, ED_view3d_test_clipping(), interp_v3_v3v3v3(), ProjPaintState::is_ortho, project_paint_occlude_ptv(), ProjPaintState::rv3d, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and simple_enum_gen::w.
Referenced by project_bucket_point_occluded().
static int project_paint_op | ( | void * | state, |
ImBuf * | UNUSEDibufb, | ||
float * | lastpos, | ||
float * | pos | ||
) | [static] |
Definition at line 4011 of file paint_image.c.
References ProjPaintState::arena_mt, BLENDER_MAX_THREADS, BLI_end_threads(), BLI_init_threads(), BLI_insert_thread(), BLI_memarena_alloc(), copy_v2_v2(), do_projectpaint_thread(), i, ProjPaintState::image_tot, partial_redraw_array_merge(), ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, project_bucket_iter_init(), ProjPaintState::projImages, ProjectHandle::projImages, ProjectHandle::ps, ProjectHandle::thread_index, ProjPaintState::thread_tot, threads, and ProjPaintImage::touch.
Referenced by project_paint_sub_stroke(), and texture_paint_camera_project_exec().
static int project_paint_PickColor | ( | const ProjPaintState * | ps, |
float | pt[2], | ||
float * | rgba_fp, | ||
unsigned char * | rgba, | ||
const int | interp | ||
) | [static] |
Definition at line 712 of file paint_image.c.
References bilinear_interpolation_color_wrap(), copy_v4_v4(), ProjPaintState::dm_mtface, ListBase::first, Image::ibufs, if(), IMAPAINT_CHAR_RGBA_TO_FLOAT, IMAPAINT_FLOAT_RGBA_TO_CHAR, interp_v2_v2v2v2(), NULL, project_paint_face_image(), project_paint_PickFace(), ImBuf::rect, ImBuf::rect_float, MTFace::uv, uvco_to_wrapped_pxco(), simple_enum_gen::w, ImBuf::x, UndoImageTile::x, ImBuf::y, and UndoImageTile::y.
Referenced by do_projectpaint_smear(), do_projectpaint_smear_f(), and project_paint_uvpixel_init().
static int project_paint_PickFace | ( | const ProjPaintState * | ps, |
float | pt[2], | ||
float | w[3], | ||
int * | side | ||
) | [static] |
Definition at line 636 of file paint_image.c.
References ProjPaintState::bucketFaces, copy_v3_v3(), ProjPaintState::dm_mface, FLT_MAX, GET_INT_FROM_POINTER, ProjPaintState::is_ortho, isect_point_tri_v2(), LinkNode::link, LinkNode::next, project_bucket_offset_safe(), ProjPaintState::screenCoords, MFace::v1, MFace::v2, MFace::v3, MFace::v4, VecZDepthOrtho(), and VecZDepthPersp().
Referenced by project_paint_PickColor().
static int project_paint_stroke | ( | ProjPaintState * | ps, |
BrushPainter * | painter, | ||
const int | prevmval_i[2], | ||
const int | mval_i[2], | ||
double | time, | ||
float | pressure | ||
) | [static] |
Definition at line 4097 of file paint_image.c.
References ProjPaintState::image_tot, partial_redraw_array_init(), ProjPaintImage::partRedrawRect, project_image_refresh_tagged(), project_paint_sub_stroke(), and ProjPaintState::projImages.
Referenced by paint_apply().
static int project_paint_sub_stroke | ( | ProjPaintState * | ps, |
BrushPainter * | painter, | ||
const int | UNUSEDprevmval_i[2], | ||
const int | mval_i[2], | ||
double | time, | ||
float | pressure | ||
) | [static] |
Definition at line 4078 of file paint_image.c.
References brush_painter_paint(), and project_paint_op().
Referenced by project_paint_stroke().
static ProjPixel* project_paint_uvpixel_init | ( | const ProjPaintState * | ps, |
MemArena * | arena, | ||
const ImBuf * | ibuf, | ||
short | x_px, | ||
short | y_px, | ||
const float | mask, | ||
const int | face_index, | ||
const int | image_index, | ||
const float | pixelScreenCo[4], | ||
const int | side, | ||
const float | w[3] | ||
) | [static] |
Definition at line 1456 of file paint_image.c.
References ProjPixel::bb_cell_index, BKE_image_get_ibuf(), BLI_memarena_alloc(), pixelPointer::ch_pt, ProjPaintState::cloneOffset, co, copy_v2_v2(), ProjPaintState::dm_mtface_clone, pixelStore::f, pixelPointer::f_pt, ProjPixel::image_index, IMAPAINT_CHAR_RGBA_TO_FLOAT, IMAPAINT_FLOAT_RGBA_TO_CHAR, ProjPixel::mask, ProjPixel::mask_max, ProjPixel::newColor, NULL, ProjPixel::origColor, PAINT_TOOL_CLONE, PAINT_TOOL_SMEAR, ProjPixel::pixel, PROJ_BOUNDBOX_DIV, ProjPixel::projCoSS, project_face_pixel(), project_paint_face_image(), project_paint_PickColor(), ImBuf::rect, ImBuf::rect_float, size(), sub_v2_v2v2(), ProjPaintState::tool, pixelStore::uint, pixelPointer::uint_pt, ImBuf::x, ProjPixel::x_px, ImBuf::y, and ProjPixel::y_px.
Referenced by project_paint_face_init().
static float project_paint_uvpixel_mask | ( | const ProjPaintState * | ps, |
const int | face_index, | ||
const int | side, | ||
const float | w[3] | ||
) | [static] |
Definition at line 1349 of file paint_image.c.
References angle(), angle_normalized_v3v3(), BKE_image_get_ibuf(), MVert::co, ProjPaintState::dm_mface, ProjPaintState::dm_mtface_stencil, ProjPaintState::dm_mvert, ProjPaintState::do_layer_stencil, ProjPaintState::do_layer_stencil_inv, ProjPaintState::do_mask_normal, ProjPaintState::is_ortho, MVert::no, ProjPaintState::normal_angle, ProjPaintState::normal_angle_inner, ProjPaintState::normal_angle_range, normalize_v3(), NULL, project_face_pixel(), project_paint_face_image(), ImBuf::rect_float, MFace::v1, MFace::v2, MFace::v3, MFace::v4, ProjPaintState::viewDir, and ProjPaintState::viewPos.
Referenced by project_paint_face_init().
static int project_paint_view_clip | ( | View3D * | v3d, |
RegionView3D * | rv3d, | ||
float * | clipsta, | ||
float * | clipend | ||
) | [static] |
Definition at line 2899 of file paint_image.c.
References ED_view3d_clip_range_get(), and orth().
Referenced by project_paint_begin(), and texture_paint_image_from_view_exec().
static void project_state_init | ( | bContext * | C, |
Object * | ob, | ||
ProjPaintState * | ps | ||
) | [static] |
Definition at line 4698 of file paint_image.c.
References ProjPaintState::ar, Brush::blend, ProjPaintState::blend, ProjPaintState::brush, BRUSH_AIRBRUSH, CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), ProjPaintState::do_backfacecull, ProjPaintState::do_layer_clone, ProjPaintState::do_layer_stencil, ProjPaintState::do_layer_stencil_inv, ProjPaintState::do_mask_normal, ProjPaintState::do_new_shading_nodes, ProjPaintState::do_occlude, ImagePaintSettings::flag, Brush::flag, IMAGEPAINT_PROJECT_BACKFACE, IMAGEPAINT_PROJECT_FLAT, IMAGEPAINT_PROJECT_LAYER_CLONE, IMAGEPAINT_PROJECT_LAYER_STENCIL, IMAGEPAINT_PROJECT_LAYER_STENCIL_INV, IMAGEPAINT_PROJECT_XRAY, Brush::imagepaint_tool, ToolSettings::imapaint, ProjPaintState::is_airbrush, ProjPaintState::is_texbrush, M_PI_2, Brush::mtex, ProjPaintState::normal_angle, ImagePaintSettings::normal_angle, ProjPaintState::normal_angle_inner, ProjPaintState::normal_angle_range, ProjPaintState::ob, ImagePaintSettings::paint, paint_brush(), PAINT_TOOL_CLONE, ProjPaintState::rv3d, ProjPaintState::scene, scene_use_new_shading_nodes(), ImagePaintSettings::seam_bleed, ProjPaintState::seam_bleed_px, MTex::tex, ProjPaintState::tool, Scene::toolsettings, and ProjPaintState::v3d.
Referenced by texture_paint_camera_project_exec(), and texture_paint_init().
static void rect_to_uvspace_ortho | ( | rctf * | bucket_bounds, |
float * | v1coSS, | ||
float * | v2coSS, | ||
float * | v3coSS, | ||
float * | uv1co, | ||
float * | uv2co, | ||
float * | uv3co, | ||
float | bucket_bounds_uv[4][2], | ||
const int | flip | ||
) | [static] |
Definition at line 1850 of file paint_image.c.
References barycentric_weights_v2(), interp_v2_v2v2v2(), simple_enum_gen::w, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
static void rect_to_uvspace_persp | ( | rctf * | bucket_bounds, |
float * | v1coSS, | ||
float * | v2coSS, | ||
float * | v3coSS, | ||
float * | uv1co, | ||
float * | uv2co, | ||
float * | uv3co, | ||
float | bucket_bounds_uv[4][2], | ||
const int | flip | ||
) | [static] |
Definition at line 1883 of file paint_image.c.
References barycentric_weights_v2_persp(), interp_v2_v2v2v2(), simple_enum_gen::w, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
static int sample_color_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5281 of file paint_image.c.
References CTX_data_scene(), CTX_wm_region(), image_paint_brush(), NA_EDITED, NC_BRUSH, OPERATOR_FINISHED, paint_sample_color(), wmOperator::ptr, RNA_int_get_array(), and WM_event_add_notifier().
Referenced by PAINT_OT_sample_color(), sample_color_invoke(), and sample_color_modal().
static int sample_color_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5296 of file paint_image.c.
References wmEvent::mval, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_int_set_array(), sample_color_exec(), and WM_event_add_modal_handler().
Referenced by PAINT_OT_sample_color().
static int sample_color_modal | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5306 of file paint_image.c.
References LEFTMOUSE, MOUSEMOVE, wmEvent::mval, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RIGHTMOUSE, RNA_int_set_array(), sample_color_exec(), and wmEvent::type.
Referenced by PAINT_OT_sample_color().
static void scale_quad | ( | float | insetCos[4][3], |
float * | origCos[4], | ||
const float | inset | ||
) | [static] |
Definition at line 1742 of file paint_image.c.
References add_v3_v3(), mul_v3_fl(), and sub_v3_v3v3().
Referenced by project_paint_face_init().
static void scale_tri | ( | float | insetCos[4][3], |
float * | origCos[4], | ||
const float | inset | ||
) | [static] |
Definition at line 1766 of file paint_image.c.
References add_v3_v3(), mul_v3_fl(), and sub_v3_v3v3().
Referenced by project_paint_face_init().
static void screen_px_from_ortho | ( | float | uv[2], |
float | v1co[3], | ||
float | v2co[3], | ||
float | v3co[3], | ||
float | uv1co[2], | ||
float | uv2co[2], | ||
float | uv3co[2], | ||
float | pixelScreenCo[4], | ||
float | w[3] | ||
) | [static] |
Definition at line 1273 of file paint_image.c.
References barycentric_weights_v2(), and interp_v3_v3v3v3().
Referenced by project_paint_face_init().
static void screen_px_from_persp | ( | float | uv[2], |
float | v1co[4], | ||
float | v2co[4], | ||
float | v3co[4], | ||
float | uv1co[2], | ||
float | uv2co[2], | ||
float | uv3co[2], | ||
float | pixelScreenCo[4], | ||
float | w[3] | ||
) | [static] |
Definition at line 1286 of file paint_image.c.
References barycentric_weights_v2(), and interp_v3_v3v3v3().
Referenced by project_paint_face_init().
static int set_clone_cursor_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5362 of file paint_image.c.
References CTX_data_scene(), CTX_wm_area(), CTX_wm_view3d(), ED_area_tag_redraw(), give_cursor(), OPERATOR_FINISHED, wmOperator::ptr, and RNA_float_get_array().
Referenced by PAINT_OT_clone_cursor_set(), and set_clone_cursor_invoke().
static int set_clone_cursor_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 5375 of file paint_image.c.
References CTX_data_scene(), CTX_wm_region(), CTX_wm_view3d(), ED_view3d_autodist(), wmEvent::mval, OPERATOR_CANCELLED, wmOperator::ptr, RNA_float_set_array(), set_clone_cursor_exec(), and view3d_operator_needs_opengl().
Referenced by PAINT_OT_clone_cursor_set().
static int texpaint_break_stroke | ( | float * | prevuv, |
float * | fwuv, | ||
float * | bkuv, | ||
float * | uv | ||
) | [static] |
Definition at line 4426 of file paint_image.c.
References dot_v2v2(), len_v2v2(), MAX2, and sub_v2_v2v2().
Referenced by imapaint_paint_stroke().
static int texture_paint_camera_project_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5517 of file paint_image.c.
References BKE_image_get_ibuf(), BKE_report(), BLI_findlink(), ProjPaintState::brush, brush_set_size(), brush_size(), Scene::camera, CTX_data_main(), CTX_data_scene(), ProjPaintState::dm, ImagePaintSettings::flag, GPU_free_image(), Image::id, IDP_ARRAY, IDP_FLOAT, IDP_GetProperties(), IDP_GetPropertyTypeFromGroup(), ProjPaintImage::ima, ProjPaintState::image_tot, image_undo_free(), image_undo_restore(), IMAGEPAINT_DRAWING, ToolSettings::imapaint, ProjPaintState::is_airbrush, ProjPaintState::is_texbrush, IDProperty::len, NA_EDITED, wmOperatorType::name, NC_IMAGE, NULL, ProjPaintState::ob, OB_MESH, OBACT, OPERATOR_CANCELLED, OPERATOR_FINISHED, PAINT_TOOL_DRAW, partial_redraw_array_init(), ProjPaintImage::partRedrawRect, PROJ_SRC_IMAGE_CAM, PROJ_SRC_IMAGE_VIEW, PROJ_VIEW_DATA_ID, PROJ_VIEW_DATA_SIZE, project_image_refresh_tagged(), project_paint_begin(), project_paint_end(), project_paint_op(), project_state_init(), ProjPaintState::projImages, wmOperator::ptr, ImBuf::rect, wmOperator::reports, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_image, RNA_enum_get(), RPT_ERROR, ProjPaintState::source, IDProperty::subtype, ProjPaintState::tool, Scene::toolsettings, wmOperator::type, Object::type, UNDO_PAINT_IMAGE, undo_paint_push_begin(), and WM_event_add_notifier().
Referenced by PAINT_OT_project_image().
static int texture_paint_image_from_view_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5638 of file paint_image.c.
References IDPropertyTemplate::array, BKE_add_image_imbuf(), BKE_reportf(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), ED_view3d_draw_offscreen_imbuf(), FILE_MAX, IB_rect, Image::id, IDP_AddToGroup(), IDP_Array, IDP_ARRAY, IDP_FLOAT, IDP_GetProperties(), IDP_New(), ToolSettings::imapaint, IDPropertyTemplate::len, OPERATOR_CANCELLED, OPERATOR_FINISHED, orth(), PROJ_VIEW_DATA_ID, PROJ_VIEW_DATA_SIZE, project_paint_view_clip(), wmOperator::ptr, rename_id(), wmOperator::reports, RNA_string_get(), RPT_ERROR, ImagePaintSettings::screen_grab_size, Scene::toolsettings, IDPropertyTemplate::type, simple_enum_gen::val, RegionView3D::viewmat, simple_enum_gen::w, and RegionView3D::winmat.
Referenced by PAINT_OT_image_from_view().
static int texture_paint_init | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 4765 of file paint_image.c.
References BKE_report(), Brush::blend, ImagePaintState::blend, ProjPaintState::brush, ImagePaintState::brush, brush_painter_new(), brush_set_size(), brush_size(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_screen(), CTX_wm_space_image(), wmOperator::customdata, ProjPaintState::dm, PaintOperation::first, ImagePaintSettings::flag, get_mesh(), SpaceImage::image, ImagePaintState::image, image_undo_free(), image_undo_restore(), IMAGEPAINT_DRAWING, IMAGEPAINT_PROJECT_DISABLE, Brush::imagepaint_tool, ToolSettings::imapaint, imapaint_canvas_set(), View3D::lay, Object::lay, ImagePaintState::me, MEM_callocN(), PaintOperation::mode, wmOperatorType::name, NULL, ProjPaintState::ob, ImagePaintState::ob, OBACT, PaintOperation::orig_brush_size, ImagePaintSettings::paint, paint_brush(), paint_brush_init_tex(), PAINT_MODE_2D, PAINT_MODE_3D, PAINT_MODE_3D_PROJECT, PAINT_TOOL_CLONE, PAINT_TOOL_DRAW, PAINT_TOOL_SOFTEN, PaintOperation::painter, PROJ_SRC_VIEW, project_paint_begin(), project_state_init(), PaintOperation::ps, wmOperator::reports, PaintOperation::restore_projection, RPT_WARNING, PaintOperation::s, ImagePaintState::scene, ImagePaintState::screen, ImagePaintState::sima, ProjPaintState::source, ImagePaintState::tool, Scene::toolsettings, wmOperator::type, UNDO_PAINT_IMAGE, undo_paint_push_begin(), ARegion::v2d, ImagePaintState::v2d, ProjPaintState::v3d, PaintOperation::vc, view3d_set_viewcontext(), ImagePaintState::warnmultifile, and ImagePaintState::warnpackedfile.
Referenced by paint_exec(), and paint_invoke().
static int texture_paint_poll | ( | bContext * | C | ) | [static] |
Definition at line 5488 of file paint_image.c.
References CTX_data_active_object(), OB_MODE_TEXTURE_PAINT, and texture_paint_toggle_poll().
Referenced by image_texture_paint_poll().
static int texture_paint_toggle_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 5422 of file paint_image.c.
References BKE_report(), CD_DEFAULT, CD_MTFACE, CTX_data_active_object(), CTX_data_scene(), CustomData_add_layer(), DAG_id_tag_update(), Mesh::fdata, get_mesh(), UserDef::glreslimit, GPU_free_images(), GPU_paint_set_mipmap(), Object::id, ToolSettings::imapaint, Object::mode, Mesh::mtface, NC_SCENE, ND_MODE, NULL, OB_MODE_TEXTURE_PAINT, OB_RECALC_DATA, object_data_is_libdata(), OPERATOR_CANCELLED, OPERATOR_FINISHED, ImagePaintSettings::paint, PAINT_CURSOR_TEXTURE_PAINT, paint_init(), wmOperator::reports, RPT_ERROR, toggle_paint_cursor(), Scene::toolsettings, Mesh::totface, U, and WM_event_add_notifier().
Referenced by PAINT_OT_texture_paint_toggle().
static int texture_paint_toggle_poll | ( | bContext * | C | ) | [static] |
Definition at line 5412 of file paint_image.c.
References CTX_data_active_object(), CTX_data_edit_object(), and NULL.
Referenced by PAINT_OT_texture_paint_toggle(), and texture_paint_poll().
static void toggle_paint_cursor | ( | bContext * | C, |
int | enable | ||
) | [static] |
Definition at line 5153 of file paint_image.c.
References brush_drawcursor(), CTX_data_scene(), CTX_wm_manager(), image_paint_poll(), ToolSettings::imapaint, NULL, ImagePaintSettings::paintcursor, Scene::toolsettings, WM_paint_cursor_activate(), and WM_paint_cursor_end().
Referenced by texture_paint_toggle_exec().
static void undo_copy_tile | ( | UndoImageTile * | tile, |
ImBuf * | tmpibuf, | ||
ImBuf * | ibuf, | ||
int | restore | ||
) | [static] |
Definition at line 394 of file paint_image.c.
References IMAPAINT_TILE_SIZE, IMB_rectcpy(), ImBuf::rect, UndoImageTile::rect, ImBuf::rect_float, SWAP, UndoImageTile::x, and UndoImageTile::y.
Referenced by image_undo_push_tile(), and image_undo_restore().
static void uv_image_outset | ( | float(*) | orig_uv[2], |
float(*) | outset_uv[2], | ||
const float | scaler, | ||
const int | ibuf_x, | ||
const int | ibuf_y, | ||
const int | is_quad | ||
) | [static] |
Definition at line 1137 of file paint_image.c.
References add_v2_v2v2(), angle_normalized_v2v2(), M_PI, mul_v2_fl(), mul_v2_v2(), normalize_v2(), shell_angle_to_dist(), and sub_v2_v2v2().
Referenced by project_paint_face_init().
static void uvco_to_wrapped_pxco | ( | float | uv[2], |
int | ibuf_x, | ||
int | ibuf_y, | ||
float * | x, | ||
float * | y | ||
) | [static] |
Definition at line 698 of file paint_image.c.
References fmodf.
Referenced by project_face_pixel(), and project_paint_PickColor().
static float VecZDepthOrtho | ( | float | pt[2], |
float | v1[3], | ||
float | v2[3], | ||
float | v3[3], | ||
float | w[3] | ||
) | [static] |
Definition at line 596 of file paint_image.c.
References barycentric_weights_v2().
Referenced by project_paint_occlude_ptv(), and project_paint_PickFace().
static float VecZDepthPersp | ( | float | pt[2], |
float | v1[4], | ||
float | v2[4], | ||
float | v3[4], | ||
float | w[3] | ||
) | [static] |
Definition at line 602 of file paint_image.c.
References barycentric_weights_v2_persp().
Referenced by project_paint_occlude_ptv(), and project_paint_PickFace().
int vert_paint_poll | ( | bContext * | C | ) |
Definition at line 5507 of file paint_image.c.
References CTX_data_active_object(), and paint_vertsel_test().
Referenced by ED_keymap_paint(), PAINT_OT_vert_select_all(), and PAINT_OT_vert_select_inverse().
ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0} [static] |
Definition at line 390 of file paint_image.c.