DACOM(DEV) DACOM(DEV) NAME dacom - facsimile machine SYNOPSIS DCT faxinput setdct("faxin", 0350, 0174750, 0174740, faxii, faxin, faxini, &faxoutput); DCT faxoutput setdct("faxout", 0354, 0174752, 0174742, faxoi, faxot, faxoti, &faxinput); DESCRIPTION The DACOM facsimile machine can read a document, creating the corresponding image data blocks. It can also accept the data of relevant format, printing the correponding image. Each data block consists of 585 bits, and is stored in a block of 74 bytes starting on a byte boundary. The final 7 bits of the last byte are not used and they are undefined. The 585 bits in each block need to be read as a bit stream: the bits in each byte run from the high orger end of the byte to the low order end. The last 12 bits of the 585 bits in each block consistute the CRC field whereby the block can be validated. There are two kinds of blocks: SETUP blocks and DATA blocks. The first of block of an image data file should be a single SETUP block. All following blocks in the file must be DATA blocks. Note that the second block is a DATA block that con- tains ZERO samples, i.e. a dummy data blocks. Form the third block, the DATA blocks store the reall image data. A standard dacom page contains about 1200 scan lines, each of which has 1726 pels. One can choose
Appendix II: Task Controller and Task Processes
CCITT(FAX) CCITT(FAX) NAME ccitt - conversion between vector and CCITT T4 format SYNOPSIS ccitt() - a MOS task command string (task name is defined as ccitt): ccitt"<function> DESCRIPTION This routine operates as a MOS pipe task to convert the vec- tors to CCITT T4 format or inversely. The parameter function specifies what the task is to do. value function 1c one-dimensional compression 1d one-dimensional decompression 2c[<k>] two-dimensional compression 2d two-dimensional decompression Note k is the maximun number of lines to be coded two- dimensionally before a one-dimensionally coded line is in- serted. If k is omitted, the default value 2 is adopted. SEE ALSO vector(fax), t4(fax), fitter(fax)
CHECK(FAX) CHECK(FAX) NAME check - check the validity of a vector file. SYNOPSIS check() - a MOS task command string (the task name is defined as check): check"<function>,<width>,<height>,[<from>,<to>] DESCRIPTION This routine operates as a MOS pipe task checking the vali- dity of the input vector file. The number of lines to be checked is specified by the param- eter height. If the height of the image is less than the parameter, the actual height is printed. Thus, one can set the parameter height to a big number in order to count the number of lines of the input image. The run lengths in each of these lines are accumulated and the sum is compared with the parameter width. These are the basic functions which are performed whenever the task is invoked. However, there are several options one can choose by setting the one-character parameter function. value function 'n' basic function only 'c' print the count of each line 'l' print all lines 's' print the lines in the interval specified by parameter from and to DIAGNOSTICS A bad line will be reported and it will cause the job abort- ed. SEE ALSO vector(fax), getl(fax), fitter(fax)
CHOP(FAX) CHOP(FAX) NAME chop - extract a designated rectangular area from an image SYNOPSIS chop() - a MOS task command string (task name is defined as chop): chop"<x0>,<y0>,<x1>,<y1> DESCRIPTION This routine operates as a MOS pipe task extracting a desig- nated rectangular area from an input image. Input and out- put are image data files in the form of vectors. The following diagram shows the coordinate system being used. Note that the lengths are measured in number of pels. (0, 0) width X +-------------------------+----> | | | | | (x0, y0) | | +---------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------+ | | (x1, y1) | | | | | | | | | height +-------------------------+ | | Y V As can be seen in the diagram, the rectangular area to be extracted is specified by the parameters x0, x1, y0, y1, which are decimal strings. BUGS One has to make sure that
0 < x0 < width 0 < y0 < height 0 < x1 < width 0 < y1 < height SEE ALSO vector(fax), getl(fax), putl(fax), fitter(fax)
CLEAN(FAX) CLEAN(FAX) NAME clean - clean an image. SYNOPSIS clean() - a MOS task command string (task name is defined as clean): clean"<width>,<height> DESCRIPTION This routine operates as a MOS pipe task cleaning an image by means of mask scanning. Input and output are image data files in the form of vectors. The width and height should be given as the parameters. SEE ALSO vector(fax), getl(fax), putl(fax), fitter(fax)
DECOMP(FAX) DECOMP(FAX) NAME decomp - decompress DACOM blocks SYNOPSIS decomp() - a MOS task command string (task name is defined as decomp): decomp DESCRIPTION This task takes DACOM blocks from the Clean and Simple in- terface, and decompresses them into vector format. Then it writes the vectors to the Clean and Simple interface. SEE ALSO dacom(dev), vector(fax), fitter(fax)
FAX(FAX) FAX(FAX) NAME fax - interface process for DACOM facsimile machine SYNOPSIS fax() - a MOS task command string (task name is defined as fax): fax"<function> DESCRIPTION This task uses the Clean and Simple interface to read or write facsimile image data. The one character parameter function specifies whether the data is to be read or written. Character w is for writing. In this case, 74 byte DACOM blocks contaning correct CRC fields are expected. On the other hand, character r is for reading. In this case, a document is read on the facsimile machine, the DACOM blocks being created. SEE ALSO dacom(dev), fitter(fax)
FITTER(FAX) FITTER(FAX) NAME fitter - fit processes together to form a data pipe SYNOPSIS fitter() - the MOS task controller DESCRIPTION According to the command string typed on the console, fitter links the specified processes together to form a task chain. The name of the processes is the name given in the PCB. The processes must communicate using the C+S interface. Only one C+S interface is opened per process - data is pushed in with a cswrite and pulled out with a csread. The fitter does not inspect the data in any way but merely passes it from one process to another. The format of command string is: A | B | C. The fitter takes data from the process called A, write it to the process called B, reads data from the process B and write that data to the process C. Note that all middle processes are both read and written, while the first one in the list is only read from and the last in the list is only written to. A double quote is used as the separator between the task name and the open parameter string, e.g. A"500 | B"n,xyz | C, where the strings '500' and 'n,xyz' are the open parameter stings for tasks A and B, respectively. The parameter stirng is passed to the corresponding task routine when the csopen call returns. DIAGNOSTICS The command string containing undefined task will be reject- ed. SEE ALSO csinit(fax), csopen(fax), csread(fax), cswrite(fax)
FS(FAX) FS(FAX) NAME fs - file system for use under MOS SYNOPSIS fs() - a MOS task command string (task name is defined as fs): fs"<funciton>,<file_name> DESCRIPTION This is a file system, based on the Double Density floppy disk, for use under MOS. The fs task is used for manipulate the files, managed by the file system. This task can only appear at the first or last position on a command string. In the former case, the file specified is to be read, while the file is to be written in the latter case. The <function> field contains only one character indicating the function to be performed. The possible values are: e - open an existing file (for reading). c - open an existing file, and set the length to zero (for rewriting). a - append to an existing file. If the capitals A, C, and E are used, the functions are the same as described above but the specified file is created if it does not exist. BUGS This task is for reading and writing only. As for the other facilities, e.g. seek, delete, status and sync, one has to use C+S interface directly. Note that only 15 files are permitted per disk, only drive 0 is supported at present, and no hierarchical directory is allowed. SEE ALSO aed62(dev), fitter(fax)
FTP(FAX) FTP(FAX) NAME ftp, pftp - NIFTP task processes SYNOPSIS ftp(), pftp() - MOS tasks command string (task name is defined as ftp): ftp"<function>,<code>,<user_name>,<password>,<file_name>; <trasport_service_process>:<transport_service_parameters> DESCRIPTION These tasks are implementation of Network Independent File Transfer Protocol (NIFTP) for LSIs under MOS. They employ a transport service for communication with a remote host on the network, where the same protocol must be supported. They communicate with the user process and transport service processes thourgh the Clean and Simple interface, so that they can be used in a fitter command chain directly. The code is available in two versions: ftp which is a P+Q version supporting both server and intitiator and pftp which is a P version working only as an initiator. Both of them are capable of sending and receiving. This implementation of NIFTP is just a subset of the proto- col as its main purpose is to provided the facsimile system with a data transmission mechanism. For the sake of simpli- city, only the necessary facilities are included in the module, while more complex facilities, such as data compres- sion and error recovery are not implemented. The following table shows the transfer control parameters being used. Attribute Value Mod. Remarks Mode of access 0001 EQ Creating a new file 8002 EQ Retrieving file Codes - - Text file, any parity 1002 EQ Binary file Format effector 0000 EQ No interpretation Binary mapping 0008 EQ Default byte size Max record size 00FC EQ Default record size Transfer size 0400 LE Default transfer size Facilities 0000 EQ Minimum service The meanings of the parameters in the command string are listed below: function is the NIFTP function of our site. Any ASCII string beginning
beginning with 't' means the file is to be transmitted to the remote site. Otherwise, the file will be retrieved from the remote site. code specifies the type of the file to be transferred. Any ASCII string beginning with 'b' means it is a binary file, while others mean text file. user_name is the login name of the server site. password is the password of the server site. file_name is the name of the file to be transmitted. transport_service_process is the process name of the tran- sport service to be used. transport_service_parameters are the parameter string re- quired by the transport service. They are network dependent and specified by the corresponding transport service. SEE ALSO fitter(fax)
GRINNELL(FAX) GRINNELL(FAX) NAME grinnell - task to convert and display fax vector data SYNOPSIS grinnell() - a MOS task command string (task name is defined as string): grinnell"<x0>,<y0>,<x1>,<y1>,<mode>,<colour> DESCRIPTION This task takes the vector data from a Clean and Simple in- terface and displays it on the Grinnell screen. The Grinnell screen is viewed as an X-Y plane with (0,0) being the lower left hand corner, (512, 0) being the lower right hand corner, etc. The parameters x0, y0, x1, y1 are decimal strings defining the rectangular space on the screen where the image is to be displayed. If the image is smaller than this area, it is ar- tificially expanded to the size of this area. If the image is larger than this area it is truncated to the size of the area. The colour field consists of any combination of the charac- ters r,g or b to define the colours red, green and blue respectively. For instance "gb" would write the image as yellow. The mode defines how the image is to be displayed. Any com- bination of the characters r,a and z may be used, to the following effect: r = reverse image a = additive image z = zerowrite image. There are three bit planes to define the three colours. Nor- mally the bit planes corresponding to the selected colours have either zero bits or one bits written to them depending upon whether the image or the background is being written. For zerowrite, all non-selected bit planes (i.e. colours) are always set to zero, thus erasing any unselected colours in the area. Additive mode means that in the selected colour planes the new bits are ORed in, rather than just written. Thus the image is added to. In reverse mode, the image writ- ten as one bits is written as zero bits and the bits written as zero bits are written as one bits, i.e. the bits are flipped before being used.
SEE ALSO grinnell(dev), vector(fax), fitter(fax)
MERGE(FAX) MERGE(FAX) NAME merge - merge two images together SYNOPSIS merge() - a MOS task command string (task name is defined as merge): merge"<file_name>,<action>,<x0>,<y0>,<x1>,<y1> DESCRIPTION This routine operates as a MOS pipe task merging two images together to form the result image. Input and output are im- age data files in the form of vectors. One of the two input images is called background which is to be copied directly. This is specified by the parameter file_name. The image data of the back ground is read via a 'tunnel', maintained by this task. Another input image is taken form the Clean and Simple interface managed by the fitter. As shown in the following diagram, the position where it is to be put on the background image is specified by the parameters x0, y0, x1, y1, which are decimal strings. This implies that the dimension of the image is x1 - x0 and y1 -y0. (0, 0) width X +-------------------------+----> | | | (x0, y0) | | +---------+ | | | | | | | | | | | | | | | | | | | | | | +---------+ | | (x1, y1) | | | | | | (back ground) | height +-------------------------+ | | Y V The parameter action indicates how the two images are merged. If it set to 0, The second image is simply overlaid on the back ground image. On the other hand any non-zero value
MERGE(FAX) MERGE(FAX) causes the second image to replace the specified area of the back ground image. BUGS One has to make sure that 0 < x0 < width_of_back_ground 0 < y0 < height_of_back_ground 0 < x1 < width_of_back_ground 0 < y1 < height_of_back_ground In addition, x0, y0, x1, y1 must be consistent with the di- mension of the image SEE ALSO vector(fax), getl(fax), putl(fax), chop(fax), fitter(fax)
OD(FAX) OD(FAX) NAME od - dump the input data SYNOPSIS od() - a MOS task command string (task name is defined as od): od"<format> DESCRIPTION This routine operates as a MOS pipe task dumping the input data in a selected format. The input data is taken from the Clean and Simple interface. The meanings of the one character parameter format are: value format 'd' words in decimal 'o' words in octal 'c' bytes in ASCII 'b' bytes in octal SEE ALSO fitter(fax)
RECOMP(FAX) RECOMP(FAX) NAME recomp - compress the vectors to form the DACOM blocks SYNOPSIS recomp() - a MOS task command string (task name is defined as recomp): recomp DESCRIPTION This task takes vectors from the Clean and Simple interface, and recompresses them into DACOM blocks. Then it writes the blocks to the Clean and Simple interface. SEE ALSO dacom(dev), vector(fax), fitter(fax)
SCALE(FAX) SCALE(FAX) NAME scale - scale an image to a specified dimension SYNOPSIS scale() - a MOS task command string (task name is defined as scale): scale"<old_width>,<old_height>,<new_width>,<new_height> DESCRIPTION This routine operates as a MOS pipe task scaling the input image to the specified dimension. Input and output are im- age data files in the form of vectors. The dimension of the input image is given by the parameters old_width and old_height, while the dimension of the output is specified by the parameters new_width and new_height. SEE ALSO vector(fax), getl(fax), putl(fax), fitter(fax)
STRING(FAX) STRING(FAX) NAME string - convert an ASCII string to the vector format SYNOPSIS string() - a MOS task command string (task name is defined as string): string"<s> DESCRIPTION This routine operates as a MOS pipe task converting the parameter string s to the corresponding vectors. SEE ALSO vector(fax), ts(fax)
TF(FAX) TF(FAX) NAME tf - convert a text to the vector format. SYNOPSIS tf() - a MOS task command string (task name is defined as tf): tf"<width>,<line_sp>,<upper>,<left> DESCRIPTION This routine operates as a MOS pipe task converting the in- put text to the corresponding vectors. The input text, taken from the Clean and Simple interface should be in the format defined in text(fax). +-------------------------+ | | | upper | | | | XXXXXXXXXXXX | | XXXXXXXXXXXX | | XXXXXXXXXXXX | | XXXXXXXXXXXX | | left XXXXXXXXXXXX | | XXXXXXXXXXXX | | XXXXXXXXXXXX | | XXXXXXXXXXXX | | XXXXXXXXXXXX | | width | | | +-------------------------+ As shown in the diagram, the parameters give the information for the formating. The parameter width is the maximum width of the text lines. Every vector will be padded to fit this width. White pels may be padded to the left of each vectors, and the number of pel to be padded is specified by the parameter left. Empty lines may also be inserted. They are defined by param- eters upper and line_sp, the number of pels being used as the unit. SEE ALSO vector(fax), text(fax), ts(fax), fitter(fax)
Appendix III: Utility Routines and Data Formats
BITMAP(FAX) BITMAP(FAX) NAME bitmap - convert vector format to core bit map SYNOPSIS int bitmap(ivec, cnt, buff); int *ivec; int cnt; char *buff; DESCRIPTION Bitmap converts the fax vector format into a bit map, using each bit of the area pointed to by buff. The number of ele- ments in ivec is given by cnt, and the first element of ivec is taken as a white pel count, the second as a black pel count, etc. The resultant bit map is placed in the area pointed to by buff. The actual number of bits stored is re- turned from the function. The bits in buff are stored in byte order, with the highest value bit of the byte taken as the first bit of the byte. BUGS You have to make sure that buff is big enough for all the bits. SEE ALSO vector(fax), tovec(fax)
TOVEC(FAX) TOVEC(FAX) NAME tovec - convert bitmap to vector format SYNOPSIS int *tovec(buff, nbits); char *buff; int nbits; DESCRIPTION The bitmap in the buffer pointed to by buff is converted to vector format. The length of the bitmap in bits is passed in nbits. As the caller would normally not know how many vec- tor elements are going to be needed, the tovec routine allo- cates this area for the user. Buff is assumed to be organised in byte order with the highest value bit of each byte being the first bit of the byte. The counts of white and black pels are placed into an integer vector, the first element of which is the length of the rest of the vector. The vector information proper starts in the second element which is the count of the number of leading white pels. This is followed by the count of the numbr of black pels, etc. The routine goes to great lengths to make sure only enough vector storage is allocated. Temporary storage is allocated in small chunks and then, when the length of the whole vec- tor is known, the chunks are contacenated into a contiguous vector. The pointer to this vector is returned to the user. SEE ALSO vector(fax), bitmap(fax)
CHOICE(FAX) CHOICE(FAX) NAME choice - specify a rectangular area on Grinnell SYNOPSIS struct square { int x0, y0; int x1, y1; }; struct square *choice(colour, height, width, area, fw, fh) char colour; int height, width, area, fw, fh; DESCRIPTION This subroutine is called by a MOS task. to specify a rec- tangular area of an image by manipulating a square on the Grinnel display being illustrating the image. The dimension of the original image is defined as height and width. The area on which the original image is shown is specified by the parameter area. value area dimension coordinates 0 the whole screen 512x512 0,511,511,0 1 the left half 256x512 0,511,255,0 2 the right half 256x512 256,511,511,0 The square will be drwan in a colour defined by the parame- ter colour, which can only be: value colour 'r' red 'g' green 'b' blue There are two modes being supported: (1) Fixed: The square will have a fixed dimension specified by the parameters fw and fh. The operator can move the square around as a whole within the predetermined area by using following commands, each of which is invoked by typing the corresponding characer on the keyboard of the system console.
command function 'u' move the square up one step 'd' move the square down one step 'l' move the square one step left 'r' move the square one step right 'f' move fast - set the step to 8 pel 'o' move slowly - set the step to 1 pel <CR> ok - the area has been chosen, and return its coordinates (2) Arbitrary: This mode is set up when the subroutine is called with the parameters fw and fh set to 0. Any edge of the square can be selected to be moved on its own by using the same commands described above. The following commands are required to select the relevant edge as well as switching the operation mode. command function 'e' select the right ('east') edge. 'w' select the left ('west') edge. 'n' select the upper ('north') edge. 's' select the lower ('south') edge. 'a' move the square as a whole As soon as the user types <CR>, the coordinates of the current square, which are accommodated in a square struc- ture, are returned. Note these are concerned with the coor- dinate system defined for the image but not for the grin- nell. BUGS Currently, only three working areas can be used. SEE ALSO vector(fax), grinnell(dev), grinnell(fax)
CRC(FAX) CRC(FAX) NAME crc - calculate or check the DACOM CRC code SYNOPSIS int crc(buff, insert); char *buff; int insert; DESCRIPTION This routine will check/insert the 12-bit CRC code for a DACOM block, pointed to by buff. The block contains 585 bits, the last 12 bits being the CRC code. The block is checked only when the parameter insert is set to 0, other- wise the CRC code is created and inserted into the block. When the block is checked, the routine returns the result: 0 means OK and any non-zero value means the block is bad. On the other hand, when the CRC code is inserted, the routine returns the CRC code it has created. This routine uses a tabular approach to determine the CRC code, processing a whole byte at a time and resulting in a high throughput. BUGS Do not forget to supply enough space when the 12-bit CRC code is to be inserted. SEE ALSO dacom(dev)
CSINIT(FAX) CSINIT(FAX) NAME csinit - initiate the Clean and Simple interface SYNOPSIS int csinit(); DESCRIPTION This routine is called to initiate the Clean and Simple in- terface for the calling process. Its code is re-entrant, so that only one copy is needed for all processes in a system. This routine returns the task identifier, which must be used on all subsequent interface calls. SEE ALSO csopen(fax), csread(fax), cswrite(fax), fitter(fax)
CSOPEN(FAX) CSOPEN(FAX) NAME csopen - establish the Clean and Simple connection SYNOPSIS char *csopen(tid); int tid; DESCRIPTION A process calls this routine, waiting to be scheduled. Its code is re-entrant, so that only one copy is needed for all processes in a system. The task identifier tid is the word returned from the csinit call. When the fitter process has established the Clean and Simple connection for the process, this routine returns the pointer to the parameter string of the corresponding task command. SEE ALSO csinit(fax), csread(fax), cswrite(fax), fitter(fax)
CSREAD(FAX) CSREAD(FAX) NAME csread - read data from the Clean and Simple interface SYNOPSIS char *csread(tid, need); int tid, need; DESCRIPTION This routine is called to read data from the Clean and Sim- ple interface. Its code is re-entrant, so that only one copy is needed for all processes in a system. The task identifier tid is the word returned from the csinit call. The need parameter indicates the number of bytes that are required. This routine returns a pointer to a buffer with this much data in it. This is usually more efficient as it means that the data does not have to be reblocked. DIAGNOSTICS If the returned value is 0, the end of data is reached. BUGS Funnies happen at the end of data to be read. The csread() call has no way of saying that the final buffer is partly filled. Thus if you ask for more data, you hang forever. But if the data structures are working correctly, this should never happen. SEE ALSO csinit(fax), cswrite(fax), fitter(fax)
CSWRITE(FAX) CSWRITE(FAX) NAME cswrite - write data to the Clean and Simple interface SYNOPSIS char *cswrite(tid, need); int tid, need; DESCRIPTION This routine is call to write data to the Clean and Simple interface. Its code is re-entrant, so that only one copy is needed for all processes in a system. The task identifier tid is the word returned from the csinit call. The need parameter indicates the number of bytes that are to be written. This routine returns a write buffer of the required length, to which the user data can be copied. The subsequent cswrite() call automatically releases the previous write buffer. The cswrite() call with need set to 0 indicates the end of data, closing the current Clean and Simple connection. BUGS As indicated, the write buffer must be filled up before the next cswrite() call. SEE ALSO csinit(fax), csread(fax), fitter(fax)
GETL(FAX) GETL(FAX) NAME getl - get a line vector from the Clean and Simple interface SYNOPSIS int *getl(tid); int tid, need; DESCRIPTION This routine is called to read a line vector from the Clean and Simple interface. Its code is re-entrant, so that only one copy is needed for all processes in a system. The task identifier tid is the word returned from the csinit call. The routine returns the pointer to the buffer where the line vector is stored. DIAGNOSTICS 0 will be returned when end of file is reached. BUGS Any memory violation causes the whole task chain to be aborted. SEE ALSO vector(fax), putl(fax), fitter(fax)
PUTL(FAX) PUTL(FAX) NAME putl - put a line vector to the Clean and Simple Interface SYNOPSIS putl(tid, buf); int tid, *buf; DESCRIPTION This routine is called to write a line vector to the Clean and Simple interface. Its code is re-entrant, so that only one copy is needed for all processes in a system. The task identifier tid is the word returned from the csinit call. The line vector is stored in a buffer pointed by buf. SEE ALSO vector(fax), getl(fax), fitter(fax)
T4(FAX) T4(FAX) NAME t4 - the data format defined in CCITT recommendation T4 DESCRIPTION Dimension and Resolution: In vertical direction the resolu- tion is defined below. Standard resolution: 3.85 line/mm Optional higher resolution: 7.70 line/mm In horizontal direction, the standard resolution is defined as 1728 black and white picture elements along the standard line length of 215 mm. Optionally, there can be 2048 or 2432 picture elements along a scan line length of 255 or 303 mm, respectively. The input documents up to a minimum of ISO A4 size should be accepted. One-Dimensional Coding: The one-dimensional run length data compression is accomplished by the popular modified Huffman coding scheme. In this scheme, black and white runs are re- placed by a base 64 codes representation. Compression is achieved since the code word lengths are invertly related to the probability of the occurrence of a particular run. A special code (000000000001), known as EOL (End of Line), follows each line of data. This code starts the facsimile message phase, while the control phase is restored by a com- bination of six contiguous EOLs (RTC). The data format of a facsimile message is shown below. start of the facsimile data | v +---+------+---+------+-/ !EOL! DATA !EOL! DATA ! +---+------+---+------+-/ end of the facsimile data | v /-+---+------+---+---+---+---+---+---+ !EOL! DATA !EOL!EOL!EOL!EOL!EOL!EOL! /-+---+------+---+---+---+---+---+---+ |<------ RTC ------->| Two-Dimensional Coding: The two-dimensional coding scheme is labeled as the Modified READ Code. It codes one line with reference to the line above,correlation between adja- cent lines allowing for more efficient compression. In order to limit the disturbed area in the event of transmission er- rors,
a one-dimensionally coded line is transmitted after one or more two-dimensionally coded lines. A bit, following the EOL, indicates whether one- or two-dimensional coding is used for the next line: EOL1: one-dimensional coding; EOL0: two-dimensional coding. start of the facsimile data | v +----+--------+----+--------+-/ !EOL1!DATA(1D)!EOL0!DATA(2D)! +----+--------+----+--------+-/ end of the facsimile data | v /-+----+--------+----+----+----+----+----+----+ !EOL0!DATA(2D)!EOL1!EOL1!EOL1!EOL1!EOL1!EOL1! /-+----+--------+----+----+----+----+----+----+ |<--------- RTC --------->|
TEXT(FAX) TEXT(FAX) NAME text - the text format for use in the facsimile system DESCRIPTION This is the representation structure for coded character text. It is used in the facsimile system. The text structure consists of a series of character strings, each of which represents a text line. However no control characters, e.g. <CR> and <LF>, are used in the structure. Each text line is proeeded by a count byte, indi- cating the number of characters on the line. The character sting follows after the the count byte. A zero count indi- cates the end of file. EXAMPLES Here is an example text shown below: This is a text. This is a picture. It can be represented as: <017> T h i s <040> i s <040> a <040> t e x t . <022> T h i s <040> i s <040> a <040> p i c t u r e . <0>
TS(FAX) TS(FAX) NAME ts - translate an ASCII string into vector format SYNOPSIS ts(ar_in, left, right, tid) char *ar_in; int left, right, tid; DESCRIPTION This routine will convert a zero-ended ASCII string pointed to by ar_in into the corresponding vecter format. As the character font being used is a set of 12x20 matrices, there will be 20 line vectors created. These vectors are written to the Cleans and Simple interface by calling cswrite. The callers task identifier tid has to be provided. At the two ends of the text line, blanks can be padded that are specified as left and right. Note that they are meas- ured in pels. Consequently, the result should be a image, whose dimension is: width = left + 12*length + right; height = 20; where length is the number of characters in the input string. As an intermediate result the bitmap is first created which is then converted into the vector format, by calling tovec. BUGS The input string must be ended with a zero field. SEE ALSO vector(fax), tovec(fax), csinit(fax), cswrite(fax), fitter(fax)
VECTOR(FAX) VECTOR(FAX) NAME vector - the internal data structure for a facsimile image DESCRIPTION This is the representation structure for binary images, a simple run length compression algorithm being used. Most of the image files are kept in vector format for ease of pro- cessing. The vector format consists of a series of integer vectors, one vector for each row of pels in the image. Each vector is proceeded by a count word which indicates the number of in- teger words in the vector. The next element of the vector after the count field is the number of white pels in the first run of the line. The second word then gives the number of pels that follow the initial white run, and so on t the end of the vector. Note the first run length element must refer to a white run. It should be set to 0 if the first run is black. EXAMPLES A line consists of 20 pels as follows: 00011111111011100000 It can be represented as: 5, 3, 8, 1, 3, 5 The inverse of the line: 11100000000100011111 should be represented as: 6, 0, 3, 8, 1, 3, 5