Beispiel #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// This really, *really*, needs to be preprocessed into a loaded blob.
        /// </remarks>
        private unsafe void InitLutNx( Texture3D lut, int n, FilterCaseDelegate filterCase )
        {
            float[] lutbits = new float[10 * n * n * 16 * 256];
            Color[] lutValues = new Color[2 * n * n * 16 * 256];

            fixed( float *pLutBits = lutbits )
            fixed( Color *pLutValueBits = lutValues )
            {
                float *pLut = pLutBits;
                Color *pValues = pLutValueBits;

                for( int pattern = 0; pattern < 256; pattern++ )
                {
                    for( int cmp2 = 0; cmp2 < 16; cmp2++ )
                    {
                        filterCase( pLut, pattern, cmp2 );

                        for( int tap = 0; tap < n * n; tap++ )
                        {
                            NormalizeKernel( pLut );
                            ConvertKernel( pValues, pLut );

                            pLut += 10;
                            pValues += 2;
                        }
                    }
                }
            }

            lut.SetData( lutValues );
        }
Beispiel #2
0
 static unsafe hq3x()
 {
     FilterCase = InternalFilterCase;
 }