[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface : Subroutine Reference

GPWRCT - Write Rectangle

GPWRCT (tibid, torigin, size, format, parm, sorigin, data)

Purpose

Use GPWRCT to write pixel data into an image board. Pixel data for the specified source rectangle will be extracted from the source application image data and written to the target rectangle within the specified image board.

The specified target rectangle need not be inside of the target image board but the specified source rectangle must be inside of the source application image. When the target rectangle exceeds the target image board boundaries, pixel data outside the boundaries is discarded. If source and target data have different bit depth, source pixels are adjusted to the target bit length by removing most significant bits or adding 0-bit to the most significant part.

See The graPHIGS Programming Interface: Understanding Concepts for a discussion on image processing.

Parameters

tibid -- specified by user, fullword integer

Target image board identifier.

torigin -- specified by user, two fullword integers

Target rectangle origin (x, y) (>=0)

size -- specified by user, two fullword integers

Rectangle size (SX, SY) (>=1)

format -- specified by user, fullword integer

Source application image format (1=PIXEL_ARRAY )

parm -- specified by user, variable data

Format dependent parameters.

The image format 1 requires the following parameters:

  • bit depth -- fullword integer (1, 2, 4, 8, 16)

  • x size -- fullword integer (>=1)

  • y size -- fullword integer (>=1)

  • pixel order -- fullword integer (1=LEFT_RIGHT_BOTTOM_TOP,2=LEFT_RIGHT_TOP_BOTTOM )

    The product of x size and bit depth must be a multiple of 8. This is to ensure that each row of the application's image data starts on a byte boundary.

  • sorigin -- specified by user, two fullword integers

    Source rectangle origin (x, y) (>=0)

    data -- specified by user, array of pixels

    Source application image data. For the purpose of byte swapping between different shell/nucleus environments, the source application image data with bit depth of 16 will be handled as 16-bit halfwords. Bit depths 1, 2, 4, 8 should be packed respectively as 8, 4, 2 and 1 pixels per byte. For all other bit depths, the application image data will be treated as 8-bit unsigned characters.

    Error Codes

    232
    SPECIFIED IMAGE BOARD DOES NOT EXIST
    236
    RECTANGLE DEFINITION IS INVALID
    237
    SPECIFIED APPLICATION IMAGE FORMAT IS NOT SUPPORTED
    240
    APPLICATION IMAGE DESCRIPTION IS INVALID

    Related Subroutines

    GPCRIB
    Create Image Board
    GPQAI
    Inquire List of Available Application Image Formats
    GPQIBC
    Inquire Image Board Characteristics
    GPQIBF
    Inquire Image Board Facilities
    GPQIMC
    Inquire Image Mapping Characteristics
    GPQIMF
    Inquire Image Mapping Facilities

    RCP code

    201346311 (X'0C004D07')



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