Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ IL_EFS_TIFF_W(3X) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

IL_EFS_TIFF_READ_TAGS(3X)

ilEFSWriteImage(3X)

ilEFSGetFileInfo(3X)

ilEFSGetFileTypeInfo(3X)

ilEFSReadImage(3X)

ilerror(5)

ilReadFileTags(3X)

ilWriteFileImage(3X)

IL_EFS_TIFF_WRITE_IMAGE...(3X)

NAME

IL_EFS_TIFF_WRITE_IMAGE_WITH_TAGS − add a consumer to the pipe that writes an image to a TIFF file which has been opened via ilEFSOpen() and also writes additional application-defined TIFF tags. 

SYNOPSIS

ilEFSFileTypeInfo fileTypeInfo;

ilBool
(*fileTypeInfo.Escape) (

ilEFSFileType fileType,
IL_EFS_TIFF_WRITE_IMAGE_WITH_TAGS,

ilEFSTIFFWriteImageWithTagsInfo
*pWriteImageWithTagsInfo);

DESCRIPTION

IL_EFS_TIFF_WRITE_IMAGE_WITH_TAGS is a parameter for the (*fileTypeInfo.Escape) function fir the TIFF file type.  It allows you to write the values of tags associated with an image to a TIFF file and is intended for use with the Image library’s Extensible File Support (EFS) features. 

(*fileTypeInfo.Escape)( ..., IL_EFS_TIFF_WRITE_IMAGE_WITH_TAGS, ...  ) adds a consumer to the pipe that writes an image to a TIFF file which was opened via ilEFSOpen() and also writes additional application-defined TIFF tags specified by the caller.  If the file is being used by another pipe, an IL_ERROR_EFS_IN_USE error is returned; see ilEFSReadImage(3X). 

Each execution of the pipe writes a new page to the file. 

fileType is the type of the file. 

pWriteImageWithTagsInfo->pipe
is a pipe created by ilCreatePipe(). 

pWriteImageWithTagsInfo->file
is an ilEFSFile data structure. 

pWriteImageWithTagsInfo->xRes, pWriteImageWithTagsInfo->yRes
are the X and Y resolution of the image being written, in dots per inch (dpi) times two (2). For example, 150 is 75 dpi. 

pWriteImageWithTagsInfo->maskImage
is either the client image, which is a mask to the pipe image to be written, or NULL meaning no mask image is to be written.  The client image must be an uncompressed bitonal image the size of the pipe image, with a rowBitAlign of 32.  A client image created with a descriptor of IL_DES_BITONAL and a format of IL_FORMAT_BIT satisfies these requirements.  The zero (0) bits in the mask image correspond to transparent pixels in the pipe image. 

pWriteImageWithTagsInfo->pOptions
is reserved for future use and must be NULL. 

pWriteImageWithTagsInfo->nTags
is the number of additional application-defined TIFF tags to be written to the file as part of this image. 

pWriteImageWithTagsInfo->pTags
if pWriteImageWithTagsInfo->nTags is greater than zero (0), points to an array of pWriteImageWithTagsInfo->nTags additional application-defined tags to be written as part of this image.  The tag values must be as returned by ilReadFileTags() or (*fileTypeInfo.Escape)( ..., IL_EFS_TIFF_READ_TAGS, ...  ).  Tags written by the Image Library are listed in the include file ilfile.h.  Tags in the pWriteImageWithTags->pTags array that have the same identifier as tags in the include file will be ignored. 

RETURN VALUE

Upon successful completion, (*fileTypeInfo.Escape)( ..., IL_EFS_TIFF_WRITE_IMAGE_WITH_TAGS, ...  ) returns TRUE. 

ERRORS

If the call fails, context->error receives a non-zero error code. 

EXAMPLE

The following example creates a pipe, then uses ilEFSGetPageInfo() to get information about the current page in open-for-reading EFS file.  The image on that page is read, filtered, and written to an TIFF file that was opened-for-writing via ilEFSOpen() and the additional TIFF tags specified by tags are also written. 

The given pipe is now complete, and ready to be executed with ilExecutePipe(). 

ilContext context;

ilEFSFile inFile, outFile;

ilPipe pipe;

ilEFSPageInfo pageInfo;

ilEFSFileInfo outFileInfo;

ilEFSFileTypeInfo outFileTypeInfo;

ilFileTag tags[] = { ...  };

#define N_TAGS  (sizeof(tags)/sizeof(ilFileTag))

ilEFSTIFFWriteFileWithTagsInfo
writeFileWithTagsInfo;

. 
.
.

inFile = ilEFSOpen(context, ...);

outFile = ilEFSOpen(context, ...);

if (!(pipe = ilCreatePipe(context, 0))
|| !ilEFSGetPageInfo(inFile, &pageInfo)
|| !ilEFSReadImage(pipe, inFile, IL_EFS_READ_MAIN, 0, 0,
|| !AddConverterFilter(pipe))

return context->error;

ilEFSGetFileInfo(outFile, &outFileInfo);
ilEFSGetFileTypeInfo(outFileInfo.fileType, &outFileTypeInfo);
if (strcmp(outFileTypeInfo.name, "TIFF") == 0)

/* Here if outFileTypeInfo.name equals "TIFF". */
if (outFileTypeInfo.Escape != NULL) {

/* Here if escape function present. 
writeFileWithTagsInfo.pipe = pipe;
writeFileWithTagsInfo.file = outFile;
writeFileWithTagsInfo.xRes = pageInfo.xRes;
writeFileWithTagsInfo.yRes = pageInfo.yRes;
writeFileWithTagsInfo.maskImage = NULL;
writeFileWithTagsInfo.pOptions = NULL;
writeFileWithTagsInfo.nTags = N_TAGS;
writeFileWithTagsInfo.pTags = tags;
if (!(*outFileTypeInfo.Escape)(

outFileInfo.fileType,
IL_EFS_TIFF_WRITE_FILE_WITH_TAGS,
&writeFileWithTagsInfo))

return context->error;

}

AUTHOR

(*fileTypeInfo.Escape)() was developed by HP. 

SEE ALSO

IL_EFS_TIFF_READ_TAGS(3X), ilEFSWriteImage(3X), ilEFSGetFileInfo(3X), ilEFSGetFileTypeInfo(3X), ilEFSReadImage(3X), ilerror(5), ilReadFileTags(3X), ilWriteFileImage(3X). 

Using the Image Developer’s Kit.

  —  November 03, 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026