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

UMSImagePlayer Object

The UMSImagePlayer class is an Ultimedia Services Version 2 feature and does not apply to Ultimedia Services Version 1.2.1.

The UMSImagePlayer class provides an abstract interface for displaying image files. Concrete implementations of the UMSImagePlayer class, such as the UMSLowLevelImagePlayer, use a UMSImageReader and one or more UMSImageWindow objects to read and display images from an image file. Extending a UMSImagePlayer's ability to display different kinds of image files only requires deriving new image reader objects from the base UMSImageReader class and adding the appropriate stanzas to the UMS configuration file.

The UMSImagePlayer is derived from the UMSObject.

To learn more about the UMSImagePlayer object, see:

For introductory information, see Media Handler Objects.

Enumeration Lists

The enumerated lists that are defined for this object are:

enum Transform {
        ROTATE_0,
        ROTATE_90,
        ROTATE_180,
        ROTATE_270,
        MIRROR_0,
        MIRROR_90,
        MIRROR_180,
        MIRROR_270
        };
enum ReturnCode {
        Success,
        Failure,
        OutOfRange,
        InvalidState,
        UnsupportedVisual,
        ValueChanged,
        ReadFailed,
        NoFile,
        WrongFormat,
        FileError,
        NoWindow,
        NoDisplay,
        NoEvent,
        CanNotConnect,
        CommoFailure,
        ForkFailed,
        ExecFailed,
        NoConnection,
        NoLowLevelPlayer,
        emoryAllocationFailure,
        NullPointer
        };
enum ColorUsage {
        UseMinColors,
        UseAllColors
        };
typedef enum {
        SOURCE_COORDINATE_SYSTEM   /*the coordinate system of the image on                        disk*/
        DESTINATION_COORDINATE_SYSTEM   /*the coordinate system of a                                 displayed image*/
} UMSImageCoordinateSystem;
typedef enum {
        ROTATE_0,        /*0 deg. rot. in x-y plane*/
        ROTATE_90,       /*90 deg. rot. in x-y plane*/
        ROTATE_180,      /*180 deg. rot. in x-y plane*/
        ROTATE_270,      /*270 deg. rot. in x-y plane*/
        MIRROR_0,        /*left to right mirror with 0                                          deg.rotation*/
        MIRROR_90,       /*left to right mirror with 90 deg.                                    rotation*/
        MIRROR_180,      /*left to right mirror with 180 deg.                                   rotation*/
        MIRROR_270       /*left to right mirror with 270 deg.                                   rotation*/
} UMSImageTransform;

Defined Constants

The following constants define the list of possible UMSImagePlayer states:

const unsigned long NotReadyState = 0x00000001;
const unsigned long ReadyState = 0x00000002;
const unsigned long ReadingState = 0x00000004;
const unsigned long DisplayingState = 0x00000008;

The following constants define the list of UMSImagePlayer events:

const unsigned long StateEvent = 0x00000001;
const unsigned long ReadingEvent = 0x00000002;
const unsigned long DisplayCompleteEvent = 0x00000004;
const unsigned long ErrorEvent = 0xF0000000;

The following constants define true and false values used in the UMSImagePlayer's interface:

const boolean False   = 0;
const boolean True    = 1;

Defined Structures

The UMSImagePlayer class uses the UMSImageRect, UMSImageSize, and UMSImageColorProperties structures.

UMSImageRect

The UMSImageRect type defines a rectangular portion of an image in units of pixels. The origin (0,0) of an image is defined to be the top-left corner of the image.

typedef struct {
        short top;
        short left;
        short bottom;
        short right
        }UMSImageRect;

UMSImageSize

The UMSImageSize type defines the size of an image in units of pixels

typedef struct {
        long width;
        long height;
        }UMSImageSize;

UMSImageColorProperties

The UMSImageColorProperties type defines values to control the red, green, and blue color balance, overall image lightness, and color saturation of an image. Positive values for the red, green, or blue color properties increase the amount of the corresponding color in the image. Increasing the lightness setting simultaneously increases the red, green, and blue values to increase the overall lightness of the image. Positive saturation values increase the saturation of the colors in the image, while leaving neutrals unaffected. Specifying negative values produces the opposite effect.

typedef struct {
        short red;
        short green;
        short blue;
        short lightness;
        short saturation
        }UMSImageColorProperties;

The UMSImagePlayer also defines the following structures:

EventData Structure

The EventData structure defines the format of a UMSImagePlayer event. Since SOM's IDL doesn't support nested structures or unions, this data structure is flat:

typedef struct {
        unsigned long event_type;
        unsigned long state;
        unsigned long image_index;
        unsigned long percent;
        ReturnCode error
        }EventData;

State Diagram

The UMSImagePlayer state-transition diagram shows the effect of each UMSImagePlayer operation on the state of a UMSImagePlayer. The diagram also shows the state of the UMSImagePlayer required for an operation to succeed. For more information. see the UMSImagePlayer State Transition figure.

UMSImagePlayer State Transition Figure

Any time a UMSImagePlayer changes state, it generates a StateEvent indicating the UMSImagePlayer's new state.

As shown in the figure, a UMSImagePlayer has the following states:

NotReadyState    By default, when a UMSImagePlayer is first created, it's initially in the NotReadyState meaning that the UMSImagePlayer is not ready to display any images. From the NotReadyState, you can move a UMSImagePlayer to the ReadyState by calling the UMSImagePlayer's open() method. You can move a UMSImagePlayer to the NotReadyState from any other state, using the close() method.
ReadyState A UMSImagePlayer in the ReadyState has an open image file (its open() method has been successfully called), but the UMSImagePlayer is not actively reading or displaying any images. To begin reading and displaying the images, use the start_display() method which moves a UMSImagePlayer from the ReadyState to the ReadingState. Use the stop_display() method to move a UMSImagePlayer from the ReadingState or DisplayingState back to the ReadyState.
ReadingState A UMSImagePlayer in the ReadingState is reading image data from the UMSImagePlayer's open image file. The ReadingState is a transitory state: once a UMSImagePlayer completes reading and displaying images from an image file, the UMSImagePlayer's state automatically moves to the DisplayingState.
DisplayingState In the DisplayingState, a UMSImagePlayer is actively displaying images from an image file which includes handling window-system expose events generated when you move windows on the screen. While in the DisplayingState, window-system expose events and changes to the state of a UMSImagePlayer's images, resulting from calls made by your application, can cause the UMSImagePlayer to reread one or more images from the image file. In that case, the UMSImagePlayer moves to the ReadingState. Once the images are again displayed, the UMSImagePlayer moves back to the DisplayingState.

Method Descriptions

Each section below specifies the UMSImagePlayer's logical attributes and corresponding operations. A logical attribute is an attribute of an object that can or cannot be implemented as a member variable in the object's implementation (that is why it is called logical) yet is an attribute of the object.

unsigned long get_state()

Description

Returns the state of a UMSImagePlayer. A UMSImagePlayer can be in one of four states; ReadyState, NotReadyState, ReadingState, or DisplayingState as defined in "Defined Constants" .

Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values

The return value of the get_state() method contains the current state of the UMSImagePlayer as defined in "Defined Constants" .

ReturnCode get_file_info(out string pathname, out sequence<string> info)

Description

The get_file_info() method returns the pathname of a UMSImagePlayer's open image file and any string information associated with that file. The actual string information is image file specific and can include such information as copyright notices or the author's name.

Arguments
out string pathname Upon successful return from the get_file_info() method, the pathname parameter contains the pathname of the UMSImagePlayer's open image file. Your application is responsible for freeing the pathname string.
out sequence<string> info Upon successful return from the get_file_info() method, the info parameter contains the a sequence of strings containing information about the UMSImagePlayer's currently open image file. If no information is available, the method return a NULL info._buffer; otherwise, the info._buffer points to an array of strings. The info._length field contains the number of strings in the info._buffer. Your application is responsible for freeing each of the strings and the info._buffer.
Required States

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

InvalidState

ReturnCode get_image_count(out long count)

Description

Returns the number of images in the UMSImagePlayer's open image file.

Arguments
out long count The number of images in the UMSImagePlayer's open image file.
Required States

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

InvalidState

ReturnCode set_image(in unsigned long image_index)

Description

Sets the UMSImagePlayer's current image attribute to the image specified by the zero-based image_index parameter. Attempts to set the index to an invalid value (greater than or equal to the number of images) result in an error, in which case the current image remains unchanged. By default, the current image index is zero (0).

Arguments
in unsigned long image_index The zero-based index of the UMSImagePlayer's current image. The specified image index must be less-than the UMSImagePlayer's image count attribute as returned by the get_image_count() method.
Required States

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

OutOfRange

InvalidState

ReturnCode get_image(out unsigned long image_index)

Description

Returns the UMSImagePlayer's current image index. By default, the current image index is zero (0).

Arguments
in unsigned long image_num The zero-based index of the UMSImagePlayer's current image.
Required States

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

InvalidState

ReturnCode set_image_caching(in boolean image_caching_on)

Description

Use the set_image_caching() method to set a UMSImagePlayer's image caching attribute. When the image caching attribute is set to TRUE, a UMSImagePlayer caches image data instead of rereading the data each time the image is redisplayed. When set to FALSE, a UMSImagePlayer does not cache image data but instead rereads any image data required to redisplay an image. Set the image caching attribute to FALSE to preserve memory and to TRUE to obtain the best image update performance. By default, a UMSImagePlayer's image caching attribute is TRUE.

Arguments
in boolean image_caching_on Use the image_caching_on parameter turn on (TRUE) or off (FALSE) image caching.
Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

ReturnCode get_image_caching(out boolean image_caching_on)

Description

Use the get_image_caching() method to query a UMSImagePlayer's image caching attribute. When the image caching attribute is set to TRUE, a UMSImagePlayer caches image data instead of rereading the data each time the image is redisplayed. When set to FALSE, a UMSImagePlayer does not cache image data but instead rereads any image data required to redisplay an image. Set the image caching attribute to FALSE to preserve memory and to TRUE to obtain the best image update performance. By default, a UMSImagePlayer's image caching attribute is TRUE.

Arguments
out boolean image_caching_on Upon successful return from the get_image_caching() method, the image_caching_on parameter contains the current value of the UMSImagePlayer's image caching attribute. If set to FALSE image caching is disabled; otherwise image caching is enabled.
Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

ReturnCode get_file_type(out string file_type)

Description

Returns a UMSImagePlayer's filetype attribute which defines the type of a UMSImagePlayer's open image file. The string returned by the get_file_type() method is the file's type alias as defined in the UMS configuration file.

Your application is responsible for freeing the memory associated with the string.

Arguments
out string file_type The filetype alias associated with the UMSImagePlayer's image file.
Required States

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

InvalidState

ReturnCode set_display(in string display_name)

Description

Sets the UMSImagePlayer's display attribute. By default, the display attribute equals the value of the DISPLAY environment variable. Your application must set the display attribute to a valid value before calling the set_window(), set_colormap(), or set_colormap_id() methods.

If you change the display attribute, the UMSImagePlayer releases all of the windows associated with the UMSImagePlayer's images; therefore, you must reset the UMSImagePlayer's windows (via the set_window() method) and colormaps (via the set_colormap() or set_colormap_id() methods) after calling the set_display() method. All windows associated with a UMSImagePlayer's images (subsequently set via the set_window() method) must be owned by the UMSImagePlayer's display.

Arguments
in string display_name The string UMSImagePlayer uses to open an X display connection.

If the display_name is NULL, the value defaults to the contents of the DISPLAY environment variable. The display_name parameter and DISPLAY environment variable are strings that have the format hostname:server or hostname:server.screen. For example, frog:0.2 specifies screen 2 of server 0 on the machine frog.

Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values

Success

Failure

ReturnCode get_display(out string display_name)

Description

Returns the value of the UMSImagePlayer's display attribute in the form of an X display name. By default, a UMSImagePlayer's display attribute equals the value of the DISPLAY environment variable. To set the display attribute, use the set_display() method.

Arguments
out string display_name The UMSImagePlayer's display name. Your application is responsible for freeing the display_name string.

See the set_display() method for the format of the display_name parameter.

Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.

ReturnCode set_event_mask(in unsigned long event_mask)

Description

Sets a UMSImagePlayer's event mask attribute which enables or disables reporting of maskable events.

Arguments
in unsigned long event_mask An OR set of bit flags enabling the corresponding events. The set of UMSImagePlayer event types is defined in "Defined Constants" .
Required States

ReadyState

NotReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.

unsigned long get_event_mask()

Description

Returns a UMSImagePlayer's event mask attribute which enables or disables reporting of maskable events. To set the mask, use the set_event_mask() method.

Required States

ReadyState

NotReadyState

ReadingState

DisplayingState

Return Values

The get_event_mask() method returns an OR set of bits indicating which events are enabled. The set of UMSImagePlayer events is defined in "Defined Constants" .

boolean event_pending()

Description

This method checks a UMSImagePlayer's event queue for a Pending Event. If an event is pending, the method returns a nonzero value (true); otherwise it returns zero (false).

Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values
Nonzero If an event is pending.
Zero If no events are pending.

ReturnCode get_event(out EventData event_data)

Description

Returns a UMSImagePlayer's pending event in the space provided by event_data.

If no event is pending and the UMSImagePlayer is in the ReadingState, get_event() blocks until an event is received; for all other states, the get_event() method returns the NoEvent return code if no event is pending.

Arguments
out EventData event_data Upon success, the event_data parameter contains the UMSImagePlayer's pending event. The EventData structure is defined in "Defined Constants" .
Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
NoEvent No event is pending.

long get_event_handle()

Description

Returns an event handle which your application can use as a file descriptor on which to select, and thereby query or block on, UMSImagePlayer events.

Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values

The method returns a nonzero handle number for success and zero (0) for failure.

Note: A UMSImagePlayer maintains each of the attribute defined below for each of a UMSImagePlayer's images. For example, each of the UMSImagePlayer's images have a subimage rectangle attribute. The UMSImagePlayer's current image attribute is used to address a particular image in order to query or set the image's attributes. So to set the subimage rectangle attribute of a particular image, you first address the image by setting the UMSImagePlayer's current image attribute, via a call to set_image(), and then call the set_subimage() method to set the subimage attribute of the current image. Like all of the methods in this section, the set_subimage() method does not affect the subimage rectangle attribute of the UMSImagePlayer's other images. If you're using a UMSImagePlayer to display images from image files containing only one image, you need not set the UMSImagePlayer's current image attribute since the attribute defaults to the first (and only) image in an image file.

ReturnCode get_image_info(out sequence<string> info)

Description

Use the get_image_info() method to query information (if any) associated with a UMSImagePlayer's current image.

Copyright-specific information is returned by the get_copyright_info() method. Information associated with the UMSImagePlayer's open image file is returned by the get_file_info() method. For some image files, the information returned by get_image_info() can be identical to the information returned by get_file_info() and both methods can also contain copyright information.

Arguments
out sequence<string> info Upon a successful return from the get_image_info() method, the info parameter contains a sequence of strings containing the information about the current image. The content and format of the strings are image file specific and can or cannot be translated into the current locale.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure An error was detected that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_copyright_info(out sequence<octet> info)

Description

Use the get_copyright_info() method to query the copyright information (if any) associated with a UMSImagePlayer's current image.

Arguments
out sequence<octet> info Upon a successful return from the get_copyright_info() method, the info parameter contains a sequence of octets containing the copyright information. The format of the data in the sequence is image file specific but is typically a formated buffer of ASCII characters read from a copyright file. The text can or cannot be translated into the current locale.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure An error was detected that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

boolean supports_arbitrary_scaling()

Description

Use the supports_arbitrary_scaling() method to determine if a UMSImagePlayer's supports arbitrary scaling for the current image. For more information on image scaling, see "Current Image's Sizes, Size, and Display Size" .

Required States

NotReady

ReadyState

ReadingState

DisplayingState

Return Values
True The UMSImagePlayer supports arbitrary scaling for the current image.
False Either the UMSImagePlayer is in the NotReadyState or the UMSImagePlayer does not support arbitrary scaling of the current image.

boolean supports_color_properties()

Description

Use the supports_color_properties() method to determine if a UMSImagePlayer's supports setting the current image's color properties.

Required States

NotReady

ReadyState

ReadingState

DisplayingState

Return Values
True The UMSImagePlayer supports changing the current Image's color properties.
False Either the UMSImagePlayer is in the NotReadyState or does not support changing the current image's color properties attribute.

ReturnCode get_transforms(out sequence<UMSImageTransform> transforms)

Description

Use the get_transforms() method to query the current images list of supported image transformations. The values returned are used to set the current image's transform attribute via the set_transform() method. For more information on image transformations, see "Current Image's Transform" .

Arguments
out sequence<UMSImageTransform> transforms After a successful call to the get_transforms() method, the transforms parameter contains a sequence of UMSImageTransform enumerations defining the set of image transforms supported by the UMSImagePlayer for the current image.

The method returns the number of supported transforms in the transforms._length field and the actual list of transformations in the transforms._buffer field. Your application is responsible for freeing the transforms._buffer.

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure An error was detected that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode set_subimage(in UMSImageCoordinateSystem coord_system, in UMSImageRect* rect, out UMSImageSize actual_display_size, out UMSImageRect actual_display_subimage_rect)

Description

Sets the current image's subimage rectangle attribute which defines the portion of the current image the UMSImagePlayer object displays. To display the entire image (the default), set the rect parameter to NULL.

You have a choice of coordinate systems when specifying the current image's subimage rectangle. You can specify the rectangle in either the source or destination coordinate systems by using the coord_system parameter whose value can either be SOURCE_COORDINATE_SYSTEM or DESTINATION_COORDINATE_SYSTEM. The source coordinate system is the coordinate system of the image as stored in the image file. The origin of the source coordinate system is the upper-left corner of the image and the coordinate system's extent is defined by the current image's size attribute which you can set and query using the set_image_size() and get_image_size() methods, respectively. The source coordinate system does not reflect the current image's display size or transformation attributes.

The destination coordinate system is the coordinate system the UMSImagePlayer uses when displaying the current image. The destination coordinate system is defined by the current image's display Size attribute which your application can set and query using the set_display_size() and get_display_size() methods. The destination coordinate system's origin is the upper left corner of the image after application of all transformations such as rotations.

An error is returned if any of the coordinates of the specified subimage rectangle are outside the bounds of the specified coordinate system or if the rectangle is degenerate in any way (For example, if the rectangle's top coordinate is more than its bottom coordinate, or its right coordinate is less than its left coordinate.). If any error is detected, the current image's subimage rectangle remains unchanged.

If you specify the current image's subimage rectangle in the source coordinate system and then change the current image's size attribute, the current image's subimage rectangle is automatically mapped to the new image size. Likewise, if you specify the current image's subimage rectangle in the destination (display) coordinate system and then change the current image's display Size attribute, the current image's subimage rectangle is automatically mapped to the new display size.

Note: Because of rounding errors, the mapping might not result in the display of exactly the same subimage both before and after the mapping.
Arguments
in UMSImageCoordinateSystem coord_system The coord_system parameter specifies the coordinate system of the rectangle specified by the rect parameter.
in UMSImageRect* rect Upon return from the set_transform() method, the actual_display_subimage_rect parameter contains the value of the current image's subimage rectangle attribute as defined in the display (destination) coordinate system.

A rectangle defining the current image's subimage rectangle. See "Defined Structures" for a definition of the UMSImageRect structure.

out UMSImageSize actual_display_size Upon return from the set_subimage() method, the actual_display_size parameter contains the value of the current image's display size attribute which is the size (width and height) the UMSImagePlayer uses when displaying the current image. For more information on the current image's display size attribute, see "Current Image's Sizes, Size, and Display Size" .
out UMSImageRect actual_display_subimage_rect Upon return from the set_transform() method, the actual_display_subimage_rect parameter contains the value of the current image's subimage rectangle attribute as defined in the display (destination) coordinate system.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure An error was detected that is not described by any other return code.
OutOfRange One or more of the specified subimage rectangle's coordinates are invalid.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_subimage(in UMSImageCoordinateSystem coord_system, out UMSImageRect rect)

Description

Returns the value of the current image's subimage rectangle attribute. The coordinates returned are defined in the coordinate system specified by the coord_system parameter. For more information on image coordinate systems and subimage rectangles, see the description of the set_subimage() method .

Arguments
in UMSImageCoordinateSystem coord_system Use the coord_system parameter to specify the coordinate system of the rectangle returned by the rect parameter. See "Enumeration Lists" for a definition of the UMSImageCoordinateSystem enumeration.
out UMSImageRect rect The subimage rectangle the UMSImagePlayer object uses when displaying the current image.
Required States

7ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_subimage_coordinates (in UMSImageCoordinateSystem coord_system, in UMSImageRect* input_rect, out UMSImageRect output_rect)

Description

Use the get_subimage_coordinates() method to query the coordinates of a subimage rectangle in either the current image's source (image) coordinate system or the current image's destination (display) coordinate system given the coordinates of a subimage rectangle in the other coordinate system.

Arguments
in UMSImageCoordinateSystem coord_system Use the coord_system parameter to specify either the source or destination coordinate system of the input rectangle (input_rect). The value of the coord_system parameter can be either SOURCE_COORDINATE_SYSTEM, referring to the coordinate system of the image as read from the image file, or the DESTINATION_COORDINATE_SYSTEM, referring to the coordinate system in which the image is displayed. Whichever coordinate system you choose for the input_rect parameter, the method returns output_rect parameter defined in the other coordinate system. For example, if you define the input_rect in the SOURCE_COORDINATE_SYSTEM, the method returns the output_rect parameter relative to the DESTINATION_COORDINATE_SYSTEM. See "Enumeration Lists" for a definition of the UMSImageCoordinateSystem enumeration.
in UMSImageRect input_rect Use the input_rect parameter to specify subimage rectangle in the coordinate system specified by the coord_system parameter. The get_subimage_coordinates() method calculates the output_rect from the specified input_rect using the ratio of the current image's size and current image's display size attributes.
out UMSImageRect output_rect Upon a successful return from the get_subimage_coordinates() method, the output_rect parameter contains the coordinates of the specified input_rect mapped to either the source or destination coordinate systems depending upon the value of the coord_system parameter. For example, if you specify a coordinate system of SOURCE_COORDINATE_SYSTEM via the coord_system parameter, the coordinates of the output_rect parameter are returned in the DESTINATION_COORDINATE_SYSTEM, and vice-versa.
Required State(s)

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode set_window(in unsigned long window)

Description

The set_window() method associates the specified window with the current image. If the format of the current image and the X visual of the specified window are incompatible, the method returns the UnsupportedVisual return code. If you've already set the current image's window attribute, the set_window() method implicitly calls the release_window() method before setting the new window.

Before calling the set_window() method, a UMSImagePlayer's display attribute must be set to a valid value. See the set_display() method for more information.

If set_window() is called while the UMSImagePlayer is in the ReadingState or DisplayingState, the current image is read from the UMSImagePlayer's image file and displayed in the specified window. Reading the image from the image file can cause the UMSImagePlayer to move to the ReadingState. If you call set_window() while the UMSImagePlayer is in the ReadyState, the current image is read and displayed the next time your application calls the start_display() method.

Arguments
in unsigned long window Specifies the X window ID to associate with the current image.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
NoDisplay If the UMSImagePlayer's set_display() method has not been called.
OutOfRange If the specified window is not one owned by the UMSImagePlayer's display.
InvalidState The state of the UMSImagePlayer precludes calling this method.
UnsupportedVisual The current image cannot be displayed in the specified window.

ReturnCode get_window(out unsigned long window_id)

Description

Returns the X window ID associated with the UMSImagePlayer's current image. If no window is associated with the current image, the get_window() method returns the NoWindow return code and the output parameter is undefined.

Arguments
out unsigned long window_id The X window ID associate with the current image.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
NoWindow The UMSImagePlayer's set_window() method has not been called for the current image.

ReturnCode release_window()

Description

Releases the X window associated with the current image. If the UMSImagePlayer is in the ReadingState or DisplayingState, a call to release_window() causes the UMSImagePlayer to stop actively displaying the current image. If the current image is already displayed, a UMSImagePlayer does not remove the image but stops handling the image's window-system expose events.

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_image_sizes(out sequence<UMSImageSize> sizes)

Description

Use the get_image_sizes() method to obtain the list of native image sizes (resolutions) available for the current image. Each size specifies an image width and height in units of pixels.

Through the set_image_size() method, you can set the current image's size attribute to any one of the image sizes returned by the get_image_sizes() method.

Arguments
out sequence<UMSImageSize> sizes Upon a successful return from the get_image_sizes() method, the sizes parameter contains a sequence of UMSImageSize structures, each of which define one of the native image sizes, or resolutions, available for the current image.

The UMSImageSize type is defined in "Defined Structures" .

Your application is responsible for freeing the memory address by sizes._buffer.

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode set_image_size(in UMSImageSize* image_size, out UMSImageSize actual_display_size, out UMSImageRect actual_display_subimage_size)

Description

Use the set_image_size() method to select one of the native image sizes (resolutions) available for the UMSImagePlayer's current image. The list of native image sizes is returned by the get_image_sizes() method. You must specify one of the image sizes returned by the get_image_sizes() method; otherwise the set_image_size() method returns the OutOfRange return code.

The actual size of the current image when displayed by a UMSImagePlayer is controlled by the current image's display size attribute which is set and queried using the set_display_size() and get_display_size() methods irrespectively. If the UMSImagePlayer does not support scaling between the specified image_size and the current image's display size, the set_image_size() method modifies the current image's display size and returns the new display size in the actual_display_size parameter. The method also returns the ValueChanged return code. To change both the current image's image size and current image's display size via one method call, use the set_image_and_display_sizes() method. See "Current Image's Sizes, Size, and Display Size" for more information regarding the interaction between the current image's size and the current image's display size attributes.

Arguments
in UMSImageSize* image_size Use the image_size parameter to specify the desired image size for the current image. You can use the get_image_sizes() method to get the list of image sizes available for the current image. If you specify an image size not returned by get_image_sizes(), the set_image_size() method returns the OutOfRange return code.

The UMSImageSize type is defined in "Defined Structures" .

out UMSImageSize actual_display_size The actual_display_size parameter contains the actual display size the UMSImagePlayer uses when displaying the current image. If the actual display size differs from the current image's display size in affect before you called the set_image_size() method, the set_image_size() method returns the ValueChanged return code.
out UMSImageRect actual_display_subimage_rect The actual_display_subimage_rect parameter contains the coordinates (top, left, bottom, right) of the current image's subimage rectangle defined in the destination (display) coordinate system. If, as a result of calling the set_image_size() method, the UMSImagePlayer changes the current image's subimage rectangle attribute, the set_image_size() method returns the ValueChanged return code.

The UMSImageRect type is defined in "Defined Structures" .

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
OutOfRange The specified image size is invalid.
ValueChanged Changing the current image's size necessitated a change in the current image's display size. The new display size and display subimage rectangle is reflected in the actual_display_size and actual_display_subimage_rectangle parameters.

ReturnCode get_image_size(out UMSImageSize size)

Description

Use the get_image_size() method to query the current image's size attribute which defines which of the current image's sizes the UMSImagePlayer uses when displaying the current image.

You can use the get_image_sizes() method to query the current image's list of available image sizes and the set_image_size() method to select one of the available image sizes. Use the set_display_size() and get_display_size() methods to set and query the current image's display size attribute which, if the UMSImagePlayer supports scaling, can differ from the current image's size.

Arguments
out UMSImageSize size The current image's size in units of number of pixels. The UMSImageSize type is defined in "Defined Structures" . The size (Specifically, width and height) is in units of number of pixels.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode set_display_size(in UMSImageSize* display_size, out UMSImageSize actual_display_size, out UMSImageRect actual_display_subimage_rect)

Description

Sets the current image's display size attribute which defines the height and width (in units of pixels) of the current image when displayed by a UMSImagePlayer.

Depending on an image's format, the UMSImagePlayer cannot support arbitrary scaling of an image's data. If scaling is supported, you can set the current image's display size to any positive height and width values and the UMSImagePlayer scales the current image, from the current image's size to the specified display size.

When the UMSImagePlayer does not support arbitrary scaling for a particular image format, the following restrictions apply to the current image's display size attribute and to the display_size argument of the set_display_size() method:

Use the get_display_size() method to query the current image's display size attribute and the get_image_sizes(), set_image_size(), get_image_size() methods to query the current image's sizes, set the current image's size, and query the current image's size, respectively.

Arguments
in UMSImageSize* display_size Use the display_size parameter to specify the desired display size (width and height) for the current image. The UMSImageSize type is defined in "Defined Structures" . The specified height and width must be positive values; otherwise the method returns the OutOfRange return code.
out UMSImageSize actual_display_size The actual_display_size parameter contains the actual display size the UMSImagePlayer uses when displaying the current image. If the actual display size differs from the display size you specify via the size parameter, the set_display_size() method returns the ValueChanged return code.
out UMSImageRect actual_display_subimage_rect The actual_display_subimage_rect parameter contains the coordinates (top, left, bottom, right) of the current image's subimage rectangle defined in the destination (display) coordinate system. If, as a result of calling the set_display_size() method, the UMSImagePlayer changes the current image's subimage rectangle attribute, the set_display_size() method returns the ValueChanged return code.

The UMSImageRect type is defined in "Defined Structures" .

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
OutOfRange The specified display size is invalid.
InvalidState -- The state of the UMSImagePlayer precludes calling this method.
                         
ValueChanged -- The actual display size differs from the specified display size.
                         

ReturnCode get_display_size(out UMSImageSize size)

Description

Returns the current image's display size attribute (Specifically, width and height) in units of number of pixels. The current image's display size attribute is set via the set_display_size() method.

Arguments
out UMSImageSize size After a successful call to the get_display_size() method, the size parameter contains the current image's display size in units of number of pixels.

The UMSImageSize type is defined in "Defined Structures" .

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode set_image_and_display_sizes(in UMSImageSize* image_size, in UMSImageSize* display_size, out UMSImageSize actual_display_size, out UMSImageRect actual_display_subimage_rect)

Description

As an alternative to using the set_image_size() and set_display_size() methods, you can use the set_image_and_display_sizes() method to simultaneiously set the current image's image size and display size attributes.

The image size you specify must be one of the native image sizes is returned by the get_image_sizes() method; otherwise the set_image_size() method returns the OutOfRange return code.

The actual size of the current image when displayed by a UMSImagePlayer is controlled by the current image's display size attribute which is set via the display_size parameter. If the UMSImagePlayer does not support scaling between the specified image_size and display_size, the set_image_and_display_sizes() method returns the actual display size in the actual_display_size parameter and returns the ValueChanged return code.

When the UMSImagePlayer does not support arbitrary scaling for a particular image format, the following restrictions apply to the current image's display size attribute and to the display_size argument of the set_display_size() method:

Use the get_display_size() method to query the current image's display size attribute. See "Current Image's Sizes, Size, and Display Size" for more information regarding the interaction between the current image's size and the current image's display size attributes.

Arguments:
in UMSImageSize* image_size Use the image_size parameter to specify the desired image size for the current image. You can use the get_image_sizes() method to get the list of image sizes available for the current image. If you specify an image size not returned by get_image_sizes(), the set_image_size() method returns the OutOfRange return code.

The UMSImageSize type is defined in "Defined Structures" .

in UMSImageSize* display_size Use the display_size parameter to specify the desired display size (width and height) of the current image.
out UMSImageSize actual_display_size The actual_display_size parameter contains the actual display size the UMSImagePlayer uses when displaying the current image. If the actaul_display_size differs from the specified display_size, the set_image_and_display_sizes() method returns the ValueChanged return code.
out UMSImageRect actual_display_subimage_rect The actual_display_subimage_rect parameter contains the coordinates (top, left, bottom, right) of the current image's subimage rectangle defined in the destination (display) coordinate system. If, as a result of calling the set_image_and_display_sizes() method, the UMSImagePlayer changes the current image's subimage rectangle attribute, the set_image_and_display_sizes() method returns the ValueChanged return code.

The UMSImageRect type is defined in "Defined Structures" .

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
OutOfRange The specified image size is invalid.
ValueChanged The specified display size and actual display size differ.

ReturnCode set_colormap_attributes(in boolean allow_new_colormap, in unsigned long base_index, in unsigned long size, out unsigned long actual_base_index, out unsigned long actual_size, out unsigned long colormap_id)

Description

Sets the current image's base colormap index (zero-based) and size (number of colormap entries). If the requested colormap base index or size is not supported, the method returns ValueChanged with the respective output parameters reflecting values which are supported.

If the UMSImagePlayer is in the ReadingState or DisplayingState, the actual colormap size and base-index values are immediately applied to the current image. If the UMSImagePlayer is in the ReadyState, the actual colormap size and base-index values are applied when your application next calls the start_display() method.

Arguments
in boolean allow_new_colormap Use the allow_new_colormap parameter to control whether the UMSImagePlayer allocates a new X colormap if the specified size number of color entries at the specified base_index cannot be allocated in the current image's colormap on the X server.

Specifically, if the allow_new_colormap flag is TRUE, and the specified size number of colormap entries cannot be allocated at the specified base_index, the set_colromap_attributes() method creates a new X colormap, allocates the specified size number of colormap entries at the specified base_index, returns the colormap's ID in the colormap_id output parameter, and returns Success as the return code..

If the allow_new_colormap flag is set to FALSE, the method first attempts to find size number of free colormap entries in the current image's colormap at the specified base_index, and if that fails, at any base index. If that also fails, the method allocates the largest contiguous block of colormap entries it can find within the current image's colormap on the X server. The method then returns the actual base index and size in the actual_base_index and actual_size parameters respectively and returns the ValueChanged return code.

in unsigned long base_index The base index (zero-based) of the current image's colormap.
in unsigned long size The size (number of colormap entries) of the current image's colormap.
out unsigned long actual_base_index The actual base index (zero-based) of the current image's colormap. If the actual base index differs from the specified base index, the set_colormap_attributes() method returns ValueChanged.
out unsigned long actual_size The actual size of the current image's colormap. If the actual size differs from the specified size, the set_colormap_attributes() method returns ValueChanged.
out unsigned long colormap_id The colormap_id output parameter contains the current X colormap ID of the current image's colormap.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
ValueChanged Returned if either the actual base colormap index or colormap size differs from the specified base index or size.
NoWindow The set_window() method must be called for the current image before calling the set_colormap_attributes() method.

ReturnCode get_colormap_attributes(out unsigned long base_index, out unsigned long size)

Description

Returns the base index (zero based) and size (number of colormap entries) of the current image's colormap.

Arguments
out unsigned long base_index The base index (zero based) of the current image's colormap.
out unsigned long size The size (number of colormap entries) in the current image's colormap.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
NoWindow The set_window() method must be called for the current image before calling the get_colormap_attributes() method.

ReturnCode set_colormap(in sequence<octet> colormap, out sequence<octet> actual_colormap)

Description

Sets the colormap associated with the UMSImagePlayer's current image. The current image's colormap attributes, set using the set_colormap_attributes() method, define the colormap's base index (zero based) and size.

The set_colormap() method has the effects of:

If the colormap you specify is not supported by the current image, the set_colormap() method returns the ValueChanged return code and sets actual_colormap._buffer to point to a copy of the actual colormap the UMSImagePlayer uses when displaying the current image. The set_colormap() method also sets the actual_colormap._length and actual_colormap._maximum fields to reflect the size of the actual colormap pointed to by actual_colormap._buffer. So, when the set_colormap() method returns ValueChanged, your application is responsible for freeing the memory pointed to by actual_colormap._buffer. If the set_colormap() method returns something other than ValueChanged (for example, Success, Failure, or InvalidState), the actual_colormap._buffer is not set; therefore, your application should not free the actual_colormap._buffer.

Each colormap entry is four bytes long and is encoded as pad, red, green, and blue as shown in the following figure.

If the UMSImagePlayer is in the ReadingState or DisplayingState, the actual colormap is immediately applied to the current image. If the UMSImagePlayer is in the ReadyState, the actual colormap is applied when your application next calls the start_display() method.

Arguments
in sequence<octet> colormap The colormap parameter contains the colormap, defined as a sequence of octets (8 bit bytes), you would like the UMSImagePlayer to use when displaying the current image. The colormap._length field should contain the number of octets in the colormap where each colormap entry is four octets (bytes) long and is encoded as pad, red, green, and blue.
out sequence<octet> actual_colormap If the set_colormap() method returns the ValueChanged return code, the actual_colormap._buffer contains the actual colormap the UMSImagePlayer uses when displaying the current image; in which case your application is responsible for freeing the actual_colormap._buffer. The actual_colormap._length and actual_colormap._maximum fields contain the length of the actual colormap in units of octets (bytes). Each colormap entry is four octets (bytes) long and is encoded as pad, red, green, and blue as shown in the figure .

If the set_colormap() method returns Success, Failure, or InvalidState, the actual_colormap._buffer is not set and should not be freed by your application.

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
ValueChanged The actual colormap differs from the specified colormap.
NoWindow The set_window() method must be called for the current image before calling the set_colormap() method.

ReturnCode get_colormap(out sequence<octet> colormap)

Description

Returns the colormap associated with the current image. The current image's colormap attributes, returned by the get_colormap_attributes() method, define the size and base index (zero based) of the current image's colormap. Your application is responsible for freeing the actual_colormap._buffer.

Each color map entry is four octets (bytes) long and is encoded as pad, red, green, and blue as shown in the figure .

Arguments
out sequence<octet> colormap After your application calls the get_colormap() method, colormap._buffer contains a copy of the Current Image's Colormap. Each colormap entry is four octets (bytes) long and is encoded as pad, red, green, and blue. The length of the colormap is defined in units of octets and is returned in colormap._length.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
NoWindow The set_window() method must be called for the current image before calling the get_colormap() method.

ReturnCode set_colormap_id(in unsigned long colormap_id)

Description

Sets the current image's X colormap ID attribute. The specified colormap_id must refer to an X colormap resource created on the UMSImagePlayer's Display. If the specified X colormap ID represents a colormap not suitable for current image (for example, the current image does not allow the specification of a colormap), the actual_colormap_id parameter contains the actual X colormap ID the UMSImagePlayer uses when displaying the current image.

If the UMSImagePlayer is in the ReadingState or DisplayingState, the actual colormap ID is immediately applied to the current image. If the UMSImagePlayer is in the ReadyState, the actual colormap ID is applied when your application next calls the start_display() method.

Be default, all of a UMSImagePlayer's images have an X colormap ID attribute which you can query using the get_colormap_id() method.

Arguments
in unsigned long colormap_id The colormap_id parameter contains the X colormap ID of the X colormap you would like the UMSImagePlayer to use when displaying the current image. The specified colormap_id must refer to an X colormap resource created on the UMSImagePlayer's Display; otherwise the set_colormap_id() method returns an OutOfRange return code.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
OutOfRange If the specified colormap ID is invalid.
InvalidState The state of the UMSImagePlayer precludes calling this method.
NoWindow The set_window() method must be called for the current image before calling the set_colormap_id() method.

ReturnCode get_colormap_id(out unsigned long colormap_id)

Description

Returns the current image's X colormap ID attribute the UMSImagePlayer uses when displaying the current image.

Arguments
out unsigned long colormap_id The colormap_id parameter contains the X colormap ID the UMSImagePlayer uses when displaying the current image.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
NoWindow The set_window() method must be called for the current image before calling the get_colormap_id() method.

ReturnCode set_transform(in UMSImageTransform transform, out UMSImageSize actual_display_size, out UMSImageRect actual_display_subimage_rect)

Description

Sets the current image's transform attribute. If the specified transform is not supported, the actual_transform parameter contains the actual image transformation the UMSImagePlayer uses when displaying the current image.

Use the get_rightsideup_transform() method to determine current image's default image transformation and use the get_transform() method to determine the current image's current transformation.

Arguments
in UMSImageTransform transform Use the transform parameter to specify the image transform you would like the UMSImagePlayer to apply when displaying the current image.

The UMSImageTransform type is defined in "Enumeration Lists" .

out UMSImageSize actual_display_size Upon return fro the set_transform() method, the actual_display_size parameter contains the value of the current image's display size attribute which is the size (width and height) the UMSImagePlayer uses when displaying the current image. For more information on the current image's display size attribute, see "Current Image's Sizes, Size, and Display Size" .
out UMSImageRect actual_display_subimage_rect Upon return from the set_transform() method, the actual_display_subimage_rect parameter contains the value of the current image's subimage rectangle attribute as defined in the display (destination) coordinate system. For more information on the current image's subimage rectangle attribute, see "Current Image's Subimage Rectangle" .
Required States

ReadyState, ReadingState, or DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_transform(out UMSImageTransform transform)

Description

Returns the current image's transform attribute which defines the image transformation the UMSImagePlayer uses when displaying the current image.

Use the set_transform() method to set the current image's transform attribute.

Arguments
out UMSImageTransform transform Upon return from the get_transform() method, the transform parameter contains the actual image transformation the UMSImagePlayer applies when displaying the current image.

The UMSImageTransform type is defined in "Enumeration Lists" .

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_rightsideup_transform(out UMSImageTransform transform)

Description

Returns the current image's right-side-up transform attribute. You can use the returned value in the set_transform() method to rotate the current image into a right-side-up orientation. Some image formats do not support the concept of a right-side-up transformation. Therefore, images defined in those formats always have a right-side-up tansform of ROTATE_0 and may not appear to you to be right-side-up.

By default, the transform attribute of a UMSImagePlayer image is set to the image's right-side-up transform so that the image, by default, appears right-side-up. For more information on image transformations, see "Current Image's Transform" .

Arguments
out UMSImageTransform transform After a successful call to the get_rightsideup_transform() method, the transform parameter contains one of the UMSImageTransform enumeration values indicating the transformation which must be applied to display the current image right-side-up. The UMSImageTransform enumeration is defined in "Enumeration Lists" .
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode get_associated_image_path(out string pathname)

Description

Returns the current image's associated Image Pathname attribute as a string. If the current image has no associated image pathname, the method returns a NULL.

Arguments
out string pathname Upon return from the get_associated_image_path() method, the pathname parameter contains the fully qualified path to an image file associated with the current image. If the current image does not have an associated image file, the get_associate_image_path() method return a NULL in the pathname parameter.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode set_color_properties (in UMSImageColorProperties* image_color_properties, out UMSImageColorProperties actual_image_color_properties)

Description

Sets the current image's color properties attribute which controls the red, green, and blue color balance, overall image lightness, and color saturation of the current image. Positive values for the red, green, or blue color properties increase the amount of the corresponding color in the Current Image. Increasing the lightness setting simultaneously increases the red, green, and blue values to increase the overall lightness of the Current Image. Positive saturation values increase the saturation of the colors in the image, while leaving neutrals unaffected. Specifying negative values produces the opposite effect.

Arguments
in UMSImageColorProperties image_color_properties Use the image_color_properties argument to set the red, green, and blue color balance, overall image lightness, and color saturation of the current image. The UMSImageColorProperties structure is defined in "Defined Structures" .
out UMSImageColorProperties actual_image_color_properties
                          Upon return from the set_color_properties() method, the actual_image_color_properties argument contains the actual image color properties of the current image. If the image color properties you specify in the image_color_properties argument differ from the actual image color properties returned in the actual_image_color_properties argument, the set_color_properties() method returns the ValueChanged return code.
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.
ValueChanged The specified image color properties and the actual image color properties differ.

ReturnCode get_color_properties( out UMSImageColorProperties image_color_properties)

Description

Gets the current image's color properties attribute which controls the red, green, and blue color balance, overall image lightness, and color saturation of the current image. Positive values for the red, green, or blue color properties increase the amount of the corresponding color in the current image. Increasing the lightness setting simultaneously increases the red, green, and blue values to increase the overall lightness of the current image. Positive saturation values increase the saturation of the colors in the image, while leaving neutrals unaffected. Specifying negative values produces the opposite effect.

Arguments
out UMSImageColorProperties image_color_properties Upon return from the get_color_properties() method, the image_color_properties argument contains the Image Color Properties of the current image. The UMSImageColorProperties structure is defined in "Defined Structures" .
Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

Operations

The following methods are operations which can be performed on a UMSImagePlayer.

ReturnCode open(in string pathname)

Description

Opens an UMSImagePlayer to play the image file specified by the pathname parameter. If the file cannot be played, an error is returned. After a successful call to open(), the state of a UMSImagePlayer is ReadyState. If the UMSImagePlayer is already in the ReadyState, the open() method first closes the file it has open (see the close() method) before opening the specified file. If the UMSImagePlayer is in the DisplayingState, the open() method first stops displaying images from the currently opened file (see the stop_display() method), then closes the currently open file (see the close() method), before actually opening the specified file.

Arguments
in string pathname The pathname of the image file to open.
Required States

NotReadyState

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
NoFile The specified file was not found.
WrongFormat The specified file is not a recognized image format.
FileError An error occurred while attempting to open the specified file.

ReturnCode close()

Description

The close() method closes the UMSImagePlayer freeing all allocated resources, releasing any windows associated with the UMSImagePlayer's images (see the set_window() and release_window() methods), and closing the image file opened by the open() method. After a successful call to the close() method, the state of a UMSImagePlayer is NotReadyState.

Required States

ReadyState

NotReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.

ReturnCode start_display()

Description

The start_display() method starts the process of displaying a UMSImagePlayer's images.

Part of the process is to read image data from the UMSImagePlayer's open image file. When starting the read, the UMSImagePlayer moves to the ReadingState and generates an IsReading event. After reading and displaying all of the image data, a UMSImagePlayer's state move to the DisplayingState and the UMSImagePlayer generates an IsDisplaying event.

While in the DisplayingState, a UMSImagePlayer maintains an image on the screen by redrawing all of part of the image whenever the image is exposed or the state of the image is modified by your application. For example, if a UMSImagePlayer is displaying the fifth image in an image file, and your application modifies the colormap of the fifth image, the UMSImagePlayer redisplays the fifth image using the new colormap.

In some cases, redisplaying all or part of an image can require the UMSImagePlayer to reread the image data from the image file. If so, the UMSImagePlayer's changes to the ReadingState and generates an IsReading event.

Note that only those images associated with an X window, through the set_window() method, are actually read and displayed by the start_display() method.

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

ReturnCode stop_display()

Description

Stops the display and expose event handling of the all of the UMSImagePlayer's images.

After a successful call to the stop_display() method, the state of the UMSImagePlayer is the ReadyState.

Required States

ReadyState

ReadingState

DisplayingState

Return Values
Success No error was found.
Failure If an error is found that is not described by any other return code.
InvalidState The state of the UMSImagePlayer precludes calling this method.

For introductory information, see Media Handler Objects.


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