//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; } } }
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); }
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)); }
public void Add(ChunkContainer chunkContainer) { ChunkContainers.Add(chunkContainer); }