Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image_2d.c
| Show First 20 Lines • Show All 396 Lines • ▼ Show 20 Lines | static unsigned short *brush_painter_curve_mask_new(BrushPainter *painter, | ||||
| /* Temporal until we have the brush properties */ | /* Temporal until we have the brush properties */ | ||||
| const float hardness = 1.0f; | const float hardness = 1.0f; | ||||
| const float rotation = 0.0f; | const float rotation = 0.0f; | ||||
| float aa_offset = 1.0f / (2.0f * (float)aa_samples); | float aa_offset = 1.0f / (2.0f * (float)aa_samples); | ||||
| float aa_step = 1.0f / (float)aa_samples; | float aa_step = 1.0f / (float)aa_samples; | ||||
| float bpos[2]; | float bpos[2]; | ||||
| bpos[0] = pos[0] - floorf(pos[0]) + offset + aa_offset; | bpos[0] = pos[0] - floorf(pos[0]) + offset - aa_offset; | ||||
| bpos[1] = pos[1] - floorf(pos[1]) + offset + aa_offset; | bpos[1] = pos[1] - floorf(pos[1]) + offset - aa_offset; | ||||
| const float co = cosf(DEG2RADF(rotation)); | const float co = cosf(DEG2RADF(rotation)); | ||||
| const float si = sinf(DEG2RADF(rotation)); | const float si = sinf(DEG2RADF(rotation)); | ||||
| float norm_factor = 65535.0f / (float)(aa_samples * aa_samples); | float norm_factor = 65535.0f / (float)(aa_samples * aa_samples); | ||||
| for (int y = 0; y < diameter; y++) { | for (int y = 0; y < diameter; y++) { | ||||
| for (int x = 0; x < diameter; x++, m++) { | for (int x = 0; x < diameter; x++, m++) { | ||||
| ▲ Show 20 Lines • Show All 1,622 Lines • Show Last 20 Lines | |||||