Example #1
0
        public void FromColor(Bgra4444 source)
        {
            ushort packedSource = source.PackedValue;

            PackedValue = (ushort)(
                ((packedSource & Bgra4444.MaxXYZW) * 2) |
                ((((packedSource >> 4) & Bgra4444.MaxXYZW) * 4) << 5) |
                ((((packedSource >> 8) & Bgra4444.MaxXYZW) * 2) << 11));
        }
Example #2
0
        public void FromColor(Bgra4444 source)
        {
            ushort packedSource = source.PackedValue;

            PackedValue = (ushort)(
                ((((packedSource >> 0) & Bgra4444.MaxXYZW) * 2) << 0) |
                ((((packedSource >> 4) & Bgra4444.MaxXYZW) * 2) << 5) |
                ((((packedSource >> 8) & Bgra4444.MaxXYZW) * 2) << 10) |
                ((int)((packedSource >> 12) / (float)Bgra4444.MaxXYZW + 0.5f) << 15));
        }
Example #3
0
 public void FromColor(Bgra4444 source) => FromColor(source.ToRgba32());