Exemple #1
0
        public override int CompareTo(object obj)
        {
            int Result = base.CompareTo(obj);

            if (Result != 0)
            {
                return(Result);
            }

            TPdfType2Function o2 = obj as TPdfType2Function;

            Debug.Assert(o2 != null, "The object should be a TPdfType0Function, this has been checked in base Compare");

            Result = FlxUtils.CompareArray(C0, o2.C0);
            if (Result != 0)
            {
                return(Result);
            }

            Result = FlxUtils.CompareArray(C1, o2.C1);
            if (Result != 0)
            {
                return(Result);
            }

            Result = N.CompareTo(o2.N);
            if (Result != 0)
            {
                return(Result);
            }

            return(Result);
        }
Exemple #2
0
        private TPdfFunction[] GetFunctions(ColorBlend BlendColors, List <TPdfFunction> FunctionList)
        {
            int functionCount = BlendCount(BlendColors) - 1;

            TPdfFunction[] Result = new TPdfFunction[functionCount];
            for (int i = 1; i <= functionCount; i++)
            {
                TPdfFunction SearchFunction = new TPdfType2Function(new Double[] { 0, 1 }, null, BlendColorArray(BlendColors, i), BlendColorArray(BlendColors, i - 1), 1);
                int          Index          = FunctionList.BinarySearch(0, FunctionList.Count, SearchFunction, null);

                if (Index < 0)
                {
                    FunctionList.Insert(~Index, SearchFunction);
                }
                else
                {
                    SearchFunction = FunctionList[Index];
                }
                Result[functionCount - i] = SearchFunction;
            }
            return(Result);
        }