Пример #1
0
        public static ushort ConvertToUshort(uint color)
        {
            RGBA8888 ucolor = new RGBA8888()
            {
                color = color
            };

            return(ConvertToUshort(ucolor.r, ucolor.g, ucolor.b));
        }
Пример #2
0
        public static void ConvertToVec4(uint color, ref vec4 output)
        {
            var rgba8888 = new RGBA8888()
            {
                color = color
            };

            ConvertToVec4(rgba8888.r, rgba8888.g, rgba8888.b, rgba8888.a, ref output);
        }
Пример #3
0
        public static RGB565 ConvertToRGB565(uint color)
        {
            RGBA8888 ucolor = new RGBA8888()
            {
                color = color
            };

            return(ConvertToRGB565(ucolor.r, ucolor.g, ucolor.b));
        }
Пример #4
0
        public override string ToString()
        {
            RGBA8888 rgba = new RGBA8888()
            {
                color = (PixelFormatConverter.ConvertToUint(this))
            };

            return(string.Format("r={0} g={1} b={2} value=0x{3:X}",
                                 rgba.r, rgba.g, rgba.b, color));
        }
Пример #5
0
        public static float ConvertToFloat(byte[] data, int offsetIndex)
        {
            var point = new RGBA8888()
            {
                r = data[offsetIndex + P_BYTE_OFFSET_RED],
                g = data[offsetIndex + P_BYTE_OFFSET_GREEN],
                b = data[offsetIndex + P_BYTE_OFFSET_BLUE],
                a = data[offsetIndex + P_BYTE_OFFSET_ALPHA],
            };

            return(point.depth);
        }
Пример #6
0
 public static uint ConvertToUint(RGBA8888 input)
 {
     return(ConvertToUint(input.r, input.g, input.b, input.a));
 }
Пример #7
0
 public static ushort ConvertToUshort(RGBA8888 color)
 {
     return(ConvertToUshort(color.r, color.g, color.b));
 }
Пример #8
0
 public static void ConvertToVec4(RGBA8888 color, ref vec4 output)
 {
     ConvertToVec4(color.r, color.g, color.b, color.a, ref output);
 }
Пример #9
0
 public static RGB565 ConvertToRGB565(RGBA8888 color)
 {
     return(ConvertToRGB565(color.r, color.g, color.b));
 }
Пример #10
0
 public static void ConvertToBytes(RGBA8888 color, byte[] outputData, int offsetIndex)
 {
     ConvertToBytes(color.r, color.g, color.b, color.a, outputData, offsetIndex);
 }