[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSImageReaderMClass Class

The UMSImageReaderMClass metaclass is an Ultimedia Services Version 2 feature and does not apply to Ultimedia Services Version 1.2.1.

To learn more about the UMSImageReaderMClass class, see:

For introductory information, see MetaClass Objects.

Method Descriptions

make_by_pathname(in string pathname, out ErrorCode error, out string error_string, out string file_type_alias)

Description

This method returns an instantiated child of the UMSImageReader class that is capable of processing the file indicated by pathname. The particular child returned depends upon interaction with a UMSConfig object.

Arguments
in string pathname Specifies the pathname of the image file that the instantiated UMS image reader object processes. For example: /cd/photo_cd/overview.pcd, which is a Photo CD overview file.
out string file_type_alias This string is the image reader detector file type alias that corresponds with the image file specified by the input parameter pathname. For example: PCDOverview, which is the image reader file detector file type alias for Photo CD overview files. make_by_pathname opens pathname as part of its processing.
Error Codes

For certain Error Codes, more specific information can be obtained from the error_string parameter.

Error Code error_string
FatalUMSError Failed making new class.
NoConfigObject Detector not found.
AliasNotFound Name of the alias that was not found by the UMSConfig object.
NotRegularFile File was not a regular file.
FileNotFound File does not exist.
UnsupportedFormat File format is not supported by image reader.
FailedOpeningFile Unable to open file.

make_by_alias(in string file_type_alias, out ErrorCode error, out string error_string)

Description

This method returns an instantiated child of the UMSImageReader class as determined by the alias parameter. The particular child returned depends upon interaction with a UMSConfig object.

Arguments
in string file_type_alias Specifies the image detector file type alias to instantiate the UMSImage object. For example: PCDImagePac. The file to be read is known to be a Photo CD Image Pac, and therefore the image file detector file type alias for Photo CD Image Pacs is specified.
Error Codes

For certain Error Codes, more specific information can be obtained from the error_string parameter.

Error Code error_string
FatalUMSError Failed making new class.
NoConfigObject Detector not found.
AliasNotFound Name of the alias that was not found by the UMSConfig object.
PropertyNotFound Name of the property that was not found by the UMSConfig object.
InvalidClassName Name of the class that could not be found.
NotAChild Name of the class that is not a child of the image reader base class.
Failure Name of the class that caused somNew to fail.

UMSImageReaderMClass Usage

The UMSImageReaderMClass_make_by_pathname method uses the Dectector.image stanza (shown below) of the UMS_config file to determine which detectors to run against the input file specified by the path name. When a detector returns success, the corresponding file_type_alias value is used to determine the specific Image Reader object to instantiate.

Detector.image:
        detection_module          "d_PCDO"
        file_type_alias           "PCDOverview"
*NEXT:
        detection_module           "d_PCDI"
        file_type_alias            "PCDImagePac"
*NEXT:
        detection_module           "d_JPEG"
        file_type_alias            "JPEG"
*NEXT:
        detection_module           "d_TIFF"
        file_type_alias            "TIFF"
*NEXT:
        detection_module           "d_GIF"
        file_type_alias            "GIF"

The image reader metaclass' make_by_pathname runs these detectors and returns the appropriate file_type_alias string to the application.

PCDOverview:
        CLASS_UMSImageReader       "UMSPCDOImageReader"
PCDImagePac:
        CLASS_UMSImageReader       "UMSPCDIPImageReader"
        CLASS_UMSImageReaderMem    "8000000"
JPEG:
        CLASS_UMSImageReader       "UMSJPEGImageReader"

When the image reader reconstructs image data from an Image Pac, it makes use of internal memory buffers. The CLASS_UMSimageReaderMem attribute specifies the maximum size of these memory buffers. The value of 8000000 allows for maximum performance in image reconstruction. However, this value cannot be appropriate for systems with limited real memory. In such cases, the attribute can specify a smaller value. (Note, however, that a smaller value can result in reduced performance of image reconstruction.) To specify the minimum acceptable buffer, the attribute should be set to the value 0. This attribute applies only to the PCDImagePac stanza.

For introductory information, see MetaClass Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]