/** @copydoc LayerParameterBase::Clone */ public override LayerParameterBase Clone() { CropParameter p = new CropParameter(); p.Copy(this); return(p); }
/** @copydoc LayerParameterBase::Copy */ public override void Copy(LayerParameterBase src) { CropParameter p = (CropParameter)src; m_nAxis = p.m_nAxis; m_rgOffset = Utility.Clone <uint>(p.m_rgOffset); }
/** @copydoc LayerParameterBase::Load */ public override object Load(System.IO.BinaryReader br, bool bNewInstance = true) { RawProto proto = RawProto.Parse(br.ReadString()); CropParameter p = FromProto(proto); if (!bNewInstance) { Copy(p); } return(p); }
/// <summary> /// Parses the parameter from a RawProto. /// </summary> /// <param name="rp">Specifies the RawProto to parse.</param> /// <returns>A new instance of the parameter is returned.</returns> public static CropParameter FromProto(RawProto rp) { string strVal; CropParameter p = new CropParameter(); if ((strVal = rp.FindValue("axis")) != null) { p.axis = int.Parse(strVal); } p.offset = rp.FindArray <uint>("offset"); return(p); }