home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 800s / rfc809.txt < prev    next >
Text File  |  1991-10-16  |  165KB  |  5,671 lines

  1. INDRA Note 1185                                            INDRA
  2.  
  3. Feb. 1982                                                 Working
  4.                                                            Paper
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. RFC 809
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                       UCL FACSIMILE SYSTEM
  20.  
  21.  
  22.                            Tawei Chang
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.      ABSTRACT:  This note describes the features  of
  39.                 the  computerised  facsimile  system
  40.                 developed  in  the   Department   of
  41.                 Computer  Science at UCL.  First its
  42.                 functions  are  considered  and  the
  43.                 related    experimental   work   are
  44.                 reported. Then the  disciplines  for
  45.                 system    design    are   discussed.
  46.                 Finally, the implementation  of  the
  47.                 system are described, while detailed
  48.                 description are given as appendices.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                  Department of Computer Science
  55.  
  56.                    University College, London
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.       NOTE: Figures 5 and 6 may be obtained by sending a request to
  64.       Ann Westine at USC-Information Sciences Institute, 4676 Admiralty
  65.       Way, Marina del Rey, California, 90291 (or WESTINE@ISIF) including
  66.       your name and postal mailing address.  Please mention that you are
  67.       requesting figures 5 and 6 from RFC 809.
  68.  
  69.  
  70.       OR: You can obtain these two figures online from the files
  71.  
  72.           <NETINFO>RFC809a.FAX   and   <NETINFO>RFC809b.FAX
  73.  
  74.       from the SRI-NIC online library.  These files are in the format
  75.       described in RFC 769.
  76.  
  77.  
  78. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  79.  
  80.                             Contents
  81.  
  82.   1. INTRODUCTION...........................................1
  83.  
  84.  
  85.   2. SYSTEM FUNCTIONS.......................................2
  86.  
  87.      2.1 Communication......................................4
  88.      2.2 Interworking with Other Equipment..................8
  89.         2.2.1 Facsimile machines............................8
  90.         2.2.2 Output Devices................................9
  91.      2.3 Image Enhancement..................................11
  92.      2.4 Image Editing......................................15
  93.      2.5 Integration with Other Data Types..................16
  94.  
  95.   3. SYSTEM ARCHITECTURE....................................17
  96.  
  97.      3.1 System Requirements................................17
  98.      3.2 Hierarchical Model.................................19
  99.      3.3 Clean and Simple Interface.........................20
  100.         3.3.1 Principles....................................21
  101.         3.3.2 Synchronisation and Desynchronisation.........21
  102.         3.3.3 Data Transfer.................................22
  103.      3.4 Control and Organisation of the Tasks..............22
  104.         3.4.1 Command Language..............................23
  105.         3.4.2 Task Controller...............................23
  106.      3.5 Interface Routines.................................26
  107.         3.5.1 Sharable Control Structure....................26
  108.         3.5.2 Buffer Management.............................27
  109.  
  110.   4. UCL FACSIMILE SYSTEM...................................28
  111.  
  112.      4.1 Multi-Task Structure...............................29
  113.      4.2 The Devices........................................29
  114.      4.3 The Networks.......................................30
  115.      4.4 File System........................................31
  116.      4.5 Data Structure.....................................32
  117.      4.6 Data Conversion....................................34
  118.      4.7 Image Manipulation.................................35
  119.      4.8 Data Transmission..................................39
  120.  
  121.   5. CONCLUSION.............................................41
  122.  
  123.      5.1 Summary............................................41
  124.      5.2 Problems...........................................42
  125.      5.3 Future Study.......................................46
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  135.  
  136.      Appendix I:   Devices
  137.  
  138.      Appendix II:  Task Controller and Task Processes
  139.  
  140.      Appendix III: Utility and Data Formats
  141.  
  142.      Reference
  143.  
  144.  
  145.  
  146.  
  147.  
  148.      1. INTRODUCTION
  149.  
  150.  
  151.        The object of a  facsimile  system  is  to  reproduce
  152.      faithfully  a document or image from one piece of paper
  153.      onto another piece of paper  sited  remotely  from  the
  154.      first  one.  Up  to  now,  the main method of facsimile
  155.      communication has been via the telephone network.  Most
  156.      facsimile  machines permit neither the storage of image
  157.      page nor their modification before  transmission.  With
  158.      such  machines,  it is almost impossible to communicate
  159.      between different makes of facsimile machines. In  this
  160.      respect,   facsimile   machines   fall   behind   other
  161.      electronic communication services.
  162.  
  163.        Integration of  a  facsimile  service  with  computer
  164.      communication  techniques  can bring great improvements
  165.      in service. Not only is the reliability and  efficiency
  166.      improved   but,  more  important,  the  system  can  be
  167.      integrated with  other  forms  of  data  communication.
  168.      Moreover, the computer enables the facsimile machine to
  169.      fit into a complete message and information  processing
  170.      environment.   The  storage  facilities provided by the
  171.      computer system make it possible to store large amounts
  172.      of  facsimile  data  and  retrieve  them  rapidly. Data
  173.      conversion allows facsimile machines of different types
  174.      to   communicate  with  each  other.  Furthermore,  the
  175.      facsimile image is edited and/or  combined  with  other
  176.      forms  of  data,  such  as text, voice and graphics, to
  177.      construct a multi-media message, which  can  be  widely
  178.      distributed over computer networks.
  179.  
  180.        In the Department  of  Computer  Science  at  UCL,  a
  181.      computerised  facsimile  system  has  been developed in
  182.      order to fully apply  computer  technology,  especially
  183.      communication,  to  the facsimile field.  Some work has
  184.      been done to improve the facsimile service  in  several
  185.      areas.
  186.  
  187.       (1) Adaptation of the facsimile machine for  use  with
  188.           computer networks.  This permits more reliable and
  189.           accurate  document  transmission,   as   well   as
  190.           improving the normal point-to-point transfers.
  191.  
  192.       (2) Storage  of  facsimile  pages.  This  permits  the
  193.           queueing  of pages, so saving operator time. Also,
  194.           standard documents can  be  kept  permanently  and
  195.           transmitted at any time.
  196.  
  197.       (3) Interworking with other facsimile  machines.  This
  198.           permits  different  makes of facsimile machines to
  199.  
  200.  
  201.  
  202.                               - 1 -
  203.  
  204. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  205.  
  206.           exchange images.
  207.  
  208.       (4) Compression of the facsimile images.  This  allows
  209.           more   efficient   transmission  to  be  achieved.
  210.           Different compression schemes are investigated.
  211.  
  212.       (5) Display of images  on  other  devices.   A  colour
  213.           display  is  used  so  that  the  result  of image
  214.           processing can be shown very vividly.
  215.  
  216.       (6) Improvement of the images. The ability to  'clean'
  217.           the  facsimile  images  not  only  allows for even
  218.           higher  compression  ratio,  but  also  provide  a
  219.           better result at the destination.
  220.  
  221.       (7) Editing of  facsimile  pages.  This  includes  the
  222.           ability  to  change  pictures,  alter  the size of
  223.           images  and  merge  two  or   more   images,   all
  224.           electronically.
  225.  
  226.       (8) Integration of the facsimile  service  with  other
  227.           data  types.   For the time being, coded character
  228.           text can be converted into  facsimile  format  and
  229.           mixed  pages  containing  pictures and text can be
  230.           manipulated.
  231.  
  232.        This  note  first  considers  the  functions  of  the
  233.      facsimile  system,  the related experimental work being
  234.      reported.  Then the discipline for the system design is
  235.      discussed.  Finally,  the  implementation  of  the  UCL
  236.      facsimile system is described. As appendices,  detailed
  237.      description of the system are given, namely
  238.  
  239.              I.   Devices
  240.              II.  Task controller and task processes
  241.              III. Utility routines and Data format
  242.  
  243.  
  244.  
  245.      2. SYSTEM FUNCTIONS
  246.  
  247.        The computerised facsimile system we  have  developed
  248.      is composed of an LSI-11 micro-computer running the MOS
  249.      operating system [14] with two AED62 floppy disk drives
  250.      [17], a Grinnell colour display [18], a DACOM facsimile
  251.      machine [16], and a VDU as  the  system  console.  This
  252.      LSI-11  is also attached to several networks, including
  253.      the ARPANET/SATNET [21], [22]  and  the  UCL  Cambridge
  254.      Ring. A schematic of the system is shown in Fig. 1.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                               - 2 -
  262.  
  263. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  264.  
  265.  
  266.               facsimile machine  bit-map display
  267.                      +------+    +------+
  268.                      !      !    !      !
  269.                      +------+    +------+
  270.            +------+        \      /        VDU
  271.            ! disk !      +----------+    +-----+
  272.            +------+ ---- !  LSI-11  ! -- !     !
  273.            ! disk !      +----------+    +-----+
  274.            +------+           |
  275.                            +------+
  276.                            !  NI  !
  277.                            +------+
  278.                        Network Interface
  279.  
  280.             Fig. 1  Schematic of UCL facsimile system
  281.  
  282.        In this system, a  page  is  read  on  the  facsimile
  283.      machine  and  the  image data produced is stored on the
  284.      floppy disk. This data can be processed locally in  the
  285.      micro-computer  and  then  sent  to  a  file store of a
  286.      remote computer across the  computer  network.  At  the
  287.      remote  site,  the  image  data  may  be  processed and
  288.      printed on a facsimile machine.
  289.  
  290.        On the other hand, we can receive image data which is
  291.      sent  by a remote host on the network. This data can be
  292.      manipulated in the same way, including being printed on
  293.      the local machine.
  294.  
  295.        Section 2.1  dicusses  the  problems  concerned  with
  296.      transmission  of  facsimile  image data over a network,
  297.      while the following sections deal with those  of  local
  298.      manipulation of image data.
  299.  
  300.        In order to interwork with other  facsimile  machine,
  301.      we   have   to   convert   the   image  data  from  one
  302.      representation format  to  another.  Interworking  with
  303.      other  output devices requires that the image be scaled
  304.      to fit the dimension of the destination  device.  These
  305.      are described in section 2.2.
  306.  
  307.        Being able to process the image by computer opens the
  308.      door  to  many  possibilities.  First, as considered in
  309.      section 2.3, an image can  be  enhanced,  so  that  the
  310.      quality of the image may be improved and more efficient
  311.      storage and transmission can be achieved.  Secondly,  a
  312.      facsimile  editing  system  can  be supported whereby a
  313.      picture can  be  changed  and/or  combined  with  other
  314.  
  315.  
  316.  
  317.  
  318.                               - 3 -
  319.  
  320. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  321.  
  322.      pictures. This is described in section 2.4.
  323.  
  324.        In our system, coded character text can be  converted
  325.      into  its  bit-map representation format so that it can
  326.      be  handled  as  a  facsimile  image  and  merged  with
  327.      pictures. This provides an environment where multi-type
  328.      information can be dealt with.  This  is  discussed  in
  329.      section 2.5.
  330.  
  331.  
  332.      2.1 Communication
  333.  
  334.        The first goal of our computerised  facsimile  system
  335.      is  to  use a computer network to transmit data between
  336.      facsimile machines which are geographically separated.
  337.  
  338.        Normally, facsimile machines are used in  association
  339.      with  telephone  equipment,  the  data being sent along
  340.      telephone lines.  Placing the facsimile machines  on  a
  341.      computer  network  presents  a problem as the facsimile
  342.      machine does not have the ability  to  use  a  computer
  343.      network  directly.   To  perform  the  network  tasks a
  344.      computer is required, and so the  first  phase  was  to
  345.      attach the facsimile machine to a computer.
  346.  
  347.        The facsimile machine is not like a standard piece of
  348.      computer  equipment.  We  required  a  special hardware
  349.      interface to enable communication between the facsimile
  350.      machine  and  a small computer. This interface was made
  351.      to appear exactly like  the  telephone  system  to  the
  352.      facsimile   machine.   Furthermore,  the  computer  was
  353.      programmed  to  act  exactly  as  if  it  were  another
  354.      facsimile  machine on the end of a telephone line. Thus
  355.      the local facsimile machine could transmit data to  the
  356.      computer  quite happily, believing that it was actually
  357.      talking to a remote facsimile machine on the other  end
  358.      of  a  telephone  wire.  Because of the property of the
  359.      DACOM 6450 used in the experiment [16],  the  interface
  360.      could  be  identical to one developed for connecting to
  361.      an X25 network. The binary synchronous mode of the chip
  362.      used  (SMC  COM5025) was appropriate to drive the DACOM
  363.      machine.
  364.  
  365.        At the other side of the computer network there was a
  366.      similar  computer  with an identical facsimile machine.
  367.      The problem of transmitting  a  facsimile  picture  now
  368.      appeared  simple:  data  was  taken  from the facsimile
  369.      machine into the computer, transmitted over the network
  370.      as  if  it was normal computer data, and then sent from
  371.      the computer to the facsimile  machine  at  the  remote
  372.      end.  The  data  being  sent  over  the network appears
  373.  
  374.  
  375.  
  376.  
  377.                               - 4 -
  378.  
  379. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  380.  
  381.      exactly as any other computer data;  there  is  nothing
  382.      special  about  it  to  signify  that  it  came  from a
  383.      facsimile machine.  The  schematic  of  such  facsimile
  384.      transfer system is shown in Fig. 2.
  385.  
  386.  
  387.  
  388.      facsimile
  389.      machine
  390.       +---+  interface
  391.       !   !    +--+    +-----+
  392.       !   ! == !  ! == !     ! computer
  393.       +---+    +--+    +-----+
  394.                           |
  395.                            - - - - - -    computer
  396.                          /             \  network
  397.  
  398.                          \             /             facsimile
  399.                            - - - - - -               machine
  400.                                       |    interface  +---+
  401.                                    +-----+    +--+    !   !
  402.                           computer !     ! == !  ! == !   !
  403.                                    +-----+    +--+    +---+
  404.  
  405.                 Fig. 2  Facsimile transfer system
  406.  
  407.  
  408.        The experimental system was used to perform  a  joint
  409.      experiment  between  UCL  and  two groups in the United
  410.      States. Pictures were exchanged via the  ARPANET/SATNET
  411.      [21],  [22]  between UCL in London, ISI in Los Angeles,
  412.      and  COMSAT  in  Washington   D.C.   (Fig.   3).   This
  413.      environment  was chosen because no equivalent group was
  414.      available in the UK.
  415.  
  416.        One  problem   concerned   with   such   image   data
  417.      transmission  is  the  quantity of data. Even with data
  418.      compression,  a  single  page  of  facsimile  data  can
  419.      produce  as  much  computer  data  as would normally be
  420.      sufficient   for   sending   over   20,000   alphabetic
  421.      characters  -  or  over a dozen typed pages. Thus for a
  422.      given number of pages put into the system,  an  immense
  423.      amount  of  computer  data is produced. This means that
  424.      the transmission will be slower than for sending  text,
  425.      and  that far more storage will be required to hold the
  426.      data.
  427.  
  428.        Another problem was encountered which became only too
  429.      apparent  when we implemented this system.  The network
  430.      we were using was often unable  to  keep  up  with  the
  431.      speed of the facsimile machine.  When this happened the
  432.  
  433.  
  434.  
  435.  
  436.                               - 5 -
  437.  
  438. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  439.  
  440.  
  441.  
  442.                       US               UK
  443.                            satellite
  444.      COMSAT                   __
  445.      +---+    +--+           /  \
  446.      !   ! -- !  !           /  \
  447.      +---+    +--+          /    \
  448.        |          \        /      \
  449.      +---+         \      /        \           UCL
  450.      !fax!          \+--+/          \+--+    +---+
  451.      +---+  ARPANET  !  !   SATNET   !  ! -- !   !
  452.                     /+--+            +--+    +---+
  453.                    /                           |
  454.      ISI         /                          +---+
  455.      +---+    +--+                           !fax!
  456.      !   ! -- !  !                           +---+
  457.      +---+    +--+
  458.        |
  459.      +---+
  460.      !fax!
  461.      +---+
  462.  
  463.      Fig. 3. The three participants of the facsimile experiments
  464.  
  465.      computer tried to slow down the facsimile machine.  The
  466.      facsimile  machine  would  detect  this 'slowness' as a
  467.      communication problem (as a telephone line would  never
  468.      act  in  this  manner),  and would abandon the transfer
  469.      mid-way through the page.
  470.  
  471.        This is because the the  facsimile  machine  we  were
  472.      using  was never intended for use on a computer; it was
  473.      designed and built for use on telephone lines.  Indeed,
  474.      being  unaware that it was connected to a computer, the
  475.      facsimile machine transmitted data at a constant  rate,
  476.      which exceeded the limit that the network could accept.
  477.      In other words, the computer network we were using  was
  478.      not  designed for the transfer rate that we were trying
  479.      to use over it.
  480.  
  481.        Both  these  problems  are  surmountable.   Facsimile
  482.      machines are coming on the market that are designed for
  483.      direct communication with a computer. These machines do
  484.      not  mind  the delays on the computer interface and are
  485.      tolerant of the stops and re-starts. On the other hand,
  486.      if  there were a serious use of facsimile machines on a
  487.      computer network, the network could be designed for the
  488.      high  data rate required. Our problem was aggravated by
  489.  
  490.  
  491.  
  492.  
  493.                               - 6 -
  494.  
  495. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  496.  
  497.      using a network that was never designed  for  the  data
  498.      rates required in our mode of usage.
  499.  
  500.        Despite the problems we encountered being a result of
  501.      the  experimental  equipment  we  were working with, we
  502.      still had to  improve  the  situation  to  permit  more
  503.      extensive communications to take place. The easiest way
  504.      to do this was to introduce a local storage area in our
  505.      computer   where  the  data  could  be  held  prior  to
  506.      transmission.  The transfer of a page is  now  done  in
  507.      three  stages.   First, the facsimile data is read from
  508.      the facsimile machine and stored on a local disk.  This
  509.      takes  place  at  high  speed  as  this is just a local
  510.      operation.  When this is complete,  the  data  is  sent
  511.      over  the  network  to  a  disk on the remote computer.
  512.      Finally, the data from  that  disk  is  output  to  the
  513.      remote  facsimile  machine.   This  improved  system is
  514.      shown in Fig. 4.
  515.  
  516.  
  517.  
  518.                      computer network
  519.       fax    computer    - - - -     computer   fax
  520.      +---+   +-----+   /         \   +-----+   +---+
  521.      !   ! = !     ! =     ==>     = !     ! = !   !
  522.      +---+   +-----+   \         /   +-----+   +---+
  523.         - - - + |        - - - -        | + - - >
  524.               | | + - - - - - - - - - + | |
  525.               | | |                   | | |
  526.               V | |                   V | |
  527.               +---+                   +---+
  528.               !   !                   !   !
  529.               !   !                   !   !
  530.               +---+                   +---+
  531.               disk                    disk
  532.  
  533.          Fig. 4.  The improved facsimile transfer system
  534.  
  535.  
  536.        The idea  behind  this  method  is  to  decouple  the
  537.      facsimile  machine from the network communications. The
  538.      data is read from the facsimile machine at full  speed,
  539.      without  the  delays  caused  by  the computer network.
  540.      This also has the effect of being  more  acceptable  to
  541.      the human operators: each page is now read in less than
  542.      a minute.  The transmission over the network then takes
  543.      place  at  whatever speed the network can sustain. This
  544.      does not affect the facsimile machines at all; they are
  545.      not involved in the sending or receiving. Only when all
  546.      the data has been received at the remote  disk  is  the
  547.      remote  facsimile  machine told that the data is ready.
  548.  
  549.  
  550.  
  551.  
  552.                               - 7 -
  553.  
  554. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  555.  
  556.      The facsimile machine is then given the data as fast as
  557.      it will accept it.
  558.  
  559.        The disadvantage of such a system is that the  person
  560.      sending  the  pages  does  not know how long it will be
  561.      before they are actually printed at the other side.  If
  562.      several  pages  are  input  in  quick succession by the
  563.      operator, they will be stored on disk; it may  then  be
  564.      some time before the last page is actually delivered to
  565.      the destination. This is  not  always  a  disadvantage;
  566.      where  many  operators  are  sending  data  to the same
  567.      destination, it is a definite advantage to be  able  to
  568.      input  the  pages and have the system deliver them when
  569.      the  destination  becomes  free.  Such  a   system   is
  570.      preferable to use of the current telephone system where
  571.      the  operator  has  to  keep  re-dialing   the   remote
  572.      facsimile machine until the call is answered.
  573.  
  574.  
  575.      2.2 Interworking with Other Equipment
  576.  
  577.      2.2.1 Facsimile machines
  578.  
  579.        As was mentioned earlier, facsimile machines  produce
  580.      a large amount of data per page due to the way in which
  581.      the pages are encoded.  To reduce the data that has  to
  582.      be  transmitted,  various  compression  techniques  are
  583.      employed.  The manufacturers of facsimile machines have
  584.      developed   proprietary  ways  in  which  the  data  is
  585.      compressed and encoded.  Unfortunately this  has  meant
  586.      that  interworking  of different facsimile machines has
  587.      been impossible.  In the system described in  the  last
  588.      section, exchange of pictures was only possible between
  589.      sites that had identical facsimile  machines.  The  new
  590.      set  of CCITT recommendations will reduce the extent to
  591.      which differences in equipment persist.
  592.  
  593.        Having  the  data  on  a  computer   gives   us   the
  594.      opportunity  to manipulate data in any way we wish.  In
  595.      particular we could convert the data from the form used
  596.      in  one  facsimile machine to that required by another.
  597.      This means that interworking between different types of
  598.      facsimile machines can be achieved.
  599.  
  600.        The development of this  system  took  place  in  two
  601.      stages:  the  decompression  of the facsimile data from
  602.      the coded form used in our  machine  into  an  internal
  603.      data  form  and  the  recompression  of the data in the
  604.      internal form into the encoded form  required  for  the
  605.      destination  machine.  Two  programs  were developed to
  606.      perform these two operations.
  607.  
  608.  
  609.  
  610.  
  611.                               - 8 -
  612.  
  613. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  614.  
  615.        At the same time we were developing  compression  and
  616.      decompression  programs  for  machines  that  use other
  617.      techniques.  In particular, we  developed  programs  to
  618.      handle  the  recently approved CCITT recommendation for
  619.      facsimile compression [15]. The CCITT came up with  two
  620.      varieties of compression, depending upon the resolution
  621.      being used.
  622.  
  623.        Unfortunately there were no facsimile machines on the
  624.      network  that  use  the  CCITT  compression  technique.
  625.      However, the programming of the  new  methods  achieved
  626.      two  goals:  it proved that the data could be converted
  627.      inside a small computer, so that machines of  different
  628.      types could be supported on the network, and it enabled
  629.      us  to  compare  the  compression  results.  These  are
  630.      described  in  more detail in [13].  Essentially, these
  631.      show that the DACOM technique  used  by  our  facsimile
  632.      machine  is  comparatively  poor, and that considerably
  633.      less data need be transmitted if some other  method  is
  634.      used.  This  brings  up  another  possibility: we could
  635.      change the compression of the data to reduce the volume
  636.      for transmission and then change the data back again at
  637.      the   destination.   This   may    save    considerable
  638.      transmission  time,  especially  if  fast  computers or
  639.      special hardware was easily available.   This  has  not
  640.      been  tried  yet  in  our  system, as none of the other
  641.      users on the network have the  capability  of  changing
  642.      the  data  format  back  into  that  required  by their
  643.      machines.
  644.  
  645.        There  are  many  other  more  efficient  compression
  646.      schemes,  e.g.   block  compression  [7] and predictive
  647.      compression [8], but we have not yet incorporated  them
  648.      into our system.
  649.  
  650.  
  651.      2.2.2 Output Devices
  652.  
  653.        One area that we have explored is the use of  devices
  654.      other  than facsimile machines for outputting the data.
  655.      Facsimile  machines  are  both  expensive  to  buy  and
  656.      relatively  slow  to  operate. We have investigated the
  657.      use of a TV-like screen to display the  data,  just  as
  658.      character VDUs are commonly used to display text.  This
  659.      activity requires bit-map displays, with an address  in
  660.      memory  for each postion on the screen. Full colour and
  661.      multiple shades can be used  with  appropriately  large
  662.      bit-map  storage.   Although  simple  in principle, the
  663.      implementation  of   the   relevant   techniques   took
  664.      considerable effort.
  665.  
  666.  
  667.  
  668.  
  669.  
  670.                               - 9 -
  671.  
  672. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  673.  
  674.        The problems arise in  the  way  that  the  facsimile
  675.      image  is encoded. Raw facsimile images consist of rows
  676.      of small dots, each dot recorded as a  black  or  white
  677.      space. When these dots are arranged together they build
  678.      up a picture in a similar manner to the way in which  a
  679.      newspaper  picture is made up. Unfortunately the number
  680.      of dots used in a facsimile page is not the same as the
  681.      number  used  on  most screens. For instance, the DACOM
  682.      facsimile machine uses 1726 dots across each page,  but
  683.      across  a  screen there are usually just 512 dots. Thus
  684.      to show the picture on the screen the 1726 dots must be
  685.      'squeezed' into just 512 dots; stated another way, 1214
  686.      dots must be thrown away without losing the picture!
  687.  
  688.        It is in reducing the number of picture elements that
  689.      the  problem  arises.  We could just every third dot or
  690.      so from the facsimile  page  and  just  display  those.
  691.      Alternatively,  we  could  take three or more at a time
  692.      and try to convert the group  of  them  into  a  single
  693.      black  or  white  dot.   Unfortunately,  in  both these
  694.      cases, data can get  lost  that  is  necessary  to  the
  695.      picture.   For  instance,  a  facsimile  encoding of an
  696.      architect drawing could easily end up with  a  complete
  697.      line  removed,  radically  changing the presentation of
  698.      the image.
  699.  
  700.        After much experimentation, we developed a method  of
  701.      reducing  the  number  of  dots  without destroying the
  702.      picture. This is  a  thinning  technique,  whereby  key
  703.      elements  of  the picture are thinned, but not removed.
  704.      Occasionally, when  the  detail  gets  too  fine,  some
  705.      elements  are merged, but under these circumstances the
  706.      eye would not have been able to see the detail  anyway.
  707.      The  details of this technique are described in [3] and
  708.      [4].
  709.  
  710.        It may also be required that a picture  be  enlarged.
  711.      This enlargement can be done by simply duplicating each
  712.      pixel in the picture.  For a  non-integral  ratio,  the
  713.      picture  can  be expanded up to the nearest integer and
  714.      then shrunk to the correct size.  However, this  method
  715.      may degrade the image quality, e.g. the oblique contour
  716.      may become stepped,  especially  when  the  picture  is
  717.      enlarged  too much. This problem can be solved by using
  718.      an iterative enlargement algorithm. Each time  a  pixel
  719.      is  replaced  with a 2x2 array of pixels, whose pattern
  720.      depends  on  the  original   pixel   and   the   pixels
  721.      surrounding  it.  This  procedure is repeated until the
  722.      requested ratio is reached. If  the  ration  is  not  a
  723.      power  of 2's, the same method as that for non-integral
  724.      ratios is used.
  725.  
  726.  
  727.  
  728.  
  729.                              - 10 -
  730.  
  731. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  732.  
  733.        As a side effect of  developing  this  technique,  we
  734.      could  freely  change  the  size and shape of an image.
  735.      The picture can be expanded or shrunk,  or  it  can  be
  736.      distorted.   Distortion,  whereby  the  horizontal  and
  737.      vertical dimensions of the  image  may  be  changed  by
  738.      different amounts, is often useful in image editing.
  739.  
  740.        The immediate consequence of this ability  to  change
  741.      the image size meant that we could display the image on
  742.      a screen as well as output the  image  on  a  facsimile
  743.      machine.  To  a user of a computerised facsimile system
  744.      this could be a very  useful  feature:  images  can  be
  745.      displayed  on  screen  much  faster than on a facsimile
  746.      machine, and displays are  significantly  cheaper  than
  747.      the  facsimile machines as well. It is possible that an
  748.      installation could have many screen displays where  the
  749.      image  could  be viewed, but perhaps only one facsimile
  750.      machine would be available for hard copy. This would be
  751.      similar to many computer configurations today where the
  752.      number of printers is limited due to  their  cost,  and
  753.      display screens are far more numerous.
  754.  
  755.  
  756.      2.3 Image Enhancement
  757.  
  758.        One aspect of computer processing that we  wanted  to
  759.      investigate  was  that  of image enhancement. Enhancing
  760.      the image is a  very  tricky  operation;  as  the  name
  761.      implies  it  means  that  the image is improved in some
  762.      sense.  Under program  control  this  is  difficult  to
  763.      achieve: what the program thinks is an improvement, the
  764.      human might judge to be distinctly worse.
  765.  
  766.        Our enhancement attempts were aimed  particularly  at
  767.      printed  documents  and  other forms of typed text. The
  768.      experiment was double pronged: we  hoped  to  make  the
  769.      image  easier  to  read by humans while also making the
  770.      image easier for the computer to handle.
  771.  
  772.        In our earlier experiments we had  noticed  that  the
  773.      encoding  of  printed  matter was often very poor. This
  774.      was especially noticeable when we  enlarged  an  image.
  775.      Rather  than  each  character having smooth edges as on
  776.      the original  document,  the  edges  were  very  rough,
  777.      unexpected notches and excrescences being caused by the
  778.      facsimile scanner.  They not  only  degrade  the  image
  779.      quality but also decrease the compression efficiency. A
  780.      typical enlargement of several characters is  shown  in
  781.      Fig. 5.
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.                              - 11 -
  789.  
  790. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.              Fig 5.  An enlargement of an typed text
  834.  
  835.  
  836.        The enhancement method we adopted was first  employed
  837.      at  Loughborough  University  [5].  This method has the
  838.      effect of smoothing the edges of the dark areas on  the
  839.      image.  The  technique consists of considering each dot
  840.      in the image in turn. The dot is either left as  it  is
  841.  
  842.  
  843.  
  844.  
  845.                              - 12 -
  846.  
  847. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  848.  
  849.      or changed to the opposite colour (white  to  black  or
  850.      black  to  white)  depending  upon  the eight dots that
  851.      surround it. The particular pattern of surrounding dots
  852.      that  are  required to change the inner dot's colour is
  853.      used to control the harshness  of  the  algorithm  [6],
  854.      [8].
  855.  
  856.        In our  first  set  of  experiments  the  result  was
  857.      definitely  worse  than  the original. Although square-
  858.      like characters such as H, L, and T came out very well,
  859.      anything  with slope (M, V, W, or S) became so bad that
  860.      the oblique  contours  were  stepped.  The  method  was
  861.      subsequently  modified to produce a result that was far
  862.      more acceptable; the image looked a  lot  cleaner  than
  863.      the  original.  Fig.  6  shows the same text as that in
  864.      Fig. 5, but after it has been cleaned.
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.                              - 13 -
  905.  
  906. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.                      Fig. 6  A cleaned text
  950.  
  951.  
  952.        The effect of these can be difficult to see  clearly.
  953.      We have used the colour on our Grinnell display to show
  954.      the original picture and the outcome of various picture
  955.      processing  operations superposed in different colours.
  956.      This brings out  the  effect  of  the  operations  very
  957.  
  958.  
  959.  
  960.  
  961.                              - 14 -
  962.  
  963. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  964.  
  965.      vividly.
  966.  
  967.        It was mentioned above that the enhancement was  done
  968.      not  only to improve the image for reading but also for
  969.      easier  processing  by  the  computer.   As   described
  970.      earlier,  the  image  from  the  facsimile  machine  is
  971.      compressed in order to reduce the amount of data.   The
  972.      cleaning  allows a higher compression rate so that more
  973.      efficient transmission and/or storage can be achieved.
  974.  
  975.        We  learned   some   important   lessons   from   the
  976.      enhancement  exercise.   Originally we thought that the
  977.      main attraction in enhancement would be to improve  the
  978.      readability.  In  the  end, we found that improving the
  979.      readability was very difficult, especially because  the
  980.      facsimile  image was so poor. Instead we found that the
  981.      effect of  reducing  the  compressed  output  was  more
  982.      important.  By reducing the data to be transmitted by a
  983.      quarter, significant savings could be made. But  before
  984.      such  a  technique  could be used in a live system, the
  985.      time it  takes  to  produce  the  enhancement  must  be
  986.      weighed  against  the  time  that  would  be  saved  in
  987.      transmission.
  988.  
  989.  
  990.      2.4 Image Editing
  991.  
  992.        By editing we mean that the facsimile picture can  be
  993.      changed,  or  combined with other pictures, while it is
  994.      stored inside the computer.  In  previous  sections  it
  995.      was  mentioned  that we could change the size and shape
  996.      of a facsimile image. This technique was later combined
  997.      with  an  overlaying method that enabled one picture to
  998.      be combined with another [12].
  999.  
  1000.        In order to perform any editing it  is  necessary  to
  1001.      have  the picture displayed for the user to see. In our
  1002.      case we displayed the picture on  the  bit-map  screen.
  1003.      The image took up the left-hand side of the screen, the
  1004.      right side being reserved  for  the  picture  that  was
  1005.      being  built.   The  user  could  select an area of the
  1006.      left-hand screen and move  it  to  a  position  on  the
  1007.      right-hand  screen.   Several images could be displayed
  1008.      in succession on the left, and areas selected and moved
  1009.      to  the right.  Finally, the right-hand screen could be
  1010.      printed on the facsimile machine.
  1011.  
  1012.        The selection of an area of the picture was  done  by
  1013.      the   use   of   a   coloured  rectangular  subsection,
  1014.      controlled by a program in the computer, that could  be
  1015.      moved  around on the screen. The rectangular subsection
  1016.  
  1017.  
  1018.  
  1019.  
  1020.                              - 15 -
  1021.  
  1022. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1023.  
  1024.      was moved with instructions typed in by  the  operator;
  1025.      it  could  be  moved  up  or  down,  and  increased  or
  1026.      decreased in size. When the  appropriate  area  of  the
  1027.      screen  had  been  selected, the program remembered the
  1028.      coordinates  and   moved   the   coloured   rectangular
  1029.      subsection  to  the  right-hand side of the screen. The
  1030.      user then selected an area again, in a similar  manner.
  1031.      When the user finished the editing, the program removed
  1032.      the part of the picture  selected  from  the  left-hand
  1033.      screen  and  converted  it  to  fit  the  shape  of the
  1034.      rectangular subsection on the  right-hand  screen.  The
  1035.      result was then displayed for the user to see.
  1036.  
  1037.        When an image was being edited,  the  editor  had  to
  1038.      keep  another  scaled  copy for display. This is due to
  1039.      the fact that the screen had a different  dimension  to
  1040.      that  of the facsimile machine. The editing operations,
  1041.      e.g.  chopping  and  merging,  were  performed  on  the
  1042.      original  image  data  files  with  the full resolution
  1043.      available on the facsimile machine.
  1044.  
  1045.  
  1046.      2.5 Integration with Other Data Types
  1047.  
  1048.        The facsimile  machine  can  be  viewed  in  a  wider
  1049.      context than merely a facsimile input/output device. It
  1050.      can work as a printer  for  other  data  representation
  1051.      types,  such  as  coded  character  text  and geometric
  1052.      graphics.  At  present,  text  can  be  converted  into
  1053.      facsimile  format and printed on the facsimile machine.
  1054.      Moreover, mixed pages containing pictures and text  can
  1055.      be  manipulated  by  our  system.  The  integration  of
  1056.      facsimile images with geometric graphics is a topic  of
  1057.      future research.
  1058.  
  1059.        In order to  convert  a  character  string  into  its
  1060.      facsimile  format,  the  system maintains a translation
  1061.      table whereby the patterns of the characters  available
  1062.      in  the  system  can  be retrieved. The input character
  1063.      string is translated into a set of scan lines, each  of
  1064.      which  is  created  by  concatenating the corresponding
  1065.      patterns of the characters in the string.
  1066.  
  1067.        The translation table is in  fact  a  software  font,
  1068.      which  can be edited and modified. Even though only one
  1069.      font is available in our system for the time being,  it
  1070.      is  quite  easy  to  introduce  other  character fonts.
  1071.      Furthermore, it is also  possible  for  a  font  to  be
  1072.      remotely  loaded  from a database via the communication
  1073.      network.
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.                              - 16 -
  1080.  
  1081. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1082.  
  1083.        This allows for more interesting applications of  the
  1084.      facsimile  machine.  For  example,  it could serve as a
  1085.      Teletex printer, provided that  the  Teletex  character
  1086.      font  is included in our system. In this case, the text
  1087.      images may be distorted to fit the presentation  format
  1088.      requested  by  the Teletex service.  Similarly, Prestel
  1089.      viewdata pages  could  be  displayed  on  the  Grinnell
  1090.      screen.
  1091.  
  1092.        Moreover,  pictures  can  be  mixed  with   text   by
  1093.      combining   this   text  conversion  with  the  editing
  1094.      described in  the  previous  section.  This  should  be
  1095.      regarded   as   a   notable   step  towards  multi-type
  1096.      processing.
  1097.  
  1098.        Not  only  does  this  support  a  local   multi-type
  1099.      environment   but   multi-type   information   can   be
  1100.      transmitted over a network. So far  as  this  facsimile
  1101.      system  is  concerned, a mixed page containing text and
  1102.      pictures can be sent only when it has been  represented
  1103.      in  a  bit-map  format.  However,  much  more efficient
  1104.      transmission would be achieved if  one  could  transmit
  1105.      the text and pictures separately and reproduce the page
  1106.      at the destination site. This requires  that  a  multi-
  1107.      type  data structure be designed which is understood by
  1108.      the two communication sites.
  1109.  
  1110.  
  1111.      3. SYSTEM ARCHITECTURE
  1112.  
  1113.        Now let us discuss the general disciplines for design
  1114.      and  implementation  of a computerised facsimile system
  1115.      which  carries  out  the  functions  described  in  the
  1116.      previous  sections.   Having discussed the requirements
  1117.      of the system, a hierarchical model  is  introduced  in
  1118.      which  the  modules of different layers are implemented
  1119.      as separate processes.  The Clean and Simple interface,
  1120.      which  is  adopted  for inter-process communication, is
  1121.      then  described.   The  task   controller,   which   is
  1122.      responsible  for  organising  the  tasks  involved in a
  1123.      requested job, is discussed in  detail.   Some  efforts
  1124.      have  been  made  in our experimental work to provide a
  1125.      more convenient user programming environment and a more
  1126.      efficient   data   transfer  method.  This  is  finally
  1127.      described.
  1128.  
  1129.  
  1130.      3.1 System Requirements
  1131.  
  1132.        In a computerised facsimile system,  the  images  are
  1133.      represented  in  a  digital  form.  To  carry  out this
  1134.  
  1135.  
  1136.  
  1137.  
  1138.                              - 17 -
  1139.  
  1140. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1141.  
  1142.      conversion, a page is scanned by the optical scanner of
  1143.      the  facsimile machine, a digital number being produced
  1144.      to represent  the  darkness  of  each  pixel.  As  high
  1145.      resolution  has to be adopted to keep the detail of the
  1146.      image, the facsimile  data  files  are  usually  rather
  1147.      large.  In  order  to  achieve  efficient  storage  and
  1148.      transmission, the facsimile data must be compressed  as
  1149.      much as possible.
  1150.  
  1151.        Currently, the facsimile machines made  by  different
  1152.      manufacturers   h different  properties,  such  as
  1153.      different compression methods and different resolution.
  1154.      There   are   also  some  international  standards  for
  1155.      facsimile data compression, which are employed for  the
  1156.      facsimile  data  to be transferred over the public data
  1157.      network. These  require  that  the  facsimile  data  be
  1158.      converted  from  one representation form to another, so
  1159.      that users who are  separated  geographically  and  use
  1160.      different  machines  can  communicate  with each other.
  1161.      More sophisticated applications,  e.g.  image  editing,
  1162.      request processing facilities of the system as well.
  1163.  
  1164.        When being processed, the facsimile image  should  be
  1165.      represented   in  a  common  format  or  internal  data
  1166.      structure,  which  is  used  to  pass  the  information
  1167.      between  different processing routines. For the sake of
  1168.      convenience and efficiency, the internal data structure
  1169.      should  be fairly well compressed and its format should
  1170.      be  easy  for  the  computer  to  manipulate.  In   our
  1171.      experimental  work,  the  line  vector  is  chosen as a
  1172.      standard unit, a simple  run-length  compression  being
  1173.      employed  [3].  Some  processing routines may use other
  1174.      data   formats,   e.g.   bit-map,   but   it   is   the
  1175.      responsibility   of   such   routines  to  perform  the
  1176.      conversion between those formats and the standard one.
  1177.  
  1178.        The  system   should   contain   several   processing
  1179.      routines,  each  of  which performs one primitive task,
  1180.      such  as  chopping,  merging,  and  scale-changing.  An
  1181.      immense variety of processing operations can be carried
  1182.      out as long as those  task  modules  can  be  organised
  1183.      flexibly. The capability for flexible task organisation
  1184.      should be thought of  as  one  of  the  most  important
  1185.      requirements of the system.
  1186.  
  1187.        One  possibility  is  for  the  processing   routines
  1188.      involved  to  be  executed  separately, temporary files
  1189.      being used as communication media. Though very  simple,
  1190.      this method is far too inefficient.
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.                              - 18 -
  1198.  
  1199. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1200.  
  1201.        As described above,  the  information  unit  for  the
  1202.      communication  between  the  processing routines is the
  1203.      line vector, so that the routines can be  organised  as
  1204.      embedded  loops,  where  a processing routine takes the
  1205.      input line from its source routine located in the inner
  1206.      loop,  and  passes  the  output line to the destination
  1207.      routine located in the outer loop [3].  Obviously  this
  1208.      method  is quite efficient. But it is not realistic for
  1209.      our system, because it is very difficult  to  build  up
  1210.      different  processing  loops  at  run-time and flexible
  1211.      task organisation is impossible.
  1212.  
  1213.        In a  real-time  operating  system  environment,  the
  1214.      primitive   tasks   can   be  implemented  as  separate
  1215.      processes. This method, which is discussed in detail in
  1216.      the   following   sections,   provides   the   required
  1217.      flexibility.
  1218.  
  1219.  
  1220.      3.2 Hierarchical Model
  1221.  
  1222.        As shown in Fig. 7, the modules in a single  computer
  1223.      fall into three layers.
  1224.  
  1225.  
  1226.                        +---------+
  1227.                        !         ! task controller
  1228.                        +---------+
  1229.  
  1230.                               tasks
  1231.                 +---+  +---+  +---+  +---+  +---+
  1232.                 !   !  ! !   !  !   !  !   !
  1233.                 +---+  +---+  +---+  +---+  +---+
  1234.                   |      |                    |
  1235.                 +---+  +---+                +---+
  1236.                 !   !  !   ! device drivers !   !
  1237.                 +---+  +---+                +---+
  1238.             - - - | - -  |  - - - - - - - - - | - - - -
  1239.                 +---+  +---+                +---+
  1240.                 !   !  !   !    physical    |   !
  1241.                 !   !  !   !    devices     !   !
  1242.                 +---+  +---+                +---+
  1243.  
  1244.                  Fig. 7  The hierarchical model
  1245.  
  1246.  
  1247.        These are:
  1248.  
  1249.       (1) Device Drivers, which constitute the lowest  layer
  1250.           in the model.  The modules in this layer deal with
  1251.           I/O activities of the physical  devices,  such  as
  1252.  
  1253.  
  1254.  
  1255.  
  1256.                              - 19 -
  1257.  
  1258. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1259.  
  1260.           facsimile machine, display and floppy  disk.  This
  1261.           layer  frees  the task modules of upper layer from
  1262.           the burden of I/O programming.
  1263.  
  1264.       (2) Tasks, which perform all processing primitives and
  1265.           handle different data structures. Above the driver
  1266.           of each physical device, there  are  one  or  more
  1267.           such  device-independent  modules,  which  work as
  1268.           information source or sink in the task chain  (see
  1269.           below).  A file system module allows other modules
  1270.           to store and retrieve information on the secondary
  1271.           storage  device such as floppy disk. Decompression
  1272.           and recompression routines convert data structures
  1273.           of   facsimile   image  information  so  that  the
  1274.           facsimile machines can communicate with  the  rest
  1275.           of   the   system.   Processing  primitives,  e.g.
  1276.           chopping, merging,  scaling,  are  implemented  as
  1277.           task modules in this layer. They are designed such
  1278.           that they can be concatenated to  carry  out  more
  1279.           complex  jobs.  So far as the system is concerned,
  1280.           the protocols for data transmission over  computer
  1281.           networks are also regarded as task modules in this
  1282.           layer.
  1283.  
  1284.       (3)  Task  Controller,  which   organises   the   task
  1285.           processes   to   perform  the  specified  job.  It
  1286.           provides the users of the application layer with a
  1287.           procedure-oriented  language whereby the requested
  1288.           job can be defined as a  chain  of  task  modules.
  1289.           Literally, the chain is represented by a character
  1290.           string:
  1291.  
  1292.  
  1293.              <source_task>|{<processing_task>|}<sink_task>
  1294.  
  1295.  
  1296.             According to such a command, the task controller
  1297.           selects the relevant task modules and concatenates
  1298.           them in proper order by means  of  logical  links.
  1299.           Then the tasks on the chain are executed under its
  1300.           control, so that the data taken  from  the  source
  1301.           are processed and the result is put into the sink.
  1302.  
  1303.  
  1304.      3.3 Clean and Simple Interface
  1305.  
  1306.        It is important, in this application, to develop  the
  1307.      software  in  a  modular  way.  It  is desirable to put
  1308.      together a set of modules to carry  out  the  different
  1309.      image   processing  tasks.  Another  set  of  transport
  1310.      modules must be developed for shipping  data  over  the
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                              - 20 -
  1316.  
  1317. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1318.  
  1319.      different networks to which the UCL system is attached.
  1320.      In   our  computerised  facsimile  system,  these  task
  1321.      modules are  implemented  as  separate  processes.  The
  1322.      operation  of  the  system  relies on the communication
  1323.      between these processes.  The interface which  is  used
  1324.      for   such   communication  has  been  designed  to  be
  1325.      universal; it is independent of these modules, and  has
  1326.      been  termed  the Clean and Simple interface [20]. This
  1327.      interface is discussed in this section.
  1328.  
  1329.  
  1330.      3.3.1 Principles
  1331.  
  1332.        The Clean and Simple interface is concerned with  the
  1333.      synchronisation   and   transfer  of  full-duplex  data
  1334.      streams between two communicating processes.  Thus  the
  1335.      interface   has   three  major  components:  connection
  1336.      synchronisation,   data   transfer    and    connection
  1337.      desynchronisation.   These   components  are  discussed
  1338.      below.
  1339.  
  1340.        The connection between two processes is initiated  by
  1341.      one  of  them,  which, generally speaking, belongs to a
  1342.      higher  layer.  For  example,  the  interface   between
  1343.      protocols  of  different  layers is always initiated by
  1344.      the higher layer, though, sometimes, the connection  is
  1345.      initiated  passively by the primitive 'listen'. It will
  1346.      be seen in the next section  that  task  processes  can
  1347.      communicate  with each other via the connections to the
  1348.      higher  layer  (task  controller)  and  this  makes  it
  1349.      possible to achieve flexible task organisation.
  1350.  
  1351.        The process initiating the connection is  called  the
  1352.      'master' process, while the other is called the 'slave'
  1353.      process. The 'master' process is also  responsible  for
  1354.      resource   allocation   for   the   two   communicating
  1355.      processes. Here 'resource' refers mainly to the  memory
  1356.      areas  for  the message structure and data buffer. This
  1357.      asymmetric definition of the interface  eliminates  any
  1358.      possible confusion in resource allocation.
  1359.  
  1360.        The interface is implemented by using the signal-wait
  1361.      mechanism  provided  by  the  operating  system. A data
  1362.      structure called CSB (Clean and  Simple  Block),  which
  1363.      contains  function, data buffer, and other information,
  1364.      is sent as the event message, when one process  signals
  1365.      another [20].
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.                              - 21 -
  1375.  
  1376. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1377.  
  1378.      3.3.2 Synchronisation and Desynchronisation
  1379.  
  1380.        The  procedure  for  connection  synchronisation   is
  1381.      composed   of  two  steps.  First,  the  two  processes
  1382.      exchange their identifiers for the specific  connection
  1383.      by  means  of a getcid primitive.  Usually, the pointer
  1384.      to the task control structure of the process is used as
  1385.      the connection identifier.
  1386.  
  1387.        Then, the 'master' sends an open CSB with appropriate
  1388.      parameter    string    passing    the    initialisation
  1389.      information. This information, which can also be called
  1390.      open   parameter,   is   process   dependent,  or  more
  1391.      accurately, task dependent. For example, the parameters
  1392.      for  the  file  system  should be the file name and the
  1393.      access mode. Provided the 'slave' accepts the  request,
  1394.      the connection is established successfully and data can
  1395.      be transferred via the interface.
  1396.  
  1397.        In  order  to  desynchronise  the   connection,   the
  1398.      'master' initiates a 'close' action. On the other hand,
  1399.      an error state or  EOF  (end  of  file)  state  can  be
  1400.      reported   by  the  'slave'  to  request  a  connection
  1401.      desynchronisation.
  1402.  
  1403.        The listen primitive in our system  is  reserved  for
  1404.      the  processes  that  receive a request from the remote
  1405.      hosts on the networks.
  1406.  
  1407.  
  1408.      3.3.3 Data Transfer
  1409.  
  1410.        While the Clean and Simple interface is asymmetric in
  1411.      relation  to  connection synchronisation, data transfer
  1412.      is completely symmetric so long as the  connection  has
  1413.      been  established.  Data  flows  in both directions are
  1414.      permitted, though the operations are quite different.
  1415.  
  1416.        The  interface  provides  two  primitives  for   data
  1417.      transfer  --  read  and write. To transfer some data to
  1418.      the  'slave',  the  'master'  signals  it  with  a  CSB
  1419.      containing  the write function and a buffer filled with
  1420.      the data to be transferred.  Having consumed the  data,
  1421.      the 'slave' returns the CSB to report the result status
  1422.      of the transmission.
  1423.  
  1424.        On the other hand, in order to receive some data from
  1425.      the 'slave', the 'master' uses a read CSB with an empty
  1426.      buffer. Having received the CSB, the 'slave' fills  the
  1427.      buffer  with  the data requested and, then, returns the
  1428.      CSB.
  1429.  
  1430.  
  1431.  
  1432.  
  1433.                              - 22 -
  1434.  
  1435. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1436.  
  1437.      3.4 Control and Organisation of the Tasks
  1438.  
  1439.        Another  important  aspect   of   the   multi-process
  1440.      architecture  of  the UCL facsimile system, is the need
  1441.      to systematise the  control  and  organisation  of  the
  1442.      tasks.  This  activity  is  the  function  of  the task
  1443.      controller, whose  operations  are  discussed  in  this
  1444.      section.
  1445.  
  1446.  
  1447.      3.4.1 Command Language
  1448.  
  1449.        As mentioned earlier, the task controller supports  a
  1450.      procedure-oriented  language by means of which the user
  1451.      or the routines of the upper layers can define the jobs
  1452.      requested.  A  command  should  contain  the  following
  1453.      information:
  1454.  
  1455.        1. the names of the task processes which are involved
  1456.           in the job.
  1457.        2. the open parameters for these task processes.
  1458.        3. the order in which the tasks are to be linked.
  1459.  
  1460.        The last item is quite  important,  though,  usually,
  1461.      the same order as that given in the command is used.
  1462.  
  1463.        A command in this language is presented  as  a  zero-
  1464.      ended  character  string.  In the task name strings and
  1465.      the attribute strings of the open parameters, '|', '"',
  1466.      and  ','  must  be  excluded as they will be treated as
  1467.      separators. The definition is shown below,  where  '|',
  1468.      which  is  the  separator of the command strings in the
  1469.      language, does not mean 'OR'.
  1470.  
  1471.  
  1472.      <command_string> ::= <task_string>
  1473.      <command_string> ::= <task_string>|<command_string>
  1474.      <task_string> ::= <task_name>
  1475.      <task_string> ::= <task_name>"<open_parameter>
  1476.      <open_parameter> ::= <attribute>
  1477.      <open_parameter> ::= <attribute>,<open_parameter>
  1478.  
  1479.  
  1480.  
  1481.      3.4.2 Task Controller
  1482.  
  1483.        In our experimental work, the task controller  module
  1484.      is  called  fitter.   This  name which is borrowed from
  1485.      UNIX hints how the  module  works.   According  to  the
  1486.      command  string,  it  links  the specified tasks into a
  1487.      chain, along which the data is processed to fulfil  the
  1488.  
  1489.  
  1490.  
  1491.  
  1492.                              - 23 -
  1493.  
  1494. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1495.  
  1496.      job requested (Fig. 8).
  1497.  
  1498.  
  1499.  
  1500.  
  1501.                             tasks
  1502.                 +-----+    +-----+    +-----+
  1503.                 !  a  ! -> !  b  ! -> !  c  !
  1504.                 +-----+    +-----+    +-----+
  1505.  
  1506.                      Fig. 8  The task chain
  1507.  
  1508.  
  1509.        Since  all  modules,  including  fitter  itself,  are
  1510.      implemented   as  processes,  the  connections  between
  1511.      modules should be via the Clean and Simple  interfaces.
  1512.      Upon  receiving  the  command string, the fitter parses
  1513.      the string to find each task process involved and opens
  1514.      a  connection  to  it. Formally, the task processes are
  1515.      chained directly, but, logically, there  is  no  direct
  1516.      connection  between  them. All of them are connected to
  1517.      the fitter (Fig. 9).
  1518.  
  1519.  
  1520.  
  1521.  
  1522.                            fitter
  1523.                        +-------------+
  1524.                    +-- !             ! --+
  1525.                    |   +-------------+   |
  1526.                    |          |          |
  1527.                    V          V          V
  1528.                 +-----+    +-----+    +-----+
  1529.                 !  a  !    !  b  !    !  c  !
  1530.                 +-----+    +-----+    +-----+
  1531.  
  1532.           Fig. 9 The connection initiated by the fitter
  1533.  
  1534.  
  1535.        For each of the processes  it  connects,  the  fitter
  1536.      keeps  a  table called pipe. When the command string is
  1537.      parsed, the pipe tables are double-linked to  represent
  1538.      the specified order of data flow. So far as one process
  1539.      is concerned, its pipe table contains two  pointers:  a
  1540.      forward  one pointing to its destination and a backward
  1541.      one pointing to its sources. Besides the  pointers,  it
  1542.      also  maintains  the  information  to identify the task
  1543.      process and the corresponding connection.
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.                              - 24 -
  1552.  
  1553. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1554.  
  1555.        Fig. 10 illustrates the chain of the pipe tables  for
  1556.      the  job "a|b|c".  Note that the forward (output) chain
  1557.      ends at the sink, while the backward (input) chain ends
  1558.      at  the  source.  In this sense, the task processes are
  1559.      chained in the specified order  via  the  fitter  (Fig.
  1560.      11). The data transfer along the chain is initiated and
  1561.      controlled by the  fitter,  each  process  getting  the
  1562.      input  from  its  source  and putting the output to its
  1563.      destination.
  1564.  
  1565.  
  1566.  
  1567.  
  1568.                +-----+    +-----+    +-----+
  1569.                !  * -+--> !  * -+--> !  0  !
  1570.                +-----+    +-----+    +-----+
  1571.                !  0  ! <--+- *  ! <--+- *  !
  1572.                +-----+    +-----+    +-----+
  1573.                !  a  !    !  b  !    !  c  !
  1574.                +-----+    +-----+    +-----+
  1575.                !     !    !     !    !     !
  1576.                !     !    !     !    !     !
  1577.                +-----+    +-----+    +-----+
  1578.  
  1579.                      Fig. 10  The pipe chain
  1580.  
  1581.  
  1582.  
  1583.                            fitter
  1584.                        +-------------+
  1585.                    +-> ! * -> * -> * ! --+
  1586.                    |   +-------------+   |
  1587.                    |         | A         |
  1588.                    |         V |         V
  1589.                 +-----+    +-----+    +-----+
  1590.                 !  a  !    !  b  !    !  c  !
  1591.                 +-----+    +-----+    +-----+
  1592.  
  1593.                      Fig. 11  The data flow
  1594.  
  1595.  
  1596.        This strategy makes the task organisation so flexible
  1597.      that  only the links have to be changed when a new task
  1598.      chain is to be built up. In such an  environment,  each
  1599.      task process can be implemented independently, provided
  1600.      the Clean and Simple interface is supported. This  also
  1601.      makes the system extension quite easy.
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.                              - 25 -
  1611.  
  1612. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1613.  
  1614.        The fitter manipulates one job at a time. But it must
  1615.      maintain  a  command  queue  to cope with the requests,
  1616.      which come simultaneously from either the  upper  level
  1617.      processes or other hosts on the network.
  1618.  
  1619.  
  1620.      3.5 Interface Routines
  1621.  
  1622.        In a modular, multi-process system such  as  the  UCL
  1623.      facsimile   system,  the  structure  of  the  interface
  1624.      routines is very important. The CSI of section  3.3  is
  1625.      fundamental  to the modular interface; a common control
  1626.      structure is also essential. This  section  gives  some
  1627.      details  both  about the sharable control structure and
  1628.      the buffer management.
  1629.  
  1630.  
  1631.      3.5.1 Sharable Control Structure
  1632.  
  1633.        Though the CSI specification is straightforward,  the
  1634.      implementation   of   the  inter-process  communication
  1635.      interface may be  rather  tedious,  especially  in  our
  1636.      system,  where  there  are  many  task  processes to be
  1637.      written. Not only does each process have  to  implement
  1638.      the  same  control  structure  for signal handling, but
  1639.      also the buffer management routines must be included in
  1640.      all the processes.
  1641.  
  1642.        For the sake of simplicity and efficiency, a  package
  1643.      of  standard  interface  routines is provided which are
  1644.      shared by the  task  processes  in  the  system.  These
  1645.      routines  are re-entrant, so that they can be shared by
  1646.      all processes.
  1647.  
  1648.        The 'csinit' primitive is called for a  task  process
  1649.      to check in.  An information table is allocated and the
  1650.      pointer to the table is returned to the caller  as  the
  1651.      task  identifier,  which is to be used for each call of
  1652.      these interface routines.
  1653.  
  1654.        Then,  each  task  process  waits  by  invoking   the
  1655.      'csopen'  primitive  which  does  not  return until the
  1656.      calling process  is  scheduled.   When  the  connection
  1657.      between  the process and the fitter is established, the
  1658.      call returns the pointer to the open  parameter  string
  1659.      of  the  task,  the corresponding task being started. A
  1660.      typical structure of the task process (written in c) is
  1661.      shown  below.  After  the task program is executed, the
  1662.      process calls the 'csopen' and waits again. It  can  be
  1663.      seen  that  the  portability  of  the  task routines is
  1664.      improved to a great extent. Only the interface routines
  1665.  
  1666.  
  1667.  
  1668.  
  1669.                              - 26 -
  1670.  
  1671. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1672.  
  1673.      should be changed if  the  system  were  to  run  in  a
  1674.      different operating environment.
  1675.  
  1676.  
  1677.      static int mytid;       /* task identifier */
  1678.  
  1679.      task()
  1680.      {
  1681.              char *op;       /* open parameter */
  1682.  
  1683.              mytid = csinit();
  1684.              for(;;) {
  1685.                      op = csopen(mytid);
  1686.                      ...     /* the body of the task */
  1687.              }
  1688.      }
  1689.  
  1690.  
  1691.  
  1692.      3.5.2 Buffer Management
  1693.  
  1694.        The package of the interface routines also provides a
  1695.      universal buffer management, so that the task processes
  1696.      are freed from this burden. The allocation of the  data
  1697.      buffers  is  the  responsibility  of  the  higher level
  1698.      process, the fitter. If the  task  processes  allocated
  1699.      their own buffers, some redundant copying would have to
  1700.      be  done.  Thus,  the  primitives  for  data  transfer,
  1701.      'csread' and 'cswrite', are designed as:
  1702.  
  1703.  
  1704.              char *csread(tid, need);
  1705.              char *cswrite(tid, need);
  1706.  
  1707.  
  1708.      where 'tid' is the identifier of the task and 'need' is
  1709.      the  number  of  data  bytes  to  be  transferred.  The
  1710.      primitives return the pointer to  the  area  satisfying
  1711.      the  caller's requirement. The 'csread' returns an area
  1712.      containing  the  data  required  by  the  caller.   The
  1713.      'cswrite'  returns  an  area  into which the caller can
  1714.      copy the data to be transferred. The copied  data  will
  1715.      be  written to its destination at a proper time without
  1716.      the caller's interference.  Obviously  the  unnecessary
  1717.      copy  operations can be avoided. It is recommended that
  1718.      the data buffer returned  by  the  primitives  be  used
  1719.      directly to attain higher performance.
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.                              - 27 -
  1729.  
  1730. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1731.  
  1732.        In order to implement  this  strategy,  each  time  a
  1733.      piece  of  data  is  required,  the  size of the buffer
  1734.      needed is compared with that of the unused buffer  area
  1735.      in  the current CSB. If the latter is not less than the
  1736.      former,  the  current  buffer  pointer   is   returned.
  1737.      Otherwise,  a  temporary buffer has to be employed. The
  1738.      data is copied into the buffer until the requested size
  1739.      is  reached.  In  this  case,  instead of a part of the
  1740.      current buffer, the temporary buffer will be returned.
  1741.  
  1742.        A 'cswrite' call with the 'need' field  set  to  zero
  1743.      tells  the  interface routine that no more data will be
  1744.      sent. It causes  a  'close'  CSB  to  be  sent  to  the
  1745.      destination routine.
  1746.  
  1747.        If there  is  not  enough  data  available,  'csread'
  1748.      returns zero to indicate the end of data.
  1749.  
  1750.  
  1751.      4. UCL FACSIMILE SYSTEM
  1752.  
  1753.        Now we discuss the implementation of the computerised
  1754.      facsimile   system   developed  in  the  Department  of
  1755.      Computer Science at UCL.
  1756.  
  1757.        This system has several components. Since  the  total
  1758.      system  is  a modular and multi-process one, a specific
  1759.      system must be built up for a specific application. The
  1760.      way  that this is done is discussed in section 4.1. The
  1761.      specific devices and their  drivers  are  described  in
  1762.      section  4.2. The system can be attached to a number of
  1763.      networks.  In  the  UCL  configuration,   the   network
  1764.      interface  can be direct to SATNET [22], SERC NET [23],
  1765.      PSS [24], and the Cambridge Ring. The form  of  network
  1766.      connection  is  discussed  further  in section 4.3. The
  1767.      system must transfer data between the facsimile devices
  1768.      and  the disks, and between the networks and the disks.
  1769.      For this a filing system is required which is discussed
  1770.      in section 4.4.
  1771.  
  1772.        A key aspect of the  UCL  system  is  flexibility  of
  1773.      devices, networks, and data formats. The flexibility of
  1774.      device is achieved by the modular nature of the  device
  1775.      drivers  (section  4.2).  The flexibility of network is
  1776.      discussed in section 4.8. The additional flexibility of
  1777.      data   structure  is  described  in  section  4.5.  The
  1778.      flexibility can be utilised by incorporating conversion
  1779.      routines  as in section 4.6. An important aspect of the
  1780.      UCL system is the ability to provide local manipulation
  1781.      facilities  for  the  graphics  files.   The facilities
  1782.      implemented for the local manipulation are discussed in
  1783.  
  1784.  
  1785.  
  1786.  
  1787.                              - 28 -
  1788.  
  1789. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1790.  
  1791.      section 4.7.  In  order  to  transfer  files  over  the
  1792.      different  networks  of  section 4.3. a high level data
  1793.      transmission protocol must be defined.  The  procedures
  1794.      used in the UCL system are discussed in section 4.8.
  1795.  
  1796.  
  1797.      4.1 Multi-Task Structure
  1798.  
  1799.        The  task  controller  and   processing   tasks   are
  1800.      implemented  as  MOS  processes.  A  number  of utility
  1801.      routines are provided  for  users  to  build  new  task
  1802.      processes and modules at application level.
  1803.  
  1804.        In the environment of MOS, a process is included in a
  1805.      system  by  specifying a Process Control Table when the
  1806.      system is built up. The macro  'setpcte'  is  used  for
  1807.      this  purpose,  the  meaning  of  its  parameters being
  1808.      defined in [14].
  1809.  
  1810.  
  1811.      #define setpcte(name,entry,pridev,prodev,stklen,
  1812.          relpid,relopc)
  1813.        {0,name,entry,pridev,prodev,stklen,relpid,relopc}
  1814.  
  1815.  
  1816.        A Device Control Table (DCT) has to be specified  for
  1817.      each  device  when the system is built up. A DCT can be
  1818.      defined anywhere as devices are referenced by  the  DCT
  1819.      address.  The  macro  'setdcte'  is designed to declare
  1820.      devices, the meanings of its parameters being specified
  1821.      in   [14].    This   method   is  used  in  the  device
  1822.      descriptions.
  1823.  
  1824.  
  1825.      #define setdcte(name,intvec,devcsr,devbuf,devinit,
  1826.          ioinit,intrpt,mate)
  1827.        {04037,intrpt,0,0,name,mate,intvec,devinit,
  1828.          devcsr,devbuf,ioinit}
  1829.  
  1830.  
  1831.  
  1832.      4.2 The Devices
  1833.  
  1834.        As mentioned in section 2,  apart  from  the  general
  1835.      purpose  system console, there are three devices in the
  1836.      system to support the facsimile service. These are:
  1837.  
  1838.       (1) AED62 Floppy Disk, which is used as the  secondary
  1839.           memory storing the facsimile image data. Above its
  1840.           driver, a file system is implemented to manage the
  1841.           data  stored  on  the disks, so that an image data
  1842.  
  1843.  
  1844.  
  1845.  
  1846.                              - 29 -
  1847.  
  1848. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1849.  
  1850.           file can be accessed through the Clean and  Simple
  1851.           interface.  This file system is dicussed in detail
  1852.           in the next section. For some processing jobs, the
  1853.           image  data  has  to  buffered on a temporary file
  1854.           lest time-out occurs on the facsimile machine.
  1855.  
  1856.       (2) DACOM Facsimile Machine, which is  used  to  input
  1857.           and  output  image  data.  It  reads  an image and
  1858.           creates the corresponding data  stream.  On  other
  1859.           hand, it accepts the image data and reproduces the
  1860.           corresponding image. Above its driver, there is  a
  1861.           interface  task  to fit the facsimile machine into
  1862.           the system, the Clean and Simple  interface  being
  1863.           supported.   The  encoding algorithm for the DACOM
  1864.           machine is described in [19].
  1865.  
  1866.       (3) Grinnell Colour Display,  which  is  used  as  the
  1867.           monitor  of  the  system.  Above  its  driver,  an
  1868.           interface task is implemented so  that  the  image
  1869.           data  in  standard  format can be accepted through
  1870.           the Clean and Simple interface.
  1871.  
  1872.        The detailed description  of  these  devices  can  be
  1873.      found  in  Appendix  1.  The  interface  task  and  the
  1874.      description for each device are listed in the following
  1875.      table. The interface tasks can be directly used as data
  1876.      source or sink in a task string.
  1877.  
  1878.  
  1879.            Device       Interface Task  Description
  1880.  
  1881.      AED62 Floppy Disk        fs()      aed62(device)
  1882.      DACOM fax Machine       fax()      dacom(device)
  1883.      Grinnell Display   grinnell()      grinnell(device)
  1884.  
  1885.  
  1886.        Note that the DCTs  for  the  facsimile  machine  and
  1887.      Grinnell    display   have   been   included   in   the
  1888.      corresponding interface tasks, so that there is no need
  1889.      to declare them if these tasks are used.
  1890.  
  1891.  
  1892.      4.3 The Networks
  1893.  
  1894.        There   are   three   relevant   wide-area   networks
  1895.      terminating  in  the  Department of Computer Science at
  1896.      the end of 1981. These are:
  1897.  
  1898.       (1) A British Telecom X25 network (PSS, [24]).
  1899.  
  1900.       (2) A private X25 network (SERC NET, [23])
  1901.  
  1902.  
  1903.  
  1904.  
  1905.                              - 30 -
  1906.  
  1907. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1908.  
  1909.       (3) A Defence network (ARPANET/SATNET, [21], [22])
  1910.  
  1911.        In addition there is a  Cambridge  Ring  as  a  local
  1912.      network.
  1913.  
  1914.        For the time  being,  the  UCL  facsimile  system  is
  1915.      directly  attached to the various networks at the point
  1916.      NI (Network Interface) of Fig. 1.
  1917.  
  1918.        As mentioned earlier, pictures can be  exchanged  via
  1919.      the  SATNET/ARPANET,  between UCL in London, ISI in Los
  1920.      Angeles, and COMSAT in  Washington  D.C..  The  Network
  1921.      Independent File Transfer Protocol (NIFTP, [9]) is used
  1922.      to transfer the image data.   This  protocol  has  been
  1923.      implemented  on LSI under MOS [10].  In addition, we at
  1924.      UCL have put NIFTP on an ARPANET  TOPS-20  host,  which
  1925.      can  act  as  an Internet File Forwader (IFF).  In this
  1926.      case, TCP/IP ([28], [29]) is employed as the underlying
  1927.      transport   service.   Since   TCP   provides  reliable
  1928.      communication channels, the  provision  of  checkpoints
  1929.      and  error-recovery  procedures are not included in our
  1930.      NIFTP implementations.
  1931.  
  1932.        In  the  X25  network,  the  transport  procedure  is
  1933.      NITS/X25   ([25],   [26]).    Though  pictures  can  be
  1934.      transferred to the X25 networks, no  experimental  work
  1935.      has been done, because:
  1936.  
  1937.       (1) There is at present no  collaborative  partner  on
  1938.           these networks.
  1939.  
  1940.       (2) The LSI-11, on which our  system  is  implemented,
  1941.           has no direct connection to these networks.
  1942.  
  1943.        Locally,  image  data  can  be  transmitted  to   the
  1944.      PDP11-44s   running  the  UNIX  time-sharing  operating
  1945.      system. At present, the SCP ring-driver  software  uses
  1946.      permanent   virtual  circuits  (PVCs)  to  connect  the
  1947.      various computers on the ring.
  1948.  
  1949.  
  1950.      4.4 File System
  1951.  
  1952.        A file system has been designed, based on  the  AED62
  1953.      double  density  floppy  disk, for use under MOS. It is
  1954.      itself implemented as  a  MOS  process  supporting  the
  1955.      Clean  and  Simple  interface.  The description of this
  1956.      task, fs(fax), can be found in Appendix 2.
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.                              - 31 -
  1965.  
  1966. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  1967.  
  1968.        In a command string, the file system  task  can  only
  1969.      serve  as  either  data  source  or data sink. In other
  1970.      words, it can only appear at the first or last position
  1971.      on  a  command  string.  In  the  former case, the file
  1972.      specified is to be  read,  while  the  file  is  to  be
  1973.      written in the latter case.
  1974.  
  1975.        Three access modes are allowed which are:
  1976.  
  1977.  
  1978.        * Read a file
  1979.        * Create a file
  1980.        * Append a file
  1981.  
  1982.  
  1983.        The file name and access mode are  specified  as  the
  1984.      open parameters.
  1985.  
  1986.        Let us consider an example.  If a document is  to  be
  1987.      read  on  the  facsimile  machine  and  the data stream
  1988.      created is to be stored on the file system, the command
  1989.      string required is:
  1990.  
  1991.  
  1992.              fax"r|fs"c,doc
  1993.  
  1994.      where:  fax - interface task for facsimile machine
  1995.              r   - read from facsimile machine
  1996.              fs  - file system task
  1997.              c   - create a new file
  1998.              doc - the name of the file to be created.
  1999.  
  2000.  
  2001.        In order to dump a  file,  a  task  process  od()  is
  2002.      provided  which  works  as  a  data  sink  in a command
  2003.      string.
  2004.  
  2005.  
  2006.      4.5 Data Structure
  2007.  
  2008.        Facsimile  image  data  is  created  using  a   high-
  2009.      resolution raster scanner, so that the original picture
  2010.      can  be  reproduced  faithfully.  The  facsimile   data
  2011.      represents  binary  images,  in  monochrome,  with  two
  2012.      levels of intensity, belonging  to  the  data  type  of
  2013.      bit-mapped graphics.
  2014.  
  2015.        The simplest representation is  the  bit-map  itself.
  2016.      The bits, each of which corresponds to a single picture
  2017.      element, are arranged in the  same  order  as  that  in
  2018.      which  the original picture is scanned, 1s standing for
  2019.  
  2020.  
  2021.  
  2022.  
  2023.                              - 32 -
  2024.  
  2025. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2026.  
  2027.      black pixels and 0s for white ones. Operations  on  the
  2028.      picture are easily carried out. For example, two images
  2029.      represented  in  the  bit-map  format  can  be   merged
  2030.      together  by  using  a  simple  logic OR operation. Any
  2031.      specific  pixel  can   be   retrieved   by   a   simple
  2032.      calculation. However, its size is usually large because
  2033.      of  the  high  resolution.   This   makes   it   almost
  2034.      unrealistic for storage or transmission.
  2035.  
  2036.        Facsimile image data should therefore  be  compressed
  2037.      to reduce its redundancy, so that the efficient storage
  2038.      and transmission can be achieved.
  2039.  
  2040.        Run-length encoding is a useful  compression  scheme.
  2041.      Instead of the pattern, the counts of consecutive black
  2042.      and white runs are used to represent the image.
  2043.  
  2044.        Vector representation, in which the  run-lengths  are
  2045.      coded  as  integers  or  bytes,  is  a  useful internal
  2046.      representation of images. Not  only  is  it  reasonably
  2047.      compressed,  but  it is also quite easy for processing.
  2048.      Chopping, scaling and mask-scanning are examples of the
  2049.      processing   operations   which   may   be   performed.
  2050.      Furthermore, a conversion between different compression
  2051.      schemes  may  have to be carried out in such a way that
  2052.      the data is first decompressed into the  vector  format
  2053.      and  then recompressed. The difficulty in retrieval can
  2054.      be overcome by means of line  index,  which  gives  the
  2055.      pointers to each lines of the image.
  2056.  
  2057.        A higher compression rate leads to a  more  efficient
  2058.      transmission.  But  this  is  at the expense of ease of
  2059.      processing.  An example of this is the use  of  Huffman
  2060.      Code  in  the  CCITT  1-dimensional compression scheme.
  2061.      While the data can be compressed more  efficiently,  it
  2062.      is rather difficult to manipulate the data direcltly.
  2063.  
  2064.        Taking the correlation between  adjacent  lines  into
  2065.      account,  2-dimensional compression can achieve an even
  2066.      higher   compression    rate.    CCITT    2-dimensional
  2067.      compression  and  the  DACOM facsimile machine use this
  2068.      method.
  2069.  
  2070.        It is desirable to integrate  facsimile  images  with
  2071.      other  data types, such as text and geometric graphics;
  2072.      the  structure  of  these  other  types  must  then  be
  2073.      incorporated  in  the  system.  At  present,  only text
  2074.      structure  is  available,  while  the   structure   for
  2075.      geometric graphics is a topic for the further study.
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.                              - 33 -
  2083.  
  2084. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2085.  
  2086.        In  the  facsimile   system,   the   following   data
  2087.      structures    are    supported.    The    corresponding
  2088.      descriptions, if any, are listed as well and  they  can
  2089.      be found in Appendix 3 (except of dacom(device)).
  2090.  
  2091.  
  2092.      type    structure       compression     description
  2093.  
  2094.      bit-map  bit-map               -              -
  2095.              vector          1D run-length   vector(fax)
  2096.              dacom block     2D run-length   dacom(device)
  2097.              CCITT T4        1D run-length   t4(fax)
  2098.                              2D run-length   t4(fax)
  2099.  
  2100.      text    text                  -         text(fax)
  2101.  
  2102.  
  2103.        As an  internal  data  structure,  vector  format  is
  2104.      widely  used  for data transfer between task processes.
  2105.      The set of interface  routines  has  been  extended  by
  2106.      introducing  two subroutines, namely getl() and putl(),
  2107.      which read and write line vectors directly through  the
  2108.      Clean  and  Simple interface. These two routines can be
  2109.      found in Appendix 3 (getl(fax) and putl(fax))
  2110.  
  2111.        In order to check the validity of a  vector  file,  a
  2112.      check task process check() is provided which works as a
  2113.      data sink in a command string. It  can  also  dump  the
  2114.      vector elements of the specific lines.
  2115.  
  2116.  
  2117.      4.6 Data Conversion
  2118.  
  2119.        In order to convert one data structure into  another,
  2120.      several conversion modules are provided in this system.
  2121.      These modules fall into two categories, task  processes
  2122.      and  subroutines.  The task processes are MOS processes
  2123.      which can only be used in the environment described  in
  2124.      this note, while the subroutines which are written in c
  2125.      and compatible under UNIX are more generally usable.
  2126.  
  2127.        Character strings  or  text  can  be  converted  into
  2128.      vector  format,  so  that an integrated image combining
  2129.      picture and text can be formed.
  2130.  
  2131.        The following table lists these  conversion  modules,
  2132.      including  their  functions and descriptions (which can
  2133.      be found in Appendix 3).
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.                              - 34 -
  2142.  
  2143. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2144.  
  2145.      module  type          from          to      description
  2146.  
  2147.      decomp  process       dacom         vector   decomp(fax)
  2148.      recomp  process       vector        dacom    recomp(fax)
  2149.  
  2150.      ccitt   process       vector        t4       ccitt(fax)
  2151.                            t4            vector
  2152.  
  2153.      bitmap  subroutine    vector        bitmap    bit-map(fax)
  2154.      tovec   subroutine    bitmap        vector    tovec(fax)
  2155.  
  2156.      ts      subroutine    ASCII string  vector   ts(fax)
  2157.      string  process       ASCII string  vector   string(fax)
  2158.      tf      process       text          vector   tf(fax)
  2159.  
  2160.  
  2161.        Since each DACOM block contains a  Cyclic  Redundancy
  2162.      Check  (CRC)  field,  the  system supplies a subroutine
  2163.      crc()  to  calculate  or  check  the  CRC  code.   (see
  2164.      crc(fax))
  2165.  
  2166.        If a vector file  is  to  be  printed  on  the  DACOM
  2167.      facsimile   machine,  the  image  data  should  be  re-
  2168.      compressed into the DACOM-block  format,  the  required
  2169.      command string being shown below.
  2170.  
  2171.  
  2172.      fs"e,pic|recomp|fax"w
  2173.  
  2174.      where   fs     - file system task
  2175.              e      - read an existing file
  2176.          ic    - file name
  2177.              recomp - re-compression task
  2178.              fax    - interface task for facsimile machine
  2179.              w      - print an image on facsimile machine
  2180.  
  2181.  
  2182.  
  2183.      4.7 Image Manipulation
  2184.  
  2185.        Four processing task processes are  provided  in  the
  2186.      system.  These are:
  2187.  
  2188.       (1) Chop, which applies a defined window to the  input
  2189.           image.
  2190.  
  2191.       (2) Scale, which enlarges or shrinks the  input  image
  2192.           to the defined dimensions.
  2193.  
  2194.       (3) Merge, which puts the input image on the specified
  2195.           area of a background image.
  2196.  
  2197.  
  2198.  
  2199.  
  2200.                              - 35 -
  2201.  
  2202. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2203.  
  2204.       (4) Clean, which removes the noise on the input image.
  2205.  
  2206.        The Clean and  Simple  interfaces  are  supported  in
  2207.      these processing tasks so that the tasks can be used in
  2208.      command strings.  However, these tasks can  be  neither
  2209.      source  nor  sink in a command string.  The data format
  2210.      of their input and output is vector.
  2211.  
  2212.        For example, a facsimile page can be cleaned and then
  2213.      printed  on  the facsimile machine. Note that the image
  2214.      data must be recompressed  before  being  sent  to  the
  2215.      facsimile  machine. If the original data is the form of
  2216.      DACOM  block,  it  has  to  be  decompressed   as   the
  2217.      processing   tasks   only  accept  line  vectors.   The
  2218.      required command string is shown below.
  2219.  
  2220.  
  2221.      fs"e,page|clean|recomp|fax"w
  2222.  
  2223.      where   fs     - file system task
  2224.              e      - read an existing file
  2225.              page   - file name
  2226.              clean  - cleaning task
  2227.              recomp - re-compression task
  2228.              fax    - interface task for facsimile machine
  2229.              w      - print an image on facsimile machine
  2230.  
  2231.  
  2232.  
  2233.        The descriptions of these  processing  tasks  can  be
  2234.      found in Appendix 2 (chop(fax), scale(fax), merge(fax),
  2235.      and clean(fax)).
  2236.  
  2237.        In tasks 'chop' and  'merge',  a  window  is  set  by
  2238.      giving  the coordinates of its vertices. However, it is
  2239.      usually rather difficult for a human user to decide the
  2240.      exact  coordinates.  The  system  supplies a subroutine
  2241.      choice() which specifies a rectangular subsection of an
  2242.      image  by  interactive  manipulations  of a rectangular
  2243.      subsection  on  the  screen  of  the  Grinnell  display
  2244.      displaying the image.  It provides a set of interactive
  2245.      commands whereby a user can intuitively choose an  area
  2246.      he  is interested in. Note that this subroutine must be
  2247.      called by a MOS process and the Grinnell  display  must
  2248.      be included in the system.
  2249.  
  2250.        By means of these image processing modules, the image
  2251.      editing  described  in  section 2.4 can be carried out.
  2252.      Let us consider an example. An image abstracted from  a
  2253.      picture  'a'  is  to be merged onto a specified area of
  2254.      another picture 'b'. First of all, the two pictures 'a'
  2255.  
  2256.  
  2257.  
  2258.  
  2259.                              - 36 -
  2260.  
  2261. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2262.  
  2263.      and 'b' should be displayed on the left half and  right
  2264.      half  of  the screen, respectively. Assume that the two
  2265.      pictures are standard DACOM pages whose dimensions  are
  2266.      1726x1200.  They have to be shrunk to fit the dimension
  2267.      of the half screen (256x512).  Note that  if  the  data
  2268.      format  is not vector, conversion should be carried out
  2269.      first.  the required command strings are:
  2270.  
  2271.  
  2272.    e,a|scale"1726,1200,256,512|grinnell"0,511,255,0,z,g
  2273.      fs"e,b|scale"1726,1200,256,512|grinnell"256,511,511,0,z,b
  2274.  
  2275.      where   fs            - file system task
  2276.              e             - read an existing file
  2277.              a             - file name
  2278.              b             - file name
  2279.              scale         - scale task
  2280.              1726,1200     - old dimension
  2281.              256,512       - new dimension
  2282.              grinnell       - grinnell display interface task
  2283.              0,511,255,0   - presentation area (the left half)
  2284.              256,511,511,0 - presentation area (the right half)
  2285.              z             - zero write mode
  2286.              g             - green
  2287.              b             - blue
  2288.  
  2289.  
  2290.        In an application process, the subroutine choice() is
  2291.      called in the following ways for the user to choose the
  2292.      areas on both pictures.
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.                              - 37 -
  2319.  
  2320. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2321.  
  2322.      choice(r, 1726, 1200, 1, 0, 0);
  2323.              /* choice the area on 'a' */
  2324.              /* r    - red
  2325.                 1726 - width of the original picture
  2326.                 1200 - height of the original picture
  2327.                 1    - left half of the screen
  2328.                 0    - the subsection can be of any width
  2329.                 0    - the subsection can be of any height
  2330.               */
  2331.      choice(r, 1726, 1200, 2, 0, 0);
  2332.              /* choice the area on 'b' */
  2333.              /* r    - red
  2334.                 1726 - width of the original picture
  2335.                 1200 - height of the original picture
  2336.                 2    - right half of the screen
  2337.                 0    - the subsection can be of any width
  2338.                 0    - the subsection can be of any height
  2339.               */
  2340.  
  2341.  
  2342.        When the user finishes editing,  the  coordinates  of
  2343.      the  chosen  rectangular areas are returned. An example
  2344.      is given in the table below.  The  widths  and  heights
  2345.      listed  in  the  table are actually calculated from the
  2346.      coordinates returned and they indicate that the  source
  2347.      image has to be enlarged to fit its destination.
  2348.  
  2349.  
  2350.               (0, 0)
  2351.                 +-------------------------------> x
  2352.                 |
  2353.                 |  (x0, y0)     w
  2354.                 |     +--------------------+
  2355.                 |     !                    !
  2356.                 |     !                    !
  2357.                 |     !                    ! h
  2358.                 |     !                    !
  2359.                 |     !                    !
  2360.                 |     +--------------------+
  2361.                 |                       (x1, y1)
  2362.                 V
  2363.                 y
  2364.  
  2365.      original   x0      y0      x1      y1      w       h
  2366.  
  2367.         a       30      40     100     120      70      80
  2368.         b      100     100    1100    1100    1000    1000
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.                              - 38 -
  2378.  
  2379. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2380.  
  2381.        At this stage, our final  goal  can  be  achieved  by
  2382.      performing  a  job  specified below. It is assumed that
  2383.      the result image is to be stored as a new file 'c'.
  2384.  
  2385.  
  2386.      fs"e,a|chop"30,40,100,120|scale"70,80,1000,1000
  2387.          |merge"b,0,100,100,1100,1100|fs"c,c
  2388.  
  2389.      where   fs                - file system task
  2390.              e                 - read an existing file
  2391.              a                 - file name
  2392.              chop              - chop task
  2393.              30,40,100,120     - the area to be abstracted
  2394.              scale             - scale task
  2395.              70,80             - old dimension
  2396.              1000,1000         - new dimension
  2397.              merge             - merge task
  2398.              b                 - file name of the background image
  2399.              0                 - to be overlaid
  2400.              100,100,1100,1100 - the area to be overlaid
  2401.              fs                - file system task
  2402.              c                 - create a new file
  2403.              c                 - the name of the file to be
  2404.                                  created
  2405.  
  2406.  
  2407.  
  2408.  
  2409.      4.8 Data Transmission
  2410.  
  2411.        In  order  to  transmit  facsimile  image  data  over
  2412.      computer  networks,  using the configuration of Fig. 1,
  2413.      the Network Independent File Transfer Protocol  [9]  is
  2414.      implemented as a MOS task process, the Clean and Simple
  2415.      interface of section 3.3  being  supported  [10].  Thus
  2416.      this  module  can be used in a command string directly.
  2417.      In this case, the module always works in the  initiator
  2418.      mode,  though the server mode is supported as well. Its
  2419.      description can be found in Appendix 2 (ftp(fax)).
  2420.  
  2421.        As  a  network-independent  protocol,  it  employs  a
  2422.      transport  service  to communicate across the networks.
  2423.      The Clean and Simple interface is  also  used  for  the
  2424.      communication  between the module and transport service
  2425.      processes.
  2426.  
  2427.        Suppose that an image file stored in  a  remote  file
  2428.      system is to be printed on the local facsimile machine.
  2429.      Assume that the data is  transmitted  via  the  ARPANET
  2430.      [21],  Transport Control Protocol (TCP) [28] being used
  2431.      as the underlying transport service. As  was  described
  2432.  
  2433.  
  2434.  
  2435.  
  2436.                              - 39 -
  2437.  
  2438. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2439.  
  2440.      before, since the  delay  caused  by  the  network  may
  2441.      result  in  a  time-out on the local facsimile machine,
  2442.      the job should be divided into two subjobs.
  2443.  
  2444.       (1) The remote file  is  transmitted  by  using  NIFTP
  2445.           module.   However,  instead  of  being  put on the
  2446.           facsimile machine directly, the received  data  is
  2447.           store in a temporary file.
  2448.  
  2449.  
  2450.           ftp"r,b,ucl,fax,pic;tcp:1234,10,3,3,42,4521|fs"c,tmp
  2451.  
  2452.           where   ftp - NIFTP task
  2453.                   t   - receive
  2454.                   b   - binary
  2455.                   ucl - remote user name
  2456.                   fax - remote password
  2457.                   pic - remote file name
  2458.                   tcp - transport service process
  2459.  
  2460.                   parameters for the transport service:
  2461.  
  2462.                       1234      - local channel number
  2463.                       10,3,3,42 - remote address
  2464.                       4521      - channel reserved for the
  2465.                                   remote server
  2466.  
  2467.                   fs  - local file system task
  2468.                   c   - create a new file
  2469.                   tmp - the name of the file to be created
  2470.  
  2471.  
  2472.       (2) The temporary file is read and the image  is  sent
  2473.           to  the facsimile machine for printing. Here it is
  2474.           assumed the data received is in the form of  DACOM
  2475.           block so that no conversion is needed.
  2476.  
  2477.  
  2478.           fs"e,tmp|fax"w
  2479.  
  2480.           where   fs     - file system task
  2481.                   e      - read an existing file
  2482.                   tmp    - file name
  2483.                   fax    - interface task for facsimile machine
  2484.                   w      - print an image on facsimile machine
  2485.  
  2486.  
  2487.        We are able to  exchange  image  data  with  ISI  and
  2488.      COMSAT.  At present DACOM block is the only format that
  2489.      can be used as  all  the  three  participants  in  this
  2490.      experiment  possess  DACOM  facsimile  machines  and no
  2491.  
  2492.  
  2493.  
  2494.  
  2495.                              - 40 -
  2496.  
  2497. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2498.  
  2499.      other data format is available in both ISI and  COMSAT.
  2500.      However,  it  is  the  intention  of the ARPA-Facsimile
  2501.      community to adopt the CCITT standard for future  work.
  2502.      As mentioned earlier, UCL already has this facility.
  2503.  
  2504.        Above NIFTP, a simple protocol was  used  to  control
  2505.      the  transmission  of facsimile data. In this protocol,
  2506.      the format of a facsimile  data  file  was  defined  as
  2507.      follows:  Each  DACOM  block was recorded with a 2-byte
  2508.      header at the front. This  header  was  composed  of  a
  2509.      length-byte   indicating   the   length  of  the  block
  2510.      (including the header) and a code-byte  indicating  the
  2511.      type  of  the  block.  This  is  shown in the following
  2512.      diagram.
  2513.  
  2514.  
  2515.              |<--- header ---->|<------ 74 bytes ------->|
  2516.              +--------+--------+-------------------------+
  2517.              ! length !  code  !       DACOM block       !
  2518.              +--------+--------+-------------------------+
  2519.  
  2520.  
  2521.        The Length-byte is 76 (decimal) for all DACOM blocks.
  2522.      The  code-byte for a setup block is 071 (octal) and 072
  2523.      for a data block. A  special  EOP  block  was  used  to
  2524.      indicate  the  end  of  a page. This block had only the
  2525.      header with the length-byte set to 2 and the  code-byte
  2526.      undefined.  A facsimile data file could contain several
  2527.      pages, which were separated by EOP blocks.
  2528.  
  2529.  
  2530.      5. CONCLUSION
  2531.  
  2532.      5.1 Summary
  2533.  
  2534.        Though techniques  for  facsimile  transmission  were
  2535.      invented  in  1843,  it  was not until the recent years
  2536.      that integration with  computer  communication  systems
  2537.      gave rise to "great expectation".  The system described
  2538.      in  this  note   incarnates   the   compatibility   and
  2539.      flexibility of computerised facsimile systems.
  2540.  
  2541.        In this system, facsimile no longer refers simply  to
  2542.      the  transmission device, but rather to the function of
  2543.      transferring hard copy from one place to another.   Not
  2544.      only  does  the  system  allow  for  more  reliable and
  2545.      accurate document transmission over  computer  networks
  2546.      but  images  can  also  be  manipulated electronically.
  2547.      Image is converted from one  representation  format  to
  2548.      another,  so that different makes of facsimile machines
  2549.      can communicate with each other.  It is possible for  a
  2550.  
  2551.  
  2552.  
  2553.  
  2554.                              - 41 -
  2555.  
  2556. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2557.  
  2558.      picture to be presented on different  bit-map  devices,
  2559.      e.g.  TV-like  screen,  as it can be scaled to overcome
  2560.      the incompatibilities.  Moreover, the  system  provides
  2561.      windowing   and   overlaying   facilities   whereby   a
  2562.      sophisticated editor can be supported.
  2563.  
  2564.        One of the most important aspects of this  system  is
  2565.      that   text   can  be  converted  into  its  bit-mapped
  2566.      representation format  and  integrated  with  pictures.
  2567.      Geometric  graphics  could  also  be  included  in  the
  2568.      system. Thus, the facsimile  machine  may  serve  as  a
  2569.      printer  for  multi-type  documents.  It  is clear that
  2570.      facsimile  will  play  an  important  role  in   future
  2571.      information processing system.
  2572.  
  2573.        As far  as  the  system  per  se  is  concerned,  the
  2574.      following  advantages  can  be  recognised.  Though our
  2575.      discussion is concentrated  on  the  facsimile  system,
  2576.      many  features  developed  here  apply  equally well to
  2577.      other information-processing systems.
  2578.  
  2579.       (1)  Flexibility:  The  user  jobs   can   be   easily
  2580.           organised.  The  only  thing  to  be done for this
  2581.           purpose is to  make  the  logical  links  for  the
  2582.           appropriate task processes.
  2583.  
  2584.       (2) Simplicity: The interface routines are responsible
  2585.           for  the  operations  such  as signal handling and
  2586.           buffer management.  By avoiding this  burden,  the
  2587.           implementation  of the task processes becomes very
  2588.           "clean and simple".
  2589.  
  2590.       (3) Portability: The interface routines also makes the
  2591.           task   processes   totally   independent   of  the
  2592.           operating environment.  Only these routines should
  2593.           be modified if the environment were changed.
  2594.  
  2595.       (4) Ease of extension: The power of the system can  be
  2596.           simply  and infinitely extended by adding new task
  2597.           processes.
  2598.  
  2599.       (5) Distributed  Environment:  This  approach  can  be
  2600.           easily  extended  to  a  distributed  environment,
  2601.           where limitless hardware  and  software  resources
  2602.           can be provided.
  2603.  
  2604.  
  2605.      5.2 Problems
  2606.  
  2607.        As discussed earlier, the network we were  using  for
  2608.      the  experimental  work was not designed for image data
  2609.  
  2610.  
  2611.  
  2612.  
  2613.                              - 42 -
  2614.  
  2615. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2616.  
  2617.      transmission.  The data transfer  is  so  slow  that  a
  2618.      time-out may be caused on the facsimile machine. Though
  2619.      this problem was solved by means of local buffering and
  2620.      pictures  were successfully exchanged over the network,
  2621.      the slowness is rather  disappointing  because  of  the
  2622.      quantity of image data. The measurement showed that the
  2623.      throughput was around 500 bits/sec. In other words,  it
  2624.      took  at  least  5 minutes to transfer a page. This was
  2625.      caused by the network but not our system. The situation
  2626.      has been improved recently. However, It is nevertheless
  2627.      required that more  efficient  compression  schemes  be
  2628.      developed.
  2629.  
  2630.        At present, the system must be directly  attached  to
  2631.      the  network to be accessed. However, the network ports
  2632.      are much demanded, so that frequent reconfiguration  is
  2633.      required.
  2634.  
  2635.        The facsimile system can be  connected  only  to  the
  2636.      local  network,  the  Cambridge Ring, while the foreign
  2637.      networks are connected via gateways to the  ring.  This
  2638.      is shown in Fig. 12. Now the X25 network is attached to
  2639.      the Ring via an X25 gateway, XG [25], while  SATNET  is
  2640.      connected by another gateway, SG [25]. Both network are
  2641.      at the transport level; XG and SG support the  relevant
  2642.      transport  procedures.  In  the  case  of  XG,  this is
  2643.      NITS/X25 ([26], [27]); in the case  of  SATNET,  it  is
  2644.      TCP/IP ([28], [29]).
  2645.  
  2646.  
  2647.      UCL facsimile
  2648.        system          - - - - - - - -
  2649.      +--------+      /                 \      +------+
  2650.      !        ! ----    Cambridge Ring   ---- !  PE  !
  2651.      +--------+      \                 /      +------+
  2652.                        - - - - - - - -            |
  2653.                          /         \              |
  2654.                    +------+       +------+        |
  2655.                    !  XG  !       !  SG  ! --- SATNET
  2656.                    +------+       +------+
  2657.                    /       \
  2658.                  PSS    SERC NET
  2659.  
  2660.           Fig. 12  Schematic of UCL network connection
  2661.  
  2662.  
  2663.        When the network software runs in the same machine as
  2664.      the   application   software,   the  Clean  and  Simple
  2665.      interface of section  3.5  was  used  as  an  interface
  2666.      between  the  modules.  When  the  gateway software was
  2667.      removed to a separate machine, an Inter-Processor Clean
  2668.  
  2669.  
  2670.  
  2671.  
  2672.                              - 43 -
  2673.  
  2674. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2675.  
  2676.      and  Simple  [30]  was   required.    The   appropriate
  2677.      transport   process  is  transferred  to  the  relevant
  2678.      gateway, and appropriate facilities are implemented for
  2679.      addressing   the   relevant   gateway.  Otherwise,  the
  2680.      software has to be little  altered  to  cater  for  the
  2681.      distributed case.
  2682.  
  2683.        In our experimental work, the following problems were
  2684.      also encountered.
  2685.  
  2686.       (1) The primary memory of the LSI-11 is so small  that
  2687.           we  cannot  build  up  a system to include all the
  2688.           modules we have developed.  In order  to  transfer
  2689.           an  edited picture using the NIFTP module, we have
  2690.           to first  load  an  editor  system  to  input  and
  2691.           process  the  picture, and then an NIFTP system is
  2692.           then loaded to transmit it.
  2693.  
  2694.       (2) The execution of  an  image  processing  procedure
  2695.           becomes  very  slow. For example, it takes several
  2696.           minutes to shrink a picture to fit the  screen  of
  2697.           the  Grinnell  display.  This  prevents the system
  2698.           from being widely used in its present form.
  2699.  
  2700.       (3) As secondary storage, floppy disks  are  far  from
  2701.           adequate  to keep image data files. At present, we
  2702.           have two double-density floppy  disk  drives,  the
  2703.           capacity  of  each  disk  being  about 630K bytes.
  2704.           However, an image page contains at least 50K bytes
  2705.           and,  sometimes,  this number may be doubled for a
  2706.           rather complex picture.  Only a limited number  of
  2707.           pages can be stored.
  2708.  
  2709.        On the other hand, in our  department,  we  have  two
  2710.      PDP11-44s   running  UNIX  together  with  large  disks
  2711.      supplying abundant file storage. Their processing speed
  2712.      is  much  higher  than  that of the LSIs. The UNIX file
  2713.      system  supports   a   very   convenient   information-
  2714.      management environment. This inspired the idea that the
  2715.      UNIX file system could pretend  to  be  a  file  server
  2716.      responsible for storing and managing the image data, so
  2717.      that all the processing tasks may  be  carried  out  on
  2718.      UNIX. Not only does this immediately solve the problems
  2719.      listed above, but the following  additional  advantages
  2720.      immediately accrue.
  2721.  
  2722.  
  2723.       (1) UNIX provides a  far  better  software-development
  2724.           environment than LSI MOS ever can or will.
  2725.  
  2726.       (2) The facsimile service can be enhanced to  be  able
  2727.  
  2728.  
  2729.  
  2730.  
  2731.                              - 44 -
  2732.  
  2733. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2734.  
  2735.           to support many users at a time.
  2736.  
  2737.       (3) The UNIX file system is so sophisticated that more
  2738.           complex data entities can be handled.
  2739.  
  2740.        In  fact  the  44s  and  the  LSI-11,  to  which  the
  2741.      facsimile  machine  and  Grinnell display are attached,
  2742.      are  all  connected  to  the  UCL  Cambridge  Ring.   A
  2743.      distributed  processing  environment  can  be  built up
  2744.      where a job in one computer can be initiated by another
  2745.      and  then the job will be carried out by cooperation of
  2746.      both computers.
  2747.  
  2748.        In such  a  distributed  system,  the  LSI-11  micro-
  2749.      computer,   together   with   the   facsimile  machine,
  2750.      constitutes  a   totally   passive   facsimile   server
  2751.      controlled  by  a  UNIX  user.  A  page  is read on the
  2752.      facsimile machine and the image data stream produced is
  2753.      transmitted to the UNIX via the ring. The image data is
  2754.      stored  as  a  UNIX  file  and  may  be  processed   if
  2755.      necessary.  It  can  also  be  sent via the ring to the
  2756.      facsimile server where it  will  be  reprinted  on  the
  2757.      facsimile machine.
  2758.  
  2759.        In order to build up such a distributed  environment,
  2760.      IPCS  [30] is far from adequate for this purpose, as it
  2761.      does not provide any facility for a remote  job  to  be
  2762.      organised.  In  our  system, the task controller can be
  2763.      modified so that the command strings  can  be  supplied
  2764.      from  a remote host on the network. Having accepted the
  2765.      request, the task  controller  organises  the  relevant
  2766.      task  chain and the requested job is executed under its
  2767.      control.  The execution  of  the  distributed  job  may
  2768.      require  synchronisation  between  the  two  computers.
  2769.      These problems are discussed in detail in [31].
  2770.  
  2771.        Generally speaking, a distributed system based  on  a
  2772.      local network, which supplies cheap, fast, and reliable
  2773.      communication, could be the ultimate  solution  of  the
  2774.      operational problems discussed in this section. In such
  2775.      a system, different system operations are  carried  out
  2776.      in the most suitable places.
  2777.  
  2778.        For the time being, only a  procedure-oriented  task-
  2779.      control  language  is  available  in  this system.  The
  2780.      command string of the fitter  can  be  typed  from  the
  2781.      system  console  directly,  the corresponding job being
  2782.      organised and executed.  Theoretically, this  is  quite
  2783.      enough   to  cope  with  any  requirement  of  a  user.
  2784.      However,  when  the  job  is  complex,  command  typing
  2785.      becomes very tedious and prone to error.
  2786.  
  2787.  
  2788.  
  2789.  
  2790.                              - 45 -
  2791.  
  2792. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2793.  
  2794.        Above the task-controller, a job-controller layer  is
  2795.      required  which  provides  a  problem-oriented language
  2796.      whereby the user can easily put forward his requirement
  2797.      to  the  system.  On receipt of such a command, the job
  2798.      controller translates it into a command string  of  the
  2799.      task  controller  and  passes  the  string  to the task
  2800.      controller so  that  operation  request  can  be  done.
  2801.      Sometimes,  one  job  has  to  be  divided into several
  2802.      subjobs, which are to be dealt  with  separately.   The
  2803.      job  controller  should  be  also  responsible for high
  2804.      level calculation and management, so that the user need
  2805.      not be concerned with system details.
  2806.  
  2807.        In the  system  supporting  facsimile  service  under
  2808.      UNIX,  a  set  of high-level command is provided, while
  2809.      the command  strings  for  the  facsimile  station  are
  2810.      arranged automatically and they are totally hidden from
  2811.      a UNIX user.
  2812.  
  2813.  
  2814.      5.3 Future Study
  2815.  
  2816.        At the next stage, our attention should be moved to a
  2817.      higher-level,  more sophisticated system which supports
  2818.      a multi-type environment. In such a  system,  not  only
  2819.      does   the  facsimile  machine  work  as  an  facsimile
  2820.      input/output device, but it should also play  the  role
  2821.      of  a  printer  for  the  multi-type  document. This is
  2822.      because other data types, e.g. coded character text and
  2823.      geometric  graphics  can  be easily converted into bit-
  2824.      mapped graphics format which the facsimile  machine  is
  2825.      able to accept.
  2826.  
  2827.        First of all, a data structure should be designed  to
  2828.      represent  multi-type  information.  In  a  distributed
  2829.      environment, such a structure should be understood  all
  2830.      over  the  system,  so  that multi-media message can be
  2831.      exchanged.
  2832.  
  2833.        In a future  system,  different  services  should  be
  2834.      supported,   including  viewdata,  Teletex,  facsimile,
  2835.      graphics,  slow-scan  TV  and  speech.  The  techniques
  2836.      developed  for facsimile will be generalised for use of
  2837.      other bit-mapped image representations, such  as  slow-
  2838.      scan TV.
  2839.  
  2840.        To improve the performance of the  facsimile  system,
  2841.      we  are  investigating  how  we  could use an auxiliary
  2842.      special purpose processor to perform some of the  image
  2843.      processing   operations.   Such  a  processor  will  be
  2844.      essential for the higher data rate  involved  in  slow-
  2845.  
  2846.  
  2847.  
  2848.  
  2849.                              - 46 -
  2850.  
  2851. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2852.  
  2853.      scan TV.
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.                              - 47 -
  2909.  
  2910. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2911.  
  2912.                             Reference
  2913.  
  2914.  
  2915.  
  2916.       [1] P. T. Kirstein, "The Role of Facsimile in Business
  2917.           Communication", INDRA Note 1047, Jan. 1981.
  2918.  
  2919.       [2]  T.  Chang,  "A  Proposed  Configuration  of   the
  2920.           Facsimile station", INDRA Note 922, May, 1980.
  2921.  
  2922.       [3] T.  Chang,  "Data  Structure  and  Procedures  for
  2923.           Facsimile Signal Processing", INDRA Note 923, May,
  2924.           1980.
  2925.  
  2926.       [4] S. Treadwell,  "On  Distorting  Facsimile  Image",
  2927.           INDRA Note No 762, June, 1979.
  2928.  
  2929.       [5] M. G. B. Ismail and R.  J.  Clarke,  "A  New  Pre-
  2930.           Processing   Techniques   for   Digital  Facsimile
  2931.           Transmission", Dept.  of  Electronic  Engineering,
  2932.           University of Technology, Loughborough.
  2933.  
  2934.       [6]  T.  Chang,  "Mask  Scanning  Algorithm  and   Its
  2935.           Application", INDRA Note 924, June, 1980.
  2936.  
  2937.       [7] M. Kunt and O. Johnsen, "Block Coding of Graphics:
  2938.           A  Tutorial  Review",  Proceedings  of  the  IEEE,
  2939.           special issue on  digital  encoding  of  graphics,
  2940.           Vol. 68, No 7, July, 1980.
  2941.  
  2942.       [8]  T.  Chang,   "Facsimile   Data   Compression   by
  2943.           Predictive  Encoding",  INDRA  Note  No  978, May.
  2944.           1980.
  2945.  
  2946.       [9] High Level Protocol Group, "A Network  Independent
  2947.           File  Transfer  Protocol",  HLP/CP(78)1, alos INWG
  2948.           Protocol Note 86, Dec. 1978.
  2949.  
  2950.      [10] T. Chang, "The Implementation of NIFTP on LSI-11",
  2951.           INDRA Note 1056, Mar. 1981.
  2952.  
  2953.      [11] T. Chang, "The  Design  and  Implementation  of  a
  2954.           Computerised  Facsimile  System",  INDRA  Note No.
  2955.           1184, Apr. 1981.
  2956.  
  2957.      [12] T. Chang, "The Facsimile Editor", INDRA Note 1085,
  2958.           Apr. 1981.
  2959.  
  2960.      [13]  K.  Jackson,  "Facsimile   Compression",  Project
  2961.           Report,  Dept.  of  Computer  Science,  UCL, June,
  2962.           1981.
  2963.  
  2964.  
  2965.  
  2966.  
  2967.                              - 48 -
  2968.  
  2969. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  2970.  
  2971.      [14] R. Cole and S. Treadwell, "MOS User Guide",  INDRA
  2972.           Note 1042, Jan. 1981.
  2973.  
  2974.      [15] CCITT,  "Recommendation  T.4,  Standardisation  of
  2975.           Group   3   Facsimile   Apparatus   for   Document
  2976.           Transmission", Geneva, 1980.
  2977.  
  2978.      [16]  "DACOM  6450  Computerfax  Transceiver   Operator
  2979.           Instructions", DACOM, Mar. 1977.
  2980.  
  2981.      [17] "AED 6200LP Floppy Disk Storage System", Technical
  2982.           Manual,  105499-01A,  Advanced Electronics Design,
  2983.           Inc. Feb. 1977.
  2984.  
  2985.      [18] "The User Manual for Grinnelll Colour Display".
  2986.  
  2987.      [19] D. R. Weber,  "An  Adaptive  Run  Length  Encoding
  2988.           Algorithm", ICC-75.
  2989.  
  2990.      [20] R. Braden and P. L. Higginson, "Clean  and  Simple
  2991.           Interface  under  MOS",  INDRA Note No. 1054, Feb.
  2992.           1981.
  2993.  
  2994.      [21] L. G. Roberts et al, "The ARPA Computer  Network",
  2995.           Computer  Communication  Networks,  Prentice Hall,
  2996.           Englewood, pp485-500, 1973.
  2997.  
  2998.      [22] I. M. Jacobs et  al:  "General  Purpose  Satellite
  2999.           Network",   Proc.   IEEE,   Vol.   66,   No.   11,
  3000.           pp1448-1467, 1978.
  3001.  
  3002.      [23] J.  W.  Burren  et  al,  "Design  fo  an  SRC/NERC
  3003.           Computer   Network",   RL   77-0371A,   Rutherford
  3004.           Laboratory, 1977.
  3005.  
  3006.      [24] P. T. F.  Kelly,  "Non-Voice  Network  Services  -
  3007.           Future     Plans",     Proc.     Conf.    Business
  3008.           Telecommunications, Online, pp62-82, 1980.
  3009.  
  3010.      [25] P. T. Kirstein, "UK-US  Collaborative  Computing",
  3011.           INDRA Note No. 972, Aug. 1980.
  3012.  
  3013.      [26] "A Network  Independent  Transport  Service",  PSS
  3014.           User   Forum,  Study  Group  3,  British  Telecom,
  3015.           London, 1980.
  3016.  
  3017.      [27] CCITT, Recommendation X3,  X25,  X28  and  X29  on
  3018.           Packet Switched Data Services", Geneva 1978.
  3019.  
  3020.      [28]  "DoD  Standard  Transmission  Control  Protocol",
  3021.           RFC761,  Information  Sciences  Inst.,  Marina del
  3022.  
  3023.  
  3024.  
  3025.  
  3026.                              - 49 -
  3027.  
  3028. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  3029.  
  3030.           Rey, 1979.
  3031.  
  3032.      [29]  "DoD   Standard   Internet   Protocol",   RFC760,
  3033.           Information Sciences Inst., Marina del Rey, 1979.
  3034.  
  3035.      [30] P. L. Higginson, "The Orgainisation of the Current
  3036.           IPCS System", INDRA Note No. 1163, Oct. 1981.
  3037.  
  3038.      [31] T. Chang, "Distributed Processing for  LSIs  under
  3039.           MOS", INDRA Note No. 1199, Jan. 1982.
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.                              - 50 -
  3086. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.                      Appendix I: Devices
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132. AED62(DEV)                                             AED62(DEV)
  3133.  
  3134.  
  3135.  
  3136.  
  3137. NAME
  3138.  
  3139.      aed62 - double density floppy disk
  3140.  
  3141. SYNOPSIS
  3142.  
  3143.      DCT aed62
  3144.      setdct("aed62", 0170, 0170450, 0170450,
  3145.              aedini, aedsio, aedint, 0);
  3146.  
  3147. DESCRIPTION
  3148.  
  3149.      The Double Density disks contain 77 tracks numbered  from  0
  3150.      to  76.  There  are 16 sectors (sometimes called blocks) per
  3151.      track, for a total of 1232 sectors on each side of the disk.
  3152.      These  are  numbered  0  to  1231.  Each sector contains 512
  3153.      bytes, for a total of 630,784 bytes  on  each  side  of  the
  3154.      floppy.
  3155.  
  3156.      Only one side of the floppy can be accessed at a time. There
  3157.      is  only one head per drive, and it is located on the under-
  3158.      side of the disk. To access the other side, the disk must be
  3159.      manually removed and inserted the other way up.
  3160.  
  3161.      Each block is actually two blocks on the disk:  an  adddress
  3162.      ID  block  and the data block.  The address ID block is used
  3163.      by the hardware and contains the  track  number,  the  block
  3164.      number and the size of the data block that follows.  When an
  3165.      operation is to take place, the seek mechanism first locates
  3166.      the  block  by  reading  the address ID blocks and literally
  3167.      'hunting' for the correct one. It will  hunt  for  up  to  2
  3168.      seconds before reporting a failure.
  3169.  
  3170.      Both the address ID and the data blocks are  followed  by  a
  3171.      checksum word that is maintained by the hardware and is hid-
  3172.      den from the user. On writing, the  checksum  is  calculated
  3173.      and  appended  to the block. On reading it is verified (both
  3174.      on reading the ID and data blocks) and any error is reported
  3175.      as  a  Data Check. No checking on the data block takes place
  3176.      on a write, and the hardware has no idea if it  was  written
  3177.      correctly. The only way to verify it is to read it.
  3178.  
  3179.      Although there are two drives in the unit,  they  cannot  be
  3180.      used  simultaneously. If an operation is in progress on one,
  3181.      no access can be made to the other until the first operation
  3182.      is  complete. The driver will queue requests for both drives
  3183.      however, and ensure that are performed in order.
  3184.  
  3185.      The MOS driver is called aed62.obj. It operates on the  fol-
  3186.      lowing IORB entries:
  3187.  
  3188.  
  3189. AED62(DEV)                                             AED62(DEV)
  3190.  
  3191.  
  3192.  
  3193.      irfnc
  3194.  
  3195.           The operation to be performed, as follows:
  3196.  
  3197.                           0 - Read
  3198.                           1 - Write
  3199.                           2 - Verify
  3200.                           3 - Seek
  3201.  
  3202.           Read and Write cause data to be transferred to and from
  3203.           disk.  Verify does a hardware read without transferring
  3204.           the data to memory and is used for verifying  that  the
  3205.           data  can be successfully read. The checksum at the end
  3206.           of  the  block  of  each  sector  is  verified  by  the
  3207.           hardware.  The  seek  command  is used to move the disk
  3208.           heads to a specified track.
  3209.  
  3210.      irusr1
  3211.  
  3212.           The drive number. Only Zero or One is accepted. This is
  3213.           matched  against the number dialed on the drive. If the
  3214.           number is specified  on  both  drives,  or  neither,  a
  3215.           hardware error will be reported.
  3216.  
  3217.      irusr2
  3218.  
  3219.           The Sector or Block Number. Must be in the range  0  to
  3220.           1231 inclusive.  irusr2 specifies the block number that
  3221.           the transfer is to begin at for Read and Write, the be-
  3222.           ginning  of  the  verified area for the Verify command,
  3223.           and the position of the head for the Seek  command.  In
  3224.           the  latter  case  the  head  will be positioned to the
  3225.           track that contains the block.
  3226.  
  3227.      iruva
  3228.  
  3229.           This specifies the data  adress,  which  must  be  even
  3230.           (word  boundary).   If an odd address is given, the low
  3231.           order bit is set to zero to make it even. Not  required
  3232.           for the Seek or Verify commands.
  3233.  
  3234.      irbr
  3235.  
  3236.           Transfer length as a positive number of bytes. Not  re-
  3237.           quired for the seek command, bit IS used by Verify com-
  3238.           mand so that the correct number of blocks may be  veri-
  3239.           fied.  The disk is only capable of transferring an even
  3240.           number of bytes. If an odd length is given the low ord-
  3241.           er  bit  is made zero to reduce the length to the lower
  3242.           even value.  The length is NOT restricted to the sector
  3243.           size  of  512 bytes. If the length is greater than 512,
  3244.           successive blocks are read/written until  the  required
  3245.           transfer
  3246.  
  3247. AED62(DEV)                                             AED62(DEV)
  3248.  
  3249.  
  3250.  
  3251.           length has been satisfied. If the length is not an  ex-
  3252.           act  multiple  of  512 bytes, only the specified length
  3253.           will be read/written. Note  that  the  hardware  always
  3254.           reads  and  writes  a  complete sector, so specifying a
  3255.           shorter length on a read will cause  the  remainder  of
  3256.           the  block to be skipped. On a write, the hardware will
  3257.           repeat the last specified  word  until  the  sector  is
  3258.           full.
  3259.  
  3260.      The driver will attempt to recover  from  all  soft  errors.
  3261.      There  is no automatic write/read verify as on mag tapes, so
  3262.      that data that is incorrectly written will not  be  detected
  3263.      as such until a read is attempted. For this reason, the ver-
  3264.      ify feature can be used (see above) to force the checking of
  3265.      written  data.  When an error is detected while performing a
  3266.      read, the offending block will be re-read up to 16 times and
  3267.      disk  resets  will be attempted during this time too. If all
  3268.      fails a hardware error indication is returned to  the  user.
  3269.      Other errors possible are Protection Error (attempt to write
  3270.      to a read-only disk) and User Error,  which  indicates  that
  3271.      the  parameters  in  the IORB were incorrect. Errors such as
  3272.      there being no disk loaded, or the drive door being open are
  3273.      NOT  detectable  by the program. The interface sees these as
  3274.      Seek Errors (i.e. soft errors), and thus the driver will re-
  3275.      try  several times before returning a Hardware Error indica-
  3276.      tion to the user. It should be noted that error recovery can
  3277.      take  a  long  time. As mentioned above, there is a 2 second
  3278.      delay before a seek error is reported by the  hardware,  for
  3279.      instance.
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. GRINNELL(DEV)                                       GRINNELL(DEV)
  3305.  
  3306.  
  3307.  
  3308.  
  3309. NAME
  3310.  
  3311.      grinnell - colour display
  3312.  
  3313. SYNOPSIS
  3314.  
  3315.      DCT grndout
  3316.      setdct("grndout", 03000, 0172520, 0172522,
  3317.              grnoi, grnot, grnoti, &grndin);
  3318.      DCT grndin
  3319.      setdct("grndin", 03000, 0172524, 0172526,
  3320.              grnoi, grnot, grnoti, &grndout);
  3321.  
  3322. DESCRIPTION
  3323.  
  3324.      The Grinnell colour display has a screen  of  512x512  pels.
  3325.      Three colours (red, green and blue) can be used, but no grey
  3326.      scale is supported.  Three  graphics  modes  are  available.
  3327.      These are:
  3328.  
  3329.       (1) Alphanumeric: The input ASCII characters are  displayed
  3330.           at the selected positions on the screen.
  3331.  
  3332.       (2) Graphic: Basic geometric elements,  such  as  line  and
  3333.           rectangle, are drawn by means of graphics commands.
  3334.  
  3335.       (3) Image: The input data is interpreted as  bit  patterns,
  3336.           the corresponding images being illustrated.
  3337.  
  3338.      The values used to construct commands are described  in  the
  3339.      Grinnell User Manual. They are also listed below.
  3340.  
  3341.       #define LDC     0100000   /* Load Display Channels */
  3342.  
  3343.       #define LSM     0010000   /* Load Subchannel Mask */
  3344.       #define   RED   0000010   /* Read Subchannel */
  3345.       #define   GREEN 0000020   /* Green subchannel */
  3346.       #define   BLUE  0000040   /* Blue subchannel */
  3347.  
  3348.       #define WID     0000000   /* Write Image Data */
  3349.       #define WGD     0020000   /* Write Graphic Data */
  3350.       #define WAC     0022000   /* Write AlphanumCh */
  3351.  
  3352.       #define LWM     0024000   /* Load Write Mode */
  3353.       #define   REVERSE  0200   /* Reverse Background */
  3354.       #define   ADDITIVE 0100   /* Additive (not Replace) */
  3355.       #define   ZEROWRITE 040   /* Dark Write */
  3356.       #define   VECTOR    020   /* Select Vector Graph */
  3357.       #define   DBLEHITE  010   /* Double Height write */
  3358.       #define   DBLEWIDTH 004   /* Double Width write */
  3359.       #define   CURSORAB  002   /* Cursor (La+Lb,Ea+Eb) */
  3360.  
  3361. GRINNELL(DEV)                                       GRINNELL(DEV)
  3362.  
  3363.  
  3364.  
  3365.       #define   CURSORON  001   /* Cursor On */
  3366.  
  3367.       #define LUM     0026000   /* Load Update Mode */
  3368.       #define   Ec        001   /* Load Ea with Ec */
  3369.       #define   Ea_Eb     002   /* Load Ea with Ea + Eb */
  3370.       #define   Ea_Ec     003   /* load Ea with Ea + Ec */
  3371.       #define   Lc        004   /* Load La with Lc */
  3372.       #define   La_Lb     010   /* Load La with La + Lb */
  3373.       #define   La_Lc     014   /* Load La with La + Lc */
  3374.       #define   SRCL_HOME 020   /* Scroll dsiplay to HOME */
  3375.       #define   SRCL_DOWN 040   /* Scroll down one line */
  3376.       #define   SCRL_UP   060   /* Scroll up one line */
  3377.  
  3378.       #define ERS     0030000   /* Erase */
  3379.       #define ERL     0032000   /* Erase Line */
  3380.       #define SLU     0034000   /* Special Location Update */
  3381.       #define   SCRL_ZAP 0100   /* unlimited scroll speed */
  3382.  
  3383.       #define EGW     0036000   /* Execute Graphic Write */
  3384.       #define LER     0040000   /* Load Ea relative */
  3385.       #define LEA     0044000   /* Load Ea */
  3386.       #define LEB     0050000   /* Load Eb */
  3387.       #define LEC     0054000   /* Load Ec */
  3388.       #define LLR     0060000   /* Load La Relative */
  3389.       #define LLA     0064000   /* Load La */
  3390.       #define LLB     0070000   /* Load Lb */
  3391.       #define LLC     0074000   /* Load Lc */
  3392.       #define   LGW     02000   /* perform write */
  3393.  
  3394.       #define NOP     0110000   /* No-Operation */
  3395.  
  3396.       #define SPD     0120000   /* Select Special Device */
  3397.       #define LPA     0130000   /* Load Peripheral Address */
  3398.       #define LPR     0140000   /* Load Peripheral Register */
  3399.       #define LPD     0150000   /* Load Peripheral Data */
  3400.       #define RPD     0160000   /* ReadBack Peripheral Data */
  3401.       #define MEMRB     00400   /* SPD - Memory Read-Back */
  3402.       #define DATA      01000   /* SPD - Byte Unpacking */
  3403.       #define   ALPHA   06000   /* LPR - Alphanumeric data */
  3404.       #define   GRAPH   04000   /* LPR - Graphic data */
  3405.       #define   IMAGE   02000   /* LPR - Image data */
  3406.       #define   LTHENH  01000   /* take lo byte then hi byte */
  3407.       #define   DROPBYTE 0400   /* drop last byte */
  3408.       #define INTERR    02000   /* SPD - Interrupt Enable */
  3409.       #define TEST      04000   /* SPD - Diagnostic Test */
  3410.  
  3411.      The MOS driver is called grin.obj. It operates on  the  fol-
  3412.      lowing IORB entries.
  3413.  
  3414.      iruva
  3415.  
  3416.           This is a pointer to  the  buffer  where  the  data  is
  3417.           stored.
  3418.  
  3419.  
  3420. GRINNELL(DEV)                                       GRINNELL(DEV)
  3421.  
  3422.  
  3423.  
  3424.           This data must be ready formtatted  for  the  Grinnell,
  3425.           since no conversion is performed by the driver.
  3426.  
  3427.      irbr
  3428.  
  3429.           This transfer length as a positive number of bytes.
  3430.  
  3431.      Addressing the grinnell. Rows consist of elments numbered  0
  3432.      to 511 running left to right. The lines are number from 0 to
  3433.      511 running from bottom to top. It is thus  addressed  as  a
  3434.      conventional  X-Y  coordinate system. Note that this coordi-
  3435.    e system is different the one used for the image.
  3436.  
  3437.         X A
  3438.           |
  3439.           |                                 (511, 511)
  3440.       511 +-------------------------------+
  3441.           |                               |
  3442.           |                               |
  3443.           |                               |
  3444.           |                               |
  3445.           |             (x, y)            |
  3446.           |            +                  |
  3447.           |                               |
  3448.           |                               |
  3449.           |                               |
  3450.           |                               |
  3451.           |                               |
  3452.           +-------------------------------+----->
  3453.          0                               511    Y
  3454.  
  3455. SEE ALSO
  3456.  
  3457.      grinnell(fax)
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477. DACOM(DEV)                                             DACOM(DEV)
  3478.  
  3479.  
  3480.  
  3481.  
  3482. NAME
  3483.  
  3484.      dacom - facsimile machine
  3485.  
  3486. SYNOPSIS
  3487.  
  3488.      DCT faxinput
  3489.      setdct("faxin", 0350, 0174750, 0174740,
  3490.              faxii, faxin, faxini, &faxoutput);
  3491.      DCT faxoutput
  3492.      setdct("faxout", 0354, 0174752, 0174742,
  3493.              faxoi, faxot, faxoti, &faxinput);
  3494.  
  3495. DESCRIPTION
  3496.  
  3497.      The DACOM facsimile machine can read  a  document,  creating
  3498.      the  corresponding image data blocks. It can also accept the
  3499.      data of relevant format, printing the correponding image.
  3500.  
  3501.      Each data block consists of 585 bits, and  is  stored  in  a
  3502.      block  of  74 bytes starting on a byte boundary. The final 7
  3503.      bits of the last byte are not used and they  are  undefined.
  3504.      The  585 bits in each block need to be read as a bit stream:
  3505.      the bits in each byte run from the high  orger  end  of  the
  3506.      byte  to the low order end. The last 12 bits of the 585 bits
  3507.      in each block consistute the CRC field whereby the block can
  3508.      be validated.
  3509.  
  3510.      There are two kinds of blocks: SETUP blocks and DATA blocks.
  3511.      The  first of block of an image data file should be a single
  3512.      SETUP block. All following blocks in the file must  be  DATA
  3513.      blocks. Note that the second block is a DATA block that con-
  3514.      tains ZERO samples, i.e. a dummy data blocks. Form the third
  3515.      block, the DATA blocks store the reall image data.
  3516.  
  3517.      A standard dacom page contains about 1200 scan  lines,  each
  3518.      of which has 1726 pels. One can choose
  3519.  
  3520. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.           Appendix II: Task Controller and Task Processes
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573. CCITT(FAX)                                             CCITT(FAX)
  3574.  
  3575.  
  3576.  
  3577.  
  3578. NAME
  3579.  
  3580.      ccitt - conversion between vector and CCITT T4 format
  3581.  
  3582. SYNOPSIS
  3583.  
  3584.      ccitt() - a MOS task
  3585.  
  3586.      command string (task name is defined as ccitt):
  3587.      ccitt"<function>
  3588.  
  3589. DESCRIPTION
  3590.  
  3591.      This routine operates as a MOS pipe task to convert the vec-
  3592.      tors to CCITT T4 format or inversely.
  3593.  
  3594.      The parameter function specifies what the task is to do.
  3595.  
  3596.       value           function
  3597.  
  3598.        1c             one-dimensional compression
  3599.        1d             one-dimensional decompression
  3600.  
  3601.        2c[<k>]        two-dimensional compression
  3602.        2d             two-dimensional decompression
  3603.  
  3604.      Note k is the maximun number  of  lines  to  be  coded  two-
  3605.      dimensionally  before  a one-dimensionally coded line is in-
  3606.      serted. If k is omitted, the default value 2 is adopted.
  3607.  
  3608. SEE ALSO
  3609.  
  3610.      vector(fax), t4(fax), fitter(fax)
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630. CHECK(FAX)                                             CHECK(FAX)
  3631.  
  3632.  
  3633.  
  3634.  
  3635. NAME
  3636.  
  3637.      check - check the validity of a vector file.
  3638.  
  3639. SYNOPSIS
  3640.  
  3641.      check() - a MOS task
  3642.  
  3643.      command string (the task name is defined as check):
  3644.      check"<function>,<width>,<height>,[<from>,<to>]
  3645.  
  3646. DESCRIPTION
  3647.  
  3648.      This routine operates as a MOS pipe task checking the  vali-
  3649.      dity of the input vector file.
  3650.  
  3651.      The number of lines to be checked is specified by the param-
  3652.      eter  height.   If  the height of the image is less than the
  3653.      parameter, the actual height is printed. Thus, one  can  set
  3654.      the  parameter  height to a big number in order to count the
  3655.      number of lines of the input image.
  3656.  
  3657.      The run lengths in each of these lines are  accumulated  and
  3658.      the sum is compared with the parameter width.
  3659.  
  3660.      These are the basic functions which are  performed  whenever
  3661.      the  task is invoked. However, there are several options one
  3662.      can choose by setting the one-character parameter function.
  3663.  
  3664.       value         function
  3665.  
  3666.        'n'          basic function only
  3667.        'c'          print the count of each line
  3668.        'l'          print all lines
  3669.        's'          print the lines in the interval
  3670.                     specified by parameter from and to
  3671.  
  3672. DIAGNOSTICS
  3673.  
  3674.      A bad line will be reported and it will cause the job abort-
  3675.      ed.
  3676.  
  3677. SEE ALSO
  3678.  
  3679.      vector(fax), getl(fax), fitter(fax)
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687. CHOP(FAX)                                               CHOP(FAX)
  3688.  
  3689.  
  3690.  
  3691.  
  3692. NAME
  3693.  
  3694.      chop - extract a designated rectangular area from an image
  3695.  
  3696. SYNOPSIS
  3697.  
  3698.      chop() - a MOS task
  3699.  
  3700.      command string (task name is defined as chop):
  3701.      chop"<x0>,<y0>,<x1>,<y1>
  3702.  
  3703. DESCRIPTION
  3704.  
  3705.      This routine operates as a MOS pipe task extracting a desig-
  3706.      nated  rectangular area from an input image.  Input and out-
  3707.      put are image data files in the form of vectors.
  3708.  
  3709.      The following diagram  shows  the  coordinate  system  being
  3710.      used.  Note that the lengths are measured in number of pels.
  3711.  
  3712.           (0, 0)                     width  X
  3713.              +-------------------------+---->
  3714.              |                         |
  3715.              |                         |
  3716.              |   (x0, y0)              |
  3717.              |     +---------+         |
  3718.              |     |         |         |
  3719.              |     |         |         |
  3720.              |     |         |         |
  3721.              |     |         |         |
  3722.              |     |         |         |
  3723.              |     |         |         |
  3724.              |     |         |         |
  3725.              |     +---------+         |
  3726.              |            (x1, y1)     |
  3727.              |                         |
  3728.              |                         |
  3729.              |                         |
  3730.              |                         |
  3731.       height +-------------------------+
  3732.              |
  3733.              |
  3734.            Y V
  3735.  
  3736.      As can be seen in the diagram, the rectangular  area  to  be
  3737.      extracted  is  specified  by  the parameters x0, x1, y0, y1,
  3738.      which are decimal strings.
  3739.  
  3740. BUGS
  3741.  
  3742.      One has to make sure that
  3743.  
  3744. CHOP(FAX)                                               CHOP(FAX)
  3745.  
  3746.  
  3747.  
  3748.              0 < x0 < width
  3749.              0 < y0 < height
  3750.              0 < x1 < width
  3751.              0 < y1 < height
  3752.  
  3753. SEE ALSO
  3754.  
  3755.      vector(fax), getl(fax), putl(fax), fitter(fax)
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801. CLEAN(FAX)                                             CLEAN(FAX)
  3802.  
  3803.  
  3804.  
  3805.  
  3806. NAME
  3807.  
  3808.      clean - clean an image.
  3809.  
  3810. SYNOPSIS
  3811.  
  3812.      clean() - a MOS task
  3813.  
  3814.      command string (task name is defined as clean):
  3815.      clean"<width>,<height>
  3816.  
  3817. DESCRIPTION
  3818.  
  3819.      This routine operates as a MOS pipe task cleaning  an  image
  3820.      by  means of mask scanning.  Input and output are image data
  3821.      files in the form of vectors.
  3822.  
  3823.      The width and height should be given as the parameters.
  3824.  
  3825. SEE ALSO
  3826.  
  3827.      vector(fax), getl(fax), putl(fax), fitter(fax)
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858. DECOMP(FAX)                                           DECOMP(FAX)
  3859.  
  3860.  
  3861.  
  3862.  
  3863. NAME
  3864.  
  3865.      decomp - decompress DACOM blocks
  3866.  
  3867. SYNOPSIS
  3868.  
  3869.      decomp() - a MOS task
  3870.  
  3871.      command string (task name is defined as decomp):
  3872.      decomp
  3873.  
  3874. DESCRIPTION
  3875.  
  3876.      This task takes DACOM blocks from the Clean and  Simple  in-
  3877.      terface,  and  decompresses them into vector format. Then it
  3878.      writes the vectors to the Clean and Simple interface.
  3879.  
  3880. SEE ALSO
  3881.  
  3882.      dacom(dev), vector(fax), fitter(fax)
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915. FAX(FAX)                                                 FAX(FAX)
  3916.  
  3917.  
  3918.  
  3919.  
  3920. NAME
  3921.  
  3922.      fax - interface process for DACOM facsimile machine
  3923.  
  3924. SYNOPSIS
  3925.  
  3926.      fax() - a MOS task
  3927.  
  3928.      command string (task name is defined as fax):
  3929.      fax"<function>
  3930.  
  3931. DESCRIPTION
  3932.  
  3933.      This task uses the Clean and Simple  interface  to  read  or
  3934.      write facsimile image data.
  3935.  
  3936.      The one character parameter function specifies  whether  the
  3937.      data  is  to be read or written. Character w is for writing.
  3938.      In this case, 74 byte DACOM  blocks  contaning  correct  CRC
  3939.      fields  are  expected. On the other hand, character r is for
  3940.      reading. In this case, a document is read on  the  facsimile
  3941.      machine, the DACOM blocks being created.
  3942.  
  3943. SEE ALSO
  3944.  
  3945.      dacom(dev), fitter(fax)
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972. FITTER(FAX)                                           FITTER(FAX)
  3973.  
  3974.  
  3975.  
  3976.  
  3977. NAME
  3978.  
  3979.      fitter - fit processes together to form a data pipe
  3980.  
  3981. SYNOPSIS
  3982.  
  3983.      fitter() - the MOS task controller
  3984.  
  3985. DESCRIPTION
  3986.  
  3987.      According to the command string typed on the console, fitter
  3988.      links the specified processes together to form a task chain.
  3989.      The name of the processes is the name given in the PCB.  The
  3990.      processes must communicate using the C+S interface. Only one
  3991.      C+S interface is opened per process - data is pushed in with
  3992.      a cswrite and pulled out with a csread.  The fitter does not
  3993.      inspect the data in any way but merely passes  it  from  one
  3994.      process to another.
  3995.  
  3996.      The format of command string is:
  3997.  
  3998.              A | B | C.
  3999.  
  4000.      The fitter takes data from the process called A, write it to
  4001.      the  process  called  B,  reads  data from the process B and
  4002.      write that data to the process  C.   Note  that  all  middle
  4003.      processes  are both read and written, while the first one in
  4004.      the list is only read from and the last in the list is  only
  4005.      written to.
  4006.  
  4007.      A double quote is used as the  separator  between  the  task
  4008.      name and the open parameter string, e.g.
  4009.  
  4010.              A"500 | B"n,xyz | C,
  4011.  
  4012.      where the strings '500' and 'n,xyz' are the  open  parameter
  4013.      stings  for  tasks  A  and  B,  respectively.  The parameter
  4014.      stirng is passed to the corresponding task routine when  the
  4015.      csopen call returns.
  4016.  
  4017. DIAGNOSTICS
  4018.  
  4019.      The command string containing undefined task will be reject-
  4020.      ed.
  4021.  
  4022. SEE ALSO
  4023.  
  4024.      csinit(fax), csopen(fax), csread(fax), cswrite(fax)
  4025.  
  4026.  
  4027.  
  4028.  
  4029. FS(FAX)                                                   FS(FAX)
  4030.  
  4031.  
  4032.  
  4033.  
  4034. NAME
  4035.  
  4036.      fs - file system for use under MOS
  4037.  
  4038. SYNOPSIS
  4039.  
  4040.      fs() - a MOS task
  4041.  
  4042.      command string (task name is defined as fs):
  4043.      fs"<funciton>,<file_name>
  4044.  
  4045. DESCRIPTION
  4046.  
  4047.      This is a file system, based on the  Double  Density  floppy
  4048.      disk,  for use under MOS. The fs task is used for manipulate
  4049.      the files, managed by the file system. This  task  can  only
  4050.      appear at the first or last position on a command string. In
  4051.      the former case, the file specified is to be read, while the
  4052.      file is to be written in the latter case.
  4053.  
  4054.      The <function> field contains only one character  indicating
  4055.      the function to be performed. The possible values are:
  4056.  
  4057.              e - open an existing file (for reading).
  4058.              c - open an existing file, and set the length
  4059.                        to zero (for rewriting).
  4060.              a - append to an existing file.
  4061.  
  4062.      If the capitals A, C, and E are used, the functions are  the
  4063.      same as described above but the specified file is created if
  4064.      it does not exist.
  4065.  
  4066. BUGS
  4067.  
  4068.      This task is for reading and writing only. As for the  other
  4069.      facilities,  e.g.  seek, delete, status and sync, one has to
  4070.      use C+S interface directly.
  4071.  
  4072.      Note that only 15 files are permitted per disk, only drive 0
  4073.      is  supported  at  present, and no hierarchical directory is
  4074.      allowed.
  4075.  
  4076. SEE ALSO
  4077.  
  4078.      aed62(dev), fitter(fax)
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086. FTP(FAX)                                                 FTP(FAX)
  4087.  
  4088.  
  4089.  
  4090.  
  4091. NAME
  4092.  
  4093.      ftp, pftp - NIFTP task processes
  4094.  
  4095. SYNOPSIS
  4096.  
  4097.      ftp(), pftp() - MOS tasks
  4098.  
  4099.      command string (task name is defined as ftp):
  4100.      ftp"<function>,<code>,<user_name>,<password>,<file_name>;
  4101.          <trasport_service_process>:<transport_service_parameters>
  4102.  
  4103. DESCRIPTION
  4104.  
  4105.      These tasks are implementation of Network  Independent  File
  4106.      Transfer  Protocol (NIFTP) for LSIs under MOS. They employ a
  4107.      transport service for communication with a  remote  host  on
  4108.      the network, where the same protocol must be supported. They
  4109.      communicate with the  user  process  and  transport  service
  4110.      processes  thourgh  the  Clean and Simple interface, so that
  4111.      they can be used in a fitter command chain directly.
  4112.  
  4113.      The code is available in two versions: ftp which  is  a  P+Q
  4114.      version supporting both server and intitiator and pftp which
  4115.      is a P version working only as an initiator.  Both  of  them
  4116.      are capable of sending and receiving.
  4117.  
  4118.      This implementation of NIFTP is just a subset of the  proto-
  4119.      col  as its main purpose is to provided the facsimile system
  4120.      with a data transmission mechanism. For the sake of  simpli-
  4121.      city,  only  the  necessary  facilities  are included in the
  4122.      module, while more complex facilities, such as data compres-
  4123.      sion  and  error recovery are not implemented. The following
  4124.      table shows the transfer control parameters being used.
  4125.  
  4126.       Attribute       Value Mod. Remarks
  4127.  
  4128.       Mode of access  0001  EQ   Creating a new file
  4129.                       8002  EQ   Retrieving file
  4130.       Codes            -    -    Text file, any parity
  4131.                       1002  EQ   Binary file
  4132.       Format effector 0000  EQ   No interpretation
  4133.       Binary mapping  0008  EQ   Default byte size
  4134.       Max record size 00FC  EQ   Default record size
  4135.       Transfer size   0400  LE   Default transfer size
  4136.       Facilities      0000  EQ   Minimum service
  4137.  
  4138.      The meanings of the parameters in  the  command  string  are
  4139.      listed below:
  4140.  
  4141.      function is the NIFTP function of our site. Any ASCII string
  4142.      beginning
  4143.  
  4144.  
  4145. FTP(FAX)                                                 FTP(FAX)
  4146.  
  4147.  
  4148.  
  4149.      beginning with 't' means the file is to  be  transmitted  to
  4150.      the remote site.  Otherwise, the file will be retrieved from
  4151.      the remote site.
  4152.  
  4153.      code specifies the type of the file to be  transferred.  Any
  4154.      ASCII  string  beginning with 'b' means it is a binary file,
  4155.      while others mean text file.
  4156.  
  4157.      user_name is the login name of the server site.
  4158.  
  4159.      password is the password of the server site.
  4160.  
  4161.      file_name is the name of the file to be transmitted.
  4162.  
  4163.      transport_service_process is the process name of  the  tran-
  4164.      sport service to be used.
  4165.  
  4166.      transport_service_parameters are the  parameter  string  re-
  4167.      quired by the transport service.  They are network dependent
  4168.      and specified by the corresponding transport service.
  4169.  
  4170. SEE ALSO
  4171.  
  4172.      fitter(fax)
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202. GRINNELL(FAX)                                       GRINNELL(FAX)
  4203.  
  4204.  
  4205.  
  4206.  
  4207. NAME
  4208.  
  4209.      grinnell - task to convert and display fax vector data
  4210.  
  4211. SYNOPSIS
  4212.  
  4213.      grinnell() - a MOS task
  4214.  
  4215.      command string (task name is defined as string):
  4216.      grinnell"<x0>,<y0>,<x1>,<y1>,<mode>,<colour>
  4217.  
  4218. DESCRIPTION
  4219.  
  4220.      This task takes the vector data from a Clean and Simple  in-
  4221.      terface and displays it on the Grinnell screen. The Grinnell
  4222.      screen is viewed as an X-Y plane with (0,0) being the  lower
  4223.      left  hand  corner,  (512,  0)  being  the  lower right hand
  4224.      corner, etc.
  4225.  
  4226.      The parameters x0, y0, x1, y1 are decimal  strings  defining
  4227.      the rectangular space on the screen where the image is to be
  4228.      displayed. If the image is smaller than this area, it is ar-
  4229.      tificially  expanded  to the size of this area. If the image
  4230.      is larger than this area it is truncated to the size of  the
  4231.      area.
  4232.  
  4233.      The colour field consists of any combination of the  charac-
  4234.      ters  r,g  or  b  to  define the colours red, green and blue
  4235.      respectively. For instance "gb" would  write  the  image  as
  4236.      yellow.
  4237.  
  4238.      The mode defines how the image is to be displayed. Any  com-
  4239.      bination  of  the  characters  r,a and z may be used, to the
  4240.      following effect:
  4241.  
  4242.              r = reverse image
  4243.              a = additive image
  4244.              z = zerowrite image.
  4245.  
  4246.      There are three bit planes to define the three colours. Nor-
  4247.      mally  the  bit planes corresponding to the selected colours
  4248.      have either zero bits or one bits written to them  depending
  4249.      upon  whether  the image or the background is being written.
  4250.      For zerowrite, all non-selected bit planes  (i.e.   colours)
  4251.      are  always set to zero, thus erasing any unselected colours
  4252.      in the area. Additive mode means that in the selected colour
  4253.      planes  the  new bits are ORed in, rather than just written.
  4254.      Thus the image is added to. In reverse mode, the image writ-
  4255.      ten as one bits is written as zero bits and the bits written
  4256.      as zero bits are written as one  bits,  i.e.  the  bits  are
  4257.      flipped before being used.
  4258.  
  4259. GRINNELL(FAX)                                       GRINNELL(FAX)
  4260.  
  4261.  
  4262.  
  4263.  
  4264. SEE ALSO
  4265.  
  4266.      grinnell(dev), vector(fax), fitter(fax)
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316. MERGE(FAX)                                             MERGE(FAX)
  4317.  
  4318.  
  4319.  
  4320.  
  4321. NAME
  4322.  
  4323.      merge - merge two images together
  4324.  
  4325. SYNOPSIS
  4326.  
  4327.      merge() - a MOS task
  4328.  
  4329.      command string (task name is defined as merge):
  4330.      merge"<file_name>,<action>,<x0>,<y0>,<x1>,<y1>
  4331.  
  4332. DESCRIPTION
  4333.  
  4334.      This routine operates as a MOS pipe task merging two  images
  4335.      together to form the result image.  Input and output are im-
  4336.      age data files in the form of vectors.
  4337.  
  4338.      One of the two input images is called background which is to
  4339.      be  copied  directly.  This  is  specified  by the parameter
  4340.      file_name.  The image data of the back ground is read via  a
  4341.      'tunnel',  maintained  by  this task. Another input image is
  4342.      taken form the Clean and Simple  interface  managed  by  the
  4343.      fitter.   As  shown  in  the following diagram, the position
  4344.      where it is to be put on the background image  is  specified
  4345.      by the parameters x0, y0, x1, y1, which are decimal strings.
  4346.      This implies that the dimension of the image is x1 - x0  and
  4347.      y1 -y0.
  4348.  
  4349.           (0, 0)                     width  X
  4350.              +-------------------------+---->
  4351.              |                         |
  4352.              |   (x0, y0)              |
  4353.              |     +---------+         |
  4354.              |     |         |         |
  4355.              |     |         |         |
  4356.              |     |         |         |
  4357.              |     |         |         |
  4358.              |     |         |         |
  4359.              |     +---------+         |
  4360.              |            (x1, y1)     |
  4361.              |                         |
  4362.              |                         |
  4363.              |       (back ground)     |
  4364.       height +-------------------------+
  4365.              |
  4366.              |
  4367.            Y V
  4368.  
  4369.      The parameter  action  indicates  how  the  two  images  are
  4370.      merged.  If it set to 0, The second image is simply overlaid
  4371.      on the back ground image. On the  other  hand  any  non-zero
  4372.      value
  4373.  
  4374.  
  4375. MERGE(FAX)                                             MERGE(FAX)
  4376.  
  4377.  
  4378.  
  4379.      causes the second image to replace the specified area of the
  4380.      back ground image.
  4381.  
  4382. BUGS
  4383.  
  4384.      One has to make sure that
  4385.  
  4386.              0 < x0 < width_of_back_ground
  4387.              0 < y0 < height_of_back_ground
  4388.              0 < x1 < width_of_back_ground
  4389.              0 < y1 < height_of_back_ground
  4390.  
  4391.      In addition, x0, y0, x1, y1 must be consistent with the  di-
  4392.      mension of the image
  4393.  
  4394. SEE ALSO
  4395.  
  4396.      vector(fax), getl(fax), putl(fax), chop(fax), fitter(fax)
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432. OD(FAX)                                                   OD(FAX)
  4433.  
  4434.  
  4435.  
  4436.  
  4437. NAME
  4438.  
  4439.      od - dump the input data
  4440.  
  4441. SYNOPSIS
  4442.  
  4443.      od() - a MOS task
  4444.  
  4445.      command string (task name is defined as od):
  4446.      od"<format>
  4447.  
  4448. DESCRIPTION
  4449.  
  4450.      This routine operates as a MOS pipe task dumping  the  input
  4451.      data in a selected format.  The input data is taken from the
  4452.      Clean and Simple interface.
  4453.  
  4454.      The meanings of the one character parameter format are:
  4455.  
  4456.             value          format
  4457.  
  4458.              'd'           words in decimal
  4459.              'o'           words in octal
  4460.              'c'           bytes in ASCII
  4461.              'b'           bytes in octal
  4462.  
  4463.  
  4464. SEE ALSO
  4465.  
  4466.      fitter(fax)
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489. RECOMP(FAX)                                           RECOMP(FAX)
  4490.  
  4491.  
  4492.  
  4493.  
  4494. NAME
  4495.  
  4496.      recomp - compress the vectors to form the DACOM blocks
  4497.  
  4498. SYNOPSIS
  4499.  
  4500.      recomp() - a MOS task
  4501.  
  4502.      command string (task name is defined as recomp):
  4503.      recomp
  4504.  
  4505. DESCRIPTION
  4506.  
  4507.      This task takes vectors from the Clean and Simple interface,
  4508.      and  recompresses them into DACOM blocks. Then it writes the
  4509.      blocks to the Clean and Simple interface.
  4510.  
  4511. SEE ALSO
  4512.  
  4513.      dacom(dev), vector(fax), fitter(fax)
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546. SCALE(FAX)                                             SCALE(FAX)
  4547.  
  4548.  
  4549.  
  4550.  
  4551. NAME
  4552.  
  4553.      scale - scale an image to a specified dimension
  4554.  
  4555. SYNOPSIS
  4556.  
  4557.      scale() - a MOS task
  4558.  
  4559.      command string (task name is defined as scale):
  4560.      scale"<old_width>,<old_height>,<new_width>,<new_height>
  4561.  
  4562. DESCRIPTION
  4563.  
  4564.      This routine operates as a MOS pipe task scaling  the  input
  4565.      image  to the specified dimension.  Input and output are im-
  4566.      age data files in the form of vectors.
  4567.  
  4568.      The dimension of the input image is given by the  parameters
  4569.      old_width  and old_height, while the dimension of the output
  4570.      is specified by the parameters new_width and new_height.
  4571.  
  4572. SEE ALSO
  4573.  
  4574.      vector(fax), getl(fax), putl(fax), fitter(fax)
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603. STRING(FAX)                                           STRING(FAX)
  4604.  
  4605.  
  4606.  
  4607.  
  4608. NAME
  4609.  
  4610.      string - convert an ASCII string to the vector format
  4611.  
  4612. SYNOPSIS
  4613.  
  4614.      string() - a MOS task
  4615.  
  4616.      command string (task name is defined as string):
  4617.      string"<s>
  4618.  
  4619. DESCRIPTION
  4620.  
  4621.      This routine operates as a  MOS  pipe  task  converting  the
  4622.      parameter string s to the corresponding vectors.
  4623.  
  4624. SEE ALSO
  4625.  
  4626.      vector(fax), ts(fax)
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660. TF(FAX)                                                   TF(FAX)
  4661.  
  4662.  
  4663.  
  4664.  
  4665. NAME
  4666.  
  4667.      tf - convert a text to the vector format.
  4668.  
  4669. SYNOPSIS
  4670.  
  4671.      tf() - a MOS task
  4672.  
  4673.      command string (task name is defined as tf):
  4674.      tf"<width>,<line_sp>,<upper>,<left>
  4675.  
  4676. DESCRIPTION
  4677.  
  4678.      This routine operates as a MOS pipe task converting the  in-
  4679.      put text to the corresponding vectors. The input text, taken
  4680.      from the Clean and Simple interface should be in the  format
  4681.      defined in text(fax).
  4682.  
  4683.              +-------------------------+
  4684.              |                         |
  4685.              |            upper        |
  4686.              |                         |
  4687.              |         XXXXXXXXXXXX    |
  4688.              |         XXXXXXXXXXXX    |
  4689.              |         XXXXXXXXXXXX    |
  4690.              |         XXXXXXXXXXXX    |
  4691.              |  left   XXXXXXXXXXXX    |
  4692.              |         XXXXXXXXXXXX    |
  4693.              |         XXXXXXXXXXXX    |
  4694.              |         XXXXXXXXXXXX    |
  4695.              |         XXXXXXXXXXXX    |
  4696.              |            width        |
  4697.              |                         |
  4698.              +-------------------------+
  4699.  
  4700.      As shown in the diagram, the parameters give the information
  4701.      for  the formating. The parameter width is the maximum width
  4702.      of the text lines.
  4703.  
  4704.      Every vector will be padded to fit this  width.  White  pels
  4705.      may be padded to the left of each vectors, and the number of
  4706.      pel to be padded is specified by the parameter left.
  4707.  
  4708.      Empty lines may also be inserted. They are defined by param-
  4709.      eters  upper  and  line_sp, the number of pels being used as
  4710.      the unit.
  4711.  
  4712. SEE ALSO
  4713.  
  4714.      vector(fax), text(fax), ts(fax), fitter(fax)
  4715.  
  4716. UCL FACSIMILE SYSTEM                              INDRA Note 1185
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.           Appendix III: Utility Routines and Data Formats
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767.  
  4768.  
  4769. BITMAP(FAX)                                           BITMAP(FAX)
  4770.  
  4771.  
  4772.  
  4773.  
  4774. NAME
  4775.  
  4776.      bitmap - convert vector format to core bit map
  4777.  
  4778. SYNOPSIS
  4779.  
  4780.      int  bitmap(ivec, cnt, buff);
  4781.  
  4782.      int  *ivec;
  4783.      int  cnt;
  4784.      char *buff;
  4785.  
  4786. DESCRIPTION
  4787.  
  4788.      Bitmap converts the fax vector format into a bit map,  using
  4789.      each bit of the area pointed to by buff.  The number of ele-
  4790.      ments in ivec is given by cnt, and the first element of ivec
  4791.      is  taken  as  a  white pel count, the second as a black pel
  4792.      count, etc. The resultant bit map  is  placed  in  the  area
  4793.      pointed  to by buff. The actual number of bits stored is re-
  4794.      turned from the function.  The bits in buff  are  stored  in
  4795.      byte  order, with the highest value bit of the byte taken as
  4796.      the first bit of the byte.
  4797.  
  4798. BUGS
  4799.  
  4800.      You have to make sure that buff is big enough  for  all  the
  4801.      bits.
  4802.  
  4803. SEE ALSO
  4804.  
  4805.      vector(fax), tovec(fax)
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826. TOVEC(FAX)                                             TOVEC(FAX)
  4827.  
  4828.  
  4829.  
  4830.  
  4831. NAME
  4832.  
  4833.      tovec - convert bitmap to vector format
  4834.  
  4835. SYNOPSIS
  4836.  
  4837.      int  *tovec(buff, nbits);
  4838.  
  4839.      char *buff;
  4840.      int  nbits;
  4841.  
  4842. DESCRIPTION
  4843.  
  4844.      The bitmap in the buffer pointed to by buff is converted  to
  4845.      vector format. The length of the bitmap in bits is passed in
  4846.      nbits.  As the caller would normally not know how many  vec-
  4847.      tor elements are going to be needed, the tovec routine allo-
  4848.      cates this area for the user.
  4849.  
  4850.      Buff is assumed to be  organised  in  byte  order  with  the
  4851.      highest  value  bit  of each byte being the first bit of the
  4852.      byte. The counts of white and black pels are placed into  an
  4853.      integer  vector, the first element of which is the length of
  4854.      the rest of the vector. The vector information proper starts
  4855.      in  the  second  element which is the count of the number of
  4856.      leading white pels.  This is followed by the  count  of  the
  4857.      numbr of black pels, etc.
  4858.  
  4859.      The routine goes to great lengths to make sure  only  enough
  4860.      vector  storage is allocated. Temporary storage is allocated
  4861.      in small chunks and then, when the length of the whole  vec-
  4862.      tor  is known, the chunks are contacenated into a contiguous
  4863.      vector.  The pointer to this vector is returned to the user.
  4864.  
  4865. SEE ALSO
  4866.  
  4867.      vector(fax), bitmap(fax)
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883. CHOICE(FAX)                                           CHOICE(FAX)
  4884.  
  4885.  
  4886.  
  4887.  
  4888. NAME
  4889.  
  4890.      choice - specify a rectangular area on Grinnell
  4891.  
  4892. SYNOPSIS
  4893.  
  4894.      struct  square  {
  4895.              int  x0, y0;
  4896.              int  x1, y1;
  4897.      };
  4898.      struct  square  *choice(colour, height, width, area, fw, fh)
  4899.  
  4900.      char colour;
  4901.      int  height, width, area, fw, fh;
  4902.  
  4903. DESCRIPTION
  4904.  
  4905.      This subroutine is called by a MOS task.  to specify a  rec-
  4906.      tangular  area  of  an image by manipulating a square on the
  4907.      Grinnel display being illustrating the image. The  dimension
  4908.      of  the  original image is defined as height and width.  The
  4909.      area on which the original image is shown  is  specified  by
  4910.      the parameter area.
  4911.  
  4912.       value       area           dimension    coordinates
  4913.  
  4914.         0     the whole screen    512x512     0,511,511,0
  4915.         1     the left half       256x512     0,511,255,0
  4916.         2     the right half      256x512     256,511,511,0
  4917.  
  4918.      The square will be drwan in a colour defined by the  parame-
  4919.      ter colour, which can only be:
  4920.  
  4921.              value   colour
  4922.  
  4923.               'r'     red
  4924.               'g'     green
  4925.               'b'     blue
  4926.  
  4927.  
  4928.      There are two modes being supported:
  4929.  
  4930.       (1) Fixed: The square will have a fixed dimension specified
  4931.           by the parameters fw and fh.  The operator can move the
  4932.           square around as a whole within the predetermined  area
  4933.           by  using  following commands, each of which is invoked
  4934.           by typing the corresponding characer on the keyboard of
  4935.           the system console.
  4936.  
  4937.  
  4938.  
  4939.  
  4940. CHOICE(FAX)                                           CHOICE(FAX)
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.            command         function
  4947.  
  4948.              'u'           move the square up one step
  4949.              'd'           move the square down one step
  4950.              'l'           move the square one step left
  4951.              'r'           move the square one step right
  4952.              'f'           move fast - set the step to 8 pel
  4953.              'o'           move slowly - set the step to 1 pel
  4954.              <CR>          ok - the area has been chosen, and
  4955.                           return its coordinates
  4956.  
  4957.  
  4958.       (2) Arbitrary: This mode is set up when the  subroutine  is
  4959.           called  with  the  parameters  fw and fh set to 0.  Any
  4960.           edge of the square can be selected to be moved  on  its
  4961.           own  by  using  the  same commands described above. The
  4962.           following commands are required to select the  relevant
  4963.           edge as well as switching the operation mode.
  4964.  
  4965.            command         function
  4966.  
  4967.              'e'           select the right ('east') edge.
  4968.              'w'           select the left ('west') edge.
  4969.              'n'           select the upper ('north') edge.
  4970.              's'           select the lower ('south') edge.
  4971.              'a'           move the square as a whole
  4972.  
  4973.  
  4974.      As soon as the user  types  <CR>,  the  coordinates  of  the
  4975.      current  square,  which  are accommodated in a square struc-
  4976.      ture, are returned. Note these are concerned with the  coor-
  4977.      dinate  system  defined  for the image but not for the grin-
  4978.      nell.
  4979.  
  4980. BUGS
  4981.  
  4982.      Currently, only three working areas can be used.
  4983.  
  4984. SEE ALSO
  4985.  
  4986.      vector(fax), grinnell(dev), grinnell(fax)
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997. CRC(FAX)                                                 CRC(FAX)
  4998.  
  4999.  
  5000.  
  5001.  
  5002. NAME
  5003.  
  5004.      crc - calculate or check the DACOM CRC code
  5005.  
  5006. SYNOPSIS
  5007.  
  5008.      int  crc(buff, insert);
  5009.  
  5010.      char *buff;
  5011.      int  insert;
  5012.  
  5013. DESCRIPTION
  5014.  
  5015.      This routine will check/insert the 12-bit  CRC  code  for  a
  5016.      DACOM  block,  pointed  to  by buff.  The block contains 585
  5017.      bits, the last 12 bits being the  CRC  code.  The  block  is
  5018.      checked  only  when the parameter insert is set to 0, other-
  5019.      wise the CRC code is created and inserted  into  the  block.
  5020.      When the block is checked, the routine returns the result: 0
  5021.      means OK and any non-zero value means the block is  bad.  On
  5022.      the  other  hand, when the CRC code is inserted, the routine
  5023.      returns the CRC code it has created.
  5024.  
  5025.      This routine uses a tabular approach to  determine  the  CRC
  5026.      code,  processing  a whole byte at a time and resulting in a
  5027.      high throughput.
  5028.  
  5029. BUGS
  5030.  
  5031.      Do not forget to supply enough space  when  the  12-bit  CRC
  5032.      code is to be inserted.
  5033.  
  5034. SEE ALSO
  5035.  
  5036.      dacom(dev)
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054. CSINIT(FAX)                                           CSINIT(FAX)
  5055.  
  5056.  
  5057.  
  5058.  
  5059. NAME
  5060.  
  5061.      csinit - initiate the Clean and Simple interface
  5062.  
  5063. SYNOPSIS
  5064.  
  5065.      int  csinit();
  5066.  
  5067. DESCRIPTION
  5068.  
  5069.      This routine is called to initiate the Clean and Simple  in-
  5070.      terface for the calling process.  Its code is re-entrant, so
  5071.      that only one copy is needed for all processes in a system.
  5072.  
  5073.      This routine returns the task identifier, which must be used
  5074.      on all subsequent interface calls.
  5075.  
  5076. SEE ALSO
  5077.  
  5078.      csopen(fax), csread(fax), cswrite(fax), fitter(fax)
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111. CSOPEN(FAX)                                           CSOPEN(FAX)
  5112.  
  5113.  
  5114.  
  5115.  
  5116. NAME
  5117.  
  5118.      csopen - establish the Clean and Simple connection
  5119.  
  5120. SYNOPSIS
  5121.  
  5122.      char *csopen(tid);
  5123.  
  5124.      int  tid;
  5125.  
  5126. DESCRIPTION
  5127.  
  5128.      A process calls this routine, waiting to be scheduled.   Its
  5129.      code  is re-entrant, so that only one copy is needed for all
  5130.      processes in a system.
  5131.  
  5132.      The task identifier tid is the word returned from the csinit
  5133.      call.  When the fitter process has established the Clean and
  5134.      Simple connection for the process, this routine returns  the
  5135.      pointer  to  the  parameter string of the corresponding task
  5136.      command.
  5137.  
  5138. SEE ALSO
  5139.  
  5140.      csinit(fax), csread(fax), cswrite(fax), fitter(fax)
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.  
  5168. CSREAD(FAX)                                           CSREAD(FAX)
  5169.  
  5170.  
  5171.  
  5172.  
  5173. NAME
  5174.  
  5175.      csread - read data from the Clean and Simple interface
  5176.  
  5177. SYNOPSIS
  5178.  
  5179.      char *csread(tid, need);
  5180.  
  5181.      int  tid, need;
  5182.  
  5183. DESCRIPTION
  5184.  
  5185.      This routine is called to read data from the Clean and  Sim-
  5186.      ple interface. Its code is re-entrant, so that only one copy
  5187.      is needed for all processes in a system.
  5188.  
  5189.      The task identifier tid is the word returned from the csinit
  5190.      call.  The need parameter indicates the number of bytes that
  5191.      are required. This routine returns a  pointer  to  a  buffer
  5192.      with this much data in it. This is usually more efficient as
  5193.      it means that the data does not have to be reblocked.
  5194.  
  5195. DIAGNOSTICS
  5196.  
  5197.      If the returned value is 0, the end of data is reached.
  5198.  
  5199. BUGS
  5200.  
  5201.      Funnies happen at the end of data to be read.  The  csread()
  5202.      call  has  no  way of saying that the final buffer is partly
  5203.      filled.  Thus if you ask for more data,  you  hang  forever.
  5204.      But  if  the  data  structures  are  working correctly, this
  5205.      should never happen.
  5206.  
  5207. SEE ALSO
  5208.  
  5209.      csinit(fax), cswrite(fax), fitter(fax)
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225. CSWRITE(FAX)                                         CSWRITE(FAX)
  5226.  
  5227.  
  5228.  
  5229.  
  5230. NAME
  5231.  
  5232.      cswrite - write data to the Clean and Simple interface
  5233.  
  5234. SYNOPSIS
  5235.  
  5236.      char *cswrite(tid, need);
  5237.  
  5238.      int  tid, need;
  5239.  
  5240. DESCRIPTION
  5241.  
  5242.      This routine is call to write data to the Clean  and  Simple
  5243.      interface.  Its code is re-entrant, so that only one copy is
  5244.      needed for all processes in a system.
  5245.  
  5246.      The task identifier tid is the word returned from the csinit
  5247.      call.  The need parameter indicates the number of bytes that
  5248.      are to be written. This routine returns a  write  buffer  of
  5249.      the  required  length, to which the user data can be copied.
  5250.      The subsequent cswrite()  call  automatically  releases  the
  5251.      previous write buffer.
  5252.  
  5253.      The cswrite() call with need set to 0 indicates the  end  of
  5254.      data, closing the current Clean and Simple connection.
  5255.  
  5256. BUGS
  5257.  
  5258.      As indicated, the write buffer must be filled up before  the
  5259.      next cswrite() call.
  5260.  
  5261. SEE ALSO
  5262.  
  5263.      csinit(fax), csread(fax), fitter(fax)
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282. GETL(FAX)                                          GETL(FAX)
  5283.  
  5284.  
  5285.  
  5286.  
  5287. NAME
  5288.  
  5289.      getl - get a line vector from the Clean and Simple interface
  5290.  
  5291. SYNOPSIS
  5292.  
  5293.      int  *getl(tid);
  5294.  
  5295.      int  tid, need;
  5296.  
  5297. DESCRIPTION
  5298.  
  5299.      This routine is called to read a line vector from the  Clean
  5300.      and  Simple  interface. Its code is re-entrant, so that only
  5301.      one copy is needed for all processes in a system.
  5302.  
  5303.      The task identifier tid is the word returned from the csinit
  5304.      call.  The  routine  returns the pointer to the buffer where
  5305.      the line vector is stored.
  5306.  
  5307. DIAGNOSTICS
  5308.  
  5309.      0 will be returned when end of file is reached.
  5310.  
  5311. BUGS
  5312.  
  5313.      Any memory violation causes  the  whole  task  chain  to  be
  5314.      aborted.
  5315.  
  5316. SEE ALSO
  5317.  
  5318.      vector(fax), putl(fax), fitter(fax)
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339. PUTL(FAX)                                               PUTL(FAX)
  5340.  
  5341.  
  5342.  
  5343.  
  5344. NAME
  5345.  
  5346.      putl - put a line vector to the Clean and Simple Interface
  5347.  
  5348. SYNOPSIS
  5349.  
  5350.      putl(tid, buf);
  5351.  
  5352.      int  tid, *buf;
  5353.  
  5354. DESCRIPTION
  5355.  
  5356.      This routine is called to write a line vector to  the  Clean
  5357.      and  Simple  interface. Its code is re-entrant, so that only
  5358.      one copy is needed for all processes in a system.
  5359.  
  5360.      The task identifier tid is the word returned from the csinit
  5361.      call. The line vector is stored in a buffer pointed by buf.
  5362.  
  5363. SEE ALSO
  5364.  
  5365.      vector(fax), getl(fax), fitter(fax)
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396. T4(FAX)                                                   T4(FAX)
  5397.  
  5398.  
  5399.  
  5400.  
  5401. NAME
  5402.  
  5403.      t4 - the data format defined in CCITT recommendation T4
  5404.  
  5405. DESCRIPTION
  5406.  
  5407.      Dimension and Resolution: In vertical direction the  resolu-
  5408.      tion is defined below.
  5409.  
  5410.              Standard resolution:            3.85 line/mm
  5411.              Optional higher resolution:     7.70 line/mm
  5412.  
  5413.      In horizontal direction, the standard resolution is  defined
  5414.      as  1728 black and white picture elements along the standard
  5415.      line length of 215 mm.  Optionally, there  can  be  2048  or
  5416.      2432 picture elements along a scan line length of 255 or 303
  5417.      mm, respectively. The input documents up to a minimum of ISO
  5418.      A4 size should be accepted.
  5419.  
  5420.      One-Dimensional Coding: The one-dimensional run length  data
  5421.      compression  is accomplished by the popular modified Huffman
  5422.      coding scheme. In this scheme, black and white runs are  re-
  5423.      placed  by  a  base  64 codes representation. Compression is
  5424.      achieved since the code word lengths are invertly related to
  5425.      the  probability  of  the  occurrence of a particular run. A
  5426.      special code (000000000001), known as  EOL  (End  of  Line),
  5427.      follows  each  line  of data. This code starts the facsimile
  5428.      message phase, while the control phase is restored by a com-
  5429.      bination  of six contiguous EOLs (RTC). The data format of a
  5430.      facsimile message is shown below.
  5431.  
  5432.       start of the facsimile data
  5433.       |
  5434.       v
  5435.       +---+------+---+------+-/
  5436.       !EOL! DATA !EOL! DATA !
  5437.       +---+------+---+------+-/
  5438.  
  5439.                     end of the facsimile data
  5440.                                             |
  5441.                                             v
  5442.        /-+---+------+---+---+---+---+---+---+
  5443.          !EOL! DATA !EOL!EOL!EOL!EOL!EOL!EOL!
  5444.        /-+---+------+---+---+---+---+---+---+
  5445.                     |<------   RTC  ------->|
  5446.  
  5447.      Two-Dimensional Coding: The two-dimensional coding scheme is
  5448.      labeled  as  the  Modified READ Code. It codes one line with
  5449.      reference to the line above,correlation  between  adja-
  5450.      cent lines allowing for more efficient compression. In order
  5451.      to limit the disturbed area in the event of transmission er-
  5452.      rors,
  5453.  
  5454.  
  5455. T4(FAX)                                                   T4(FAX)
  5456.  
  5457.  
  5458.  
  5459.      a one-dimensionally coded line is transmitted after  one  or
  5460.      more  two-dimensionally  coded  lines.  A bit, following the
  5461.      EOL, indicates whether one-  or  two-dimensional  coding  is
  5462.      used for the next line:
  5463.  
  5464.              EOL1: one-dimensional coding;
  5465.              EOL0: two-dimensional coding.
  5466.  
  5467.       start of the facsimile data
  5468.       |
  5469.       v
  5470.       +----+--------+----+--------+-/
  5471.       !EOL1!DATA(1D)!EOL0!DATA(2D)!
  5472.       +----+--------+----+--------+-/
  5473.  
  5474.                              end of the facsimile data
  5475.                                                      |
  5476.                                                      v
  5477.        /-+----+--------+----+----+----+----+----+----+
  5478.          !EOL0!DATA(2D)!EOL1!EOL1!EOL1!EOL1!EOL1!EOL1!
  5479.        /-+----+--------+----+----+----+----+----+----+
  5480.                        |<---------   RTC   --------->|
  5481.  
  5482.  
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.  
  5497.  
  5498.  
  5499.  
  5500.  
  5501.  
  5502.  
  5503.  
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512. TEXT(FAX)                                               TEXT(FAX)
  5513.  
  5514.  
  5515.  
  5516.  
  5517. NAME
  5518.  
  5519.      text - the text format for use in the facsimile system
  5520.  
  5521. DESCRIPTION
  5522.  
  5523.      This is the representation  structure  for  coded  character
  5524.      text.  It is used in the facsimile system.
  5525.  
  5526.      The  text  structure  consists  of  a  series  of  character
  5527.      strings,  each  of  which represents a text line. However no
  5528.      control characters, e.g. <CR> and  <LF>,  are  used  in  the
  5529.      structure. Each text line is proeeded by a count byte, indi-
  5530.      cating the number of characters on the line.  The  character
  5531.      sting  follows  after the the count byte. A zero count indi-
  5532.      cates the end of file.
  5533.  
  5534. EXAMPLES
  5535.  
  5536.      Here is an example text shown below:
  5537.  
  5538.              This is a text.
  5539.              This is a picture.
  5540.  
  5541.      It can be represented as:
  5542.  
  5543.       <017> T  h  i  s <040> i  s <040> a <040> t  e  x  t  .
  5544.       <022> T  h  i  s <040> i  s <040> a <040> p  i  c  t  u
  5545.       r e  . <0>
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569. TS(FAX)                                                   TS(FAX)
  5570.  
  5571.  
  5572.  
  5573.  
  5574. NAME
  5575.  
  5576.      ts - translate an ASCII string into vector format
  5577.  
  5578. SYNOPSIS
  5579.  
  5580.      ts(ar_in, left, right, tid)
  5581.  
  5582.      char *ar_in;
  5583.      int  left, right, tid;
  5584.  
  5585. DESCRIPTION
  5586.  
  5587.      This routine will convert a zero-ended ASCII string  pointed
  5588.      to  by  ar_in  into  the corresponding vecter format. As the
  5589.      character font being used is a set of 12x20 matrices,  there
  5590.      will  be  20 line vectors created. These vectors are written
  5591.      to the Cleans and Simple interface by calling cswrite.   The
  5592.      callers task identifier tid has to be provided.
  5593.  
  5594.      At the two ends of the text line, blanks can be padded  that
  5595.      are  specified  as left and right.  Note that they are meas-
  5596.      ured in pels.
  5597.  
  5598.      Consequently, the result should be a image, whose  dimension
  5599.      is:
  5600.  
  5601.              width  = left + 12*length + right;
  5602.              height = 20;
  5603.  
  5604.      where length is  the  number  of  characters  in  the  input
  5605.      string.
  5606.  
  5607.      As an intermediate result the bitmap is first created  which
  5608.      is then converted into the vector format, by calling tovec.
  5609.  
  5610. BUGS
  5611.  
  5612.      The input string must be ended with a zero field.
  5613.  
  5614.  
  5615.  
  5616. SEE ALSO
  5617.  
  5618.      vector(fax),    tovec(fax),    csinit(fax),    cswrite(fax),
  5619.      fitter(fax)
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626. VECTOR(FAX)                                           VECTOR(FAX)
  5627.  
  5628.  
  5629.  
  5630.  
  5631. NAME
  5632.  
  5633.      vector - the internal data structure for a facsimile image
  5634.  
  5635. DESCRIPTION
  5636.  
  5637.      This is the representation structure for  binary  images,  a
  5638.      simple  run length compression algorithm being used. Most of
  5639.      the image files are kept in vector format for ease  of  pro-
  5640.      cessing.
  5641.  
  5642.      The vector format consists of a series of  integer  vectors,
  5643.      one vector for each row of pels in the image. Each vector is
  5644.      proceeded by a count word which indicates the number of  in-
  5645.      teger  words  in the vector.  The next element of the vector
  5646.      after the count field is the number of  white  pels  in  the
  5647.      first  run  of  the  line.   The  second word then gives the
  5648.      number of pels that follow the initial white run, and so  on
  5649.      t  the  end of the vector. Note the first run length element
  5650.      must refer to a white run. It should be  set  to  0  if  the
  5651.      first run is black.
  5652.  
  5653. EXAMPLES
  5654.  
  5655.      A line consists of 20 pels as follows:
  5656.  
  5657.              00011111111011100000
  5658.  
  5659.      It can be represented as:
  5660.  
  5661.              5, 3, 8, 1, 3, 5
  5662.  
  5663.      The inverse of the line:
  5664.  
  5665.              11100000000100011111
  5666.  
  5667.      should be represented as:
  5668.  
  5669.              6, 0, 3, 8, 1, 3, 5
  5670.  
  5671.