#include "P_TransformCenter.h"
#include "PixelCallback.h"
#include <stdlib.h>
#include <string.h>

void TransformCenter_callback(TransformCenter* self, struct PixelContext* pc) {
	pc->x -= self->centerX;
	pc->y -= self->centerY;
}

PixelCallback* TransformCenter_setup(TransformCenter obj) {
	PixelCallback* pca = malloc(sizeof(struct PixelCallback));

	pca->callback = (PixelCallback_callback)TransformCenter_callback;
	pca->callback_self = malloc(sizeof(obj));
	memcpy(pca->callback_self, &obj, sizeof(obj));

	return pca;
}
