public void BuildPngImageLine(int lineNumber, ImageLine iLine) { DPoint c = new DPoint(0, _yVals[lineNumber]); for (int xPtr = 0; xPtr < CanvasSize.Width; xPtr++) { c.X = _xVals[xPtr]; DPoint z = new DPoint(0, 0); int cnt = 0; double escapeVelocity = _mPointWork.Iterate(c, z, ref cnt, done: out bool notUsed); int[] cComps; if (cnt == MapInfo.MaxIterations) { cComps = ColorMap.HighColorEntry.StartColor.ColorComps; } else { cComps = ColorMap.GetColor(cnt, escapeVelocity); } ImageLineHelper.SetPixel(iLine, xPtr, cComps[0], cComps[1], cComps[2]); } }
//private int[] GetOneLineFromCountsBlock(int[] counts, int lPtr) //{ // int[] result = new int[BlockWidth]; // Array.Copy(counts, lPtr * BlockWidth, result, 0, BlockWidth); // return result; //} //private int[] GetOneLineFromCountsBlock(uint[] counts, int lPtr) //{ // int[] result = new int[BlockWidth]; // int srcPtr = lPtr * BlockWidth; // for (int i = 0; i < result.Length; i++) // result[i] = (int)counts[srcPtr++]; // return result; //} public static void BuildPngImageLineSegment(int pixPtr, int[] counts, ImageLine iLine, int maxIterations, ColorMap colorMap) { for (int xPtr = 0; xPtr < counts.Length; xPtr++) { double escapeVelocity = GetEscVel(counts[xPtr], out int cnt); int[] cComps; if (cnt == maxIterations) { cComps = colorMap.HighColorEntry.StartColor.ColorComps; } else { cComps = colorMap.GetColor(cnt, escapeVelocity); } ImageLineHelper.SetPixel(iLine, pixPtr++, cComps[0], cComps[1], cComps[2]); } }