Ejemplo n.º 1
0
 public static LedDataObject LedData(string effectType, ControlDevice.LedUnit[] leds)
 {
     return(new LedDataObject
     {
         effect = effectType,
         param = leds.Select(x => RazerDriver.ToBgr(x.Color)).ToArray()
     });
 }
Ejemplo n.º 2
0
        public static int[][] ToJaggedArray(ControlDevice.LedUnit[] leds, int width, int height)
        {
            int[]   colors     = leds.Select(x => RazerDriver.ToBgr(x.Color)).ToArray();
            int[][] twodColors = new int[height][];
            int     ptr        = 0;

            for (int i = 0; i < height; i++)
            {
                twodColors[i] = new int[width];
                for (int p = 0; p < width; p++)
                {
                    twodColors[i][p] = colors[ptr];
                    ptr++;
                }
            }

            return(twodColors);
        }