cell - CELL language interpreter for visualization using SDL/OpenGL/PostScript/AVI/PDF

Version 1.15 / December 7, 2016


DTN simulator visualization

DTN simulator visualization with blurring

CCN simulator visualization with blurring

CCN simulator visualization with blurring and blue-yellow (#3) color map

DFC-BP+ visualization

DFC-BP+ visualization

Circuit-switching illustration (converted from PostScript)

M/M/1 queue illustration (converted from PostScript)


  cell [-dfN] [-c #] [-M class] [-F rate] [-L rate] [-A alpha] [-o file] [file...]


This manual page documents cell. This program is a one-pass interpreter of the CELL language, a simple line-oriented language for dynamic graphic drawing. cell read a source code written in the CELL language from the standard input or specified files. Every line in the source code is parsed and interpreted. The output is sent to either a window in SDL and OpenGL modes or a file in PostScript, AVI, and PDF modes.



Enable debugging using Smart::Comments module.


Run in full-screen mode in SDL and OpenGL modes. By default, the window size is set to 800x600 pixels.


Disable macro expansion with cpp (pre-processor for the C language).

-c #

Select the color map for gradient color. The color map is specified by the number (0 - 6). The supported color map is as follows.

  0: HSV (Hue Saturation Value)
  1: cyan-red
  2: blue-orange
  3: blue-yellow
  4: purple-green
  5: green-magenta
  6: green-red

Gradient colors are named as `heat0', `heat1', ..., `heat100'. With the color map 0 (HSV), `heat0' is blue, `heat50' is green, and `heat100' is red. With the color map 4 (purple-green), `heat0' is purple, `heat50' is white, and `heat100' is green.

-M class

Specify the monitor class. By default, `SDL' monitor class is used. The supported monitor classes are:

  SDL           Draw in a window with SDL library
  SDL_Filter    SDL with blurring filter
  OpenGL        Draw in a window with OpenGL library
  OpenGL_Filter OpenGL with blurring filter
  PostScript    Write to the standard out in PostScript language
  Export::AVI   Export to a file in AVI video format
  Export::PDF   Export to a file in PDF format
-F rate

The number of frames per animate/fade. The default frame rate is 30 (i.e., 30 frames per animate/fade).

-L rate

The maximum number of frames per second. The default frame rate is 30 (i.e., 30 frames per second).

-A alpha

The alpha value for SDL_Filter and OpenGL_Filter monitor classes. The default value is 128.

-o file

Specify the filename of the output file for Export::AVI and Export::PDF monitor classes.


  alpha (name|regexp) alpha
  animate name (goal_x goal_y|name[(+|-)dx(+|-)dy])
  attach name parent_name dx dy
  color (name|regexp) color
  define name bitmap file [(x y|name[(+|-)dx(+|-)dy])]
  define name box [-f color] [width height color (x y|name[(+|-)dx(+|-)dy])]
  define name ellipse [-f color] [rx ry color] [(x y|name[(+|-)dx(+|-)dy])]
  define name line [-ht] sx sy dx dy [width color]
  define name link src_name dst_name [width color]
  define name polygon [-f color] [-r degree] n r [color (x y|name[(+|-)dx(+|-)dy])]
  define name spline x1 y1 x2 y2 x3 y3 [width color]
  define name text [-lcr] string [size color (x y|name[(+|-)dx(+|-)dy])]
  define name wire [-ht] sx sy dx dy [width color]
  fade (name|regexp)...
  hide (name|regexp)...
  kill (name|regexp)...
  move (name|regexp) (x y|name[(+|-)dx(+|-)dy])
  palette symbol r g b [alpha]
  priority (name|regexp) level
  resize (name|regexp) (x y|name[(+|-)dx(+|-)dy])
  shift (name|regexp) dx dy
  scale (name|regexp) ratio
  sleep x
  spring [-f filter] [-r degree] (name|regexp)... [x1 y1 x2 y2]
  unhide (name|regexp)...


Many examples are found in ./ex directory in the source archive.

M/M/1 queue

  #define font_size 20
  #define packet_color gray80
  #define add_note_above(name, str) \
  define name##_note text str font_size white name+0-40
  #define add_note_below(name, str) \
  define name##_note text str font_size white name+0+40
  #define create_slot(name) \
    define name box -f black 10 50 white
  #define create_slot_at(name, pos) \
    create_slot(name) pos
  #define create_customer(name) \
    define name box -f black 10 50 packet_color
  #define create_customer_at(name, pos) \
    create_customer(name) pos
  define server ellipse -f black 30 30 white
  add_note_below(server, server) 
  move server_note server+.02+.08
  create_slot_at(b1, server-35+0)
  create_slot_at(b2, b1-10+0)
  create_slot_at(b3, b2-10+0)
  create_slot_at(b4, b3-10+0)
  create_slot_at(b5, b4-10+0)
  add_note_below(b5, buffer)
  move b5_note b5+0+.08
  define lb line -h .25 .5 b5-10+0 undef 2 black
  define la line -h server+30+0 undef .65 .5 2 black
  create_customer_at(c1, .33 .44)
  create_customer_at(c2, .36 .44)
  create_customer_at(c3, .56 .44)
  create_customer_at(c4, .62 .44)
  add_note_above(c1, customer)


The latest version of cell is available at


cell uses standard Perl's MakeMaker module. Thus, just type the following commands.

  perl Makefile.PL
  make install

cell depends on several standard and non-standard Perl modules available in CPAN: Class::Accessor::Lite, File::Temp, Jcode, List::MoreUtils, List::Util, OpenGL, SDL, Smart::Comments, and Time::HiRes.


Copyright (C) 2013-2016 Hiroyuki Ohsaki (ohsaki[atmark]

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


SDL(3pm), OpenGL(3pm)


Hiroyuki Ohsaki <ohsaki[atmark]>