[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/phpbb/captcha/ -> gd_wave.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\captcha;
  15  
  16  /**
  17  * Wave3D CAPTCHA
  18  */
  19  class gd_wave
  20  {
  21      var $width        = 360;
  22      var $height        = 96;
  23  
  24  	function execute($code, $seed)
  25      {
  26          // seed the random generator
  27          mt_srand($seed);
  28  
  29          // set height and width
  30          $img_x = $this->width;
  31          $img_y = $this->height;
  32  
  33          // Generate image
  34          $img    = imagecreatetruecolor($img_x, $img_y);
  35          $x_grid = mt_rand(6, 10);
  36          $y_grid = mt_rand(6, 10);
  37  
  38          // Ok, so lets cut to the chase. We could accurately represent this in 3d and
  39          // do all the appropriate linear transforms. my questions is... why bother?
  40          // The computational overhead is unnecessary when you consider the simple fact:
  41          // we're not here to accurately represent a model, but to just show off some random-ish
  42          // polygons
  43  
  44          // Conceive of 3 spaces.
  45          // 1) planar-space (discrete "pixel" grid)
  46          // 2) 3-space. (planar-space with z/height aspect)
  47          // 3) image space (pixels on the screen)
  48          // resolution of the planar-space we're embedding the text code in
  49          $plane_x    = 100;
  50          $plane_y    = 30;
  51  
  52          $subdivision_factor = 3;
  53  
  54          // $box is the 4 points in img_space that correspond to the corners of the plane in 3-space
  55          $box = array(
  56              'upper_left'    => array(
  57                  'x' => mt_rand(5, 15),
  58                  'y' => mt_rand(10, 15)
  59              ),
  60              'upper_right'    => array(
  61                  'x' => mt_rand($img_x - 35, $img_x - 19),
  62                  'y' => mt_rand(10, 17)
  63              ),
  64              'lower_left'    => array(
  65                  'x' => mt_rand($img_x - 45, $img_x - 5),
  66                  'y' => mt_rand($img_y - 15, $img_y - 0),
  67              ),
  68          );
  69  
  70          $box['lower_right'] = array(
  71              'x' => $box['lower_left']['x'] + $box['upper_left']['x'] - $box['upper_right']['x'],
  72              'y' => $box['lower_left']['y'] + $box['upper_left']['y'] - $box['upper_right']['y'],
  73          );
  74  
  75          // TODO
  76          $background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255));
  77          imagefill($img, 0, 0, $background);
  78  
  79          $random = array();
  80          $fontcolors = array();
  81  
  82          for ($i = 0; $i < 15; ++$i)
  83          {
  84              $random[$i] = imagecolorallocate($img, mt_rand(120, 255), mt_rand(120, 255), mt_rand(120, 255));
  85          }
  86  
  87          $fontcolors[0] = imagecolorallocate($img, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120));
  88  
  89          $colors = array();
  90  
  91          $minr = mt_rand(20, 30);
  92          $ming = mt_rand(20, 30);
  93          $minb = mt_rand(20, 30);
  94  
  95          $maxr = mt_rand(150, 230);
  96          $maxg = mt_rand(150, 230);
  97          $maxb = mt_rand(150, 230);
  98  
  99          for ($i = -30; $i <= 30; ++$i)
 100          {
 101              $coeff1 = ($i + 12) / 45;
 102              $coeff2 = 1 - $coeff1;
 103              $colors[$i] = imagecolorallocate($img, ($coeff2 * $maxr) + ($coeff1 * $minr), ($coeff2 * $maxg) + ($coeff1 * $ming), ($coeff2 * $maxb) + ($coeff1 * $minb));
 104          }
 105  
 106          // $img_buffer is the last row of 3-space positions (converted to img-space), cached
 107          // (using this means we don't need to recalculate all 4 positions for each new polygon,
 108          // merely the newest point that we're adding, which is then cached.
 109          $img_buffer = array(array(), array());
 110  
 111          // In image-space, the x- and y-offset necessary to move one unit in the x-direction in planar-space
 112          $dxx = ($box['upper_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_x);
 113          $dxy = ($box['upper_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_x);
 114  
 115          // In image-space, the x- and y-offset necessary to move one unit in the y-direction in planar-space
 116          $dyx = ($box['lower_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_y);
 117          $dyy = ($box['lower_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_y);
 118  
 119          // Initial captcha-letter offset in planar-space
 120          $plane_offset_x = mt_rand(3, 8);
 121          $plane_offset_y = mt_rand( 12, 15);
 122  
 123          // character map
 124          $map = $this->captcha_bitmaps();
 125  
 126          // matrix
 127          $plane = array();
 128  
 129          // for each character, we'll silkscreen it into our boolean pixel plane
 130          for ($c = 0, $code_num = strlen($code); $c < $code_num; ++$c)
 131          {
 132              $letter = $code[$c];
 133  
 134              for ($x = $map['width'] - 1; $x >= 0; --$x)
 135              {
 136                  for ($y = $map['height'] - 1; $y >= 0; --$y)
 137                  {
 138                      if ($map['data'][$letter][$y][$x])
 139                      {
 140                          $plane[$y + $plane_offset_y + (($c & 1) ? 1 : -1)][$x + $plane_offset_x] = true;
 141                      }
 142                  }
 143              }
 144              $plane_offset_x += 11;
 145          }
 146  
 147          // calculate our first buffer, we can't actually draw polys with these yet
 148          // img_pos_prev == screen x,y location to our immediate left.
 149          // img_pos_cur == current screen x,y location
 150          // we calculate screen position of our
 151          // current cell based on the difference from the previous cell
 152          // rather than recalculating from absolute coordinates
 153          // What we cache into the $img_buffer contains the raised text coordinates.
 154          $img_pos_prev    = $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']);
 155          $prev_height = $this->wave_height(0, 0, $subdivision_factor);
 156          $full_x            = $plane_x * $subdivision_factor;
 157          $full_y            = $plane_y * $subdivision_factor;
 158  
 159          for ($x = 1; $x <= $full_x; ++$x)
 160          {
 161              $cur_height        = $this->wave_height($x, 0, $subdivision_factor);
 162              $offset            = $cur_height - $prev_height;
 163              $img_pos_cur    = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
 164  
 165              $img_buffer[0][$x]    = $img_pos_cur;
 166              $img_pos_prev        = $img_pos_cur;
 167              $prev_height        = $cur_height;
 168          }
 169  
 170          for ($y = 1; $y <= $full_y; ++$y)
 171          {
 172              // swap buffers
 173              $buffer_cur        = $y & 1;
 174              $buffer_prev    = 1 - $buffer_cur;
 175  
 176              $prev_height    = $this->wave_height(0, $y, $subdivision_factor);
 177              $offset            = $prev_height - $this->wave_height(0, $y - 1, $subdivision_factor);
 178              $img_pos_cur    = array($img_buffer[$buffer_prev][0][0] + $dyx, min($img_buffer[$buffer_prev][0][1] + $dyy + $offset, $img_y - 1));
 179  
 180              // make sure we don't try to write off the page
 181              $img_pos_prev    = $img_pos_cur;
 182  
 183              $img_buffer[$buffer_cur][0]    = $img_pos_cur;
 184  
 185              for ($x = 1; $x <= $full_x; ++$x)
 186              {
 187                  $cur_height        = $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, $x_grid, $y_grid, 1);
 188  
 189                  // height is a z-factor, not a y-factor
 190                  $offset            = $cur_height - $prev_height;
 191                  $img_pos_cur    = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
 192  
 193                  // height is float, index it to an int, get closest color
 194                  $color            = $colors[intval($cur_height)];
 195                  $img_pos_prev    = $img_pos_cur;
 196                  $prev_height    = $cur_height;
 197  
 198                  $y_index_old = intval(($y - 1) / $subdivision_factor);
 199                  $y_index_new = intval($y / $subdivision_factor);
 200                  $x_index_old = intval(($x - 1) / $subdivision_factor);
 201                  $x_index_new = intval($x / $subdivision_factor);
 202  
 203                  if (!empty($plane[$y_index_new][$x_index_new]))
 204                  {
 205                      $img_pos_cur[1]    += $this->wave_height($x, $y, $subdivision_factor, 1) - 30 - $cur_height;
 206                      $color            = $colors[20];
 207                  }
 208                  $img_pos_cur[1] = min($img_pos_cur[1], $img_y - 1);
 209                  $img_buffer[$buffer_cur][$x] = $img_pos_cur;
 210  
 211                  // Smooth the edges as much as possible by having not more than one low<->high traingle per square
 212                  // Otherwise, just
 213                  $diag_down    = (empty($plane[$y_index_old][$x_index_old]) == empty($plane[$y_index_new][$x_index_new]));
 214                  $diag_up    = (empty($plane[$y_index_old][$x_index_new]) == empty($plane[$y_index_new][$x_index_old]));
 215  
 216                  // natural switching
 217                  $mode = ($x + $y) & 1;
 218  
 219                  // override if it requires it
 220                  if ($diag_down != $diag_up)
 221                  {
 222                      $mode = $diag_up;
 223                  }
 224  
 225                  if ($mode)
 226                  {
 227                      //        +-/              /
 228                      // 1    |/        2     /|
 229                      //        /            /-+
 230                      $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x]);
 231                      $poly2 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_cur][$x], $img_buffer[$buffer_prev][$x]);
 232                  }
 233                  else
 234                  {
 235                      //        \            \-+
 236                      // 1    |\        2     \|
 237                      //        +-\              \
 238                      $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_cur][$x]);
 239                      $poly2 = array_merge($img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x], $img_buffer[$buffer_cur][$x]);
 240                  }
 241  
 242                  imagefilledpolygon($img, $poly1, 3, $color);
 243                  imagefilledpolygon($img, $poly2, 3, $color);
 244              }
 245          }
 246  
 247          // Output image
 248          header('Content-Type: image/png');
 249          header('Cache-control: no-cache, no-store');
 250          //$mtime = explode(' ', microtime());
 251          //$totaltime = $mtime[0] + $mtime[1] - $starttime;
 252  
 253          //echo $totaltime . "<br />\n";
 254          //echo memory_get_usage() - $tmp;
 255          imagepng($img);
 256          imagedestroy($img);
 257      }
 258  
 259  	function wave_height($x, $y, $factor = 1, $tweak = 0.7)
 260      {
 261          // stretch the wave. TODO: pretty it up
 262          $x = $x/5 + 180;
 263          $y = $y/4;
 264          return ((sin($x / (3 * $factor)) + sin($y / (3 * $factor))) * 10 * $tweak);
 265      }
 266  
 267  	function grid_height($x, $y, $x_grid, $y_grid, $factor = 1)
 268      {
 269          return ((!($x % ($x_grid * $factor)) || !($y % ($y_grid * $factor))) ? 3 : 0);
 270      }
 271  
 272  	function captcha_bitmaps()
 273      {
 274          return array(
 275              'width'        => 9,
 276              'height'    => 13,
 277              'data'        => array(
 278                  'A' => array(
 279                      array(0,0,1,1,1,1,0,0,0),
 280                      array(0,1,0,0,0,0,1,0,0),
 281                      array(1,0,0,0,0,0,0,1,0),
 282                      array(1,0,0,0,0,0,0,1,0),
 283                      array(1,0,0,0,0,0,0,1,0),
 284                      array(1,0,0,0,0,0,0,1,0),
 285                      array(1,0,0,0,0,0,0,1,0),
 286                      array(1,1,1,1,1,1,1,1,0),
 287                      array(1,0,0,0,0,0,0,1,0),
 288                      array(1,0,0,0,0,0,0,1,0),
 289                      array(1,0,0,0,0,0,0,1,0),
 290                      array(1,0,0,0,0,0,0,1,0),
 291                      array(1,0,0,0,0,0,0,1,0),
 292                      array(0,0,0,0,0,0,0,0,0),
 293                  ),
 294                  'B' => array(
 295                      array(1,1,1,1,1,1,0,0,0),
 296                      array(1,0,0,0,0,0,1,0,0),
 297                      array(1,0,0,0,0,0,0,1,0),
 298                      array(1,0,0,0,0,0,0,1,0),
 299                      array(1,0,0,0,0,0,0,1,0),
 300                      array(1,0,0,0,0,0,1,0,0),
 301                      array(1,1,1,1,1,1,0,0,0),
 302                      array(1,0,0,0,0,0,1,0,0),
 303                      array(1,0,0,0,0,0,0,1,0),
 304                      array(1,0,0,0,0,0,0,1,0),
 305                      array(1,0,0,0,0,0,0,1,0),
 306                      array(1,0,0,0,0,0,1,0,0),
 307                      array(1,1,1,1,1,1,0,0,0),
 308                      array(0,0,0,0,0,0,0,0,0),
 309                  ),
 310                  'C' => array(
 311                      array(0,0,1,1,1,1,1,0,0),
 312                      array(0,1,0,0,0,0,0,1,0),
 313                      array(1,0,0,0,0,0,0,0,1),
 314                      array(1,0,0,0,0,0,0,0,0),
 315                      array(1,0,0,0,0,0,0,0,0),
 316                      array(1,0,0,0,0,0,0,0,0),
 317                      array(1,0,0,0,0,0,0,0,0),
 318                      array(1,0,0,0,0,0,0,0,0),
 319                      array(1,0,0,0,0,0,0,0,0),
 320                      array(1,0,0,0,0,0,0,0,1),
 321                      array(0,1,0,0,0,0,0,1,0),
 322                      array(0,0,1,1,1,1,1,0,0),
 323                      array(0,0,0,0,0,0,0,0,0),
 324                      array(0,0,0,0,0,0,0,0,0),
 325                  ),
 326                  'D' => array(
 327                      array(1,1,1,1,1,1,1,0,0),
 328                      array(1,0,0,0,0,0,0,1,0),
 329                      array(1,0,0,0,0,0,0,0,1),
 330                      array(1,0,0,0,0,0,0,0,1),
 331                      array(1,0,0,0,0,0,0,0,1),
 332                      array(1,0,0,0,0,0,0,0,1),
 333                      array(1,0,0,0,0,0,0,0,1),
 334                      array(1,0,0,0,0,0,0,0,1),
 335                      array(1,0,0,0,0,0,0,0,1),
 336                      array(1,0,0,0,0,0,0,1,0),
 337                      array(1,1,1,1,1,1,1,0,0),
 338                      array(0,0,0,0,0,0,0,0,0),
 339                      array(0,0,0,0,0,0,0,0,0),
 340                      array(0,0,0,0,0,0,0,0,0),
 341                  ),
 342                  'E' => array(
 343                      array(0,0,1,1,1,1,1,1,1),
 344                      array(0,1,0,0,0,0,0,0,0),
 345                      array(1,0,0,0,0,0,0,0,0),
 346                      array(1,0,0,0,0,0,0,0,0),
 347                      array(1,0,0,0,0,0,0,0,0),
 348                      array(1,1,1,1,1,1,1,0,0),
 349                      array(1,0,0,0,0,0,0,0,0),
 350                      array(1,0,0,0,0,0,0,0,0),
 351                      array(1,0,0,0,0,0,0,0,0),
 352                      array(0,1,0,0,0,0,0,0,0),
 353                      array(0,0,1,1,1,1,1,1,1),
 354                      array(0,0,0,0,0,0,0,0,0),
 355                      array(0,0,0,0,0,0,0,0,0),
 356                      array(0,0,0,0,0,0,0,0,0),
 357                  ),
 358                  'F' => array(
 359                      array(0,0,1,1,1,1,1,1,0),
 360                      array(0,1,0,0,0,0,0,0,0),
 361                      array(1,0,0,0,0,0,0,0,0),
 362                      array(1,0,0,0,0,0,0,0,0),
 363                      array(1,0,0,0,0,0,0,0,0),
 364                      array(1,1,1,1,1,1,0,0,0),
 365                      array(1,0,0,0,0,0,0,0,0),
 366                      array(1,0,0,0,0,0,0,0,0),
 367                      array(1,0,0,0,0,0,0,0,0),
 368                      array(1,0,0,0,0,0,0,0,0),
 369                      array(1,0,0,0,0,0,0,0,0),
 370                      array(1,0,0,0,0,0,0,0,0),
 371                      array(0,0,0,0,0,0,0,0,0),
 372                      array(0,0,0,0,0,0,0,0,0),
 373                  ),
 374                  'G' => array(
 375                      array(0,0,1,1,1,1,1,0,0),
 376                      array(0,1,0,0,0,0,0,1,0),
 377                      array(1,0,0,0,0,0,0,0,1),
 378                      array(1,0,0,0,0,0,0,0,1),
 379                      array(1,0,0,0,0,0,0,0,0),
 380                      array(1,0,0,0,0,0,0,0,0),
 381                      array(1,0,0,0,0,0,0,0,0),
 382                      array(1,0,0,0,0,0,0,1,1),
 383                      array(1,0,0,0,0,0,0,0,1),
 384                      array(1,0,0,0,0,0,0,0,1),
 385                      array(0,1,0,0,0,0,0,1,0),
 386                      array(0,0,1,1,1,1,1,0,0),
 387                      array(0,0,0,0,0,0,0,0,0),
 388                      array(0,0,0,0,0,0,0,0,0),
 389                  ),
 390                  'H' => array(
 391                      array(1,0,0,0,0,0,1,0,0),
 392                      array(1,0,0,0,0,0,1,0,0),
 393                      array(1,0,0,0,0,0,1,0,0),
 394                      array(1,0,0,0,0,0,1,0,0),
 395                      array(1,0,0,0,0,0,1,0,0),
 396                      array(1,1,1,1,1,1,1,0,0),
 397                      array(1,0,0,0,0,0,1,0,0),
 398                      array(1,0,0,0,0,0,1,0,0),
 399                      array(1,0,0,0,0,0,1,0,0),
 400                      array(1,0,0,0,0,0,1,0,0),
 401                      array(1,0,0,0,0,0,1,0,0),
 402                      array(0,0,0,0,0,0,0,0,0),
 403                      array(0,0,0,0,0,0,0,0,0),
 404                      array(0,0,0,0,0,0,0,0,0),
 405                  ),
 406                  'I' => array(
 407                      array(0,1,1,1,1,1,1,1,0),
 408                      array(0,0,0,0,1,0,0,0,0),
 409                      array(0,0,0,0,1,0,0,0,0),
 410                      array(0,0,0,0,1,0,0,0,0),
 411                      array(0,0,0,0,1,0,0,0,0),
 412                      array(0,0,0,0,1,0,0,0,0),
 413                      array(0,0,0,0,1,0,0,0,0),
 414                      array(0,0,0,0,1,0,0,0,0),
 415                      array(0,0,0,0,1,0,0,0,0),
 416                      array(0,1,1,1,1,1,1,1,0),
 417                      array(0,0,0,0,0,0,0,0,0),
 418                      array(0,0,0,0,0,0,0,0,0),
 419                      array(0,0,0,0,0,0,0,0,0),
 420                      array(0,0,0,0,0,0,0,0,0),
 421                  ),
 422                  'J' => array(
 423                      array(0,0,0,0,0,0,1,1,1),
 424                      array(0,0,0,0,0,0,0,0,1),
 425                      array(0,0,0,0,0,0,0,0,1),
 426                      array(0,0,0,0,0,0,0,0,1),
 427                      array(0,0,0,0,0,0,0,0,1),
 428                      array(0,0,0,0,0,0,0,0,1),
 429                      array(0,0,0,0,0,0,0,0,1),
 430                      array(0,1,0,0,0,0,0,0,1),
 431                      array(0,1,0,0,0,0,0,0,1),
 432                      array(0,0,1,0,0,0,0,1,0),
 433                      array(0,0,0,1,1,1,1,0,0),
 434                      array(0,0,0,0,0,0,0,0,0),
 435                      array(0,0,0,0,0,0,0,0,0),
 436                      array(0,0,0,0,0,0,0,0,0),
 437                  ),
 438                  'K' => array(
 439                      array(1,0,0,0,0,0,1,0,0),
 440                      array(1,0,0,0,0,1,0,0,0),
 441                      array(1,0,0,0,1,0,0,0,0),
 442                      array(1,0,0,1,0,0,0,0,0),
 443                      array(1,0,1,0,0,0,0,0,0),
 444                      array(1,1,0,0,0,0,0,0,0),
 445                      array(1,0,1,0,0,0,0,0,0),
 446                      array(1,0,0,1,0,0,0,0,0),
 447                      array(1,0,0,0,1,0,0,0,0),
 448                      array(1,0,0,0,0,1,0,0,0),
 449                      array(1,0,0,0,0,0,1,0,0),
 450                      array(0,0,0,0,0,0,0,0,0),
 451                      array(0,0,0,0,0,0,0,0,0),
 452                      array(0,0,0,0,0,0,0,0,0),
 453                  ),
 454                  'L' => array(
 455                      array(1,0,0,0,0,0,0,0,0),
 456                      array(1,0,0,0,0,0,0,0,0),
 457                      array(1,0,0,0,0,0,0,0,0),
 458                      array(1,0,0,0,0,0,0,0,0),
 459                      array(1,0,0,0,0,0,0,0,0),
 460                      array(1,0,0,0,0,0,0,0,0),
 461                      array(1,0,0,0,0,0,0,0,0),
 462                      array(1,0,0,0,0,0,0,0,0),
 463                      array(1,0,0,0,0,0,0,0,0),
 464                      array(0,1,0,0,0,0,0,0,0),
 465                      array(0,0,1,1,1,1,0,0,0),
 466                      array(0,0,0,0,0,0,0,0,0),
 467                      array(0,0,0,0,0,0,0,0,0),
 468                      array(0,0,0,0,0,0,0,0,0),
 469                  ),
 470                  'M' => array(
 471                      array(0,1,0,0,0,0,0,1,0),
 472                      array(0,1,1,0,0,0,1,1,0),
 473                      array(0,1,0,1,0,1,0,1,0),
 474                      array(0,1,0,0,1,0,0,1,0),
 475                      array(0,1,0,0,0,0,0,1,0),
 476                      array(0,1,0,0,0,0,0,1,0),
 477                      array(0,1,0,0,0,0,0,1,0),
 478                      array(0,1,0,0,0,0,0,1,0),
 479                      array(0,1,0,0,0,0,0,1,0),
 480                      array(0,0,0,0,0,0,0,0,0),
 481                      array(0,0,0,0,0,0,0,0,0),
 482                      array(0,0,0,0,0,0,0,0,0),
 483                      array(0,0,0,0,0,0,0,0,0),
 484                      array(0,0,0,0,0,0,0,0,0),
 485                  ),
 486                  'N' => array(
 487                      array(1,0,0,0,0,0,0,0,1),
 488                      array(1,1,0,0,0,0,0,0,1),
 489                      array(1,0,1,0,0,0,0,0,1),
 490                      array(1,0,0,1,0,0,0,0,1),
 491                      array(1,0,0,0,1,0,0,0,1),
 492                      array(1,0,0,0,0,1,0,0,1),
 493                      array(1,0,0,0,0,0,1,0,1),
 494                      array(1,0,0,0,0,0,0,1,1),
 495                      array(1,0,0,0,0,0,0,0,1),
 496                      array(0,0,0,0,0,0,0,0,0),
 497                      array(0,0,0,0,0,0,0,0,0),
 498                      array(0,0,0,0,0,0,0,0,0),
 499                      array(0,0,0,0,0,0,0,0,0),
 500                      array(0,0,0,0,0,0,0,0,0),
 501                  ),
 502                  'O' => array(
 503                      array(0,0,0,1,1,1,0,0,0),
 504                      array(0,0,1,0,0,0,1,0,0),
 505                      array(0,1,0,0,0,0,0,1,0),
 506                      array(1,0,0,0,0,0,0,0,1),
 507                      array(1,0,0,0,0,0,0,0,1),
 508                      array(1,0,0,0,0,0,0,0,1),
 509                      array(1,0,0,0,0,0,0,0,1),
 510                      array(1,0,0,0,0,0,0,0,1),
 511                      array(0,1,0,0,0,0,0,1,0),
 512                      array(0,0,1,0,0,0,1,0,0),
 513                      array(0,0,0,1,1,1,0,0,0),
 514                      array(0,0,0,0,0,0,0,0,0),
 515                      array(0,0,0,0,0,0,0,0,0),
 516                      array(0,0,0,0,0,0,0,0,0),
 517                  ),
 518                  'P' => array(
 519                      array(1,1,1,1,1,1,0,0,0),
 520                      array(1,0,0,0,0,0,1,0,0),
 521                      array(1,0,0,0,0,0,0,1,0),
 522                      array(1,0,0,0,0,0,0,1,0),
 523                      array(1,0,0,0,0,0,0,1,0),
 524                      array(1,0,0,0,0,0,0,1,0),
 525                      array(1,0,0,0,0,0,1,0,0),
 526                      array(1,1,1,1,1,1,0,0,0),
 527                      array(1,0,0,0,0,0,0,0,0),
 528                      array(1,0,0,0,0,0,0,0,0),
 529                      array(1,0,0,0,0,0,0,0,0),
 530                      array(1,0,0,0,0,0,0,0,0),
 531                      array(1,0,0,0,0,0,0,0,0),
 532                      array(0,0,0,0,0,0,0,0,0),
 533                  ),
 534                  'Q' => array(
 535                      array(0,0,1,1,1,1,0,0,0),
 536                      array(0,1,0,0,0,0,1,0,0),
 537                      array(1,0,0,0,0,0,0,1,0),
 538                      array(1,0,0,0,0,0,0,1,0),
 539                      array(1,0,0,0,0,0,0,1,0),
 540                      array(1,0,0,0,0,0,0,1,0),
 541                      array(1,0,0,0,1,0,0,1,0),
 542                      array(1,0,0,0,0,1,0,1,0),
 543                      array(0,1,0,0,0,0,1,0,0),
 544                      array(0,0,1,1,1,1,0,1,0),
 545                      array(0,0,0,0,0,0,0,0,1),
 546                      array(0,0,0,0,0,0,0,0,0),
 547                      array(0,0,0,0,0,0,0,0,0),
 548                      array(0,0,0,0,0,0,0,0,0),
 549                  ),
 550                  'R' => array(
 551                      array(1,1,1,1,1,1,0,0,0),
 552                      array(1,0,0,0,0,0,1,0,0),
 553                      array(1,0,0,0,0,0,0,1,0),
 554                      array(1,0,0,0,0,0,0,1,0),
 555                      array(1,0,0,0,0,0,0,1,0),
 556                      array(1,0,0,0,0,0,1,0,0),
 557                      array(1,1,1,1,1,1,0,0,0),
 558                      array(1,0,1,0,0,0,0,0,0),
 559                      array(1,0,0,1,0,0,0,0,0),
 560                      array(1,0,0,0,1,0,0,0,0),
 561                      array(1,0,0,0,0,1,0,0,0),
 562                      array(1,0,0,0,0,0,1,0,0),
 563                      array(0,0,0,0,0,0,0,0,0),
 564                      array(0,0,0,0,0,0,0,0,0),
 565                  ),
 566                  'S' => array(
 567                      array(0,0,1,1,1,1,1,1,1),
 568                      array(0,1,0,0,0,0,0,0,0),
 569                      array(1,0,0,0,0,0,0,0,0),
 570                      array(1,0,0,0,0,0,0,0,0),
 571                      array(1,0,0,0,0,0,0,0,0),
 572                      array(0,1,0,0,0,0,0,0,0),
 573                      array(0,0,1,1,1,1,1,0,0),
 574                      array(0,0,0,0,0,0,0,1,0),
 575                      array(0,0,0,0,0,0,0,0,1),
 576                      array(0,0,0,0,0,0,0,0,1),
 577                      array(0,0,0,0,0,0,0,1,0),
 578                      array(1,1,1,1,1,1,1,0,0),
 579                      array(0,0,0,0,0,0,0,0,0),
 580                      array(0,0,0,0,0,0,0,0,0),
 581                  ),
 582                  'T' => array(
 583                      array(1,1,1,1,1,1,1,1,1),
 584                      array(0,0,0,0,1,0,0,0,0),
 585                      array(0,0,0,0,1,0,0,0,0),
 586                      array(0,0,0,0,1,0,0,0,0),
 587                      array(0,0,0,0,1,0,0,0,0),
 588                      array(0,0,0,0,1,0,0,0,0),
 589                      array(0,0,0,0,1,0,0,0,0),
 590                      array(0,0,0,0,1,0,0,0,0),
 591                      array(0,0,0,0,1,0,0,0,0),
 592                      array(0,0,0,0,1,0,0,0,0),
 593                      array(0,0,0,0,1,0,0,0,0),
 594                      array(0,0,0,0,0,0,0,0,0),
 595                      array(0,0,0,0,0,0,0,0,0),
 596                      array(0,0,0,0,0,0,0,0,0),
 597                  ),
 598                  'U' => array(
 599                      array(1,0,0,0,0,0,0,0,1),
 600                      array(1,0,0,0,0,0,0,0,1),
 601                      array(1,0,0,0,0,0,0,0,1),
 602                      array(1,0,0,0,0,0,0,0,1),
 603                      array(1,0,0,0,0,0,0,0,1),
 604                      array(1,0,0,0,0,0,0,0,1),
 605                      array(1,0,0,0,0,0,0,0,1),
 606                      array(1,0,0,0,0,0,0,0,1),
 607                      array(1,0,0,0,0,0,0,0,1),
 608                      array(0,1,0,0,0,0,0,1,0),
 609                      array(0,0,1,1,1,1,1,0,0),
 610                      array(0,0,0,0,0,0,0,0,0),
 611                      array(0,0,0,0,0,0,0,0,0),
 612                      array(0,0,0,0,0,0,0,0,0),
 613                  ),
 614                  'V' => array(
 615                      array(1,0,0,0,0,0,0,0,1),
 616                      array(1,0,0,0,0,0,0,0,1),
 617                      array(1,0,0,0,0,0,0,0,1),
 618                      array(1,0,0,0,0,0,0,0,1),
 619                      array(1,0,0,0,0,0,0,0,1),
 620                      array(1,0,0,0,0,0,0,0,1),
 621                      array(1,0,0,0,0,0,0,0,1),
 622                      array(0,1,0,0,0,0,0,1,0),
 623                      array(0,0,1,0,0,0,1,0,0),
 624                      array(0,0,0,1,0,1,0,0,0),
 625                      array(0,0,0,0,1,0,0,0,0),
 626                      array(0,0,0,0,0,0,0,0,0),
 627                      array(0,0,0,0,0,0,0,0,0),
 628                      array(0,0,0,0,0,0,0,0,0),
 629                  ),
 630                  'W' => array(
 631                      array(1,0,0,0,0,0,0,0,1),
 632                      array(1,0,0,0,0,0,0,0,1),
 633                      array(1,0,0,0,0,0,0,0,1),
 634                      array(1,0,0,0,0,0,0,0,1),
 635                      array(1,0,0,0,1,0,0,0,1),
 636                      array(1,0,0,1,0,1,0,0,1),
 637                      array(1,0,1,0,0,0,1,0,1),
 638                      array(1,1,0,0,0,0,0,1,1),
 639                      array(1,0,0,0,0,0,0,0,1),
 640                      array(0,0,0,0,0,0,0,0,0),
 641                      array(0,0,0,0,0,0,0,0,0),
 642                      array(0,0,0,0,0,0,0,0,0),
 643                      array(0,0,0,0,0,0,0,0,0),
 644                      array(0,0,0,0,0,0,0,0,0),
 645                  ),
 646                  'X' => array(
 647                      array(1,0,0,0,0,0,0,0,1),
 648                      array(1,0,0,0,0,0,0,0,1),
 649                      array(0,1,0,0,0,0,0,1,0),
 650                      array(0,0,1,0,0,0,1,0,0),
 651                      array(0,0,0,1,0,1,0,0,0),
 652                      array(0,0,0,0,1,0,0,0,0),
 653                      array(0,0,0,1,0,1,0,0,0),
 654                      array(0,0,1,0,0,0,1,0,0),
 655                      array(0,1,0,0,0,0,0,1,0),
 656                      array(1,0,0,0,0,0,0,0,1),
 657                      array(1,0,0,0,0,0,0,0,1),
 658                      array(0,0,0,0,0,0,0,0,0),
 659                      array(0,0,0,0,0,0,0,0,0),
 660                      array(0,0,0,0,0,0,0,0,0),
 661                  ),
 662                  'Y' => array(
 663                      array(1,0,0,0,0,0,0,0,1),
 664                      array(1,0,0,0,0,0,0,0,1),
 665                      array(1,0,0,0,0,0,0,0,1),
 666                      array(0,1,0,0,0,0,0,1,0),
 667                      array(0,0,1,0,0,0,1,0,0),
 668                      array(0,0,0,1,0,1,0,0,0),
 669                      array(0,0,0,0,1,0,0,0,0),
 670                      array(0,0,0,0,1,0,0,0,0),
 671                      array(0,0,0,0,1,0,0,0,0),
 672                      array(0,0,0,0,1,0,0,0,0),
 673                      array(0,0,0,0,1,0,0,0,0),
 674                      array(0,0,0,0,0,0,0,0,0),
 675                      array(0,0,0,0,0,0,0,0,0),
 676                      array(0,0,0,0,0,0,0,0,0),
 677                  ),
 678                  'Z' => array(
 679                      array(1,1,1,1,1,1,1,1,1),
 680                      array(1,0,0,0,0,0,0,0,1),
 681                      array(0,0,0,0,0,0,0,1,0),
 682                      array(0,0,0,0,0,0,1,0,0),
 683                      array(0,0,0,0,0,1,0,0,0),
 684                      array(0,0,0,0,1,0,0,0,0),
 685                      array(0,0,0,1,0,0,0,0,0),
 686                      array(0,0,1,0,0,0,0,0,0),
 687                      array(0,1,0,0,0,0,0,0,0),
 688                      array(1,0,0,0,0,0,0,0,1),
 689                      array(1,1,1,1,1,1,1,1,1),
 690                      array(0,0,0,0,0,0,0,0,0),
 691                      array(0,0,0,0,0,0,0,0,0),
 692                      array(0,0,0,0,0,0,0,0,0),
 693                  ),
 694                  '1' => array(
 695                      array(0,0,0,0,1,0,0,0,0),
 696                      array(0,0,0,1,1,0,0,0,0),
 697                      array(0,0,1,0,1,0,0,0,0),
 698                      array(0,1,0,0,1,0,0,0,0),
 699                      array(0,0,0,0,1,0,0,0,0),
 700                      array(0,0,0,0,1,0,0,0,0),
 701                      array(0,0,0,0,1,0,0,0,0),
 702                      array(0,0,0,0,1,0,0,0,0),
 703                      array(0,0,0,0,1,0,0,0,0),
 704                      array(0,0,0,0,1,0,0,0,0),
 705                      array(0,0,0,0,1,0,0,0,0),
 706                      array(0,1,1,1,1,1,1,1,0),
 707                      array(0,0,0,0,0,0,0,0,0),
 708                      array(0,0,0,0,0,0,0,0,0),
 709                  ),
 710                  '2' => array(
 711                      array(0,0,0,1,1,1,0,0,0),
 712                      array(0,0,1,0,0,0,1,0,0),
 713                      array(0,1,0,0,0,0,0,1,0),
 714                      array(0,0,0,0,0,0,0,0,1),
 715                      array(0,0,0,0,0,0,0,0,1),
 716                      array(0,0,0,0,0,0,0,0,1),
 717                      array(0,0,0,0,0,0,0,1,0),
 718                      array(0,0,0,0,0,0,1,0,0),
 719                      array(0,0,0,0,0,1,0,0,0),
 720                      array(0,0,0,0,1,0,0,0,0),
 721                      array(0,0,0,1,0,0,0,0,0),
 722                      array(0,0,1,0,0,0,0,0,0),
 723                      array(0,1,1,1,1,1,1,1,1),
 724                      array(0,0,0,0,0,0,0,0,0),
 725                  ),
 726                  '3' => array(
 727                      array(0,0,0,1,1,1,1,0,0),
 728                      array(0,0,1,0,0,0,0,1,0),
 729                      array(0,1,0,0,0,0,0,0,1),
 730                      array(0,0,0,0,0,0,0,0,1),
 731                      array(0,0,0,0,0,0,0,0,1),
 732                      array(0,0,0,0,0,0,0,1,0),
 733                      array(0,0,0,0,0,1,1,0,0),
 734                      array(0,0,0,0,0,0,0,1,0),
 735                      array(0,0,0,0,0,0,0,0,1),
 736                      array(0,0,0,0,0,0,0,0,1),
 737                      array(0,1,0,0,0,0,0,0,1),
 738                      array(0,0,1,0,0,0,0,1,0),
 739                      array(0,0,0,1,1,1,1,0,0),
 740                      array(0,0,0,0,0,0,0,0,0),
 741                  ),
 742                  '4' => array(
 743                      array(0,0,0,0,0,0,0,1,0),
 744                      array(0,0,0,0,0,0,1,1,0),
 745                      array(0,0,0,0,0,1,0,1,0),
 746                      array(0,0,0,0,1,0,0,1,0),
 747                      array(0,0,0,1,0,0,0,1,0),
 748                      array(0,0,1,0,0,0,0,1,0),
 749                      array(0,1,1,1,1,1,1,1,1),
 750                      array(0,0,0,0,0,0,0,1,0),
 751                      array(0,0,0,0,0,0,0,1,0),
 752                      array(0,0,0,0,0,0,0,1,0),
 753                      array(0,0,0,0,0,0,0,1,0),
 754                      array(0,0,0,0,0,0,0,0,0),
 755                      array(0,0,0,0,0,0,0,0,0),
 756                      array(0,0,0,0,0,0,0,0,0),
 757                  ),
 758                  '5' => array(
 759                      array(1,1,1,1,1,1,1,1,1),
 760                      array(1,0,0,0,0,0,0,0,0),
 761                      array(1,0,0,0,0,0,0,0,0),
 762                      array(1,0,0,0,0,0,0,0,0),
 763                      array(0,1,0,0,0,0,0,0,0),
 764                      array(0,0,1,1,1,1,1,0,0),
 765                      array(0,0,0,0,0,0,0,1,0),
 766                      array(0,0,0,0,0,0,0,0,1),
 767                      array(1,0,0,0,0,0,0,0,1),
 768                      array(0,1,0,0,0,0,0,1,0),
 769                      array(0,0,1,1,1,1,1,0,0),
 770                      array(0,0,0,0,0,0,0,0,0),
 771                      array(0,0,0,0,0,0,0,0,0),
 772                      array(0,0,0,0,0,0,0,0,0),
 773                  ),
 774                  '6' => array(
 775                      array(0,0,1,1,1,1,1,0,0),
 776                      array(0,1,0,0,0,0,0,1,0),
 777                      array(1,0,0,0,0,0,0,0,1),
 778                      array(1,0,0,0,0,0,0,0,0),
 779                      array(1,0,0,0,0,0,0,0,0),
 780                      array(1,0,0,1,1,1,1,0,0),
 781                      array(1,0,1,0,0,0,0,1,0),
 782                      array(1,1,0,0,0,0,0,0,1),
 783                      array(1,0,0,0,0,0,0,0,1),
 784                      array(1,0,0,0,0,0,0,0,1),
 785                      array(0,1,0,0,0,0,0,1,0),
 786                      array(0,0,1,1,1,1,1,0,0),
 787                      array(0,0,0,0,0,0,0,0,0),
 788                      array(0,0,0,0,0,0,0,0,0),
 789                      array(0,0,0,0,0,0,0,0,0),
 790                  ),
 791                  '7' => array(
 792                      array(1,1,1,1,1,1,1,1,1),
 793                      array(1,0,0,0,0,0,0,0,1),
 794                      array(0,0,0,0,0,0,0,1,0),
 795                      array(0,0,0,0,0,0,1,0,0),
 796                      array(0,0,0,0,0,1,0,0,0),
 797                      array(0,0,0,0,1,0,0,0,0),
 798                      array(0,0,0,0,1,0,0,0,0),
 799                      array(0,0,0,0,1,0,0,0,0),
 800                      array(0,0,0,0,1,0,0,0,0),
 801                      array(0,0,0,0,1,0,0,0,0),
 802                      array(0,0,0,0,1,0,0,0,0),
 803                      array(0,0,0,0,0,0,0,0,0),
 804                      array(0,0,0,0,0,0,0,0,0),
 805                      array(0,0,0,0,0,0,0,0,0),
 806                  ),
 807                  '8' => array(
 808                      array(0,0,1,1,1,1,1,0,0),
 809                      array(0,1,0,0,0,0,0,1,0),
 810                      array(1,0,0,0,0,0,0,0,1),
 811                      array(1,0,0,0,0,0,0,0,1),
 812                      array(1,0,0,0,0,0,0,0,1),
 813                      array(0,1,0,0,0,0,0,1,0),
 814                      array(0,0,1,1,1,1,1,0,0),
 815                      array(0,1,0,0,0,0,0,1,0),
 816                      array(1,0,0,0,0,0,0,0,1),
 817                      array(1,0,0,0,0,0,0,0,1),
 818                      array(1,0,0,0,0,0,0,0,1),
 819                      array(0,1,0,0,0,0,0,1,0),
 820                      array(0,0,1,1,1,1,1,0,0),
 821                      array(0,0,0,0,0,0,0,0,0),
 822                  ),
 823                  '9' => array(
 824                      array(0,0,0,1,1,1,1,0,0),
 825                      array(0,0,1,0,0,0,0,1,0),
 826                      array(0,1,0,0,0,0,0,0,1),
 827                      array(0,1,0,0,0,0,0,0,1),
 828                      array(0,1,0,0,0,0,0,0,1),
 829                      array(0,1,0,0,0,0,0,1,1),
 830                      array(0,0,1,1,1,1,1,0,1),
 831                      array(0,0,0,0,0,0,0,0,1),
 832                      array(0,0,0,0,0,0,0,0,1),
 833                      array(0,1,0,0,0,0,0,0,1),
 834                      array(0,0,1,0,0,0,0,1,0),
 835                      array(0,0,0,1,1,1,1,0,0),
 836                      array(0,0,0,0,0,0,0,0,0),
 837                      array(0,0,0,0,0,0,0,0,0),
 838                  ),
 839              )
 840          );
 841      }
 842  }


Generated: Tue Apr 7 19:42:26 2020 Cross-referenced by PHPXref 0.7.1