PROGRAMMER'S GUIDEMPEG library
BackForward
MPEG Library / 12. Function Details-4

12.4 Display control



 List
 Title

Function specifications

 Function

MPEG window generation

 Function Name

MPG_WnCreate

 No

4.1

Form
MpgWn MPG_WnCreate (Uint32 dzx, Uint32 dzy, Uint32 dsx, Uint32 dsy)
input
 dzx
 : Display reference position (X coordinate) of the display window
 dzy
 : Display reference position (Y coordinate) of the display window
 dsx
 : Display window size (X direction)
 dsy
 : Display window size (Y direction)
output
none
Function value
MPEG window
function
Generates an MPEG window for outputting the image data expanded by the MPEG handle. Returns NULL if MPEG window generation fails. The setting values of each parameter are as follows.

 Parameters
 Normal resolution
 High definition resolution
meaning
 Setting function
dzx 0-351 0-703 Display reference position of the display window MPG_WnSetloc
dzy 0-239 0-479
dzx 0-352 0-704 Display window display size MPG_WnSetSize
dzy 0-240 0-480

Also, for the other parameters of the window, the following values are set as default values.
 Parameters
 Normal resolution
meaning
 Setting function
dlx 0 Display relative position of display window MPG_WnSetDispOfst
dly 0
frx 1x (1.0) Framebuffer window magnification MPG_WnSetDispRatio
fry 1x (1.0)
fzx Equal to dzx Framebuffer window zoom point MPG_WnSetFrmLoc
fzy Equal to dzy
For the meaning of each of the above parameters, refer to " 5.1 Controlling MPEG Window ".

 List
 Title

Function specifications

 Function

Erase MPEG window

 Function Name

MPG_WnDestroy

 No

4.2

Form
void MPG_WnDestroy (MpgWn mpgwn)
input
mpgwn: MPEG window
output
none
Function value
none
function
Clears the MPEG window. It also erases the actual display screen.

 List
 Title

Function specifications

 Function

Setting the output mode of the MPEG window

 Function Name

MPG_WnSetOutputMode

 No

4.3

Form
void MPG_WnSetOutputMode (MpgWn mpgwn, Sint32 omode, void * buf)
input
 mpgwn
 : MPEG window
 omode
 : Output mode (MPG_NOCHG: Do not change)
 buf
 : Transfer area (MPG_NOCHG: Do not change)
output
none
Function value
none
function
Sets the output method of the MPEG window.
(1) Output mode
・ MPG_OMODE_DRCT
 : Direct output to VDP2
・ MPG_OMODE_HOST
 : Output by forwarding to the host area
When the host transfer power mode is specified, it is transferred to the buf area when the MPG_WnTrans function is executed. If you do not register the transfer function, you must specify the area on the B bus for buf. For details, refer to " 4.7 Registering a User Transfer Function ".

 List
 Title

Function specifications

 Function

Show / Hide Settings

 Function Name

MPG_WnDisp

 No

4.4

Form
void MPG_WnDisp (MpgWn mpgwn, Bool dsw)
input
 mpgwn
 : MPEG window
 dsw
 : Display switch (ON / OFF)
output
none
Function value
none
function
Set whether to display the MPEG window. Direct output to VDP2 and transfer to the host cannot be performed at the same time. Since the output window to VDP2 has priority, the output window by host transfer is not displayed when the output window to VDP2 is displayed.
remarks
(a) Do not turn on more than one VDP2 output window.

 List
 Title

Function specifications

 Function

Change of display reference position

 Function Name

MPG_WnSetLoc

 No

4.5

Form
void MPG_WnSetLoc (MpgWn mpgwn, Uint32 dzx, Uint32 dzy)
input
 mpgwn
 : MPEG window
 dzx
 : X coordinate of display reference position (pixel unit)
 dzy
 : Y coordinate of display reference position (pixel unit)
output
none
Function value
none
function
Set the display reference position of the display window. If the window is visible, the display position will change immediately. For details, refer to "5. MPEG Window".

 List
 Title

Function specifications

 Function

Change display size

 Function Name

MPG_WnSetSize

 No

4.6

Form
void MPG_WnSetSize (MpgWn mpgwn, Uint32 dsx, Uint32 dsy)
input
 mpgwn
 : MPEG window
 dsx
 : Size in the X direction (in pixels)
 dsy
 : Size in Y direction (pixel unit)
output
none
Function value
none
function
Sets the size of the display window. If the window is visible, it will be resized immediately. See " 5. MPEG Window " for details.

 List
 Title

Function specifications

 Function

Display relative position setting

 Function Name

MPG_WnSetDispOfst

 No

4.7

Form
void MPG_WnSetDispOfst (MpgWn mpgwn, Sint32 dlx, Sint32 dly)
input
 mpgwn
 : MPEG window
 dlx
 : Display relative position in X direction (pixel unit)
 dly
 : Display relative position in Y direction (pixel unit)
output
none
Function value
none
function
Sets the relative display position of the display window. See " 5. MPEG Window " for details.

 List
 Title

Function specifications

 Function

Magnification setting

 Function Name

MPG_WnSetDispRatio

 No

4.8

Form
void MPG_WnSetDispRatio (MpgWn mpgwn, Uint32 x_rat, Uint32 y_rat)
input
 mpgwn
 : MPEG window
 x_rat
 : Magnification in X direction (fixed point format)
 y_rat
 : Magnification in Y direction (fixed point format)
output
none
Function value
none
function
Sets the magnification of the framebuffer window relative to the display window. You can zoom in / out by gradually changing this value. The actual magnification is calculated by the following formula. (Fixed-point format with 1000 as 1.0)
・ X direction (frx)
 : X_rat / 1000
・ Y direction (fry)
 : Y_rat / 1000
For details, refer to "5. MPEG Window".

 List
 Title

Function specifications

 Function

Setting the position of the frame window

 Function Name

MPG_WnSetFrmLoc

 No

4.9

Form
void MPG_WnSetFrmLoc (MpgWn mpgwn, Uint32 fzx, Uint32 fzy)
input
 mpgwn
 : MPEG window
 fzx
 : X coordinate in frame buffer (in pixels)
 fzy
 : Y coordinate in frame buffer (in pixels)
output
none
Function value
none
function
Specifies the position of the frame window. The display reference position in the display window corresponds to the position specified by this function.
For details, refer to "5. MPEG Window".

 List
 Title

Function specifications

 Function

Transfer to host area

 Function Name

MPG_WnTrans

 No

4.10

Form
Sint32 MPG_WnTrans (MpgWn mpgwn)
input
mpgwn: MPEG window
output
none
Function value
Error code
function
Call the transfer function to transfer to the host area. The output mode of the window must be host transfer output mode. For details, refer to " 4.7 Registering a User Transfer Function ".
remarks
(a) Use the MPG_WnSetOutputMode function to set the output mode and transfer area.
(b) To register the transfer function, use the MPG_WnEntryTrFunc function.

 List
 Title

Function specifications

 Function

Border color settings

 Function Name

MPG_WnSetBcolor

 No

4.11

Form
void MPG_WnSetBcolor (MpgWn mpgwn, Uint16 clr)
input
 mpgwn
 : MPEG window
 clr
 : Border color
output
none
Function value
none
function
Set the border color.

 List
 Title

Function specifications

 Function

YC magnification setting

 Function Name

MPG_WnSetYcRatio

 No

4.12

Form
void MPG_WnSetYcRatio (MpgWn mpgwn, Uint32 y_rat, Uint32 c_rat)
input
 mpgwn
 : MPEG window
 y_rat
 : Luminance signal magnification
 c_rat
 : Magnification of color difference signal
output
none
Function value
none
function
Set the magnification of the luminance signal and the color difference signal. It can be used for fade-in / fade-out. Also, if c_rat is set to 0, the image will be monochrome. y_rat and c_rat have 16 steps (0 to 15) respectively.

 List
 Title

Function specifications

 Function

Interpolation mode setting

 Function Name

MPG_WnSetIntpol

 No

4.13

Form
void MPG_WnSetIntpol (MpgWn mpgwn, Bool sw_yh, Bool sw_yv, Bool sw_ch, Bool sw_cv)
input
 mpgwn
 : MPEG window
 sw_yh
 : Horizontal interpolation switch for brightness (ON / OFF)
 sw_yv
 : Vertical interpolation switch for brightness (ON / OFF)
 sw_ch
 : Horizontal interpolation switch for color difference (ON / OFF)
 sw_cv
 : Vertical interpolation switch for color difference (ON / OFF)
output
none
Function value
none
function
Set whether to interpolate the luminance signal and the color difference signal.

 List
 Title

Function specifications

 Function

Mosaic settings

 Function Name

MPG_WnSetMozaic

 No

4.14

Form
void MPG_WnSetMozaic (MpgWn mpgwn, Sint32 moz_h, Sint32 moz_v)
input
 mpgwn
 : MPEG window
 moz_h (n)
 : Horizontal mosaic ratio (2 to the nth root)
 moz_v (n)
 : Percentage of vertical mosaic (2 to the nth root)
output
none
Function value
none
function
Set the mosaic percentage between 0 and 10.
example
/ * Set the horizontal direction to 16 (2 to the 4th power) times and the vertical direction to 64 (2 to the 6th power) times * /
MPG_WnSetMozaic (mpgwn, 4, 6);

 List
 Title

Function specifications

 Function

Blur setting

 Function Name

MPG_WnSetSoft

 No

4.15

Form
void MPG_WnSetSoft (MpgWn mpgwn, Bool sof_h, Bool sof_v)
input
 mpgwn
 : MPEG window
 sof_h
 : Horizontal blur switch (ON: Blur, OFF: Do not)
 sof_v
 : Vertical blur switch (ON: blur, OFF: not)
output
none
Function value
none
function
Set whether to apply blur.

 List
 Title

Function specifications

 Function

Luminescence key settings

 Function Name

MPG_WnSetLumiKey

 No

4.16

Form
void MPG_WnSetLumiKey (MpgWn mpgwn, Sint32 y_lvl, Bool bdr)
input
 mpgwn
 : MPEG window
 y_lvl
 : Luminance signal level (0: normal, 1:64, 2:96, 3:128)
 bdr
 : Whether to enlarge the transparent area (ON: enlargement, OFF: normal)
output
none
Function value
none
function
Set whether to perform luminescence key processing. Luminescence key processing is a process that makes pixels with brightness below y_lvl transparent. You can specify whether to expand the transparent area by specifying bdr.

 List
 Title

Function specifications

 Function

Transfer function registration

 Function Name

MPG_WnEntryTrFunc

 No

4.17

Form
void MPG_WnEntryTrFunc (MpgWn mpgwn, MpgTrFunc trfunc)
input
 mpgwn
 : MPEG window
 trfunc
 : Transfer function (NULL: Return to default transfer function)
output
none
Function value
none
function
Register the function that transfers to the host area. The registered transfer function is called from the MPEG library when the MPG_WnTrans function is executed. If NULL is specified for trfunc, the default transfer function (DMA transfer function on B-Bus by SCU) is registered. For details, refer to " 4.7 Registration of User Transfer Function ".
example
MPG_WnEntryTrFunc (mpgwn, trfunc);
/ * Transfer function * /
void trFunc (void * dst, void * src, Sint32 nbyte)
{
/ * Forwarding processing * /
・ ・ ・
}

BackForward
PROGRAMMER'S GUIDEMPEG library
Copyright SEGA ENTERPRISES, LTD., 1997