mvView(3dm) mvView(3dm) NAME mvSetViewOffset, mvGetViewOffset, mvQueryViewOffset, mvSetViewSize, mvGetViewSize, mvQueryViewSize, mvSetViewOffsetAndSize, mvGetViewKeepAspect - Change the location and size of the region for movie display inside a GL window SYNOPSIS #include <dmedia/moviefile.h> #include <dmedia/movieplay.h> void mvSetViewOffset(MVid movieid, int offsetx, int offsety, DMboolean glcoordsystem); void mvGetViewOffset(MVid movieid, int *offsetxreturn, int *offsetyreturn, DMboolean glcoordsystem); void mvQueryViewOffset(MVid movieid, int offsetx, int offsety, int *offsetxreturn, int *offsetyreturn, DMboolean glcoordsystem); void mvSetViewSize(MVid movieid, int newwidth, int newheight, DMboolean keepAspect); void mvGetViewSize(MVid movieid, int *widthreturn, int *heightreturn); void mvQueryViewSize(MVid movieid, int width, int height, DMboolean unused, int *widthreturn, int *heightreturn); void mvSetViewOffsetAndSize(MVid movieid, int offsetx, int offsety, int newwidth, int newheight, DMboolean glcoordsystem); DMboolean mvGetViewKeepAspect(MVid movieid); DESCRIPTION mSetViewOffset(3dm) sets the offset for the view for rendering movie frames in an OpenGL window, relative to the origin of the window. You use the glcoordsystem parameter to determine the screen coordinate system for the y offset. If glcoordsystem is DM_TRUE, Movie Playback Library assumes the OpenGL screen coordinate system with (0, 0) in lower left. If it is DM_FALSE, Movie Library assumes the X coordinate system with (0, 0) in upper left. mvQueryViewOffset(3dm) returns the actual offset for the movie view for a given set of parameters to mvSetViewOffset(3dm). Because the size of the movie frame may not match the size of the view you specify (see mvSetViewSize(3dm) below), the actual origin of the movie frame may be different than what you specify. The Movie Library automatically centers the movie frame inside the view. mvGetViewOffset(3dm) will return the current origin of the movie frame, unless it is different from the value you specified with mvSetViewOffset(3dm). In that case, it returns the last offset you specified. Thus, any portion of your application code can inspect both the requested origin (via mvGetViewOffset(3dm)) and the actual origin (via mvQueryViewOffset(3dm)). The default offset is (0, 0) in the OpenGL coordinate system. mvSetViewSize(3dm) sets the size of the Movie Library view for rendering movie frames in a window. The Movie Library will zoom the movie rectangle as large as possible to fit within the specified size. (The IRIS GL version only supports zooming by integer multiples, whereas OpenGL supports arbitrary pixel zooming.) The Movie Playback Library will preserve the aspect ratio of the movie frame and center the movie rectangle within the viewport. Because various members of the Silicon Graphics product family have differing hardware image manipulation capabilities, the same values provided to mvSetViewSize(3dm) may produce different results when your code runs on various machines. The actual movie view size may not be identical to the size you specify. To determine what the actual movie frame size will be for a desired width and height, use mvQueryViewSize(3dm). The Movie Library centers the movie frames in the view you specify. It also fills the areas within the view which are not part of the movie frame with background color. To specify the background color, use mvSetViewBackground(3dm). If the movie will appear by itself in the window, and not along with other graphics, you may want to ensure that your code chooses the proper window size by calling mvQueryViewSize(3dm). You may use the results to constrain the dimensions of the window to match those of the movie. Alternatively, you can simply choose a background color for the unused portions of the display with mvSetViewBackground(3dm). If the movie will appear in a OpenGL/X window along with other graphic elements (i.e. a movie embedded in a larger display), you may wish to set your view size carefully by first calling mvQueryViewSize(3dm) and using the results as inputs to mvSetViewSize(3dm). This will ensure that the Movie Library draws on the display only over regions the movie frame actually appears. mvGetViewSize(3dm) returns the size of the movie frame, unless it differs from the value you specified with mvSetViewSize(3dm). In that case, it returns the last size you specified. Thus, any portion of your application code can inspect both the requested size (via mvGetViewSize(3dm)) and the actual frame size (via mvQueryViewSize(3dm)). mvGetViewKeepAspect(3dm) returns the flag set with mvGetViewSize(3dm). The default view size is the width and height of the movie bounding rect. mvQueryViewSize(3dm) returns the actual size the movie will actually choose for the size of the playback view, given a set of view dimensions. mvSetViewOffsetAndSize(3dm) sets the view offset and size atomically. You can use this call in place of a pair of calls to mvSetViewOffset(3dm) and You may call these functions for a specified movie instance regardless of whether or not the movie is playing. mvSetViewSize(3dm) to avoid an unnecessary redraw. You may only call these functions for a specified movie while it is bound to a window (see mvBindOpenGLWindow(3dm)). NOTES The current implementation on all platforms guarentees that the actual view size requested by mvSetViewSize(3dm) will be maintained. Previous versions of mvSetViewSize(3dm) ignored the keepAspect flag and always assumed it was DM_TRUE. This behavior can be enabled by setting MV_IGNORE_KEEPASPECT in the environment. SEE ALSO mvBindOpenGLWindow(3dm), mvIntro(3dm), mvSetViewBackground(3dm), mvGetViewBackground(3dm), mvMovieRect(3dm). Page 3