Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_ops.c
| Show First 20 Lines • Show All 2,024 Lines • ▼ Show 20 Lines | static int image_invert_exec(bContext *C, wmOperator *op) | ||||
| int i; | int i; | ||||
| if (ibuf == NULL) /* TODO: this should actually never happen, but does for render-results -> cleanup */ | if (ibuf == NULL) /* TODO: this should actually never happen, but does for render-results -> cleanup */ | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| if (support_undo) { | if (support_undo) { | ||||
| ED_undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name, | ED_undo_paint_push_begin(UNDO_PAINT_IMAGE, op->type->name, | ||||
| ED_image_undo_restore, ED_image_undo_free); | ED_image_undo_restore, ED_image_undo_free, NULL); | ||||
| /* not strictly needed, because we only imapaint_dirty_region to invalidate all tiles | /* not strictly needed, because we only imapaint_dirty_region to invalidate all tiles | ||||
| * but better do this right in case someone copies this for a tool that uses partial redraw better */ | * but better do this right in case someone copies this for a tool that uses partial redraw better */ | ||||
| ED_imapaint_clear_partial_redraw(); | ED_imapaint_clear_partial_redraw(); | ||||
| ED_imapaint_dirty_region(ima, ibuf, 0, 0, ibuf->x, ibuf->y); | ED_imapaint_dirty_region(ima, ibuf, 0, 0, ibuf->x, ibuf->y); | ||||
| } | } | ||||
| /* TODO: make this into an IMB_invert_channels(ibuf,r,g,b,a) method!? */ | /* TODO: make this into an IMB_invert_channels(ibuf,r,g,b,a) method!? */ | ||||
| if (ibuf->rect_float) { | if (ibuf->rect_float) { | ||||
| ▲ Show 20 Lines • Show All 828 Lines • Show Last 20 Lines | |||||