gint/src/image/image_hflip_alloc.c

18 lines
364 B
C

#include <gint/image.h>
image_t *image_hflip_alloc(image_t const *src)
{
if(!image_valid(src))
return NULL;
image_t *dst = image_alloc(src->width, src->height, src->format);
if(!dst || !image_copy_palette(src, dst, -1)) {
image_free(dst);
return NULL;
}
image_clear(dst);
image_hflip(src, dst);
return dst;
}