svn merge -r47246:47245 . --- revert 47246, this needs more considersation and planning to do this well
This commit is contained in:
@@ -171,7 +171,7 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
|
||||
* for speed, but waiting on final design choices for curve-data before eliminating data the DEM code will need
|
||||
* if it ends up being coupled with this function.
|
||||
*/
|
||||
int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts, float fill_color)
|
||||
int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_verts)
|
||||
{
|
||||
int x_curr; /* current pixel position in X */
|
||||
int y_curr; /* current scan line being drawn */
|
||||
@@ -308,7 +308,11 @@ int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_
|
||||
if((y_curr >= 0) && (y_curr < ctx->rb.sizey)){
|
||||
/* draw the pixels. */
|
||||
for (; cpxl <= mpxl; cpxl++){
|
||||
*cpxl = fill_color;
|
||||
if(*cpxl < 0.5f){
|
||||
*cpxl = 1.0f;
|
||||
}else{
|
||||
*cpxl = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,7 +388,7 @@ int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_
|
||||
return 1;
|
||||
}
|
||||
|
||||
int PLX_raskterize(float *verts, int num, float *buf, int buf_x, int buf_y, float fill_color) {
|
||||
int PLX_raskterize(float *verts, int num, float *buf, int buf_x, int buf_y) {
|
||||
int i; /* i: Loop counter. */
|
||||
struct poly_vert *ply; /* ply: Pointer to a list of integer buffer-space vertex coordinates. */
|
||||
struct r_fill_context ctx = {0};
|
||||
@@ -417,7 +421,7 @@ int PLX_raskterize(float *verts, int num, float *buf, int buf_x, int buf_y, floa
|
||||
ctx.rb.sizex = buf_x; /* Set the output buffer size in X. (width) */
|
||||
ctx.rb.sizey = buf_y; /* Set the output buffer size in Y. (height) */
|
||||
|
||||
i = rast_scan_fill(&ctx, ply, num, fill_color); /* Call our rasterizer, passing in the integer coords for each vert. */
|
||||
i = rast_scan_fill(&ctx, ply, num); /* Call our rasterizer, passing in the integer coords for each vert. */
|
||||
free(ply); /* Free the memory allocated for the integer coordinate table. */
|
||||
return(i); /* Return the value returned by the rasterizer. */
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ struct scan_line_batch {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int PLX_raskterize(float *verts, int num, float *buf, int buf_x, int buf_y, float fill_color);
|
||||
int PLX_raskterize(float *verts, int num, float *buf, int buf_x, int buf_y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -618,7 +618,6 @@ class CLIP_PT_active_mask_spline(Panel):
|
||||
col = layout.column()
|
||||
col.prop(spline, "weight_interpolation")
|
||||
col.prop(spline, "use_cyclic")
|
||||
col.prop(spline, "mask_negate")
|
||||
|
||||
|
||||
class CLIP_PT_active_mask_point(Panel):
|
||||
|
||||
@@ -1754,7 +1754,7 @@ void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer)
|
||||
}
|
||||
|
||||
if (tot_diff_point) {
|
||||
PLX_raskterize(diff_points, tot_diff_point, buffer, width, height, (spline->flag & MASK_SPLINE_NEGATE)?0.0f:1.0f);
|
||||
PLX_raskterize(diff_points, tot_diff_point, buffer, width, height);
|
||||
|
||||
MEM_freeN(diff_points);
|
||||
}
|
||||
|
||||
@@ -1322,8 +1322,8 @@ static void track_mask_gpencil_layer_rasterize(MovieTracking *tracking, MovieTra
|
||||
fp[0] = stroke_points[i].x * width / ibuf->x - marker->search_min[0];
|
||||
fp[1] = stroke_points[i].y * height * aspy / ibuf->x - marker->search_min[1];
|
||||
}
|
||||
/* TODO: not sure best method to get spline->flag here... to tell if mask is negative color */
|
||||
PLX_raskterize(mask_points, stroke->totpoints, mask, ibuf->x, ibuf->y, /* TODO: this is color */ 1.0f);
|
||||
|
||||
PLX_raskterize(mask_points, stroke->totpoints, mask, ibuf->x, ibuf->y);
|
||||
|
||||
MEM_freeN(mask_points);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ typedef struct MaskObject {
|
||||
/* MaskSpline->flag */
|
||||
/* reserve (1 << 0) for SELECT */
|
||||
#define MASK_SPLINE_CYCLIC (1 << 1)
|
||||
#define MASK_SPLINE_NEGATE (1 << 2)
|
||||
|
||||
/* MaskSpline->weight_interp */
|
||||
#define MASK_SPLINE_INTERP_LINEAR 1
|
||||
|
||||
@@ -506,13 +506,6 @@ static void rna_def_maskSpline(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_SPLINE_CYCLIC);
|
||||
RNA_def_property_ui_text(prop, "Cyclic", "Make this spline a closed loop");
|
||||
RNA_def_property_update(prop, 0, "rna_Mask_update_data");
|
||||
|
||||
/* negative mask? */
|
||||
prop = RNA_def_property(srna, "mask_negate", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_SPLINE_NEGATE);
|
||||
RNA_def_property_ui_text(prop, "Negate", "Make this spline subtract from mask");
|
||||
RNA_def_property_update(prop, 0, "rna_Mask_update_data");
|
||||
}
|
||||
|
||||
static void rna_def_mask_object(BlenderRNA *brna)
|
||||
|
||||
Reference in New Issue
Block a user