Home | History | Annotate | Download | only in coders
      1 /*
      2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      3 %                                                                             %
      4 %                                                                             %
      5 %                                                                             %
      6 %              PPPP    AAA   TTTTT  TTTTT  EEEEE  RRRR   N   N                %
      7 %              P   P  A   A    T      T    E      R   R  NN  N                %
      8 %              PPPP   AAAAA    T      T    EEE    RRRR   N N N                %
      9 %              P      A   A    T      T    E      R R    N  NN                %
     10 %              P      A   A    T      T    EEEEE  R  R   N   N                %
     11 %                                                                             %
     12 %                                                                             %
     13 %                      Read/Write Pattern Image Format                        %
     14 %                                                                             %
     15 %                              Software Design                                %
     16 %                                   Cristy                                    %
     17 %                                 May 2003                                    %
     18 %                                                                             %
     19 %                                                                             %
     20 %  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization      %
     21 %  dedicated to making software imaging solutions freely available.           %
     22 %                                                                             %
     23 %  You may not use this file except in compliance with the License.  You may  %
     24 %  obtain a copy of the License at                                            %
     25 %                                                                             %
     26 %    http://www.imagemagick.org/script/license.php                            %
     27 %                                                                             %
     28 %  Unless required by applicable law or agreed to in writing, software        %
     29 %  distributed under the License is distributed on an "AS IS" BASIS,          %
     30 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
     31 %  See the License for the specific language governing permissions and        %
     32 %  limitations under the License.                                             %
     33 %                                                                             %
     34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     35 %
     36 %
     37 */
     38 
     39 /*
     41   Include declarations.
     42 */
     43 #include "MagickCore/studio.h"
     44 #include "MagickCore/blob.h"
     45 #include "MagickCore/blob-private.h"
     46 #include "MagickCore/exception.h"
     47 #include "MagickCore/exception-private.h"
     48 #include "MagickCore/image.h"
     49 #include "MagickCore/image-private.h"
     50 #include "MagickCore/list.h"
     51 #include "MagickCore/magick.h"
     52 #include "MagickCore/memory_.h"
     53 #include "MagickCore/quantum-private.h"
     54 #include "MagickCore/static.h"
     55 #include "MagickCore/string_.h"
     56 #include "MagickCore/module.h"
     57 
     58 /*
     60   Bricks pattern.
     61 */
     62 static const unsigned char
     63   BricksImage[] =
     64   {
     65     0x50, 0x34, 0x0A, 0x31, 0x36, 0x20, 0x31, 0x36, 0x0A, 0x00, 0x01, 0x00,
     66     0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF,
     67     0xFF, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
     68     0x00, 0x01, 0x00, 0xFF, 0xFF
     69   };
     70 
     71 /*
     72   Checkerboard pattern.
     73 */
     74 static const unsigned char
     75   CheckerboardImage[]=
     76   {
     77     0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x1E, 0x00, 0x1E, 0x00, 0xF0, 0x01,
     78     0x00, 0x66, 0x66, 0x66, 0x99, 0x99, 0x99, 0x21, 0xF9, 0x04, 0x00, 0x00,
     79     0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x1E, 0x00,
     80     0x00, 0x02, 0x42, 0x8C, 0x8F, 0x09, 0xCB, 0xED, 0x09, 0x91, 0x9B, 0x2D,
     81     0x5A, 0x8A, 0x6D, 0xC4, 0x54, 0x43, 0x3E, 0x79, 0x0A, 0x58, 0x89, 0x07,
     82     0x59, 0x9A, 0x01, 0xCA, 0xA8, 0x06, 0xBB, 0xB8, 0x2B, 0x2C, 0xC3, 0x40,
     83     0x4D, 0xBB, 0x36, 0xCE, 0xF2, 0x36, 0xEA, 0x23, 0x05, 0x41, 0x43, 0x4E,
     84     0x31, 0xA3, 0xCB, 0xA9, 0x76, 0xC9, 0x5E, 0x13, 0xF8, 0x14, 0x46, 0x89,
     85     0x53, 0x63, 0x15, 0xB9, 0x54, 0x9A, 0x98, 0xAA, 0x02, 0x00, 0x3B
     86   };
     87 
     88 /*
     89   Circles pattern.
     90 */
     91 static const unsigned char
     92   CirclesImage[] =
     93   {
     94     0x50, 0x34, 0x0A, 0x31, 0x36, 0x20, 0x31, 0x36, 0x0A, 0x07, 0xF0, 0x18,
     95     0x0C, 0x20, 0x02, 0x40, 0x01, 0x40, 0x01, 0x80, 0x00, 0x80, 0x00, 0x80,
     96     0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x40,
     97     0x01, 0x20, 0x02, 0x18, 0x0C
     98   };
     99 
    100 /*
    101   CrossHatch pattern.
    102 */
    103 static const unsigned char
    104   CrossHatchImage[] =
    105   {
    106     0x50, 0x34, 0x0A, 0x38, 0x20, 0x34, 0x0A, 0xFF, 0x11, 0x11, 0x11
    107   };
    108 
    109 /*
    110   CrossHatch30 pattern.
    111 */
    112 static const unsigned char
    113   CrossHatch30Image[] =
    114   {
    115     0x50, 0x34, 0x0A, 0x38, 0x20, 0x34, 0x0A, 0x81, 0x66, 0x18, 0x66
    116   };
    117 
    118 /*
    119   CrossHatch45 pattern.
    120 */
    121 static const unsigned char
    122   CrossHatch45Image[] =
    123   {
    124     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x88, 0x50, 0x20, 0x50, 0x88,
    125     0x05, 0x02, 0x05
    126   };
    127 
    128 /*
    129   FishScales pattern.
    130 */
    131 static const unsigned char
    132   FishScalesImage[] =
    133   {
    134     0x50, 0x34, 0x0A, 0x31, 0x36, 0x20, 0x38, 0x0A, 0x02, 0x40, 0x0C, 0x30,
    135     0x70, 0x0E, 0x80, 0x01, 0x40, 0x02, 0x30, 0x0C, 0x0E, 0x70, 0x01, 0x80
    136   };
    137 
    138 /*
    139   Gray100 pattern.
    140 */
    141 static const unsigned char
    142   Gray100Image[] =
    143   {
    144     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x00, 0x00, 0x00,
    145     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    146     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    147     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    148     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    149     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    150     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    151     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    152     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    153     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    154     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    155     0x00, 0x00, 0x00, 0x00, 0x00
    156   };
    157 
    158 /*
    159   Gray95 pattern.
    160 */
    161 static const unsigned char
    162   Gray95Image[] =
    163   {
    164     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x00, 0x00, 0x00,
    165     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,
    166     0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    167     0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    168     0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00,
    169     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10,
    170     0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    171     0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    172     0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
    173     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,
    174     0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    175     0x00, 0x10, 0x10, 0x10, 0x10
    176   };
    177 
    178 /*
    179   Gray90 pattern.
    180 */
    181 static const unsigned char
    182   Gray90Image[] =
    183   {
    184     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x08, 0x08, 0x08,
    185     0x08, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
    186     0x00, 0x80, 0x88, 0x80, 0x88, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22,
    187     0x22, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00,
    188     0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
    189     0x80, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
    190     0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22,
    191     0x22, 0x00, 0x00, 0x00, 0x00, 0x80, 0x88, 0x80, 0x88, 0x00, 0x00, 0x00,
    192     0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08,
    193     0x08, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
    194     0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22,
    195     0x22, 0x00, 0x00, 0x00, 0x00
    196   };
    197 
    198 /*
    199   Gray85 pattern.
    200 */
    201 static const unsigned char
    202   Gray85Image[] =
    203   {
    204     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x00, 0x00, 0x00,
    205     0x00, 0x88, 0x8A, 0x88, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22,
    206     0x22, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xA8, 0xA8, 0xA8, 0x00, 0x00, 0x00,
    207     0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x8A, 0x88, 0x8A,
    208     0x88, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
    209     0x00, 0xA8, 0xA8, 0xA8, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22,
    210     0x22, 0x00, 0x00, 0x00, 0x00, 0x88, 0x8A, 0x88, 0x8A, 0x00, 0x00, 0x00,
    211     0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xA8, 0xA8,
    212     0xA8, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
    213     0x00, 0x8A, 0x88, 0x8A, 0x88, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22,
    214     0x22, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xA8, 0xA8, 0xA8, 0x00, 0x00, 0x00,
    215     0x00, 0x22, 0x22, 0x22, 0x22
    216   };
    217 
    218 /*
    219   Gray80 pattern.
    220 */
    221 static const unsigned char
    222   Gray80Image[] =
    223   {
    224     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x00, 0x00, 0x00,
    225     0x00, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x51, 0x11, 0x51,
    226     0x11, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00,
    227     0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55,
    228     0x55, 0x00, 0x00, 0x00, 0x00, 0x51, 0x51, 0x51, 0x51, 0x00, 0x00, 0x00,
    229     0x00, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11,
    230     0x11, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00,
    231     0x00, 0x51, 0x11, 0x51, 0x11, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55,
    232     0x55, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00,
    233     0x00, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x51, 0x51, 0x51,
    234     0x51, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00,
    235     0x00, 0x11, 0x11, 0x11, 0x11
    236   };
    237 
    238 /*
    239   Gray75 pattern.
    240 */
    241 static const unsigned char
    242   Gray75Image[] =
    243   {
    244     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xAA, 0xAA, 0xAA,
    245     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    246     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    247     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    248     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    249     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    250     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    251     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    252     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    253     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    254     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    255     0xAA, 0x00, 0x00, 0x00, 0x00
    256   };
    257 
    258 /*
    259   Gray70 pattern.
    260 */
    261 static const unsigned char
    262   Gray70Image[] =
    263   {
    264     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xAA, 0xAA, 0xAA,
    265     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11,
    266     0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    267     0xAA, 0x01, 0x01, 0x01, 0x01, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    268     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA,
    269     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x01, 0x11,
    270     0x01, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    271     0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00,
    272     0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x01, 0x01, 0x01, 0x01, 0xAA, 0xAA, 0xAA,
    273     0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11,
    274     0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA,
    275     0xAA, 0x11, 0x01, 0x11, 0x01
    276   };
    277 
    278 /*
    279   Gray65 pattern.
    280 */
    281 static const unsigned char
    282   Gray65Image[] =
    283   {
    284     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x44, 0x44, 0x44,
    285     0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x01, 0x01, 0x01, 0x01, 0xAA, 0xAA, 0xAA,
    286     0xAA, 0x44, 0x44, 0x44, 0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x10, 0x11,
    287     0x10, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x44, 0x44, 0x44, 0xAA, 0xAA, 0xAA,
    288     0xAA, 0x01, 0x01, 0x01, 0x01, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x44, 0x44,
    289     0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x10, 0x10, 0x10, 0x10, 0xAA, 0xAA, 0xAA,
    290     0xAA, 0x44, 0x44, 0x44, 0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x01, 0x01, 0x01,
    291     0x01, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x44, 0x44, 0x44, 0xAA, 0xAA, 0xAA,
    292     0xAA, 0x11, 0x10, 0x11, 0x10, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x44, 0x44,
    293     0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x01, 0x01, 0x01, 0x01, 0xAA, 0xAA, 0xAA,
    294     0xAA, 0x44, 0x44, 0x44, 0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x10, 0x10, 0x10,
    295     0x10, 0xAA, 0xAA, 0xAA, 0xAA
    296   };
    297 
    298 /*
    299   Gray60 pattern.
    300 */
    301 static const unsigned char
    302   Gray60Image[] =
    303   {
    304     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x11, 0x11, 0x11,
    305     0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x45, 0x44, 0x45, 0xAA, 0xAA, 0xAA,
    306     0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x54, 0x54, 0x54,
    307     0x54, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA,
    308     0xAA, 0x45, 0x44, 0x45, 0x44, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11,
    309     0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x54, 0x54, 0x54, 0x54, 0xAA, 0xAA, 0xAA,
    310     0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x45, 0x44,
    311     0x45, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA,
    312     0xAA, 0x54, 0x54, 0x54, 0x54, 0xAA, 0xAA, 0xAA, 0xAA, 0x11, 0x11, 0x11,
    313     0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x45, 0x44, 0x45, 0x44, 0xAA, 0xAA, 0xAA,
    314     0xAA, 0x11, 0x11, 0x11, 0x11, 0xAA, 0xAA, 0xAA, 0xAA, 0x54, 0x54, 0x54,
    315     0x54, 0xAA, 0xAA, 0xAA, 0xAA
    316   };
    317 
    318 /*
    319   Gray55 pattern.
    320 */
    321 static const unsigned char
    322   Gray55Image[] =
    323   {
    324     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x55, 0x55, 0x55,
    325     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0x2A, 0x2A, 0x2A,
    326     0x2A, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    327     0x55, 0x22, 0x22, 0x22, 0x22, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    328     0xAA, 0x55, 0x55, 0x55, 0x55, 0x22, 0x2A, 0x22, 0x2A, 0x55, 0x55, 0x55,
    329     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0x22, 0x22, 0x22,
    330     0x22, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    331     0x55, 0x2A, 0x2A, 0x2A, 0x2A, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    332     0xAA, 0x55, 0x55, 0x55, 0x55, 0x22, 0x22, 0x22, 0x22, 0x55, 0x55, 0x55,
    333     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0x22, 0x2A, 0x22,
    334     0x2A, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    335     0x55, 0x22, 0x22, 0x22, 0x22
    336   };
    337 
    338 /*
    339   Gray50 pattern.
    340 */
    341 static const unsigned char
    342   Gray50Image[] =
    343   {
    344     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xAA, 0xAA, 0xAA,
    345     0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    346     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    347     0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    348     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    349     0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    350     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    351     0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    352     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    353     0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    354     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    355     0xAA, 0x55, 0x55, 0x55, 0x55
    356   };
    357 
    358 /*
    359   Gray45 pattern.
    360 */
    361 static const unsigned char
    362   Gray45Image[] =
    363   {
    364     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xBB, 0xBB, 0xBB,
    365     0xBB, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    366     0x55, 0xAB, 0xAB, 0xAB, 0xAB, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    367     0xAA, 0x55, 0x55, 0x55, 0x55, 0xBB, 0xBB, 0xBB, 0xBB, 0x55, 0x55, 0x55,
    368     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xBB, 0xAB, 0xBB,
    369     0xAB, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    370     0x55, 0xBB, 0xBB, 0xBB, 0xBB, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    371     0xAA, 0x55, 0x55, 0x55, 0x55, 0xAB, 0xAB, 0xAB, 0xAB, 0x55, 0x55, 0x55,
    372     0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0xBB, 0xBB, 0xBB,
    373     0xBB, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55,
    374     0x55, 0xBB, 0xAB, 0xBB, 0xAB, 0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA,
    375     0xAA, 0x55, 0x55, 0x55, 0x55
    376   };
    377 
    378 /*
    379   Gray40 pattern.
    380 */
    381 static const unsigned char
    382   Gray40Image[] =
    383   {
    384     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xEE, 0xEE, 0xEE,
    385     0xEE, 0x55, 0x55, 0x55, 0x55, 0xAB, 0xAB, 0xAB, 0xAB, 0x55, 0x55, 0x55,
    386     0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x55, 0xBB, 0xBA, 0xBB,
    387     0xBA, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55,
    388     0x55, 0xAB, 0xAB, 0xAB, 0xAB, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE,
    389     0xEE, 0x55, 0x55, 0x55, 0x55, 0xBA, 0xBB, 0xBA, 0xBB, 0x55, 0x55, 0x55,
    390     0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x55, 0xAB, 0xAB, 0xAB,
    391     0xAB, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55,
    392     0x55, 0xBB, 0xBA, 0xBB, 0xBA, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE,
    393     0xEE, 0x55, 0x55, 0x55, 0x55, 0xAB, 0xAB, 0xAB, 0xAB, 0x55, 0x55, 0x55,
    394     0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x55, 0xBA, 0xBB, 0xBA,
    395     0xBB, 0x55, 0x55, 0x55, 0x55
    396   };
    397 
    398 /*
    399   Gray35 pattern.
    400 */
    401 static const unsigned char
    402   Gray35Image[] =
    403   {
    404     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xAA, 0xAA, 0xAA,
    405     0xAA, 0xDD, 0xDD, 0xDD, 0xDD, 0xAA, 0xAA, 0xAA, 0xAA, 0x7F, 0x7F, 0x7F,
    406     0x7F, 0xAA, 0xAA, 0xAA, 0xAA, 0xDD, 0xDD, 0xDD, 0xDD, 0xAA, 0xAA, 0xAA,
    407     0xAA, 0x77, 0xF7, 0x77, 0xF7, 0xAA, 0xAA, 0xAA, 0xAA, 0xDD, 0xDD, 0xDD,
    408     0xDD, 0xAA, 0xAA, 0xAA, 0xAA, 0x7F, 0x7F, 0x7F, 0x7F, 0xAA, 0xAA, 0xAA,
    409     0xAA, 0xDD, 0xDD, 0xDD, 0xDD, 0xAA, 0xAA, 0xAA, 0xAA, 0xF7, 0xF7, 0xF7,
    410     0xF7, 0xAA, 0xAA, 0xAA, 0xAA, 0xDD, 0xDD, 0xDD, 0xDD, 0xAA, 0xAA, 0xAA,
    411     0xAA, 0x7F, 0x7F, 0x7F, 0x7F, 0xAA, 0xAA, 0xAA, 0xAA, 0xDD, 0xDD, 0xDD,
    412     0xDD, 0xAA, 0xAA, 0xAA, 0xAA, 0x77, 0xF7, 0x77, 0xF7, 0xAA, 0xAA, 0xAA,
    413     0xAA, 0xDD, 0xDD, 0xDD, 0xDD, 0xAA, 0xAA, 0xAA, 0xAA, 0x7F, 0x7F, 0x7F,
    414     0x7F, 0xAA, 0xAA, 0xAA, 0xAA, 0xDD, 0xDD, 0xDD, 0xDD, 0xAA, 0xAA, 0xAA,
    415     0xAA, 0xF7, 0xF7, 0xF7, 0xF7
    416   };
    417 
    418 /*
    419   Gray30 pattern.
    420 */
    421 static const unsigned char
    422   Gray30Image[] =
    423   {
    424     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xFF, 0xFF, 0xFF,
    425     0xFF, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55,
    426     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xFE, 0xEE,
    427     0xFE, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    428     0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    429     0xFF, 0x55, 0x55, 0x55, 0x55, 0xFE, 0xFE, 0xFE, 0xFE, 0x55, 0x55, 0x55,
    430     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE,
    431     0xEE, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    432     0x55, 0xEE, 0xFE, 0xEE, 0xFE, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    433     0xFF, 0x55, 0x55, 0x55, 0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0x55, 0x55,
    434     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xFE, 0xFE, 0xFE,
    435     0xFE, 0x55, 0x55, 0x55, 0x55
    436   };
    437 
    438 /*
    439   Gray25 pattern.
    440 */
    441 static const unsigned char
    442   Gray25Image[] =
    443   {
    444     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xFF, 0xFF, 0xFF,
    445     0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    446     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    447     0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    448     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    449     0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    450     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    451     0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    452     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    453     0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55,
    454     0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x55, 0x55, 0x55, 0xFF, 0xFF, 0xFF,
    455     0xFF, 0x55, 0x55, 0x55, 0x55
    456   };
    457 
    458 /*
    459   Gray20 pattern.
    460 */
    461 static const unsigned char
    462   Gray20Image[] =
    463   {
    464     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xAA, 0xAA, 0xAA,
    465     0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBB, 0xBB, 0xBB, 0xFF, 0xFF, 0xFF,
    466     0xFF, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xBB, 0xBA,
    467     0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF,
    468     0xFF, 0xBB, 0xBB, 0xBB, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA, 0xAA,
    469     0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xBA, 0xBA, 0xBA, 0xFF, 0xFF, 0xFF,
    470     0xFF, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBB, 0xBB,
    471     0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF,
    472     0xFF, 0xBA, 0xBB, 0xBA, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA, 0xAA,
    473     0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBB, 0xBB, 0xBB, 0xFF, 0xFF, 0xFF,
    474     0xFF, 0xAA, 0xAA, 0xAA, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xBA, 0xBA,
    475     0xBA, 0xFF, 0xFF, 0xFF, 0xFF
    476   };
    477 
    478 /*
    479   Gray15 pattern.
    480 */
    481 static const unsigned char
    482   Gray15Image[] =
    483   {
    484     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0x77, 0x77, 0x77,
    485     0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0x5D, 0x5D, 0x5D, 0xFF, 0xFF, 0xFF,
    486     0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xD5, 0xDD, 0xD5,
    487     0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF,
    488     0xFF, 0xDD, 0x5D, 0x5D, 0x5D, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77,
    489     0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xD5, 0xDD, 0xD5, 0xFF, 0xFF, 0xFF,
    490     0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0x5D, 0x5D,
    491     0x5D, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF,
    492     0xFF, 0xD5, 0xDD, 0xD5, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77,
    493     0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0x5D, 0x5D, 0x5D, 0xFF, 0xFF, 0xFF,
    494     0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xD5, 0xDD,
    495     0xD5, 0xFF, 0xFF, 0xFF, 0xFF
    496   };
    497 
    498 /*
    499   Gray10 pattern.
    500 */
    501 static const unsigned char
    502   Gray10Image[] =
    503   {
    504     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xFF, 0xFF, 0xFF,
    505     0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xDF,
    506     0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF,
    507     0xFF, 0xFD, 0xDD, 0xFD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77,
    508     0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF,
    509     0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFD, 0xFD,
    510     0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF,
    511     0xFF, 0xDF, 0xDF, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77,
    512     0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xFD, 0xDD, 0xFF, 0xFF, 0xFF,
    513     0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xDF,
    514     0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x77, 0x77, 0x77, 0xFF, 0xFF, 0xFF,
    515     0xFF, 0xFD, 0xFD, 0xFD, 0xFD
    516   };
    517 
    518 /*
    519   Gray5 pattern.
    520 */
    521 static const unsigned char
    522   Gray5Image[] =
    523   {
    524     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xFF, 0xFF, 0xFF,
    525     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xDD,
    526     0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    527     0xFF, 0xDF, 0xDF, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    528     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF,
    529     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xDF,
    530     0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    531     0xFF, 0xDD, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    532     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF,
    533     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xDD,
    534     0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    535     0xFF, 0xDF, 0xDF, 0xDF, 0xDF
    536   };
    537 
    538 /*
    539   Gray0 pattern.
    540 */
    541 static const unsigned char
    542   Gray0Image[] =
    543   {
    544     0x50, 0x34, 0x0A, 0x33, 0x32, 0x20, 0x33, 0x32, 0x0A, 0xFF, 0xFF, 0xFF,
    545     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    546     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    547     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    548     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    549     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    550     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    551     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    552     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    553     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    554     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    555     0xFF, 0xFF, 0xFF, 0xFF, 0xFF
    556   };
    557 
    558 /*
    559   Hexagons pattern.
    560 */
    561 static const unsigned char
    562   HexagonsImage[] =
    563   {
    564     0x50, 0x34, 0x0A, 0x33, 0x30, 0x20, 0x31, 0x38, 0x0A, 0x10, 0x01, 0x00,
    565     0x00, 0x10, 0x01, 0x00, 0x00, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80,
    566     0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x80, 0x00, 0x20,
    567     0x00, 0x80, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1F, 0xFC, 0x80, 0x00, 0x20,
    568     0x00, 0x80, 0x00, 0x20, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40,
    569     0x00, 0x20, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x00, 0x10, 0x01, 0x00,
    570     0x00, 0x10, 0x01, 0x00, 0x00, 0x0F, 0xFE, 0x00, 0x00
    571   };
    572 
    573 /*
    574   Horizontal pattern.
    575 */
    576 static const unsigned char
    577   HorizontalImage[] =
    578   {
    579     0x50, 0x34, 0x0A, 0x38, 0x20, 0x34, 0x0A, 0xFF, 0x00, 0x00, 0x00
    580   };
    581 
    582 /*
    583   Horizontal-2 pattern.
    584 */
    585 static const unsigned char
    586   Horizontal2Image[] =
    587   {
    588     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
    589     0x00, 0xFF, 0x00
    590   };
    591 
    592 /*
    593   Horizontal-3 pattern.
    594 */
    595 static const unsigned char
    596   Horizontal3Image[] =
    597   {
    598     0x50, 0x34, 0x0A, 0x39, 0x20, 0x39, 0x0A, 0x00, 0x00, 0x00, 0x00, 0xFF,
    599     0x80, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0xFF,
    600     0x80,
    601   };
    602 
    603 /*
    604   HorizontalSaw pattern.
    605 */
    606 static const unsigned char
    607   HorizontalSawImage[] =
    608   {
    609     0x50, 0x34, 0x0A, 0x31, 0x36, 0x20, 0x38, 0x0A, 0x00, 0x00, 0x00, 0x00,
    610     0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x01, 0x01
    611   };
    612 
    613 /*
    614   HS_BDIAGONAL pattern (Windows GDI HS_BDIAGONAL)
    615 */
    616 static const unsigned char
    617   HS_BDIAGONALImage[] =
    618   {
    619     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x01, 0x02, 0x04, 0x08, 0x10,
    620     0x20, 0x40, 0x80
    621   };
    622 
    623 /*
    624   HS_CROSS pattern (Windows GDI HS_CROSS)
    625 */
    626 static const unsigned char
    627   HS_CROSSImage[] =
    628   {
    629     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x10, 0x10, 0x10, 0xFF, 0x10,
    630     0x10, 0x10, 0x10
    631   };
    632 
    633 /*
    634   HS_DIAGCROSS pattern (Windows GDI HS_DIAGCROSS)
    635 */
    636 static const unsigned char
    637   HS_DIAGCROSSImage[] =
    638   {
    639     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x81, 0x42, 0x24, 0x18, 0x18,
    640     0x24, 0x42, 0x81
    641   };
    642 
    643 /*
    644   HS_FDIAGONAL pattern (Windows GDI HS_FDIAGONAL)
    645 */
    646 static const unsigned char
    647   HS_FDIAGONALImage[] =
    648   {
    649     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x80, 0x40, 0x20, 0x10, 0x08,
    650     0x04, 0x02, 0x01
    651   };
    652 
    653 /*
    654   HS_HORIZONTAL pattern (Windows GDI HS_HORIZONTAL)
    655 */
    656 static const unsigned char
    657   HS_HORIZONTALImage[] =
    658   {
    659     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x00, 0x00, 0x00, 0xFF, 0x00,
    660     0x00, 0x00, 0x00
    661   };
    662 
    663 /*
    664   HS_VERTICAL pattern (Windows GDI HS_VERTICAL)
    665 */
    666 static const unsigned char
    667   HS_VERTICALImage[] =
    668   {
    669     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x10, 0x10, 0x10, 0x10, 0x10,
    670     0x10, 0x10, 0x10
    671   };
    672 
    673 /*
    674   Left30 pattern.
    675 */
    676 static const unsigned char
    677   Left30Image[] =
    678   {
    679     0x50, 0x34, 0x0A, 0x38, 0x20, 0x34, 0x0A, 0xC0, 0x30, 0x0C, 0x03
    680   };
    681 
    682 /*
    683   Left45 pattern.
    684 */
    685 static const unsigned char
    686   Left45Image[] =
    687   {
    688     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x80, 0x40, 0x20, 0x10, 0x08,
    689     0x04, 0x02, 0x01
    690   };
    691 
    692 /*
    693   LeftShingle pattern.
    694 */
    695 static const unsigned char
    696   LeftShingleImage[] =
    697   {
    698     0x50, 0x34, 0x0A, 0x32, 0x34, 0x20, 0x32, 0x34, 0x0A, 0x00, 0x00, 0x01,
    699     0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04,
    700     0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00,
    701     0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00,
    702     0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00,
    703     0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00,
    704     0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0xFF, 0xFF, 0xFF
    705   };
    706 
    707 /*
    708   Octagons image declaration.
    709 */
    710 static const unsigned char
    711   OctagonsImage[] =
    712   {
    713     0x50, 0x34, 0x0A, 0x31, 0x36, 0x20, 0x31, 0x36, 0x0A, 0x07, 0xF0, 0x08,
    714     0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x80, 0x00, 0x80,
    715     0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x20,
    716     0x02, 0x10, 0x04, 0x08, 0x08
    717   };
    718 
    719 /*
    720   Right30 pattern.
    721 */
    722 static const unsigned char
    723   Right30Image[] =
    724   {
    725     0x50, 0x34, 0x0A, 0x38, 0x20, 0x34, 0x0A, 0x03, 0x0C, 0x30, 0xC0
    726   };
    727 
    728 /*
    729   Right45 pattern.
    730 */
    731 static const unsigned char
    732   Right45Image[] =
    733   {
    734     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x01, 0x02, 0x04, 0x08, 0x10,
    735     0x20, 0x40, 0x80
    736   };
    737 
    738 /*
    739   RightShingle pattern.
    740 */
    741 static const unsigned char
    742   RightShingleImage[] =
    743   {
    744     0x50, 0x34, 0x0A, 0x32, 0x34, 0x20, 0x32, 0x34, 0x0A, 0x00, 0x00, 0x08,
    745     0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02,
    746     0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x08, 0x00,
    747     0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00,
    748     0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0x08, 0x00, 0x00,
    749     0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00,
    750     0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xFF
    751   };
    752 
    753 /*
    754   SmallFishScales pattern.
    755 */
    756 static const unsigned char
    757   SmallFishScalesImage[] =
    758   {
    759     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x80, 0x80, 0x41, 0x36, 0x08,
    760     0x08, 0x14, 0x63
    761   };
    762 
    763 /*
    764   Vertical pattern.
    765 */
    766 static const unsigned char
    767   VerticalImage[] =
    768   {
    769     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0x11, 0x11, 0x11, 0x11, 0x11,
    770     0x11, 0x11, 0x11
    771   };
    772 
    773 /*
    774   Vertical-2 pattern.
    775 */
    776 static const unsigned char
    777   Vertical2Image[] =
    778   {
    779     0x50, 0x34, 0x0A, 0x38, 0x20, 0x38, 0x0A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
    780     0xAA, 0xAA, 0xAA
    781   };
    782 
    783 /*
    784   Vertical-2 pattern.
    785 */
    786 static const unsigned char
    787   Vertical3Image[] =
    788   {
    789     0x50, 0x34, 0x0A, 0x39, 0x20, 0x39, 0x0A, 0x24, 0x80, 0x24, 0x80, 0x24,
    790     0x80, 0x24, 0x80, 0x24, 0x80, 0x24, 0x80, 0x24, 0x80, 0x24, 0x80, 0x24,
    791     0x80
    792   };
    793 
    794 /*
    795   VerticalBricks pattern.
    796 */
    797 static const unsigned char
    798   VerticalBricksImage[] =
    799   {
    800     0x50, 0x34, 0x0A, 0x31, 0x36, 0x20, 0x31, 0x36, 0x0A, 0xFF, 0x01, 0x01,
    801     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
    802     0x01, 0x01, 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
    803     0x01, 0x01, 0x01, 0x01, 0x01
    804   };
    805 
    806 /*
    807   VerticalLeftShingle pattern.
    808 */
    809 static const unsigned char
    810   VerticalLeftShingleImage[] =
    811   {
    812     0x50, 0x34, 0x0A, 0x32, 0x34, 0x20, 0x32, 0x34, 0x0A, 0x01, 0x01, 0x01,
    813     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81,
    814     0x01, 0x01, 0x61, 0x01, 0x01, 0x19, 0x01, 0x01, 0x07, 0x01, 0x01, 0x01,
    815     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x01,
    816     0x01, 0x61, 0x01, 0x01, 0x19, 0x01, 0x01, 0x07, 0x01, 0x01, 0x01, 0x01,
    817     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x01, 0x01,
    818     0x61, 0x01, 0x01, 0x19, 0x01, 0x01, 0x07, 0x01, 0x01
    819   };
    820 
    821 /*
    822   VerticalRightShingle pattern.
    823 */
    824 static const unsigned char
    825   VerticalRightShingleImage[] =
    826   {
    827     0x50, 0x34, 0x0A, 0x32, 0x34, 0x20, 0x32, 0x34, 0x0A, 0x01, 0x01, 0x01,
    828     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01,
    829     0x01, 0x0D, 0x01, 0x01, 0x31, 0x01, 0x01, 0xC1, 0x01, 0x01, 0x01, 0x01,
    830     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03,
    831     0x01, 0x01, 0x0D, 0x01, 0x01, 0x31, 0x01, 0x01, 0xC1, 0x01, 0x01, 0x01,
    832     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01,
    833     0x0D, 0x01, 0x01, 0x31, 0x01, 0x01, 0xC1, 0x01, 0x01
    834   };
    835 
    836 /*
    837   VerticalSaw pattern.
    838 */
    839 static const unsigned char
    840   VerticalSawImage[] =
    841   {
    842     0x50, 0x34, 0x0A, 0x38, 0x20, 0x31, 0x36, 0x0A, 0x40, 0x20, 0x10, 0x08,
    843     0x10, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, 0x08, 0x10, 0x20, 0x40, 0x80
    844   };
    845 
    846 typedef struct _PatternInfo
    847 {
    848   char
    849     name[MagickPathExtent],
    850     magick[MagickPathExtent];
    851 
    852   const void
    853     *blob;
    854 
    855   size_t
    856     extent;
    857 } PatternInfo;
    858 
    859 static const PatternInfo
    860   PatternImageList[] =
    861   {
    862     { "BRICKS", "PBM", BricksImage, sizeof(BricksImage) },
    863     { "CHECKERBOARD", "GIF", CheckerboardImage, sizeof(CheckerboardImage) },
    864     { "CIRCLES", "PBM", CirclesImage, sizeof(CirclesImage) },
    865     { "CROSSHATCH", "PBM", CrossHatchImage, sizeof(CrossHatchImage) },
    866     { "CROSSHATCH30", "PBM", CrossHatch30Image, sizeof(CrossHatch30Image) },
    867     { "CROSSHATCH45", "PBM", CrossHatch45Image, sizeof(CrossHatch45Image) },
    868     { "FISHSCALES", "PBM", FishScalesImage, sizeof(FishScalesImage) },
    869     { "GRAY0", "PBM", Gray0Image, sizeof(Gray0Image) },
    870     { "GRAY5", "PBM", Gray5Image, sizeof(Gray5Image) },
    871     { "GRAY10", "PBM", Gray10Image, sizeof(Gray10Image) },
    872     { "GRAY15", "PBM", Gray15Image, sizeof(Gray15Image) },
    873     { "GRAY20", "PBM", Gray20Image, sizeof(Gray20Image) },
    874     { "GRAY25", "PBM", Gray25Image, sizeof(Gray25Image) },
    875     { "GRAY30", "PBM", Gray30Image, sizeof(Gray30Image) },
    876     { "GRAY35", "PBM", Gray35Image, sizeof(Gray35Image) },
    877     { "GRAY40", "PBM", Gray40Image, sizeof(Gray40Image) },
    878     { "GRAY45", "PBM", Gray45Image, sizeof(Gray45Image) },
    879     { "GRAY50", "PBM", Gray50Image, sizeof(Gray50Image) },
    880     { "GRAY55", "PBM", Gray55Image, sizeof(Gray55Image) },
    881     { "GRAY60", "PBM", Gray60Image, sizeof(Gray60Image) },
    882     { "GRAY65", "PBM", Gray65Image, sizeof(Gray65Image) },
    883     { "GRAY70", "PBM", Gray70Image, sizeof(Gray70Image) },
    884     { "GRAY75", "PBM", Gray75Image, sizeof(Gray75Image) },
    885     { "GRAY80", "PBM", Gray80Image, sizeof(Gray80Image) },
    886     { "GRAY85", "PBM", Gray85Image, sizeof(Gray85Image) },
    887     { "GRAY90", "PBM", Gray90Image, sizeof(Gray90Image) },
    888     { "GRAY95", "PBM", Gray95Image, sizeof(Gray95Image) },
    889     { "GRAY100", "PBM", Gray100Image, sizeof(Gray100Image) },
    890     { "HEXAGONS", "PBM", HexagonsImage, sizeof(HexagonsImage) },
    891     { "HORIZONTAL", "PBM", HorizontalImage, sizeof(HorizontalImage) },
    892     { "HORIZONTAL2", "PBM", Horizontal2Image, sizeof(Horizontal2Image) },
    893     { "HORIZONTAL3", "PBM", Horizontal3Image, sizeof(Horizontal3Image) },
    894     { "HORIZONTALSAW", "PBM", HorizontalSawImage, sizeof(HorizontalSawImage) },
    895     { "HS_BDIAGONAL", "PBM", HS_BDIAGONALImage, sizeof(HS_BDIAGONALImage) },
    896     { "HS_CROSS", "PBM", HS_CROSSImage, sizeof(HS_CROSSImage) },
    897     { "HS_DIAGCROSS", "PBM", HS_DIAGCROSSImage, sizeof(HS_DIAGCROSSImage) },
    898     { "HS_FDIAGONAL", "PBM", HS_FDIAGONALImage, sizeof(HS_FDIAGONALImage) },
    899     { "HS_HORIZONTAL", "PBM", HS_HORIZONTALImage, sizeof(HS_HORIZONTALImage) },
    900     { "HS_VERTICAL", "PBM", HS_VERTICALImage, sizeof(HS_VERTICALImage) },
    901     { "LEFT30", "PBM", Left30Image, sizeof(Left30Image) },
    902     { "LEFT45", "PBM", Left45Image, sizeof(Left45Image) },
    903     { "LEFTSHINGLE", "PBM", LeftShingleImage, sizeof(LeftShingleImage) },
    904     { "OCTAGONS", "PBM", OctagonsImage, sizeof(OctagonsImage) },
    905     { "RIGHT30", "PBM", Right30Image, sizeof(Right30Image) },
    906     { "RIGHT45", "PBM", Right45Image, sizeof(Right45Image) },
    907     { "RIGHTSHINGLE", "PBM", RightShingleImage, sizeof(RightShingleImage) },
    908     { "SMALLFISHSCALES", "PBM", SmallFishScalesImage,
    909       sizeof(SmallFishScalesImage) },
    910     { "VERTICAL", "PBM", VerticalImage, sizeof(VerticalImage) },
    911     { "VERTICAL2", "PBM", Vertical2Image, sizeof(Vertical2Image) },
    912     { "VERTICAL3", "PBM", Vertical3Image, sizeof(Vertical3Image) },
    913     { "VERTICALBRICKS", "PBM", VerticalBricksImage,
    914       sizeof(VerticalBricksImage) },
    915     { "VERTICALLEFTSHINGLE", "PBM", VerticalLeftShingleImage,
    916       sizeof(VerticalLeftShingleImage) },
    917     { "VERTICALRIGHTSHINGLE", "PBM", VerticalRightShingleImage,
    918       sizeof(VerticalRightShingleImage) },
    919     { "VERTICALSAW", "PBM", VerticalSawImage, sizeof(VerticalSawImage) },
    920     { "", "", (const void *) NULL, 0 }
    921   };
    922 
    923 /*
    925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    926 %                                                                             %
    927 %                                                                             %
    928 %                                                                             %
    929 %   R e a d P A T T E R N I m a g e                                           %
    930 %                                                                             %
    931 %                                                                             %
    932 %                                                                             %
    933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    934 %
    935 %  ReadPATTERNImage() reads a PATTERN image file and returns it.  It
    936 %  allocates the memory necessary for the new Image structure and returns a
    937 %  pointer to the new image.
    938 %
    939 %  The format of the ReadPATTERNImage method is:
    940 %
    941 %      Image *ReadPATTERNImage(const ImageInfo *image_info,
    942 %        ExceptionInfo *exception)
    943 %
    944 %  A description of each parameter follows:
    945 %
    946 %    o image_info: the image info.
    947 %
    948 %    o exception: return any errors or warnings in this structure.
    949 %
    950 */
    951 static Image *ReadPATTERNImage(const ImageInfo *image_info,
    952   ExceptionInfo *exception)
    953 {
    954   const void
    955     *blob;
    956 
    957   Image
    958     *image;
    959 
    960   ImageInfo
    961     *blob_info;
    962 
    963   register ssize_t
    964     i;
    965 
    966   size_t
    967     extent;
    968 
    969   blob_info=CloneImageInfo(image_info);
    970   image=(Image *) NULL;
    971   blob=(const void *) NULL;
    972   extent=0;
    973   for (i=0; PatternImageList[i].blob != (const void *) NULL; i++)
    974     if (LocaleCompare(blob_info->filename,PatternImageList[i].name) == 0)
    975       {
    976         (void) CopyMagickString(blob_info->magick,PatternImageList[i].magick,
    977           MagickPathExtent);
    978         blob=PatternImageList[i].blob;
    979         extent=PatternImageList[i].extent;
    980         break;
    981       }
    982   if (blob == (const void *) NULL)
    983     ThrowReaderException(OptionError,"UnrecognizedImageFormat");
    984   image=BlobToImage(blob_info,blob,extent,exception);
    985   if (image_info->size != (char *) NULL)
    986     {
    987       Image
    988         *pattern_image;
    989 
    990       /*
    991         Tile pattern across image canvas.
    992       */
    993       pattern_image=image;
    994       image=AcquireImage(image_info,exception);
    995       (void) TextureImage(image,pattern_image,exception);
    996       pattern_image=DestroyImage(pattern_image);
    997     }
    998   blob_info=DestroyImageInfo(blob_info);
    999   return(GetFirstImageInList(image));
   1000 }
   1001 /*
   1002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1003 %                                                                             %
   1004 %                                                                             %
   1005 %                                                                             %
   1006 %   R e g i s t e r P A T T E R N I m a g e                                   %
   1007 %                                                                             %
   1008 %                                                                             %
   1009 %                                                                             %
   1010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1011 %
   1012 %  RegisterPATTERNImage() adds attributes for the BRICKS, CHECKERBOARD,
   1013 %  CIRCLES, etc., image formats to the list of supported formats. The attributes
   1014 %  include the image format tag, a method to read and/or write the format,
   1015 %  whether the format supports the saving of more than one frame to the same
   1016 %  file or blob, whether the format supports native in-memory I/O, and a
   1017 %  brief description of the format.
   1018 %
   1019 %  The format of the RegisterPATTERNImage method is:
   1020 %
   1021 %      size_t RegisterPATTERNImage(void)
   1022 %
   1023 */
   1024 ModuleExport size_t RegisterPATTERNImage(void)
   1025 {
   1026   MagickInfo
   1027     *entry;
   1028 
   1029   entry=AcquireMagickInfo("PATTERN","PATTERN","Predefined pattern");
   1030   entry->decoder=(DecodeImageHandler *) ReadPATTERNImage;
   1031   entry->flags^=CoderAdjoinFlag;
   1032   (void) RegisterMagickInfo(entry);
   1033   return(MagickImageCoderSignature);
   1034 }
   1035 
   1036 /*
   1038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1039 %                                                                             %
   1040 %                                                                             %
   1041 %                                                                             %
   1042 %   U n r e g i s t e r P A T T E R N I m a g e                               %
   1043 %                                                                             %
   1044 %                                                                             %
   1045 %                                                                             %
   1046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1047 %
   1048 %  UnregisterPATTERNImage() removes format registrations made by the
   1049 %  PATTERN module from the list of supported formats.
   1050 %
   1051 %  The format of the UnregisterPATTERNImage method is:
   1052 %
   1053 %      UnregisterPATTERNImage(void)
   1054 %
   1055 */
   1056 ModuleExport void UnregisterPATTERNImage(void)
   1057 {
   1058   (void) UnregisterMagickInfo("PATTERN");
   1059 }
   1060