diff --git a/pipi/codec/imlib.c b/pipi/codec/imlib.c index 85343c8..45c5d35 100644 --- a/pipi/codec/imlib.c +++ b/pipi/codec/imlib.c @@ -50,6 +50,9 @@ pipi_image_t *pipi_load_imlib2(const char *name) img->codec_priv = (void *)priv; img->codec_format = PIPI_PIXELS_RGBA32; + img->wrap = 0; + img->u8 = 1; + return img; } @@ -86,6 +89,9 @@ void pipi_save_imlib2(pipi_image_t *img, const char *name) img->codec_priv = (void *)priv; img->codec_format = PIPI_PIXELS_RGBA32; + + img->wrap = 0; + img->u8 = 1; } pipi_getpixels(img, img->codec_format); diff --git a/pipi/codec/opencv.c b/pipi/codec/opencv.c index 1086aaf..1b212cf 100644 --- a/pipi/codec/opencv.c +++ b/pipi/codec/opencv.c @@ -52,6 +52,9 @@ pipi_image_t *pipi_load_opencv(const char *name) img->codec_priv = (void *)priv; img->codec_format = PIPI_PIXELS_BGR24; + img->wrap = 0; + img->u8 = 1; + return img; } @@ -86,6 +89,9 @@ void pipi_save_opencv(pipi_image_t *img, const char *name) img->codec_priv = (void *)priv; img->codec_format = PIPI_PIXELS_BGR24; + + img->wrap = 0; + img->u8 = 1; } pipi_getpixels(img, img->codec_format); diff --git a/pipi/codec/sdl.c b/pipi/codec/sdl.c index 906c87b..f096194 100644 --- a/pipi/codec/sdl.c +++ b/pipi/codec/sdl.c @@ -59,6 +59,9 @@ pipi_image_t *pipi_load_sdl(const char *name) img->codec_priv = (void *)priv; img->codec_format = PIPI_PIXELS_RGBA32; + img->wrap = 0; + img->u8 = 1; + return img; } @@ -90,6 +93,9 @@ void pipi_save_sdl(pipi_image_t *img, const char *name) img->codec_priv = (void *)priv; img->codec_format = PIPI_PIXELS_RGBA32; + + img->wrap = 0; + img->u8 = 1; } pipi_getpixels(img, img->codec_format); diff --git a/pipi/pipi.c b/pipi/pipi.c index cadc891..083d781 100644 --- a/pipi/pipi.c +++ b/pipi/pipi.c @@ -50,6 +50,9 @@ pipi_image_t *pipi_new(int w, int h) img->last_modified = PIPI_PIXELS_UNINITIALISED; img->codec_format = PIPI_PIXELS_UNINITIALISED; + img->wrap = 0; + img->u8 = 1; + return img; } @@ -59,6 +62,7 @@ pipi_image_t *pipi_copy(pipi_image_t *src) /* Copy properties */ dst->wrap = src->wrap; + dst->u8 = src->u8; /* Copy pixels, if any */ if(src->last_modified != PIPI_PIXELS_UNINITIALISED) diff --git a/pipi/pipi_internals.h b/pipi/pipi_internals.h index 4f917eb..cc77665 100644 --- a/pipi/pipi_internals.h +++ b/pipi/pipi_internals.h @@ -25,7 +25,12 @@ struct pipi_image { int w, h, pitch; - int wrap; + + /* A list of internal image flags. + * wrap: should filters wrap around at edges? + * u8: are the image samples still 8-bit per channel? */ + int wrap, u8; + pipi_format_t codec_format, last_modified; /* List of all possible pixel formats */