浏览代码

* 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 16 年前
父节点
当前提交
5ce1d403f6
共有 1 个文件被更改,包括 10 次插入9 次删除
  1. +10
    -9
      pipi/stock.c

+ 10
- 9
pipi/stock.c 查看文件

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



正在加载...
取消
保存