//Load a glyphics file, precompute rectangles and append them to codeString as speedy cache public static void PreSerializeGlyphicsFile(string filename) { CodeList codes = GlyToCodes(filename); foreach (Code t in codes) { string code = t.codeString; if (code.Contains("*")) { code = code.Split('*')[0]; } Grid grid = CodeConverter.TokensToGrid(CodeConverter.CodeToTokens(new Code(code))); if (grid != null) { RectList rectSet = GridConverter.GridToRects(grid); string serializedRects = RectConverter.RectsToSerializedRects(rectSet).SerializedData; code = code + serializedRects; t.codeString = code; } } CodesToGly(filename, codes); }
//Rect(s)-To public static Code RectsToCode(RectList rectSet) { if (rectSet == null) { return(null); } return(RectConverter.RectsToCode(rectSet)); }
//public static RectList SerializedRectsToRects(string serializedRects) { return RectConverter.SerializedRectsToRects(new SerializedRects(serializedRects)); } public static SerializedRects RectsToSerializedRectsLimit255(RectList rectSet) { return(new SerializedRects(RectConverter.SerializeLimit255(rectSet))); }
public static RectList SerializedRectsToRects(SerializedRects serializedRects) { return(RectConverter.SerializedRectsToRects(serializedRects)); }
public static SerializedRects RectsToSerializedRects(RectList rectSet) { return(RectConverter.RectsToSerializedRects(rectSet)); }
public static RectList CodeToRects(Code rasterCode) { return(RectConverter.CodeToRects(rasterCode)); }
public static int RemoveRedundantQuads(QuadList quads) { return(RectConverter.RemoveRedundantQuads(quads)); }
//Quad and QuadList public static QuadList RectsToQuads(RectList rectSet) { return(RectConverter.RectsToQuads(rectSet)); }