1#include "rs_core.rsh"
2#include "rs_structs.h"
3
4/**
5* Sampler
6*/
7extern rs_sampler_value __attribute__((overloadable))
8        rsSamplerGetMinification(rs_sampler s) {
9    Sampler_t *prog = (Sampler_t *)s.p;
10    if (prog == NULL) {
11        return RS_SAMPLER_INVALID;
12    }
13    return prog->mHal.state.minFilter;
14}
15
16extern rs_sampler_value __attribute__((overloadable))
17        rsSamplerGetMagnification(rs_sampler s) {
18    Sampler_t *prog = (Sampler_t *)s.p;
19    if (prog == NULL) {
20        return RS_SAMPLER_INVALID;
21    }
22    return prog->mHal.state.magFilter;
23}
24
25extern rs_sampler_value __attribute__((overloadable))
26        rsSamplerGetWrapS(rs_sampler s) {
27    Sampler_t *prog = (Sampler_t *)s.p;
28    if (prog == NULL) {
29        return RS_SAMPLER_INVALID;
30    }
31    return prog->mHal.state.wrapS;
32}
33
34extern rs_sampler_value __attribute__((overloadable))
35        rsSamplerGetWrapT(rs_sampler s) {
36    Sampler_t *prog = (Sampler_t *)s.p;
37    if (prog == NULL) {
38        return RS_SAMPLER_INVALID;
39    }
40    return prog->mHal.state.wrapT;
41}
42
43extern float __attribute__((overloadable))
44        rsSamplerGetAnisotropy(rs_sampler s) {
45    Sampler_t *prog = (Sampler_t *)s.p;
46    if (prog == NULL) {
47        return 0.0f;
48    }
49    return prog->mHal.state.aniso;
50}
51