Quellcode durchsuchen

* Allow bayer:256 constructs, which do the same as bayer:256x256.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2766 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam vor 16 Jahren
Ursprung
Commit
5ce1d403f6
1 geänderte Dateien mit 10 neuen und 9 gelöschten Zeilen
  1. +10
    -9
      pipi/stock.c

+ 10
- 9
pipi/stock.c Datei anzeigen

@@ -30,18 +30,18 @@ pipi_image_t *pipi_load_stock(char const *name)
{
pipi_image_t *ret;
pipi_pixels_t *pix;
float *data;

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

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

return pipi_render_bayer(w, h);
}
@@ -168,13 +168,14 @@ pipi_image_t *pipi_load_stock(char const *name)
/* Generate a completely random image. */
if(!strncmp(name, "random:", 7))
{
int w, h;
int w, h = 0;

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



Laden…
Abbrechen
Speichern