示例#1
0
        /// <summary>
        /// finds appropriate <see cref="VL.Lib.Basics.Imaging.PixelFormat"/> for given <see cref="AllowedColorMode"/>
        /// </summary>
        /// <param name="allowedcolormode"></param>
        /// <returns></returns>
        public static PixelFormat MapAllowedColorMode(AllowedColorMode allowedcolormode)
        {
            switch (allowedcolormode)
            {
            case AllowedColorMode.Mono8:
                return(PixelFormat.R8);

            case AllowedColorMode.Mono16:
                return(PixelFormat.R16);

            case AllowedColorMode.RGB8:
                return(PixelFormat.R8G8B8);

            case AllowedColorMode.RGBA8:
                return(PixelFormat.R8G8B8A8);

            case AllowedColorMode.BGR8:
                return(PixelFormat.B8G8R8);

            case AllowedColorMode.BGRA8:
                return(PixelFormat.B8G8R8A8);

            default:
                return(PixelFormat.B8G8R8A8);
            }
        }
示例#2
0
 /// <summary>
 /// just a convenience node doing the cast from <see cref="AllowedColorMode"/> to uEye.Defines.ColorMode
 /// </summary>
 /// <param name="allowedColorMode"></param>
 /// <returns></returns>
 public static ColorMode FromAllowedColorMode(AllowedColorMode allowedColorMode)
 {
     return((ColorMode)allowedColorMode);
 }