Exemple #1
0
        //For background chunk
        public static void AddChunk(List<PaletteContainer> paletteContainers, ChunkContainer chunkContainer, SxzColor color)
        {
            foreach (PaletteContainer paletteContainer in paletteContainers)
            {
                if (paletteContainer.Contains(color))
                {
                    paletteContainer.Add(chunkContainer);
                    return;
                }
            }

            foreach (PaletteContainer paletteContainer in paletteContainers)
            {
                if (paletteContainer.HasRoom(color))
                {
                    paletteContainer.Add(chunkContainer);
                    return;
                }
            }
        }
Exemple #2
0
 private static void PrintKeptChunk(ChunkContainer chunkContainer)
 {
     int count = chunkContainer.Size();
     double ratio = 0.0;
     if (chunkContainer.Locations.Count != 0)
     {
         ratio = ((float)count / (float)chunkContainer.Locations.Count);
     }
     Console.WriteLine("Keeping " + chunkContainer.Chunk.GetType().Name.ToString() + " with size " + count + " for pixel count " + chunkContainer.Locations.Count + " ratio " + ratio);
 }
Exemple #3
0
 private static void PrintTossedChunk(ChunkContainer chunkContainer)
 {
     int count = chunkContainer.Size();
     Console.WriteLine("Tossing " + chunkContainer.Chunk.GetType().Name.ToString() + " with size " + count + " for pixel count " + chunkContainer.Locations.Count + " ratio " + ((float)count / (float)chunkContainer.Locations.Count));
 }
Exemple #4
0
 public void Add(ChunkContainer chunkContainer)
 {
     ChunkContainers.Add(chunkContainer);
 }