home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_11 / 1011105a < prev    next >
Text File  |  1992-09-02  |  1KB  |  52 lines

  1.        /************************************************
  2.        *
  3.        *       file d:\lsu\create.c
  4.        *
  5.        *       Functions: This file contains
  6.        *           main
  7.        *
  8.        *       Purpose:
  9.        *          This program creates an 8 bit tiff file 
  10.        *          of size l*ROWS by w*COLS.
  11.        *
  12.        *       External Calls:
  13.        *          wtiff.c - create_allocate_tiff_file
  14.        *
  15.        *       Modifications:
  16.        *          7 Arpil 1992 - created
  17.        *
  18.        *************************************************/
  19.  
  20.  
  21.  
  22. #include "d:\cips\cips.h"
  23.  
  24. short image[ROWS][COLS];
  25.  
  26. main(argc, argv)
  27.    int  argc;
  28.    char *argv[];
  29. {
  30.    int    l, w;
  31.    struct tiff_header_struct image_header;
  32.  
  33.    if(argc < 4 || argc > 4){
  34.       printf("\nusage: create file-name length width\n"
  35.              "\n       the program will multiply length and width"
  36.              "\n       by %d and %d", ROWS, COLS);
  37.       exit(-1);
  38.    }
  39.  
  40.    l = atoi(argv[2]);
  41.    w = atoi(argv[3]);
  42.  
  43.    image_header.lsb            = 1;
  44.    image_header.bits_per_pixel = 8;
  45.    image_header.image_length   = l*ROWS;
  46.    image_header.image_width    = w*COLS;;
  47.    image_header.strip_offset   = 1000;
  48.  
  49.    create_allocate_tiff_file(argv[1], &image_header, image);
  50.  
  51. }
  52.