# Struct ocl::Sampler [−] [src]

    #[repr(C)]
    pub struct Sampler(_);

An image sampler used to process images.

## Methods

### `impl Sampler`
[src]

#### `pub fn new(
context: &Context,
normalize_coords: bool,
addressing_mode: AddressingMode,
filter_mode: FilterMode
) -> OclResult<Sampler>`
[src]

Creates and returns a new sampler.

## Enum Quick Reference

`addressing_mode`:

- AddressingMode::None
- AddressingMode::ClampToEdge
- AddressingMode::Clamp
- AddressingMode::Repeat
- AddressingMode::MirroredRepeat

`filter_mode`:

- FilterMode::Nearest
- FilterMode::Linear

See SDK Docs for more information.

#### `pub fn with_defaults(context: &Context) -> OclResult<Sampler>`
[src]

Creates and returns a new sampler with some default settings.

## Defaults

- `normalize_coords`: false
- `addressing_mode`: `AddressingMode::None`
- `filter_mode`: `FilterMode::Nearest`

#### `pub fn info(&self, info_kind: SamplerInfo) -> OclCoreResult<SamplerInfoResult>`
[src]

Returns various kinds of information about the sampler.

## Methods from Deref<Target = SamplerCore>

#### `pub unsafe fn as_ptr(&self) -> *mut c_void`
[src]

Returns a pointer, do not store it.

## Trait Implementations

### `impl Clone for Sampler`
[src]

#### `fn clone(&self) -> Sampler`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl Debug for Sampler`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl Display for Sampler`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl Deref for Sampler`
[src]

#### `type Target = SamplerCore`

The resulting type after dereferencing.

#### `fn deref(&self) -> &SamplerCore`
[src]

Dereferences the value.

### `impl DerefMut for Sampler`
[src]

#### `fn deref_mut(&mut self) -> &mut SamplerCore`
[src]

Mutably dereferences the value.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)