NAME

mkpar, mkparl, mkparv - make complex visual display pictures with parameters

SYNOPSIS

#include <mpict_p.h>

PICT mkpar (par, pic)
struct picpar *par;
PICT pic;

PICT mkpari (par, pic1, pic2, ..., z)
struct picpar *par;
PICT pic1, pic2, ..., z;

PICT mkparv (par, picv)
struct picpar *par;
PICT picv[];

DESCRIPTION

mkpar builds a complex picture that has special characteristics or uses non-default parameter values. mkpar performs all the functions of both mkpic or mktop; it builds a complex picture from one or more basic or complex pictures, optionally assigning absolute coordinates to the resulting picture. In addition, mkpar can assign an explicit intensity value and relative offsets for placing the picture.

mkparv builds a picture from the single argument pic. mkparl builds a picture from the two or more subpictures passed as arguments; the last argument must be EOP or 0. mkparv builds a picture from subpictures contained in the array pointed to by picv; the last element in the array must equal EOP or 0.

The argument par points to a structure defined as follows:

struct picpar{
char	pp_flags;	/* flags indicating which parameters are set
*/
int	pp_x;		/* x position */
int	pp_y;		/* y position */
int 	pp_intcol;	/* intensity  */
float	pp_xscale;	/* x scale factor */
float	pp_yscale;	/* y scale factor */
float 	pp_xsctr;	/* x center for scaling */
float 	pp_ysctr;	/* y center for scaling */
int 	pp_xlclip;	/* lower x clip */
int 	pp_ylclip;	/* lower y clip */
int	pp_xuclip;	/* upper x clip */
int 	pp_yuclip;	/* upper y clip */
int	pp_xtran;	/* x translation */
int	pp_ytran;	/* y translation */
int	pp_rot		/* rotation angle (degrees) */
float	pp_xrctr;	/* x center for rotation */
float	pp_yctr;	/* y center for rotation */
};
The pp_flags field contains flags that identify the special characteristics and parameters to be assigned to the picture that mkpar builds. The flags that may be set by the user are:
P_TOP		top picture
P_OFFSET	offsets
P_INTCOL	intensity parameter
P_CLIP		clip boundaries
P_SCALE		scale parameters
P_ROTATE	rotate parameters
P_TRAN		translation parameters
If P_TOP is set, the picture is designated a top picture. IF P_OFFSET is set, as well, the picture is assgigned the coordinates specified in the pp_x and pp_y fields; otherwise, it is assigned the coordinates (0,0). These coordinates specify an offset from the origin for placing the picture. The MEGAPIC graphics facility produces pictures within the dimensions 4096 x 4096. With the origin in the center of the screen, the coordinates can range from -2048 to 2047 in both dimensions. If the origin is the lower left of the display screen, coordinates van range form 0 to 4095 in both dimensions. If numbers outside of these ranges are specified, wrap-around occurs.

If P_OFFSET is set but P_TOP is clear, then the mkpar interprets the coordinates in pp_x and pp_y as offsets from the current location. Normally, a picture is placed at the last coordinate of the picture preceding it in the display specification. When P_OFFSET is set, a picture is offset from the last screen position by pp_x and pp_y. Offsets may take negative as well as positive values, ranging from -4095 to 4095, depending on the current location.

The P_INTCOL flag indicates that an intensity/color parameter is specified in the pp_intcol field. When the picture is displayed, it uses this value rather than the default value. The intensity/color parameter is inherited by all subpictures of pic that don't explicitly contain their own intensity/color level. Subpictures (and their subpictures) that do contain explicit intensity/color spefications are unaffected. The intensity parameter can range from 0 to 15. Changing this parameter affects the intensity of the picture on monochrome monitors and the color on color monitors. On monochrome monitors values of 15 intensity levels are available, 0 being lowest and 15 highest. Absolute intensity also depends on the display refresh rate and the setting of the intensity control knob on the monitor. With color monitors, currently only 8 colors, as specified in the color lookup table (see color(3U) ) can be accessed at a time. 0 and 1 specify the first color, 2 and 3 specify the second, etc.

The next set of flags can only be used with Megatek systems that are equipped with Hardware Clip/Rotate/Scale/Translate (HCRST) device. Because they refer to absolute screen coordinates, HCRST parameters can only be set for top pictures. The HCRST ignores any resetting of the origin; it assumes the origin is in the center of the screen. HCRST transformations are applied after applying any offsets to a top picture. The result is that offsets, as well as picture elements, are rotated, scaled, and translated. HCRST parameters can later be changed by routines defined in chclip(3U) and tmatrix(3U)

The P_CLIP flag indicates that scaling parameters are provided. Only parts of the current picture that are inside of the clip boundaries (a rectangular area) are displayed. The pp_xlclip and pp_ylclip fields specify the absolute lower left screen coordinates while pp_xuclip and pp_yuclip specify the absolute upper right screen coordinates. Coordinates can range from -2048 to 2047 in both dimensions.

The P_SCALE flag indicates that scaling parameters are provided. pp_xscale and pp_yscale specify the x and y scale factors. pp_xsctr and pp_ysctc specify the absolute screen coordinate about which the scaling is centered.

The P_ROTATE flag indicates that rotation parameters are provided. pp_rot specifies a rotation angle in degrees. pp_xrctr and pp_yctr specifies the absolute screen coordinate about which the scaling is centered.

The P_TRAN flag indicates that horizontal and vertical translation parameters, pp_xtran and pp_ytran are provided.

Subpictures are placed in complex picture in the order they appear in the argument list or array. Consequently, when a subpicture is displayed, it will be placed relative to the subpictures preceding it.

There is a hardware limit to the number of levels of subpictures that a complex picture can contain. Basic pictures are level 0. Level 1 pictures are composed of only basic pictures. Level 2 pictures may be composed of level 0 and 1 pictures. level 3 pictures may be composed of level 0, 1, and 2 pictures. A complex picture that is not a top picture can be no higher than level 3. A top picture may be composed of level 0-3 pictures. Attempts to build higher level pictures are illegal.

If successful, mkpar returns a PICT pointing to the complex picture it builds.

SEE ALSO

mkpic(3U) , mktop(3U) , origin(3U) , chintcol(3U) , chpar(3U) , d_intcol(3U) , color(3U) , tmatrix(3U).

DIAGNOSTICS

mkpar will fail, printing an appropriate error message and returning the value of EOP, if: