import { CellFilter } from "../../CellFilter.js";

export class AbstractCellFilterSampleGridLayer extends CellFilter {


    /**
     *
     * @type {string}
     */
    layerId = null;

    /**
     *
     * @type {GridDataLayer}
     * @private
     */
    __layer = null;

    __u_scale = 0;
    __v_scale = 0;
    /**
     *
     * @type {Sampler2D}
     * @private
     */
    __sampler = null;


    initialize(grid, seed) {
        super.initialize(grid, seed);

        this.__layer = grid.getLayerById(this.layerId);

        // cache required values
        this.__sampler = this.__layer.sampler;

        this.__u_scale = this.__sampler.width / grid.width;
        this.__v_scale = this.__sampler.height / grid.height;
    }

}
