/// <summary> /// Creates a BC1 color table from the 32-bit colors of a block. If the color space /// contains alpha values, the color table is built according to BC1 1-bit alpha /// specification. /// </summary> private static Color565[] CreateColorTable(Color[] colors) { var colorSpace = new ColorSpace(colors); return(colorSpace.HasAlpha? BC1ColorTable.CreateFor1BitAlpha(colorSpace.MinColor, colorSpace.MaxColor) : BC1ColorTable.Create(colorSpace.MaxColor, colorSpace.MinColor)); }
/// <summary> /// Creates a BC1 color table from two compressed 16-bit reference colors. /// If the integer value of <paramref name="color0"/> is lower or equal to /// that of <paramref name="color1"/>, the color table is built according /// to the 1-bit alpha specification. /// </summary> private static Color565[] CreateColorTable(Color565 color0, Color565 color1) { return(color0.Value <= color1.Value ? BC1ColorTable.CreateFor1BitAlpha(color0, color1) : BC1ColorTable.Create(color0, color1)); }