flipGreen static method

Pixels flipGreen(
  1. Pixels map
)

map, a DirectX-style normal map (green down), as an OpenGL-style one: its green turned over.

Implementation

static Pixels flipGreen(Pixels map) {
  final out = Pixels(map.width, map.height, Uint8List.fromList(map.rgba));
  for (var i = 1; i < out.rgba.length; i += 4) {
    out.rgba[i] = 255 - out.rgba[i];
  }
  return out;
}