Flip images as pixel array

I’m trying to get Tiled maps working for my game. For flipped tiles, Tiled gives me 3 variables: FLIPPED_HORIZONTAL, FLIPPED_VERTICAL and FLIPPED_DIAGONAL. When I try to use those three variables, I can only get the Horizontal and Vertical flip working. I know the following:


if (FLIPPED_VERTICAL)
    int ys = height - y - 1; // y is the y-coordinate of the current pixel of the image we're checking, height is the height of the image.
if (FLIPPED_HORIZONTAL)
    int xs = width - x - 1; // x is the x-coordinate of the current pixel of the image we're checking, width is the width of the image.
if (FLIPPED_DIAGONAL)
    ...

Can someone explain me how to make the Diagonal flip? Or other ideas to get this going?

Wouldn’t the diagonal be something like

xs = height - y - 1;  
ys = width - x - 1;

(Depending on which diagonal you flip about, of course).