- // Now, for each point of the rotated image, find where it came from, by
- // performing an inverse rotation (a rotation of -angle) and getting the
- // pixel at those coordinates
+ // GRG: if the original image has a mask, use its RGB values
+ // as the blank pixel, else, fall back to default (black).
+ //
+ wxRotationPixel blankPixel = {{ 0, 0, 0 }};
+
+ if (HasMask())
+ {
+ unsigned char r = GetMaskRed();
+ unsigned char g = GetMaskGreen();
+ unsigned char b = GetMaskBlue();
+ rotated.SetMaskColour( r, g, b );
+ blankPixel.rgb[0] = r;
+ blankPixel.rgb[1] = g;
+ blankPixel.rgb[2] = b;
+ }
+
+ // Now, for each point of the rotated image, find where it came from, by
+ // performing an inverse rotation (a rotation of -angle) and getting the
+ // pixel at those coordinates
+
+ // GRG: I'd suggest to take the (interpolating) test out of the loops