2011-12-08 20:07:52 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) Stefano Sabatini 2011
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* cellular automaton video source, based on Stephen Wolfram "experimentus crucis"
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* #define DEBUG */
|
|
|
|
|
|
|
|
#include "libavutil/file.h"
|
2015-08-18 02:45:35 +02:00
|
|
|
#include "libavutil/internal.h"
|
2011-12-08 20:07:52 +03:00
|
|
|
#include "libavutil/lfg.h"
|
|
|
|
#include "libavutil/opt.h"
|
|
|
|
#include "libavutil/parseutils.h"
|
|
|
|
#include "libavutil/random_seed.h"
|
2013-03-03 13:17:50 +03:00
|
|
|
#include "libavutil/avstring.h"
|
2011-12-08 20:07:52 +03:00
|
|
|
#include "avfilter.h"
|
2012-06-22 15:33:09 +03:00
|
|
|
#include "internal.h"
|
2012-06-16 12:47:46 +03:00
|
|
|
#include "formats.h"
|
|
|
|
#include "video.h"
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const AVClass *class;
|
|
|
|
int w, h;
|
|
|
|
char *filename;
|
|
|
|
char *rule_str;
|
|
|
|
uint8_t *file_buf;
|
|
|
|
size_t file_bufsize;
|
|
|
|
uint8_t *buf;
|
|
|
|
int buf_prev_row_idx, buf_row_idx;
|
|
|
|
uint8_t rule;
|
|
|
|
uint64_t pts;
|
2013-03-26 15:19:16 +03:00
|
|
|
AVRational frame_rate;
|
2011-12-08 20:07:52 +03:00
|
|
|
double random_fill_ratio;
|
|
|
|
uint32_t random_seed;
|
|
|
|
int stitch, scroll, start_full;
|
|
|
|
int64_t generation; ///< the generation number, starting from 0
|
|
|
|
AVLFG lfg;
|
|
|
|
char *pattern;
|
|
|
|
} CellAutoContext;
|
|
|
|
|
|
|
|
#define OFFSET(x) offsetof(CellAutoContext, x)
|
2012-08-13 14:40:01 +03:00
|
|
|
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
static const AVOption cellauto_options[] = {
|
2012-08-13 14:40:01 +03:00
|
|
|
{ "filename", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
|
|
|
|
{ "f", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
|
|
|
|
{ "pattern", "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
|
|
|
|
{ "p", "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
|
2013-03-26 15:19:16 +03:00
|
|
|
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },
|
|
|
|
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },
|
2012-08-13 14:40:01 +03:00
|
|
|
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS },
|
|
|
|
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS },
|
2012-09-05 15:26:01 +03:00
|
|
|
{ "rule", "set rule", OFFSET(rule), AV_OPT_TYPE_INT, {.i64 = 110}, 0, 255, FLAGS },
|
2012-08-13 14:40:01 +03:00
|
|
|
{ "random_fill_ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1, FLAGS },
|
|
|
|
{ "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1, FLAGS },
|
2012-09-05 15:26:01 +03:00
|
|
|
{ "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
|
|
|
|
{ "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
|
2015-09-09 01:15:42 +02:00
|
|
|
{ "scroll", "scroll pattern downward", OFFSET(scroll), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
|
|
|
|
{ "start_full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
|
|
|
|
{ "full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
|
|
|
|
{ "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
|
2013-09-07 15:13:50 +03:00
|
|
|
{ NULL }
|
2011-12-08 20:07:52 +03:00
|
|
|
};
|
|
|
|
|
2012-06-22 15:33:09 +03:00
|
|
|
AVFILTER_DEFINE_CLASS(cellauto);
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
static void show_cellauto_row(AVFilterContext *ctx)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
int i;
|
2015-08-28 07:31:02 +02:00
|
|
|
uint8_t *row = s->buf + s->w * s->buf_row_idx;
|
|
|
|
char *line = av_malloc(s->w + 1);
|
2011-12-08 20:07:52 +03:00
|
|
|
if (!line)
|
|
|
|
return;
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
for (i = 0; i < s->w; i++)
|
2011-12-08 20:07:52 +03:00
|
|
|
line[i] = row[i] ? '@' : ' ';
|
|
|
|
line[i] = 0;
|
2015-08-28 07:31:02 +02:00
|
|
|
av_log(ctx, AV_LOG_DEBUG, "generation:%"PRId64" row:%s|\n", s->generation, line);
|
2011-12-08 20:07:52 +03:00
|
|
|
av_free(line);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int init_pattern_from_string(AVFilterContext *ctx)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
char *p;
|
|
|
|
int i, w = 0;
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
w = strlen(s->pattern);
|
2011-12-08 20:07:52 +03:00
|
|
|
av_log(ctx, AV_LOG_DEBUG, "w:%d\n", w);
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
if (s->w) {
|
|
|
|
if (w > s->w) {
|
2011-12-08 20:07:52 +03:00
|
|
|
av_log(ctx, AV_LOG_ERROR,
|
|
|
|
"The specified width is %d which cannot contain the provided string width of %d\n",
|
2015-08-28 07:31:02 +02:00
|
|
|
s->w, w);
|
2011-12-08 20:07:52 +03:00
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* width was not specified, set it to width of the provided row */
|
2015-08-28 07:31:02 +02:00
|
|
|
s->w = w;
|
|
|
|
s->h = (double)s->w * M_PHI;
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
s->buf = av_mallocz_array(sizeof(uint8_t) * s->w, s->h);
|
|
|
|
if (!s->buf)
|
2011-12-08 20:07:52 +03:00
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
|
|
|
|
/* fill buf */
|
2015-08-28 07:31:02 +02:00
|
|
|
p = s->pattern;
|
|
|
|
for (i = (s->w - w)/2;; i++) {
|
2011-12-08 20:07:52 +03:00
|
|
|
av_log(ctx, AV_LOG_DEBUG, "%d %c\n", i, *p == '\n' ? 'N' : *p);
|
|
|
|
if (*p == '\n' || !*p)
|
|
|
|
break;
|
|
|
|
else
|
2015-08-28 07:31:02 +02:00
|
|
|
s->buf[i] = !!av_isgraph(*(p++));
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int init_pattern_from_file(AVFilterContext *ctx)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
int ret;
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
ret = av_file_map(s->filename,
|
|
|
|
&s->file_buf, &s->file_bufsize, 0, ctx);
|
2011-12-08 20:07:52 +03:00
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* create a string based on the read file */
|
2015-08-28 07:31:02 +02:00
|
|
|
s->pattern = av_malloc(s->file_bufsize + 1);
|
|
|
|
if (!s->pattern)
|
2011-12-08 20:07:52 +03:00
|
|
|
return AVERROR(ENOMEM);
|
2015-08-28 07:31:02 +02:00
|
|
|
memcpy(s->pattern, s->file_buf, s->file_bufsize);
|
|
|
|
s->pattern[s->file_bufsize] = 0;
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
return init_pattern_from_string(ctx);
|
|
|
|
}
|
|
|
|
|
2013-09-27 21:51:49 +03:00
|
|
|
static av_cold int init(AVFilterContext *ctx)
|
2011-12-08 20:07:52 +03:00
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
int ret;
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
if (!s->w && !s->filename && !s->pattern)
|
|
|
|
av_opt_set(s, "size", "320x518", 0);
|
2011-12-08 20:07:52 +03:00
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
if (s->filename && s->pattern) {
|
2011-12-08 20:07:52 +03:00
|
|
|
av_log(ctx, AV_LOG_ERROR, "Only one of the filename or pattern options can be used\n");
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
if (s->filename) {
|
2011-12-08 20:07:52 +03:00
|
|
|
if ((ret = init_pattern_from_file(ctx)) < 0)
|
|
|
|
return ret;
|
2015-08-28 07:31:02 +02:00
|
|
|
} else if (s->pattern) {
|
2011-12-08 20:07:52 +03:00
|
|
|
if ((ret = init_pattern_from_string(ctx)) < 0)
|
|
|
|
return ret;
|
|
|
|
} else {
|
|
|
|
/* fill the first row randomly */
|
|
|
|
int i;
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
s->buf = av_mallocz_array(sizeof(uint8_t) * s->w, s->h);
|
|
|
|
if (!s->buf)
|
2011-12-08 20:07:52 +03:00
|
|
|
return AVERROR(ENOMEM);
|
2015-08-28 07:31:02 +02:00
|
|
|
if (s->random_seed == -1)
|
|
|
|
s->random_seed = av_get_random_seed();
|
2011-12-08 20:07:52 +03:00
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
av_lfg_init(&s->lfg, s->random_seed);
|
2011-12-08 20:07:52 +03:00
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
for (i = 0; i < s->w; i++) {
|
|
|
|
double r = (double)av_lfg_get(&s->lfg) / UINT32_MAX;
|
|
|
|
if (r <= s->random_fill_ratio)
|
|
|
|
s->buf[i] = 1;
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-14 19:26:04 +03:00
|
|
|
av_log(ctx, AV_LOG_VERBOSE,
|
2011-12-08 20:07:52 +03:00
|
|
|
"s:%dx%d r:%d/%d rule:%d stitch:%d scroll:%d full:%d seed:%u\n",
|
2015-08-28 07:31:02 +02:00
|
|
|
s->w, s->h, s->frame_rate.num, s->frame_rate.den,
|
|
|
|
s->rule, s->stitch, s->scroll, s->start_full,
|
|
|
|
s->random_seed);
|
2011-12-08 20:07:52 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static av_cold void uninit(AVFilterContext *ctx)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
av_file_unmap(s->file_buf, s->file_bufsize);
|
|
|
|
av_freep(&s->buf);
|
|
|
|
av_freep(&s->pattern);
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int config_props(AVFilterLink *outlink)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = outlink->src->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
outlink->w = s->w;
|
|
|
|
outlink->h = s->h;
|
|
|
|
outlink->time_base = av_inv_q(s->frame_rate);
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void evolve(AVFilterContext *ctx)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
int i, v, pos[3];
|
2015-08-28 07:31:02 +02:00
|
|
|
uint8_t *row, *prev_row = s->buf + s->buf_row_idx * s->w;
|
2011-12-08 20:07:52 +03:00
|
|
|
enum { NW, N, NE };
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
s->buf_prev_row_idx = s->buf_row_idx;
|
|
|
|
s->buf_row_idx = s->buf_row_idx == s->h-1 ? 0 : s->buf_row_idx+1;
|
|
|
|
row = s->buf + s->w * s->buf_row_idx;
|
2011-12-08 20:07:52 +03:00
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
for (i = 0; i < s->w; i++) {
|
|
|
|
if (s->stitch) {
|
|
|
|
pos[NW] = i-1 < 0 ? s->w-1 : i-1;
|
2011-12-08 20:07:52 +03:00
|
|
|
pos[N] = i;
|
2015-08-28 07:31:02 +02:00
|
|
|
pos[NE] = i+1 == s->w ? 0 : i+1;
|
2011-12-08 20:07:52 +03:00
|
|
|
v = prev_row[pos[NW]]<<2 | prev_row[pos[N]]<<1 | prev_row[pos[NE]];
|
|
|
|
} else {
|
|
|
|
v = 0;
|
|
|
|
v|= i-1 >= 0 ? prev_row[i-1]<<2 : 0;
|
|
|
|
v|= prev_row[i ]<<1 ;
|
2015-08-28 07:31:02 +02:00
|
|
|
v|= i+1 < s->w ? prev_row[i+1] : 0;
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
2015-08-28 07:31:02 +02:00
|
|
|
row[i] = !!(s->rule & (1<<v));
|
2015-08-18 02:45:35 +02:00
|
|
|
ff_dlog(ctx, "i:%d context:%c%c%c -> cell:%d\n", i,
|
2011-12-08 20:07:52 +03:00
|
|
|
v&4?'@':' ', v&2?'@':' ', v&1?'@':' ', row[i]);
|
|
|
|
}
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
s->generation++;
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
|
2013-03-10 03:30:30 +03:00
|
|
|
static void fill_picture(AVFilterContext *ctx, AVFrame *picref)
|
2011-12-08 20:07:52 +03:00
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = ctx->priv;
|
2011-12-08 20:07:52 +03:00
|
|
|
int i, j, k, row_idx = 0;
|
|
|
|
uint8_t *p0 = picref->data[0];
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
if (s->scroll && s->generation >= s->h)
|
2011-12-08 20:07:52 +03:00
|
|
|
/* show on top the oldest row */
|
2015-08-28 07:31:02 +02:00
|
|
|
row_idx = (s->buf_row_idx + 1) % s->h;
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
/* fill the output picture with the whole buffer */
|
2015-08-28 07:31:02 +02:00
|
|
|
for (i = 0; i < s->h; i++) {
|
2011-12-08 20:07:52 +03:00
|
|
|
uint8_t byte = 0;
|
2015-08-28 07:31:02 +02:00
|
|
|
uint8_t *row = s->buf + row_idx*s->w;
|
2011-12-08 20:07:52 +03:00
|
|
|
uint8_t *p = p0;
|
2015-08-28 07:31:02 +02:00
|
|
|
for (k = 0, j = 0; j < s->w; j++) {
|
2011-12-08 20:07:52 +03:00
|
|
|
byte |= row[j]<<(7-k++);
|
2015-08-28 07:31:02 +02:00
|
|
|
if (k==8 || j == s->w-1) {
|
2011-12-08 20:07:52 +03:00
|
|
|
k = 0;
|
|
|
|
*p++ = byte;
|
|
|
|
byte = 0;
|
|
|
|
}
|
|
|
|
}
|
2015-08-28 07:31:02 +02:00
|
|
|
row_idx = (row_idx + 1) % s->h;
|
2011-12-08 20:07:52 +03:00
|
|
|
p0 += picref->linesize[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int request_frame(AVFilterLink *outlink)
|
|
|
|
{
|
2015-08-28 07:31:02 +02:00
|
|
|
CellAutoContext *s = outlink->src->priv;
|
|
|
|
AVFrame *picref = ff_get_video_buffer(outlink, s->w, s->h);
|
2013-04-08 21:48:16 +03:00
|
|
|
if (!picref)
|
|
|
|
return AVERROR(ENOMEM);
|
2013-03-10 03:30:30 +03:00
|
|
|
picref->sample_aspect_ratio = (AVRational) {1, 1};
|
2015-08-28 07:31:02 +02:00
|
|
|
if (s->generation == 0 && s->start_full) {
|
2011-12-08 20:07:52 +03:00
|
|
|
int i;
|
2015-08-28 07:31:02 +02:00
|
|
|
for (i = 0; i < s->h-1; i++)
|
2011-12-08 20:07:52 +03:00
|
|
|
evolve(outlink->src);
|
|
|
|
}
|
|
|
|
fill_picture(outlink->src, picref);
|
|
|
|
evolve(outlink->src);
|
|
|
|
|
2015-08-28 07:31:02 +02:00
|
|
|
picref->pts = s->pts++;
|
2011-12-08 20:07:52 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
show_cellauto_row(outlink->src);
|
|
|
|
#endif
|
2013-03-13 11:57:05 +03:00
|
|
|
return ff_filter_frame(outlink, picref);
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int query_formats(AVFilterContext *ctx)
|
|
|
|
{
|
2012-10-08 21:54:00 +03:00
|
|
|
static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE };
|
2015-04-03 19:55:18 +02:00
|
|
|
AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
|
|
|
|
if (!fmts_list)
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
return ff_set_common_formats(ctx, fmts_list);
|
2011-12-08 20:07:52 +03:00
|
|
|
}
|
|
|
|
|
2012-11-28 22:01:59 +03:00
|
|
|
static const AVFilterPad cellauto_outputs[] = {
|
|
|
|
{
|
2013-09-07 15:13:50 +03:00
|
|
|
.name = "default",
|
|
|
|
.type = AVMEDIA_TYPE_VIDEO,
|
|
|
|
.request_frame = request_frame,
|
|
|
|
.config_props = config_props,
|
2012-11-28 22:01:59 +03:00
|
|
|
},
|
|
|
|
{ NULL }
|
|
|
|
};
|
|
|
|
|
2013-10-29 13:50:56 +03:00
|
|
|
AVFilter ff_vsrc_cellauto = {
|
2013-09-07 15:13:50 +03:00
|
|
|
.name = "cellauto",
|
|
|
|
.description = NULL_IF_CONFIG_SMALL("Create pattern generated by an elementary cellular automaton."),
|
|
|
|
.priv_size = sizeof(CellAutoContext),
|
|
|
|
.priv_class = &cellauto_class,
|
|
|
|
.init = init,
|
|
|
|
.uninit = uninit,
|
2011-12-08 20:07:52 +03:00
|
|
|
.query_formats = query_formats,
|
2012-11-28 22:01:59 +03:00
|
|
|
.inputs = NULL,
|
|
|
|
.outputs = cellauto_outputs,
|
2011-12-08 20:07:52 +03:00
|
|
|
};
|