Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/filter.c
| Show First 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | if (index >= 0) { | |||||||||
| } | } | |||||||||
| } | } | |||||||||
| return res; | return res; | |||||||||
| } | } | |||||||||
| /** | /** | |||||||||
| * if alpha is zero, it checks surrounding pixels and averages color. sets new alphas to 1.0 | * if alpha is zero, it checks surrounding pixels and averages color. sets new alphas to 1.0 | |||||||||
| * | * When a mask is given, the mask will be used instead of the alpha channel, where only | |||||||||
| * When a mask is given, only effect pixels with a mask value of 1, | * pixels with a mask value of 0 will be written to, and only pixels with a mask value of 1 | |||||||||
| * defined as #BAKE_MASK_MARGIN in rendercore.c | * will be used for the average. The mask will be set to one for the pixels which were written. | |||||||||
sergeyUnsubmitted Done Inline Actions
sergey: | ||||||||||
| */ | */ | |||||||||
| void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter) | void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter) | |||||||||
| { | { | |||||||||
| const int width = ibuf->x; | const int width = ibuf->x; | |||||||||
| const int height = ibuf->y; | const int height = ibuf->y; | |||||||||
| const int depth = 4; /* always 4 channels */ | const int depth = 4; /* always 4 channels */ | |||||||||
| const int chsize = ibuf->rect_float ? sizeof(float) : sizeof(unsigned char); | const int chsize = ibuf->rect_float ? sizeof(float) : sizeof(unsigned char); | |||||||||
| const size_t bsize = ((size_t)width) * height * depth * chsize; | const size_t bsize = ((size_t)width) * height * depth * chsize; | |||||||||
| ▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines | ||||||||||