Beispiel #1
0
        internal static T[] FetchArray <T>(FetchIntoBuffer <T> fetcher)
        {
            fetcher.Invoke(0, null, out int length);
            var buffer = new T[length];

            if (length > 0)
            {
                fetcher.Invoke(length, buffer, out _);
            }
            return(buffer);
        }
Beispiel #2
0
        internal static string FetchString(FetchIntoBuffer <char> fetcher)
        {
            var buffer = FetchArray(fetcher);
            int length = buffer.Length - 1;

            if (length > 0)
            {
                return(new string(buffer, 0, length));
            }
            else
            {
                return(string.Empty);
            }
        }
Beispiel #3
0
        public static int[] GetColors(this IWICPalette palette)
        {
            FetchIntoBuffer <int> fetcher = palette.GetColors;

            return(fetcher.FetchArray());
        }
Beispiel #4
0
        public static byte[] GetProfileBytes(this IWICColorContext colorContext)
        {
            FetchIntoBuffer <byte> fetcher = colorContext.GetProfileBytes;

            return(fetcher.FetchArray());
        }
        public static Guid[] GetPixelFormats(this IWICFormatConverterInfo formatConverterInfo)
        {
            FetchIntoBuffer <Guid> fetcher = formatConverterInfo.GetPixelFormats;

            return(fetcher.FetchArray());
        }
        public static Guid[] GetContainerFormats(this IWICMetadataHandlerInfo metadataHandlerInfo)
        {
            FetchIntoBuffer <Guid> fetcher = metadataHandlerInfo.GetContainerFormats;

            return(fetcher.FetchArray());
        }
        public static string GetDeviceModels(this IWICMetadataHandlerInfo metadataHandlerInfo)
        {
            FetchIntoBuffer <char> fetcher = metadataHandlerInfo.GetDeviceModels;

            return(fetcher.FetchString());
        }
Beispiel #8
0
        public static string GetColorManagementVersion(this IWICBitmapCodecInfo bitmapCodecInfo)
        {
            FetchIntoBuffer <char> fetcher = bitmapCodecInfo.GetColorManagementVersion;

            return(fetcher.FetchString());
        }
Beispiel #9
0
        public static string[] GetFileExtensions(this IWICBitmapCodecInfo bitmapCodecInfo)
        {
            FetchIntoBuffer <char> fetcher = bitmapCodecInfo.GetFileExtensions;

            return(fetcher.FetchString().Split(','));
        }
Beispiel #10
0
        public static string GetDeviceModels(this IWICBitmapCodecInfo bitmapCodecInfo)
        {
            FetchIntoBuffer <char> fetcher = bitmapCodecInfo.GetDeviceModels;

            return(fetcher.FetchString());
        }
        public static string GetAuthor(this IWICComponentInfo componentInfo)
        {
            FetchIntoBuffer <char> fetcher = componentInfo.GetAuthor;

            return(fetcher.FetchString());
        }
        public static string GetSpecVersion(this IWICComponentInfo componentInfo)
        {
            FetchIntoBuffer <char> fetcher = componentInfo.GetSpecVersion;

            return(fetcher.FetchString());
        }
        public static string GetFriendlyName(this IWICComponentInfo componentInfo)
        {
            FetchIntoBuffer <char> fetcher = componentInfo.GetFriendlyName;

            return(fetcher.FetchString());
        }
        public static IWICColorContext[] GetColorContexts(this IWICBitmapFrameDecode bitmapFrameDecode)
        {
            FetchIntoBuffer <IWICColorContext> fetcher = bitmapFrameDecode.GetColorContexts;

            return(fetcher.FetchArray());
        }
        public static string GetLocation(this IWICMetadataQueryReader metadataQueryReader)
        {
            FetchIntoBuffer <char> fetcher = metadataQueryReader.GetLocation;

            return(fetcher.FetchString());
        }