示例#1
0
        internal static Babl Create(string name,
                                    int id,
                                    int bits,
                                    string doc = "")
        {
            var value = db.Exists(id, name);

            if (id is not 0 && value is null && db.Exists(name) is not null)
            {
                Fatal.AlreadyRegistered(name, nameof(BablType));
            }

            if (value is not null)
            {
                // There is an instance already registerd by the required id/name,
                // returning the preexistent one instead if it doesn't differ.
                if (!((BablType)value).Equals(bits))
                {
                    Fatal.ExistsAsDifferentValue(name, nameof(BablType));
                }
                return(value);
            }

            value = new BablType()
            {
                Name = name,
                Id   = id,
                Bits = bits,
                Doc  = doc
            };
            db.Insert(value);
            return(value);
        }
示例#2
0
 public static Babl Type(string name) =>
 BablType.Find(name);
示例#3
0
        //public static Babl? Model(string name)
        //{

        //}

        //public static Babl? ModelWithSpace(string name, Babl space)
        //{

        //}

        //public static Babl? Space(string name)
        //{

        //}

        //public static Babl? SpaceFromIcc(ReadOnlySpan<byte> iccData, BablIccIntent intent, out string error)
        //{

        //}

        //public static double SpaceGetGamma(Babl space)
        //{

        //}

        //public static string? IccGetKey(ReadOnlySpan<byte> iccData, string key, string language, string country)
        //{

        //}

        //public static Babl? Format(string encoding)
        //{

        //}

        //public static Babl? FormatWithSpace(string encoding, in Babl space)
        //{

        //}

        //public static bool FormatExists(string name)
        //{

        //}

        //public static Babl? FormatGetSpace(Babl format)
        //{

        //}

        //public static Babl? Fish(Babl sourceFormat, Babl destinationFormat)
        //{

        //}
        //public static Babl? Fish(Babl sourceFormat, string destinationFormat)
        //{

        //}
        //public static Babl? Fish(string sourceFormat, Babl destinationFormat)
        //{

        //}
        //public static Babl? Fish(string sourceFormat, string destinationFormat)
        //{

        //}

        //public static Babl? FastFish(Babl sourceFormat, Babl destinationFormat, BablFishPerformance performance)
        //{

        //}
        //public static Babl? FastFish(Babl sourceFormat, string destinationFormat, BablFishPerformance performance)
        //{

        //}
        //public static Babl? FastFish(string sourceFormat, Babl destinationFormat, BablFishPerformance performance)
        //{

        //}
        //public static Babl? FastFish(string sourceFormat, string destinationFormat, BablFishPerformance performance)
        //{

        //}

        //public static long Process(Babl fish, ReadOnlySpan<byte> source, Span<byte> destination, long pixelsToProcess)
        //{

        //}

        //public static long ProcessRows(Babl fish, ReadOnlySpan<byte> source, int sourceStride, Span<byte> destination, int destinationStride, long pixelsToProcess, int rows)
        //{

        //}

        //public static string GetName(Babl babl)
        //{

        //}

        //public static bool FormatHasAlpha(Babl format)
        //{

        //}

        //public static int FormatGetBytesPerPixel(Babl format)
        //{

        //}

        //public static Babl? FormatGetModel(Babl format)
        //{

        //}

        //public static BablModelFlags ModelGetFlags(Babl model)
        //{

        //}

        //public static int FormatGetComponentCount(Babl format)
        //{

        //}

        //public static Babl? FormatGetType(Babl format, int componentIndex)
        //{

        //}

        public static Babl CreateType(string name, int id = 0, int bits = 0, string doc = "") =>
        BablType.Create(name, id, bits, doc);