// Copyright 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "VdbSampler_nearest.ih"
#include "VdbSampler_tricubic.ih"
#include "VdbSampler_trilinear.ih"

// This macro centralizes filter dispatch for the public API.
// To add a filter, add the enum and than add a case here.
// Then, implement all of the filter-specific functions above.
#define __vkl_switch_filter(FilterEnum, F, ...)            \
  {                                                        \
    switch (FilterEnum) {                                  \
    case VKL_FILTER_LINEAR: {                              \
      F##Trilinear(__VA_ARGS__);                           \
      break;                                               \
    }                                                      \
    case VKL_FILTER_CUBIC: {                               \
      F##Tricubic(__VA_ARGS__);                            \
      break;                                               \
    }                                                      \
    default: {                                             \
      assert(FilterEnum == VKL_FILTER_NEAREST);            \
      F##Nearest(__VA_ARGS__);                             \
      break;                                               \
    }                                                      \
    }                                                      \
  }

