Exemple #1
0
 public void CreateOCLImages(Context context)
 {
     OCLInputImage = CreateOCLBitmapFromBitmap(TestImage);
     OCLOutputImage = oclContext.CreateImage2D(MemFlags.WRITE_ONLY, CL.ImageFormat.RGBA8U, panelScaled.Width, panelScaled.Height, 0, IntPtr.Zero);
     OCLSampler = oclContext.CreateSampler(true, AddressingMode.CLAMP_TO_EDGE, FilterMode.LINEAR);
 }
Exemple #2
0
        public void ReleaseDeviceResources()
        {
            oclFullyInitialized = false;
            if (OCLSampler != null)
            {
                OCLSampler.Dispose();
                OCLSampler = null;
            }
            if (OCLInputImage != null)
            {
                OCLInputImage.Dispose();
                OCLInputImage = null;
            }

            if (OCLOutputImage != null)
            {
                OCLOutputImage.Dispose();
                OCLOutputImage = null;
            }

            if (FilterKernel != null)
            {
                FilterKernel.Dispose();
                FilterKernel = null;
            }

            if (oclProgram != null)
            {
                oclProgram.Dispose();
                oclProgram = null;
            }

            if (oclCQ != null)
            {
                oclCQ.Dispose();
                oclCQ = null;
            }

            if (oclContext != null)
            {
                oclContext.Dispose();
                oclContext = null;
            }
        }
Exemple #3
0
 public void SetSamplerArg(int argIndex, Sampler sampler)
 {
     SetIntPtrArg(argIndex, sampler.SamplerID);
 }
Exemple #4
0
 /// <summary>
 /// Set argument argIndex to sampler
 /// </summary>
 /// <param name="argIndex"></param>
 /// <param name="sampler"></param>
 public void SetArg(int argIndex, Sampler sampler)
 {
     SetArg(argIndex, sampler.SamplerID);
 }
 /// <summary>
 ///     Set argument argIndex to sampler
 /// </summary>
 /// <param name="argIndex"></param>
 /// <param name="sampler"></param>
 public void SetArg(Int32 argIndex, Sampler sampler)
 {
     this.SetArg(argIndex, sampler.SamplerID);
 }
Exemple #6
0
 /// <summary>
 /// Set argument argIndex to sampler
 /// </summary>
 /// <param name="argIndex"></param>
 /// <param name="sampler"></param>
 public void SetArg(int argIndex, Sampler sampler)
 {
     SetArg(argIndex, sampler.SamplerID);
 }
Exemple #7
0
 public void SetSamplerArg(int argIndex, Sampler sampler)
 {
     SetIntPtrArg(argIndex, sampler.SamplerID);
 }