Esempio n. 1
0
 /// <summary>
 /// Constructor of the <see cref="Sampler"/> object. Don't use this constructor, use <see cref="Context.CreateSampler(ImageAddressing, ImageFiltering, bool)"/> method instead.
 /// </summary>
 public Sampler(IntPtr handle, Context context, ImageAddressing addr, ImageFiltering filt, bool norm)
 {
     Handle                = handle;
     Context               = context;
     AddressingMode        = addr;
     FilteringMode         = filt;
     NormalizedCoordinates = norm;
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a <see cref="Sampler"/> object.
        /// </summary>
        /// <param name="addressingMode">Specifies how out-of-range image coordinates are handled when reading from an image.</param>
        /// <param name="filteringMode">Specifies the type of filter that must be applied when reading an image.</param>
        /// <param name="normalizedCoordinates">Determines if the image coordinates specified are normalized or not.</param>
        /// <returns>A new sampler.</returns>
        public Sampler CreateSampler(ImageAddressing addressingMode, ImageFiltering filteringMode, bool normalizedCoordinates)
        {
            IntPtr samplerHandle = clCreateSampler(Handle, normalizedCoordinates, addressingMode, filteringMode, out error);

            if (error != ErrorCode.Success)
            {
                return(null);
            }

            return(new Sampler(samplerHandle, this, addressingMode, filteringMode, normalizedCoordinates));
        }
Esempio n. 3
0
 private extern static IntPtr clCreateSampler(
     IntPtr context,
     [MarshalAs(UnmanagedType.Bool)] bool normalized_coords,
     ImageAddressing addressing_mode,
     ImageFiltering filter_mode,
     out ErrorCode errcode_ret);