Example #1
0
        public override bool Equals(System.Object object_Renamed)
        {
            bool isEqual = false;

            if (object_Renamed is CXForm)
            {
                CXForm cxForm = (CXForm)object_Renamed;

                if ((cxForm.hasAdd == this.hasAdd) && (cxForm.hasMult == this.hasMult) && (cxForm.redMultTerm == this.redMultTerm) && (cxForm.greenMultTerm == this.greenMultTerm) && (cxForm.blueMultTerm == this.blueMultTerm) && (cxForm.redAddTerm == this.redAddTerm) && (cxForm.greenAddTerm == this.greenAddTerm) && (cxForm.blueAddTerm == this.blueAddTerm))
                {
                    isEqual = true;
                }
            }

            return(isEqual);
        }
		private CXForm decodeCxform()
		{
			CXForm c = new CXForm();
			r.syncBits();
			
			c.hasAdd = r.readBit();
			c.hasMult = r.readBit();
			int nbits = r.readUBits(4);
			if (c.hasMult)
			{
				c.redMultTerm = r.readSBits(nbits);
				c.greenMultTerm = r.readSBits(nbits);
				c.blueMultTerm = r.readSBits(nbits);
			}
			if (c.hasAdd)
			{
				c.redAddTerm = r.readSBits(nbits);
				c.greenAddTerm = r.readSBits(nbits);
				c.blueAddTerm = r.readSBits(nbits);
			}
			return c;
		}