Permalink
Browse files

- remove grayscale step when sharing desktop

  • Loading branch information...
ritzalam committed May 22, 2012
1 parent 113cbad commit c1a59722f2080fcf9d8d4d53ba6b92ccf9e54a1d
@@ -100,7 +100,7 @@ public EncodedBlockData encode() {
System.arraycopy(capturedPixels, 0, pixelsCopy, 0, capturedPixels.length);
}
- byte[] encodedBlock = ScreenVideoEncoder.encodePixels(pixelsCopy, getWidth(), getHeight(), (sentCount.longValue() > 5) /* send grayscale image */);
+ byte[] encodedBlock = ScreenVideoEncoder.encodePixels(pixelsCopy, getWidth(), getHeight(), (sentCount.longValue() < 5) /* send grayscale image */);
return new EncodedBlockData(position, encodedBlock);
}
@@ -172,7 +172,7 @@ private static void changePixelScanFromBottomLeftToTopRight(int[] pixels, int wi
byte red = (byte) ((pixels[i] >> 16) & 0xff);
byte green = (byte) ((pixels[i] >> 8) & 0xff);
byte blue = (byte) (pixels[i] & 0xff);
-
+/*
if (grayscale) {
byte brightness = convertToGrayScale(red, green, blue);
@@ -185,7 +185,12 @@ private static void changePixelScanFromBottomLeftToTopRight(int[] pixels, int wi
rgbPixels[position++] = blue;
rgbPixels[position++] = green;
rgbPixels[position++] = red;
- }
+ }
+*/
+ // Sequence should be BGR
+ rgbPixels[position++] = blue;
+ rgbPixels[position++] = green;
+ rgbPixels[position++] = red;
}
long end = System.currentTimeMillis();

0 comments on commit c1a5972

Please sign in to comment.