CSPspEmu.Gui.texture.TextureHookPlugin.Hook C# (CSharp) Method

Hook() public method

public Hook ( TextureHookInfo TextureInfo ) : void
TextureInfo TextureHookInfo
return void
        public void Hook(TextureHookInfo TextureInfo)
        {
            Bitmap OutBitmap = null;

            if (TexMap.ContainsKey(TextureInfo.TextureCacheKey.TextureHash))
            {
                OutBitmap = new Bitmap(Image.FromFile(TexMap[TextureInfo.TextureCacheKey.TextureHash]));
            }
            else
            {
                if (PspStoredConfig.ScaleTextures)
                {
                    var InBitmap = new Bitmap(TextureInfo.Width, TextureInfo.Height).SetChannelsDataInterleaved(TextureInfo.Data.CastToStructArray<OutputPixel, byte>(), BitmapChannelList.RGBA);
                    OutBitmap = (new Engine(new ColorAlphaLerp(), new ColorAlphaThreshold(32, 32, 32, 32))).Process(InBitmap);
                }
            }

            if (OutBitmap != null)
            {
                TextureInfo.Data = OutBitmap.GetChannelsDataInterleaved(BitmapChannelList.RGBA).CastToStructArray<byte, OutputPixel>();
                TextureInfo.Width = OutBitmap.Width;
                TextureInfo.Height = OutBitmap.Height;
            }
        }