Browse Source

* Do not prefix stock image names with "pipi:", it's redundant.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2757 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
6a9475464c
2 changed files with 9 additions and 8 deletions
  1. +3
    -2
      pipi/codec.c
  2. +6
    -6
      pipi/stock.c

+ 3
- 2
pipi/codec.c View File

@@ -28,8 +28,9 @@


pipi_image_t *pipi_load(char const *name) pipi_image_t *pipi_load(char const *name)
{ {
if(!strncmp(name, "pipi:", 5))
return pipi_load_stock(name + 5);
if(!strncmp(name, "random:", 7) ||
!strncmp(name, "bayer:", 6))
return pipi_load_stock(name);


#if USE_IMLIB2 #if USE_IMLIB2
return pipi_load_imlib2(name); return pipi_load_imlib2(name);


+ 6
- 6
pipi/stock.c View File

@@ -33,12 +33,12 @@ pipi_image_t *pipi_load_stock(char const *name)
float *data; float *data;


/* Generate a Bayer dithering pattern. */ /* Generate a Bayer dithering pattern. */
if(!strncmp(name, "bayer", 5))
if(!strncmp(name, "bayer:", 6))
{ {
int i, j, w, h, n; int i, j, w, h, n;


w = atoi(name + 5);
name = strchr(name + 5, 'x');
w = atoi(name + 6);
name = strchr(name + 6, 'x');
if(!name) if(!name)
return NULL; return NULL;
h = atoi(name + 1); h = atoi(name + 1);
@@ -74,13 +74,13 @@ pipi_image_t *pipi_load_stock(char const *name)
} }


/* Generate a completely random image. */ /* Generate a completely random image. */
if(!strncmp(name, "random", 6))
if(!strncmp(name, "random:", 7))
{ {
unsigned int ctx = 1; unsigned int ctx = 1;
int x, y, t, w, h; int x, y, t, w, h;


w = atoi(name + 6);
name = strchr(name + 6, 'x');
w = atoi(name + 7);
name = strchr(name + 7, 'x');
if(!name) if(!name)
return NULL; return NULL;
h = atoi(name + 1); h = atoi(name + 1);


Loading…
Cancel
Save