Japanese
PROGRAMMER'S GUIDEMPEG library
BackForward
MPEG library/12.Function details-4

12.4 Display control



 one
View
table
 Title

function specification

 Function

Generate MPEG window

 Function name

MPG_WnCreate

 No

4.1

Format
MpgWn MPG_WnCreate(Uint32 dzx, Uint32 dzy, Uint32 dsx, Uint32 dsy)
input
 dzx
 :Display reference position of display window (X coordinate)
 dzy
 :Display reference position of display window (Y coordinate)
 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 image data expanded by an MPEG handle. Returns NULL if generation of the MPEG window fails. The setting values for each parameter are as follows.

 parameters
 normal resolution
 high definition resolution
meaning
 Setting function
dzx 0~351 0~703 Display reference position of 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

In addition, the following values are set as default values for other parameters of the window.
 parameters
 normal resolution
meaning
 Setting function
dlx 0 display window
Display relative position
MPG_WnSetDispOfst
dly 0
frx Same size (1.0) framebuffer window
magnification
MPG_WnSetDispRatio
fry Same size (1.0)
fzx equal to dzx framebuffer window
zoom point
MPG_WnSetFrmLoc
fzy equals dzy
For the meaning of each parameter above, please refer to " 5.1 MPEG Window Control ".

 one
View
table
 Title

function specification

 Function

Clearing the MPEG window

 Function name

MPG_WnDestroy

 No

4.2

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

 one
View
table
 Title

function specification

 Function

Setting the output mode of the MPEG window

 Function name

MPG_WnSetOutputMode

 No

4.3

Format
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
Set the MPEG window output method.
(1) Output mode
・MPG_OMODE_DRCT
 :Direct output to VDP2
・MPG_OMODE_HOST
 :Output due to transfer to host area
If host transfer mode is specified, executing the MPG_WnTrans function will transfer to the buf area. If no transfer function is registered, an area on the B bus must be specified for buf. For details, see " 4.7 Registering User Transfer Functions ."

 one
View
table
 Title

function specification

 Function

Display/hide settings

 Function name

MPG_WnDisp

 No

4.4

Format
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 are not possible at the same time. The output window to VDP2 has priority, so when the output window to VDP2 is displayed, the output window by host transfer will not be displayed.
remarks
(a) Do not turn on more than one VDP2 output window.

 one
View
table
 Title

function specification

 Function

Changing the display reference position

 Function name

MPG_WnSetLoc

 No

4.5

Format
void MPG_WnSetLoc(MpgWn mpgwn, Uint32 dzx, Uint32 dzy)
input
 mpgwn
 :MPEG window
 dzx
 :X coordinate of display reference position (in pixels)
 dzy
 : Y coordinate of display reference position (in pixels)
output
none
function value
none
function
Set the display reference position of the display window. If the window is currently displayed, the display position will be changed immediately. For details, see " 5. MPEG Window ."

 one
View
table
 Title

function specification

 Function

Change display size

 Function name

MPG_WnSetSize

 No

4.6

Format
void MPG_WnSetSize(MpgWn mpgwn, Uint32 dsx, Uint32 dsy)
input
 mpgwn
 :MPEG window
 dsx
 : Size in X direction (in pixels)
 dsy
 : Size in Y direction (in pixels)
output
none
function value
none
function
Sets the display window size. If the window is visible, the display size is changed immediately. For details, see " 5. MPEG Window ."

 one
View
table
 Title

function specification

 Function

Setting relative display position

 Function name

MPG_WnSetDispOfst

 No

4.7

Format
void MPG_WnSetDispOfst(MpgWn mpgwn, Sint32 dlx, Sint32 dly)
input
 mpgwn
 :MPEG window
 dlx
 : Relative display position in the X direction (in pixels)
 dly
 : Relative display position in the Y direction (in pixels)
output
none
function value
none
function
Sets the relative display position of the display window. For details, see " 5. MPEG Window ."

 one
View
table
 Title

function specification

 Function

Setting the magnification

 Function name

MPG_WnSetDispRatio

 No

4.8

Format
void MPG_WnSetDispRatio(MpgWn mpgwn, Uint32 x_rat, Uint32 y_rat)
input
 mpgwn
 :MPEG window
 x_rat
 : Magnification in the X direction (fixed point format)
 y_rat
 : Magnification in Y direction (fixed point format)
output
none
function value
none
function
Sets the frame buffer window's magnification relative to the display window. You can zoom in/zoom out by gradually changing this value. The actual magnification is calculated using the following formula. (Fixed point format where 1000 is 1.0)
・X direction (frx)
 :x_rat/1000
・Y direction (fry)
 :y_rat/1000
For details, see "5. MPEG Window."

 one
View
table
 Title

function specification

 Function

Setting the frame window position

 Function name

MPG_WnSetFrmLoc

 No

4.9

Format
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 within the display window corresponds to the position specified by this function.
For details, see "5. MPEG Window."

 one
View
table
 Title

function specification

 Function

Transfer to host area

 Function name

MPG_WnTrans

 No

4.10

Format
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 window's output mode must be host-forwarded output mode. For details, see " 4.7 Registering User Transfer Functions ."
remarks
(a) Use the MPG_WnSetOutputMode function to set the output mode and transfer area.
(b) To register a transfer function, use the MPG_WnEntryTrFunc function.

 one
View
table
 Title

function specification

 Function

Border color settings

 Function name

MPG_WnSetBcolor

 No

4.11

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

 one
View
table
 Title

function specification

 Function

Setting YC magnification

 Function name

MPG_WnSetYcRatio

 No

4.12

Format
void MPG_WnSetYcRatio(MpgWn mpgwn, Uint32 y_rat, Uint32 c_rat)
input
 mpgwn
 :MPEG window
 y_rat
 : Magnification of luminance signal
 c_rat
 : Magnification of color difference signal
output
none
function value
none
function
Set the magnification of the luminance signal and color difference signal. Can be used for fade in/fade out. Also, if c_rat is set to 0, the video will be monochrome. y_rat and c_rat each have 16 levels (0 to 15).

 one
View
table
 Title

function specification

 Function

Setting interpolation mode

 Function name

MPG_WnSetIntpol

 No

4.13

Format
void MPG_WnSetIntpol(MpgWn mpgwn, Bool sw_yh, Bool sw_yv, Bool sw_ch, Bool sw_cv)
input
 mpgwn
 :MPEG window
 sw_yh
 : Brightness horizontal interpolation switch (ON/OFF)
 sw_yv
 : Brightness vertical interpolation switch (ON/OFF)
 sw_ch
 : Color difference horizontal interpolation switch (ON/OFF)
 sw_cv
 : Color difference vertical interpolation switch (ON/OFF)
output
none
function value
none
function
Set whether to interpolate the luminance signal and color difference signal.

 one
View
table
 Title

function specification

 Function

Mosaic settings

 Function name

MPG_WnSetMozaic

 No

4.14

Format
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 power)
 moz_v(n)
 : Vertical mosaic ratio (2 to the nth power)
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) */
MPG_WnSetMozaic(mpgwn, 4, 6);

 one
View
table
 Title

function specification

 Function

Blur settings

 Function name

MPG_WnSetSoft

 No

4.15

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

 one
View
table
 Title

function specification

 Function

Luminescence key settings

 Function name

MPG_WnSetLumiKey

 No

4.16

Format
void MPG_WnSetLumiKey(MpgWn mpgwn, Sint32 y_lvl, Bool bdr)
input
 mpgwn
 :MPEG window
 y_lvl
 : Brightness signal level (0: normal, 1:64, 2:96, 3:128)
 bdr
 : Whether to enlarge the transparent area (ON: Enlarge, 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 luminance below y_lvl transparent. You can specify whether to enlarge the transparent area by specifying bdr.

 one
View
table
 Title

function specification

 Function

Registering a transfer function

 Function name

MPG_WnEntryTrFunc

 No

4.17

Format
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 will be called from the MPEG library when the MPG_WnTrans function is executed. If you specify NULL for trfunc, the default transfer function (DMA transfer function on B-Bus by SCU) will be registered. For details, see " 4.7 Registering User Transfer Functions ."
example
MPG_WnEntryTrFunc(mpgwn, trfunc);
/* Transfer function */
void trFunc(void *dst, void *src, Sint32 nbyte)
{
/* Transfer processing */
...
}

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