예제 #1
0
 public bool Transcode(PixelFormat ptFormat, VariableType eChannelType, ColourSpace eColourspace, CompressorQuality eQuality = CompressorQuality.PVRTCNormal, bool bDoDither = false)
 {
     if (IsDisposed)
     {
         throw new ObjectDisposedException("_pPvrTexture");
     }
     return(Transcode(_pPvrTexture, ptFormat, eChannelType, eColourspace, eQuality, bDoDither));
 }
예제 #2
0
        public byte[] GetRGBA(ColourSpace colour)
        {
            switch (colour)
            {
            case ColourSpace.BT709:
                return(BT709ColourSpaceConverter.ToRGBA8(_data));

            default:
                throw new ArgumentOutOfRangeException("colour");
            }
        }
예제 #3
0
        private static Func <byte[], byte[]> GetRGBAToYcbCrConverter(ColourSpace colour)
        {
            switch (colour)
            {
            case ColourSpace.BT709:
                return(BT709ColourSpaceConverter.RGBAToYCbCrA10Bit422);

            default:
                throw new ArgumentOutOfRangeException("colour");
            }
        }
예제 #4
0
            public static PVRTexture CreateTexture <T>(T[] data, uint u32Width, uint u32Height, uint u32Depth, PixelFormat ptFormat, bool preMultiplied, VariableType eChannelType, ColourSpace eColourspace) where T : struct
            {
                var gcHandle    = GCHandle.Alloc(data, GCHandleType.Pinned);
                var pPvrTexture = CreateTexture(gcHandle.AddrOfPinnedObject(), u32Width, u32Height, u32Depth, ptFormat, preMultiplied, eChannelType, eColourspace);

                gcHandle.Free();
                return(new PVRTexture(pPvrTexture));
            }
예제 #5
0
 public static extern bool Transcode(IntPtr pPvrTexture, PixelFormat ptFormat, VariableType eChannelType, ColourSpace eColourspace, CompressorQuality eQuality = CompressorQuality.PVRTCNormal, bool bDoDither = false);
예제 #6
0
 public static extern IntPtr CreateTexture(IntPtr data, uint u32Width, uint u32Height, uint u32Depth, PixelFormat ptFormat, bool preMultiplied, VariableType eChannelType, ColourSpace eColourspace);
예제 #7
0
 public static AtemFrame FromRGBA(string name, byte[] data, ColourSpace colour)
 {
     return(new AtemFrame(name, GetRGBAToYcbCrConverter(colour)(data)));
 }
예제 #8
0
        public static void CreateTexture <T>(T[] data, uint u32Width, uint u32Height, uint u32Depth, PixelFormat ptFormat, bool preMultiplied, VariableType eChannelType, ColourSpace eColourspace)
        {
            var gcHandle = GCHandle.Alloc(data, GCHandleType.Pinned);

            CreateTexture(gcHandle.AddrOfPinnedObject(), u32Width, u32Height, u32Depth, ptFormat, preMultiplied, eChannelType, eColourspace);
            gcHandle.Free();
        }