/// <summary> /// writes a jpg formated image from imInfo.getIm() into imInf.getPath() /// ****** IF EXISTS, WILL OVERWRITE THE imInf.getPath() image ******* /// </summary> /// <param name="imInf">the wanted image to save im imInf.getPath() </param> public static void writeImage(ImageInfo imInf) { writeImage(imInf.getPath(), imInf.getIm()); }
/// <summary> /// DeepCopy Constructor /// </summary> /// <param name="from">Copied Source</param> public ImageInfo(ImageInfo from) { _disposed = false; // copy path _path = from.getPath(); // copy gray image _imGray = new Bitmap(from.getIm()); // copy histogram _hist = from.getHist() == null ? null : copyHist(from.getHist()); // copy _imf if (from.getImF() != null) { _imf = new float[from.getImF().Length]; from.getImF().CopyTo(_imf, 0); } else { _imf = null; } // copy _imb if (from.getImF() != null) { _imb = new byte[from.getImb().Length]; from.getImb().CopyTo(_imb, 0); } else { _imb = null; } // copy size _width = from.Width; _height = from.Height; }
public void TestDeepCopyCOns() { ImageInfo from = new ImageInfo(PATH_160_120_RGB); from.getHist(); from.getImb(); from.getImF(); ImageInfo to = new ImageInfo(from); from.Dispose(); from = null; Debug.WriteLine("B:{0},F:{1}, W:{2}, H:{3}, HISTMEAN:{4}, P:{5}", to.getImb().Length, to.getImF().Length, to.Width, to.Height, to.getHist().Mean, to.getPath()); }