Explorar el Código

* Add a new image flag, u8, which indicates whether the image samples come

from an 8-bpp source.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2756 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam hace 16 años
padre
commit
3784480d3b
Se han modificado 5 ficheros con 28 adiciones y 1 borrados
  1. +6
    -0
      pipi/codec/imlib.c
  2. +6
    -0
      pipi/codec/opencv.c
  3. +6
    -0
      pipi/codec/sdl.c
  4. +4
    -0
      pipi/pipi.c
  5. +6
    -1
      pipi/pipi_internals.h

+ 6
- 0
pipi/codec/imlib.c Ver fichero

@@ -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);


+ 6
- 0
pipi/codec/opencv.c Ver fichero

@@ -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);


+ 6
- 0
pipi/codec/sdl.c Ver fichero

@@ -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);


+ 4
- 0
pipi/pipi.c Ver fichero

@@ -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)


+ 6
- 1
pipi/pipi_internals.h Ver fichero

@@ -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 */


Cargando…
Cancelar
Guardar