Hi,
Some comments on the code:
+static int image_invert_exec(bContext *C, wmOperator *op) {
+ Image *ima= CTX_data_edit_image(C);
+ ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+
+ // flags indicate if this channel should be inverted
+ short r,g,b,a;
+ int i;
Some comments on the code:
The image buffer should be marked as modified: ibuf-userflags |=
IB_BITMAPDIRTY;
done.
+ RNA_def_boolean(ot-srna, inv_r, 0, Red, Invert Red Channel);
+ RNA_def_boolean(ot-srna, inv_g, 0, Green, Invert Green
Channel);
+