Created
July 22, 2011 01:29
-
-
Save follesoe/1098666 to your computer and use it in GitHub Desktop.
PhotoCameraLuminanceSource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PhotoCameraLuminanceSource : LuminanceSource | |
| { | |
| public byte[] PreviewBufferY { get; private set; } | |
| public PhotoCameraLuminanceSource(int width, int height) : base(width, height) | |
| { | |
| PreviewBufferY = new byte[width * height]; | |
| } | |
| public override sbyte[] Matrix | |
| { | |
| get { return (sbyte[])(Array)PreviewBufferY; } | |
| } | |
| public override sbyte[] getRow(int y, sbyte[] row) | |
| { | |
| if (row == null || row.Length < Width) | |
| { | |
| row = new sbyte[Width]; | |
| } | |
| for (int i = 0; i < Height; i++) | |
| row[i] = (sbyte)PreviewBufferY[i * Width + y]; | |
| return row; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment