class FilterEffect {
  constructor(options) {
    this.pipe = "filter";
    this.priority = 1;
    this.filters = options?.filters;
  }
  destroy() {
    for (let i = 0; i < this.filters.length; i++) {
      this.filters[i].destroy();
    }
    this.filters = null;
  }
}
const filterEffectsPool = [];
function getFilterEffect(filters) {
  const filterEffect = filterEffectsPool.pop() || new FilterEffect();
  filterEffect.filters = filters;
  return filterEffect;
}
function returnFilterEffect(effect) {
  effect.filters = null;
  filterEffectsPool.push(effect);
}

export { FilterEffect, getFilterEffect, returnFilterEffect };
//# sourceMappingURL=FilterEffect.mjs.map
