import{ImageFilter}from"./image-filter.mjs";function performPixelize(image){let topLeftY=this.thread.y-this.thread.y%this.constants.size;let topLeftX=this.thread.x-this.thread.x%this.constants.size;let pixel=image[topLeftY][topLeftX];this.color(pixel[0],pixel[1],pixel[2],pixel[3])}class ImagePixelizeFilter extends ImageFilter{static filterFunction=performPixelize;reset(execute=true){super.reset(false);this.constants.size=2;if(execute){this.execute()}}setConstants(constants,execute=true){this.constants.size=parseInt(constants.size===undefined?this.constants.size:constants.size);if(execute){this.execute()}}set size(newSize){this.constants.size=parseInt(newSize);this.execute()}}export{ImagePixelizeFilter};
