public async Task <RgbData> GetRgbData_Xmitted() { var rgb_data = new RgbData(); var color_data = await GetRawData(); rgb_data.Red = (color_data.Red * 255 / UInt16.MaxValue); rgb_data.Blue = (color_data.Blue * 255 / UInt16.MaxValue); rgb_data.Green = (color_data.Green * 255 / UInt16.MaxValue); Debug.WriteLine("RGB Data - red: {0}, green: {1}, blue: {2}", rgb_data.Red, rgb_data.Green, rgb_data.Blue); return(rgb_data); }
public async Task <RgbData> GetRgbData_Reflected() { var rgb_data = new RgbData(); var color_data = await GetRawData(); if (color_data.Clear > 0) { rgb_data.Red = (color_data.Red * 255 / color_data.Clear); rgb_data.Blue = (color_data.Blue * 255 / color_data.Clear); rgb_data.Green = (color_data.Green * 255 / color_data.Clear); } Debug.WriteLine("RGB Data - red: {0}, green: {1}, blue: {2}", rgb_data.Red, rgb_data.Green, rgb_data.Blue); return(rgb_data); }