5 #include <glm/gtc/integer.hpp> 
   24         struct interpolate<double>
 
   30         struct interpolate<long double>
 
   32                 typedef long double type;
 
   35         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
   38                 typedef typename texture_type::size_type size_type;
 
   39                 typedef typename texture_type::extent_type extent_type;
 
   41                 typedef texel_type(*filterFunc)(
 
   42                         texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap,
 
   43                         size_type Layer, size_type Face, interpolate_type Level,
 
   44                         texel_type 
const & BorderColor);
 
   47         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
bool is_
float = true, 
bool support_border = true>
 
   48         struct nearest : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
   50                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
   51                 typedef typename base_type::size_type size_type;
 
   52                 typedef typename base_type::extent_type extent_type;
 
   53                 typedef coord_nearest<extent_type, normalized_type> coord_type;
 
   55                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const & BorderColor)
 
   57                         extent_type 
const TexelDim(Texture.extent(Level));
 
   58                         normalized_type 
const TexelLast(normalized_type(TexelDim) - normalized_type(1));
 
   61                         extent_type 
const TexelCoord = extent_type(round(SampleCoordWrap * TexelLast));
 
   62                         typename extent_type::bool_type 
const UseTexelCoord = in_interval(TexelCoord, extent_type(0), TexelDim - 1);
 
   64                         texel_type Texel(BorderColor);
 
   65                         if(all(UseTexelCoord))
 
   66                                 Texel = Fetch(Texture, TexelCoord, Layer, Face, Level);
 
   72         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
   73         struct nearest<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, false> : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
   75                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
   76                 typedef typename base_type::size_type size_type;
 
   77                 typedef typename base_type::extent_type extent_type;
 
   78                 typedef coord_nearest<extent_type, normalized_type> coord_type;
 
   80                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const & BorderColor)
 
   82                         normalized_type 
const TexelLast(normalized_type(Texture.extent(Level)) - normalized_type(1));
 
   83                         extent_type 
const TexelCoord(SampleCoordWrap * TexelLast + interpolate_type(0.5));
 
   86                         return Fetch(Texture, TexelCoord, Layer, Face, Level);
 
   90         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
bool is_
float = true, 
bool support_border = true>
 
   91         struct linear : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
   93                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
   94                 typedef typename base_type::size_type size_type;
 
   95                 typedef typename base_type::extent_type extent_type;
 
   97                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const& BorderColor)
 
  103         template <
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
  104         struct linear<DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, true> : 
public filterBase<DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  106                 typedef filterBase<DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  107                 typedef typename base_type::size_type size_type;
 
  108                 typedef typename base_type::extent_type extent_type;
 
  109                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  111                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const & BorderColor)
 
  113                         coord_type 
const& Coord = make_coord_linear_border(Texture.extent(Level), SampleCoordWrap);
 
  115                         texel_type Texel0(BorderColor);
 
  116                         if(Coord.UseTexelFloor.s)
 
  117                                 Texel0 = Fetch(Texture, extent_type(Coord.TexelFloor.s), Layer, Face, Level);
 
  119                         texel_type Texel1(BorderColor);
 
  120                         if(Coord.UseTexelCeil.s)
 
  121                                 Texel1 = Fetch(Texture, extent_type(Coord.TexelCeil.s), Layer, Face, Level);
 
  123                         return mix(Texel0, Texel1, Coord.Blend.s);
 
  127         template <
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
  128         struct linear<DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, false> : 
public filterBase<DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  130                 typedef filterBase<DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  131                 typedef typename base_type::size_type size_type;
 
  132                 typedef typename base_type::extent_type extent_type;
 
  133                 typedef coord_linear<extent_type, normalized_type> coord_type;
 
  135                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const & BorderColor)
 
  137                         coord_type 
const& Coord = make_coord_linear(Texture.extent(Level), SampleCoordWrap);
 
  139                         texel_type 
const Texel0 = Fetch(Texture, extent_type(Coord.TexelFloor.s), Layer, Face, Level);
 
  140                         texel_type 
const Texel1 = Fetch(Texture, extent_type(Coord.TexelCeil.s), Layer, Face, Level);
 
  142                         return mix(Texel0, Texel1, Coord.Blend.s);
 
  146         template <
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
  147         struct linear<DIMENSION_2D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, true> : 
public filterBase<DIMENSION_2D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  149                 typedef filterBase<DIMENSION_2D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  150                 typedef typename base_type::size_type size_type;
 
  151                 typedef typename base_type::extent_type extent_type;
 
  152                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  154                 static texel_type call(texture_type 
const& Texture, fetch_type Fetch, normalized_type 
const& SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const& BorderColor)
 
  156                         coord_type 
const& Coord = make_coord_linear_border(Texture.extent(Level), SampleCoordWrap);
 
  158                         texel_type Texel00(BorderColor);
 
  159                         if(Coord.UseTexelFloor.s && Coord.UseTexelFloor.t)
 
  160                                 Texel00 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelFloor.t), Layer, Face, Level);
 
  162                         texel_type Texel10(BorderColor);
 
  163                         if(Coord.UseTexelCeil.s && Coord.UseTexelFloor.t)
 
  164                                 Texel10 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelFloor.t), Layer, Face, Level);
 
  166                         texel_type Texel11(BorderColor);
 
  167                         if(Coord.UseTexelCeil.s && Coord.UseTexelCeil.t)
 
  168                                 Texel11 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelCeil.t), Layer, Face, Level);
 
  170                         texel_type Texel01(BorderColor);
 
  171                         if(Coord.UseTexelFloor.s && Coord.UseTexelCeil.t)
 
  172                                 Texel01 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelCeil.t), Layer, Face, Level);
 
  174                         texel_type 
const ValueA(mix(Texel00, Texel10, Coord.Blend.s));
 
  175                         texel_type 
const ValueB(mix(Texel01, Texel11, Coord.Blend.s));
 
  176                         return mix(ValueA, ValueB, Coord.Blend.t);
 
  180         template <
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
  181         struct linear<DIMENSION_2D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, false> : 
public filterBase<DIMENSION_2D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  183                 typedef filterBase<DIMENSION_2D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  184                 typedef typename base_type::size_type size_type;
 
  185                 typedef typename base_type::extent_type extent_type;
 
  186                 typedef coord_linear<extent_type, normalized_type> coord_type;
 
  188                 static texel_type call(texture_type 
const& Texture, fetch_type Fetch, normalized_type 
const& SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const& BorderColor)
 
  190                         coord_type 
const& Coord = make_coord_linear(Texture.extent(Level), SampleCoordWrap);
 
  192                         texel_type 
const& Texel00 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelFloor.t), Layer, Face, Level);
 
  193                         texel_type 
const& Texel10 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelFloor.t), Layer, Face, Level);
 
  194                         texel_type 
const& Texel11 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelCeil.t), Layer, Face, Level);
 
  195                         texel_type 
const& Texel01 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelCeil.t), Layer, Face, Level);
 
  197                         texel_type 
const ValueA(mix(Texel00, Texel10, Coord.Blend.s));
 
  198                         texel_type 
const ValueB(mix(Texel01, Texel11, Coord.Blend.s));
 
  199                         return mix(ValueA, ValueB, Coord.Blend.t);
 
  203         template <
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
  204         struct linear<DIMENSION_3D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, true> : 
public filterBase<DIMENSION_3D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  206                 typedef filterBase<DIMENSION_3D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  207                 typedef typename base_type::size_type size_type;
 
  208                 typedef typename base_type::extent_type extent_type;
 
  209                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  211                 static texel_type call(texture_type 
const& Texture, fetch_type Fetch, normalized_type 
const& SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const& BorderColor)
 
  213                         coord_type 
const& Coord = make_coord_linear_border(Texture.extent(Level), SampleCoordWrap);
 
  215                         texel_type Texel000(BorderColor);
 
  216                         if(Coord.UseTexelFloor.s && Coord.UseTexelFloor.t && Coord.UseTexelFloor.p)
 
  217                                 Texel000 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelFloor.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  219                         texel_type Texel100(BorderColor);
 
  220                         if(Coord.UseTexelCeil.s && Coord.UseTexelFloor.t && Coord.UseTexelFloor.p)
 
  221                                 Texel100 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelFloor.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  223                         texel_type Texel110(BorderColor);
 
  224                         if(Coord.UseTexelCeil.s && Coord.UseTexelCeil.t && Coord.UseTexelFloor.p)
 
  225                                 Texel110 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelCeil.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  227                         texel_type Texel010(BorderColor);
 
  228                         if(Coord.UseTexelFloor.s && Coord.UseTexelCeil.t && Coord.UseTexelFloor.p)
 
  229                                 Texel010 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelCeil.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  231                         texel_type Texel001(BorderColor);
 
  232                         if (Coord.UseTexelFloor.s && Coord.UseTexelFloor.t && Coord.UseTexelCeil.p)
 
  233                                 Texel001 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelFloor.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  235                         texel_type Texel101(BorderColor);
 
  236                         if(Coord.UseTexelCeil.s && Coord.UseTexelFloor.t && Coord.UseTexelCeil.p)
 
  237                                 Texel101 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelFloor.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  239                         texel_type Texel111(BorderColor);
 
  240                         if(Coord.UseTexelCeil.s && Coord.UseTexelCeil.t && Coord.UseTexelCeil.p)
 
  241                                 Texel111 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelCeil.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  243                         texel_type Texel011(BorderColor);
 
  244                         if(Coord.UseTexelFloor.s && Coord.UseTexelCeil.t && Coord.UseTexelCeil.p)
 
  245                                 Texel011 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelCeil.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  247                         texel_type 
const ValueA(mix(Texel000, Texel100, Coord.Blend.s));
 
  248                         texel_type 
const ValueB(mix(Texel010, Texel110, Coord.Blend.s));
 
  250                         texel_type 
const ValueC(mix(Texel001, Texel101, Coord.Blend.s));
 
  251                         texel_type 
const ValueD(mix(Texel011, Texel111, Coord.Blend.s));
 
  253                         texel_type 
const ValueE(mix(ValueA, ValueB, Coord.Blend.t));
 
  254                         texel_type 
const ValueF(mix(ValueC, ValueD, Coord.Blend.t));
 
  256                         return mix(ValueE, ValueF, Coord.Blend.p);
 
  260         template <
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type>
 
  261         struct linear<DIMENSION_3D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, true, false> : 
public filterBase<DIMENSION_3D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  263                 typedef filterBase<DIMENSION_3D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  264                 typedef typename base_type::size_type size_type;
 
  265                 typedef typename base_type::extent_type extent_type;
 
  266                 typedef coord_linear<extent_type, normalized_type> coord_type;
 
  268                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, size_type Level, texel_type 
const & BorderColor)
 
  270                         coord_type 
const & Coord = make_coord_linear(Texture.extent(Level), SampleCoordWrap);
 
  272                         texel_type 
const & Texel000 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelFloor.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  273                         texel_type 
const & Texel100 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelFloor.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  274                         texel_type 
const & Texel110 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelCeil.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  275                         texel_type 
const & Texel010 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelCeil.t, Coord.TexelFloor.p), Layer, Face, Level);
 
  276                         texel_type 
const & Texel001 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelFloor.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  277                         texel_type 
const & Texel101 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelFloor.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  278                         texel_type 
const & Texel111 = Fetch(Texture, extent_type(Coord.TexelCeil.s, Coord.TexelCeil.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  279                         texel_type 
const & Texel011 = Fetch(Texture, extent_type(Coord.TexelFloor.s, Coord.TexelCeil.t, Coord.TexelCeil.p), Layer, Face, Level);
 
  281                         texel_type 
const ValueA(mix(Texel000, Texel100, Coord.Blend.s));
 
  282                         texel_type 
const ValueB(mix(Texel010, Texel110, Coord.Blend.s));
 
  284                         texel_type 
const ValueC(mix(Texel001, Texel101, Coord.Blend.s));
 
  285                         texel_type 
const ValueD(mix(Texel011, Texel111, Coord.Blend.s));
 
  287                         texel_type 
const ValueE(mix(ValueA, ValueB, Coord.Blend.t));
 
  288                         texel_type 
const ValueF(mix(ValueC, ValueD, Coord.Blend.t));
 
  290                         return mix(ValueE, ValueF, Coord.Blend.p);
 
  294         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
bool is_
float, 
bool support_border>
 
  295         struct nearest_mipmap_nearest : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  297                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  298                 typedef typename base_type::size_type size_type;
 
  299                 typedef typename base_type::extent_type extent_type;
 
  300                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  302                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, interpolate_type Level, texel_type 
const & BorderColor)
 
  304                         return nearest<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, is_float, support_border>::call(Texture, Fetch, SampleCoordWrap, Layer, Face, glm::iround(Level), BorderColor);
 
  308         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
bool is_
float, 
bool support_border>
 
  309         struct nearest_mipmap_linear : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  311                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  312                 typedef typename base_type::size_type size_type;
 
  313                 typedef typename base_type::extent_type extent_type;
 
  314                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  316                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, interpolate_type Level, texel_type 
const & BorderColor)
 
  318                         texel_type 
const MinTexel = nearest<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, is_float, support_border>::call(Texture, Fetch, SampleCoordWrap, Layer, Face, static_cast<size_type>(floor(Level)), BorderColor);
 
  319                         texel_type 
const MaxTexel = nearest<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, is_float, support_border>::call(Texture, Fetch, SampleCoordWrap, Layer, Face, static_cast<size_type>(ceil(Level)), BorderColor);
 
  320                         return mix(MinTexel, MaxTexel, fract(Level));
 
  324         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
bool is_
float, 
bool support_border>
 
  325         struct linear_mipmap_nearest : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  327                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  328                 typedef typename base_type::size_type size_type;
 
  329                 typedef typename base_type::extent_type extent_type;
 
  330                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  332                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, interpolate_type Level, texel_type 
const & BorderColor)
 
  334                         return linear<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, is_float, support_border>::call(Texture, Fetch, SampleCoordWrap, Layer, Face, glm::iround(Level), BorderColor);
 
  338         template <dimension Dimension, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
bool is_
float, 
bool support_border>
 
  339         struct linear_mipmap_linear : 
public filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>
 
  341                 typedef filterBase<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type> base_type;
 
  342                 typedef typename base_type::size_type size_type;
 
  343                 typedef typename base_type::extent_type extent_type;
 
  344                 typedef coord_linear_border<extent_type, normalized_type> coord_type;
 
  346                 static texel_type call(texture_type 
const & Texture, fetch_type Fetch, normalized_type 
const & SampleCoordWrap, size_type Layer, size_type Face, interpolate_type Level, texel_type 
const & BorderColor)
 
  348                         size_type 
const FloorLevel = 
static_cast<size_type
>(floor(Level));
 
  349                         size_type 
const CeilLevel = 
static_cast<size_type
>(ceil(Level));
 
  350                         texel_type 
const MinTexel = linear<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, is_float, support_border>::call(Texture, Fetch, SampleCoordWrap, Layer, Face, FloorLevel, BorderColor);
 
  351                         texel_type 
const MaxTexel = linear<Dimension, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, is_float, support_border>::call(Texture, Fetch, SampleCoordWrap, Layer, Face, CeilLevel, BorderColor);
 
  352                         return mix(MinTexel, MaxTexel, fract(Level));
 
  356         template <
typename filter_type, dimension Dimensions, 
typename texture_type, 
typename interpolate_type, 
typename normalized_type, 
typename fetch_type, 
typename texel_type, 
typename T>
 
  357         inline filter_type get_filter(
filter Mip, 
filter Min, 
bool Border)
 
  359                 static filter_type Table[][FILTER_COUNT][2] =
 
  363                                         nearest_mipmap_nearest<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
false>::call,
 
  364                                         nearest_mipmap_nearest<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
true>::call
 
  367                                         linear_mipmap_nearest<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
false>::call,
 
  368                                         linear_mipmap_nearest<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
true>::call
 
  373                                         nearest_mipmap_linear<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
false>::call,
 
  374                                         nearest_mipmap_linear<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
true>::call
 
  377                                         linear_mipmap_linear<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
false>::call,
 
  378                                         linear_mipmap_linear<Dimensions, texture_type, interpolate_type, normalized_type, fetch_type, texel_type, std::numeric_limits<T>::is_iec559, 
true>::call
 
  382                 static_assert(
sizeof(Table) / 
sizeof(Table[0]) == FILTER_COUNT, 
"GLI ERROR: 'Table' doesn't match the number of supported filters");
 
  384                 GLI_ASSERT(Table[Mip - FILTER_FIRST][Min - FILTER_FIRST][Border ? 1 : 0]);
 
  386                 return Table[Mip - FILTER_FIRST][Min - FILTER_FIRST][Border ? 1 : 0];
 
Include to use filter enum, to select filtering methods. 
 
filter
Texture filtring modes. 
 
Namespace where all the classes and functions provided by GLI are exposed.