get_circumference_points_for_brush_implementation = (brush_shape, brush_size) => {

	const brush_canvas = get_brush_canvas(brush_shape, brush_size);

	const image_data = brush_canvas.ctx.getImageData(0, 0, brush_canvas.width, brush_canvas.height);

	const at = (x, y) => (
		// coordinate checking is important so it doesn't wrap (if the brush abuts the edge of the canvas)
		x >= 0 && y >= 0 &&
		x < image_data.width && y < image_data.height &&
		image_data.data[(y * image_data.width + x) * 4 + 3] > 127
	);

	const offset_x = -Math.ceil(brush_canvas.width / 2);
	const offset_y = -Math.ceil(brush_canvas.height / 2);

	const points = [];

	for (let x = 0; x < image_data.width; x += 1) {
		for (let y = 0; y < image_data.height; y += 1) {
			if (at(x, y) && (
				!at(x, y - 1) ||
				!at(x, y + 1) ||
				!at(x - 1, y) ||
				!at(x + 1, y)
			)) {
				points.push({
					x: x + offset_x,
					y: y + offset_y,
				});
			}
		}
	}

	return points;
}
Returns the points on the circumference of a brush shape.

USAGE NOTE: must be called outside of any other usage of op_canvas (because of render_brush)

@param {BrushShape} brush_shape
@param {number} brush_size
@returns {{ x: number, y: number }[]}