FFTiffMServices
multi image TIFF file management

Prototype

Put the following prototype in the prototypes section of the application program header file:

void* ( __stdcall *pfnFFTiffMServices )( int, int, int, int, int );

Purpose

Create a multi image TIFF file. All the images in the file must be compressed with the standard CCITT group IV-2d coding scheme. This function does not read a multi image TIFF file. This function has been developed for the unique purpose of creating multipage documents to be sent as e-mail attachments over the Internet. The example below illustrates how to convert several single image TIFF files into one multi image TIFF file.

Description and use

This function offers four services numbered from 1 to 4. The services are:
  • service 1 - create an empty new multi image TIFF file
  • service 2 - start writing an image
  • service 3 - stop writing an image
  • service 4 - close the newly created multi image TIFF file
Use the image comment feature to store the image description (and/or the database keys) together with each image in the file. This is a very good way for developing robust applications.

When creating a file please call service 1, then call services 2 and 3 as many times as required, and finally call service 4 to terminate the process.

Specification

This function is compliant with the TIFF specification rev. 6.0 - group B for black&white (bilevel) images. Tags used: NewSubfileType, ImageWidth, ImageLength, BitPerSample, Compression, PhotometricInterpretation, FillOrder, ImageDescription, StripsOffsets, SamplesPerPixel, RowsPerStrip, StripsByteCounts, XResolution, YResolution, T6Options, ResolutionUnit, Software, DateTime, NextIFD, HorzResolution, VertResolution. The image comment is stored in the ImageDescription tag.

Parameters

The meaning of the parameters varies according to the requested service:
  • first parameter: number of the requested service (from 1 to 4)
  • second parameter:
    • service 1: pointer to the ASCIIZ file name of the TIFF file to be created, complete with path and extension
    • service 2: NULL
    • service 3: pointer to the ASCIIZ image comment string
    • service 4: NULL
  • third parameter:
    • service 1: NULL
    • service 2: NULL
    • service 3: image width in pixels/8
    • service 4: NULL
  • fourth parameter:
    • service 1: NULL
    • service 2: NULL
    • service 3: image length in lines
    • service 4: NULL
  • fifth parameter:
    • service 1: NULL
    • service 2: NULL
    • service 3: the value returned from the last call to service 2
    • service 4: NULL

Return value

The return value depends on the service that has been requested:
  • service 1: true=file created; false=file not created
  • service 2: a value to pass as 5th parameter to the next service 3 call
  • service 3: (nothing)
  • service 4: the length of the just closed file, useful to the mail program to know the number of bytes of the attachment

Application example

See also
  • FFTiffServices: single image TIFF file management
  • FFDec: CCITT group 4 bidimensional decompression
  • FFComp: CCITT group 4 bidimensional compression

Notes