http://www.aros.org AROS-Exec AROS-Exec Archives Power2People
kitty mascottop logo menu

cgfx

Index


AllocCModeListTagList() BestCModeIDTagList() BltTemplateAlpha() CModeRequestTagList()
CVideoCtrlTagList() DoCDrawMethodTagList() ExtractColor() FillPixelArray()
FreeCModeList() GetCyberIDAttr() GetCyberMapAttr() InvertPixelArray()
IsCyberModeID() LockBitMapTagList() MovePixelArray() ProcessPixelArray()
ReadPixelArray() ReadRGBPixel() ScalePixelArray() UnLockBitMap()
UnLockBitMapTagList() WriteLUTPixelArray() WritePixelArray() WritePixelArrayAlpha()
WriteRGBPixel()      

AllocCModeListTagList()

Synopsis

struct List * AllocCModeListTagList(
         struct TagItem * tags );

struct List * AllocCModeListTags(
         TAG tag, ... );

Function

Retrieves a list of RTG screenmodes that match the criteria specified
in a taglist. The supported tags are as follows:
    CYBRMREQ_MinWidth (ULONG) - the minimum acceptable display width
        (defaults to 320).
    CYBRMREQ_MaxWidth (ULONG) - the maximum acceptable display width.
        (defaults to 1600).
    CYBRMREQ_MinHeight (ULONG) - the minimum acceptable display
        height (defaults to 240).
    CYBRMREQ_MaxHeight (ULONG) - the maximum acceptable display
        height (defaults to 1200).
    CYBRMREQ_MinDepth (UWORD) - the minimum acceptable display depth
        (defaults to 8).
    CYBRMREQ_MaxDepth (UWORD) - the minimum acceptable display depth
        (defaults to 32).
    CYBRMREQ_CModelArray (UWORD *) - array of permitted pixel formats.
        Any of the PIXFMT_#? constants may be specified (see
        LockBitMapTagList()), and the array must be terminated by ~0.
        By default, all pixel formats are acceptable.

Inputs

tags - mode selection criteria (may be NULL).

Result

result - a list of matching screenmodes, or NULL if there are none.

BestCModeIDTagList()

Synopsis

ULONG BestCModeIDTagList(
         struct TagItem * tags );

ULONG BestCModeIDTags(
         TAG tag, ... );

Function

Finds best RTG display mode ID which matches parameters specified
by the taglist.

Inputs

tags - An optional pointer to a TagList containing requirements
       for the display mode. Valid tags are:

  CYBRBIDTG_Depth (ULONG) - depth the returned ModeID must support.
                            Defaults to 8.
  CYBRBIDTG_NominalWidth  (UWORD),
  CYBRBIDTG_NominalHeight (UWORD) - desired width and height for the
                                    display mode.
  CYBRBIDTG_MonitorID (ULONG) - Specify numeric driver ID to find only
                                modes belonging to this driver. Useful
                                for systems with several graphics cards.
                                Defined board IDs are:
                                  1 - CVision64
                                  2 - Piccolo
                                  3 - PicassoII
                                  4 - Spectrum
                                  5 - Domino
                                  6 - RetinaZ3
                                  7 - PiccoSD64
                                  8 - A2410
                                 13 - CVision3D (V41)
                                 14 - Inferno   (V41)
                                 15 - PicassoIV (V41)
                                Note that this tag exists only for
                                compatibility with old software. New
                                programs should use CYBRIDTG_BoardName
                                tag instead.
CYBRBIDTG_BoardName (STRPTR) - Specify the driver name directly. For
                               example, pass "CVision3D" to get a
                               CyberVision64/3D display mode ID

Result

ID - Best matching display mode ID or INVALID_ID if there is no match.

BltTemplateAlpha()

Synopsis

void BltTemplateAlpha(
         APTR src,
         LONG srcx,
         LONG srcmod,
         struct RastPort * rp,
         LONG destx,
         LONG desty,
         LONG width,
         LONG height );

Function

Alpha blends the current foreground colour into a rectangular portion
of a RastPort. The source alpha channel to use for each pixel is taken
from an array of 8-bit alpha values. This alpha template may be any
rectangle within a larger array/rectangle of alpha values.

Inputs

src - pointer to an array of source alpha values.
srcx - byte/pixel offset of top-lefthand corner of alpha template.
srcmod - the number of bytes in each row of the source array.
rp - the RastPort to write to.
destx, desty - top-lefthand corner of portion of destination RastPort
    to write to (in pixels).
width, height - size of the area to copy (in pixels).

Result

None.

Notes

The size and destination coordinates may be outside the RastPort
boundaries, in which case the affected area is safely truncated.

CModeRequestTagList()

Synopsis

ULONG CModeRequestTagList(
         APTR ,
         struct TagItem *  );

ULONG CModeRequestTags(
         APTR ,
         TAG tag, ... );

Function

Displays a requester that allows the user to select an RTG screenmode.
Some of the requester's properties may be set using the following
tags:
    CYBRMREQ_Screen (struct Screen *) - the screen on which the
        requester should be opened.
    CYBRMREQ_WinTitle (STRPTR) - window title.
    CYBRMREQ_OKText (STRPTR) - label text for OK button.
    CYBRMREQ_CancelText (STRPTR) - label text for Cancel button.
    CYBRMREQ_MinWidth (IPTR) - Minimum acceptable display width
        (defaults to 320).
    CYBRMREQ_MaxWidth (IPTR) - Maximum acceptable display width.
        (defaults to 1600).
    CYBRMREQ_MinHeight (IPTR) - Minimum acceptable display height.
        (defaults to 240).
    CYBRMREQ_MaxHeight (IPTR) - Maximum acceptable display height.
        (defaults to 1200).
    CYBRMREQ_MinDepth (IPTR) - Minimum acceptable display depth
        (defaults to 8).
    CYBRMREQ_MaxDepth (IPTR) - Maximum acceptable display depth
        (defaults to 32).
    CYBRMREQ_CModelArray (UWORD *) - array of permitted pixel formats.
        Any of the PIXFMT_#? constants may be specified (see
        LockBitMapTagList()), and the array must be terminated by ~0.
        By default, all pixel formats are acceptable.

Inputs

requester - not used. Must be NULL.
tagItems - options for the requester that will be created (may be
    NULL).

Result

result - user-selected screenmode ID, or zero on failure or
    user-cancellation.

Bugs

This function is not implemented.

CVideoCtrlTagList()

Synopsis

void CVideoCtrlTagList(
         struct ViewPort * vp,
         struct TagItem  * tags );

void CVideoCtrlTags(
         struct ViewPort * vp,
         TAG tag, ... );

Function

Controls video output. It currently only allows adjustment of
power-saving modes, using the following tag:
    SETVC_DPMSLevel (IPTR) - one of the following DPMS levels:
        DPMS_ON - normal operation.
        DPMS_STANDBY - less than 80% power usage.
        DPMS_SUSPEND - less than 30W power usage.
        DPMS_OFF - less than 8W power usage.

Inputs

vp - a ViewPort belonging to the video output device to be controlled.
tags - a taglist containing video control options.

Result

None.

DoCDrawMethodTagList()

Synopsis

void DoCDrawMethodTagList(
         struct Hook     * hook,
         struct RastPort * rp,
         struct TagItem  * tags );

void DoCDrawMethodTags(
         struct Hook     * hook,
         struct RastPort * rp,
         TAG tag, ... );

Function

Calls a callback hook that directly accesses a RastPort's bitmap.

Inputs

hook - a callback hook. The standard hook inputs will be set as
    follows:
        object (struct RastPort *) - this function's 'rp' input.
        message (struct CDrawMsg *) - details of the area on which to
            operate.
rp - the RastPort to perform operations on.
tags - not used. Must be NULL.

Result

None.

ExtractColor()

Synopsis

ULONG ExtractColor(
         struct RastPort * RastPort,
         struct BitMap   * SingleMap,
         ULONG Colour,
         ULONG sX,
         ULONG sY,
         ULONG Width,
         ULONG Height );

Function

Create a single-plane bitmap that describes the coordinates where a
particular colour is present in a portion of a RastPort (i.e. a mask).
A one is stored in the bitmap where the requested colour is present,
and a zero where it is absent.

For true-colour RastPorts, the colour is specified in 32-bit ARGB
format: 1 byte per component, in the order alpha, red, green, blue
(the alpha byte is ignored for RastPorts without an alpha channel).
For paletted RastPorts, a pen number is given instead.

Inputs

RastPort - the RastPort to analyse.
SingleMap - a planar bitmap to fill (its pixel dimensions must be at
    least as big as the rectangle being analysed).
Colour - the colour to extract.
sX, sY - top-lefthand corner of portion of RastPort to analyse
    (in pixels).
Width, Height - size of the area to analyse (in pixels).

Result

result - Boolean success indicator.

Notes

It is safe for the bitmap being filled to have more than one bitplane.

FillPixelArray()

Synopsis

ULONG FillPixelArray(
         struct RastPort * rp,
         UWORD destx,
         UWORD desty,
         UWORD width,
         UWORD height,
         ULONG pixel );

Function

Writes the same color value to all pixels in a rectangular region of
a RastPort.

Inputs

rp - the RastPort to write to.
destx, desty - top-lefthand corner of portion of destination RastPort
    to write to (in pixels).
width, height - size of the affected area (in pixels).
pixel - the color value to use, in 32-bit ARGB format: 1 byte per
    component, in the order alpha, red, green, blue.

Result

count - the number of pixels filled.

FreeCModeList()

Synopsis

void FreeCModeList(
         struct List * modeList );

Function

Frees a list of RTG modes returned by AllocCModeListTagList().

Inputs

modeList - a list of RTG modes returned by AllocCModeListTagList().

GetCyberIDAttr()

Synopsis

ULONG GetCyberIDAttr(
         ULONG attribute,
         ULONG DisplayModeID );

Function

Provides information about a specific RTG screenmode.

Inputs

attribute - one of the following display attributes:
    CYBERIDATTR_PIXFMT - the display's pixel format. See
        LockBitMapTagList() for possible values.
    CYBERIDATTR_WIDTH - the display's width (in pixels).
    CYBERIDATTR_HEIGHT - the display's height (in pixels).
    CYBERIDATTR_DEPTH - the number of bits per pixel.
    CYBERIDATTR_BPPIX - the number of bytes per pixel.
DisplayModeID - an RTG screenmode ID.

Result

value - the value associated with the requested attribute.

Notes

If an unknown attribute is requested, -1 is returned.

GetCyberMapAttr()

Synopsis

IPTR GetCyberMapAttr(
         struct BitMap * bitMap,
         IPTR attribute );

Function

Provides information about an RTG bitmap. If you are unsure whether
the bitmap is an RTG one, you must retrieve and check
CYBRMATTR_ISCYBERGFX first, as all other attributes are only allowed
to be retrieved for RTG bitmaps.

Inputs

bitMap - an RTG bitmap.
attribute - one of the following bitmap attributes:
    CYBRMATTR_PIXFMT - the bitmap's pixel format. See
        LockBitMapTagList() for possible values.
    CYBRMATTR_WIDTH - the bitmap's width (in pixels).
    CYBRMATTR_HEIGHT - the bitmap's height (in pixels).
    CYBRMATTR_DEPTH - the number of bits per pixel.
    CYBRMATTR_BPPIX - the number of bytes per pixel.
    CYBRMATTR_XMOD - the number of bytes per row.
    CYBRMATTR_ISCYBERGFX - TRUE only if the bitmap is an RTG one.
    CYBRMATTR_ISLINEARMEM - TRUE only if the bitmap's display buffer
        is linear.
    CYBRMATTR_COLORMAP - the bitmap's color map.

Result

value - the value associated with the requested attribute.

Notes

If an unknown attribute is requested, -1 is returned.

Bugs

CYBRMATTR_COLORMAP is unimplemented.

InvertPixelArray()

Synopsis

ULONG InvertPixelArray(
         struct RastPort * rp,
         UWORD destx,
         UWORD desty,
         UWORD width,
         UWORD height );

Function

Inverts each pixel in rectangular portion of a RastPort, i.e. applies
a NOT operation to each bit of pixel data.

Inputs

rp - the RastPort to write to.
destx, desty - top-lefthand corner of portion of RastPort to invert.
width, height - size of the area to invert.

Result

count - the number of pixels inverted.

IsCyberModeID()

Synopsis

BOOL IsCyberModeID(
         ULONG modeID );

Function

Checks if the given display mode ID belongs to an RTG driver.

Inputs

modeID - a display mode ID to check.

Result

result - TRUE if the mode belongs to an RTG driver, FALSE otherwise.

LockBitMapTagList()

Synopsis

APTR LockBitMapTagList(
         APTR bitmap,
         struct TagItem * tags );

APTR LockBitMapTags(
         APTR bitmap,
         TAG tag, ... );

Function

Obtains exclusive access to a bitmap in preparation for direct access
to its pixel data. Direct access to a bitmap should only be done in
exceptional cases, and the locking period should be limited to at most
one frame.

A taglist is passed in that contains pointers to variables in which to
store the information necessary to directly access the bitmap. The
tags used are as follows:
    LBMI_WIDTH (ULONG *) - the bitmap's width.
    LBMI_HEIGHT (ULONG *) - the bitmap's height.
    LBMI_DEPTH (ULONG *) - the bitmap's depth.
    LBMI_PIXFMT (ULONG *) - the bitmap's pixel format.
    LBMI_BYTESPERPIX (ULONG *) - the number of bytes per pixel.
    LBMI_BYTESPERROW (ULONG *) - the number of bytes per row.
    LBMI_BASEADDRESS (APTR *) - the start address of the pixel data.

The value returned for LBMI_PIXFMT will be one of the following
constants:
        PIXFMT_RGB24 - 3 bytes per pixel: 1 byte per component, in
            the order red, green, blue.
        PIXFMT_RGBA32 - 4 bytes per pixel: 1 byte per component, in
            the order red, green, blue, alpha.
        PIXFMT_ARGB32 - 4 bytes per pixel: 1 byte per component, in
            the order alpha, red, green, blue.
        PIXFMT_LUT8 - 1 byte per pixel: each byte is a pen number
            rather than a direct colour value.
        PIXFMT_RGB15 - 2 bytes per pixel: one unused bit, then 5 bits
            per component, in the order red, green, blue.
        PIXFMT_BGR15 - 2 bytes per pixel: 1 unused bit, then 5 bits
            per component, in the order blue, green, red.
        PIXFMT_RGB15PC - 2 bytes per pixel, accessed as a little
            endian value: 1 unused bit, then 5 bits per component, in
            the order red, green, blue.
        PIXFMT_BGR15PC - 2 bytes per pixel, accessed as a little
            endian value: 1 unused bit, then 5 bits per component, in
            the order blue, green, red.
        PIXFMT_RGB16 - 2 bytes per pixel: 5 bits for red, then 6 bits
            for green, then 5 bits for blue.
        PIXFMT_BGR16 - 2 bytes per pixel: 5 bits for blue, then 6 bits
            for green, then 5 bits for red.
        PIXFMT_RGB16PC - 2 bytes per pixel, accessed as a little
            endian value: 5 bits for red, then 6 bits for green, then
            5 bits for blue.
        PIXFMT_BGR16PC - 2 bytes per pixel, accessed as a little
            endian value: 5 bits for blue, then 6 bits for green, then
            5 bits for red.
        PIXFMT_BGR24 - 3 bytes per pixel: 1 byte per component, in
            the order blue, green, red.
        PIXFMT_BGRA32 - 4 bytes per pixel: 1 byte per component, in
            the order blue, green, red, alpha.
        PIXFMT_ABGR32 - 4 bytes per pixel: 1 byte per component, in
            the order alpha, blue, green, red (AROS extension).
        PIXFMT_0RGB32 - 4 bytes per pixel: 1 unused byte, then 1 byte
            per component, in the order red, green, blue (AROS
            extension).
        PIXFMT_BGR032 - 4 bytes per pixel: 1 byte per component, in
            the order blue, green, red, followed by 1 unused byte
            (AROS extension).
        PIXFMT_RGB032 - 4 bytes per pixel: 1 byte per component, in
            the order red, green, blue, followed by 1 unused byte
            (AROS extension).
        PIXFMT_0BGR32 - 4 bytes per pixel: 1 unused byte, then 1 byte
            per component, in the order blue, green, red (AROS
            extension).

Inputs

bitmap - the bitmap to lock.
tags - a taglist that will be filled with information necessary to
    directly access the bitmap.

Result

handle - a handle to be passed to UnLockBitMap() or
    UnLockBitMapTagList(), or NULL for failure.

Notes

While the bitmap is locked, no cybergraphics.library or
graphics.library related functions should be called (except to unlock
it).

MovePixelArray()

Synopsis

ULONG MovePixelArray(
         UWORD SrcX,
         UWORD SrcY,
         struct RastPort * RastPort,
         UWORD DstX,
         UWORD DstY,
         UWORD SizeX,
         UWORD SizeY );

Function

Copies the pixels in a rectangular portion of a RastPort to another
rectangle with the same dimensions in the same RastPort.

Inputs

SrcX, SrcY - top-lefthand corner of source rectangle.
RastPort - the RastPort to modify.
DstX, DstY - top-lefthand corner of destination rectangle.
SizeX, SizeY - size of the rectangles (in pixels).

Result

count - the number of pixels moved.

ProcessPixelArray()

Synopsis

VOID ProcessPixelArray(
         struct RastPort * rp,
         ULONG destX,
         ULONG destY,
         ULONG sizeX,
         ULONG sizeY,
         ULONG operation,
         LONG value,
         struct TagItem * taglist );

VOID ProcessPixelArrayTags(
         struct RastPort * rp,
         ULONG destX,
         ULONG destY,
         ULONG sizeX,
         ULONG sizeY,
         ULONG operation,
         LONG value,
         TAG tag, ... );

Function

Applies one of a variety of transformations to a rectangular portion
of a RastPort.

Inputs

rp - the RastPort to process.
destX, destY - top-lefthand corner of portion of RastPort to process.
sizeX, sizeY - size of the affected area.
operation - one of the following transformation types:
    POP_TINT - tint the rectangle with an ARGB32 color ('value' input).
    POP_BLUR - blur the rectangle.
    POP_BRIGHTEN - brighten the rectangle. The amount of brightening
        to be done is defined by the 'value' input, which must be in
        the range 0 to 255.
    POP_DARKEN - darken the rectangle. The amount of darkening to be
        done is defined by the 'value' input, which must be in the
        range 0 to 255.
    POP_SETALPHA - set the alpha channel value for all pixels in the
        rectangle to that specified in the 'value' input. The valid
        range is 0 to 255.
    POP_GRADIENT - apply a gradient to the rectangle. Gradient
        parameters are supplied through the taglist.
value - see description of 'operation' input.
taglist - currently describes gradient parameters, as follows:
    PPAOPTAG_GRADIENTTYPE - GRADTYPE_HORIZONTAL or GRADTYPE_VERTICAL.
    PPAOPTAG_GRADCOLOR1 - The starting color of the gradient (ARGB32).
    PPAOPTAG_GRADCOLOR2 - The ending color of the gradient (ARGB32).
    PPAOPTAG_GRADFULLSCALE
    PPAOPTAG_GRADOFFSET

Result

count - the number of pixels processed.

Bugs

This function is not implemented.

ReadPixelArray()

Synopsis

ULONG ReadPixelArray(
         APTR dst,
         UWORD destx,
         UWORD desty,
         UWORD dstmod,
         struct RastPort * rp,
         UWORD srcx,
         UWORD srcy,
         UWORD width,
         UWORD height,
         UBYTE dstformat );

Function

Copies a rectangular portion of a RastPort to a block of raw pixel
values.

Inputs

dst - pointer to the pixel values.
destx, desty - top-lefthand corner of portion of destination rectangle
    to write to (in pixels).
dstmod - the number of bytes in each row of the destination rectangle.
rp - the RastPort to read.
srcx, srcy - top-lefthand corner of portion of source RastPort to
    read (in pixels).
width, height - size of the area to copy (in pixels).
dstformat - the format of the destination pixels. The following format
    types are supported:
        RECTFMT_RGB
        RECTFMT_RGBA
        RECTFMT_ARGB
        RECTFMT_RAW
        RECTFMT_RGB15
        RECTFMT_BGR15
        RECTFMT_RGB15PC
        RECTFMT_BGR15PC
        RECTFMT_RGB16
        RECTFMT_BGR16
        RECTFMT_RGB16PC
        RECTFMT_BGR16PC
        RECTFMT_RGB24
        RECTFMT_BGR24
        RECTFMT_0RGB32
        RECTFMT_BGR032
        RECTFMT_RGB032
        RECTFMT_0BGR32
        RECTFMT_ARGB32
        RECTFMT_BGRA32
        RECTFMT_RGBA32
        RECTFMT_ABGR32

Result

count - number of pixels read.

Notes

See WritePixelArray() for descriptions of pixel formats. Where a
RastPort does not support an alpha channel, destination alpha values
will be set to zero.

ReadRGBPixel()

Synopsis

ULONG ReadRGBPixel(
         struct RastPort * rp,
         UWORD x,
         UWORD y );

Function

Reads a particular pixel's color value from a RastPort.

Inputs

rp - the RastPort to read from.
x, y - the coordinates of the pixel to read.

Result

color - the pixel's color value in 32-bit ARGB format: 1 byte
    per component, in the order alpha, red, green, blue.

ScalePixelArray()

Synopsis

LONG ScalePixelArray(
         APTR srcRect,
         UWORD SrcW,
         UWORD SrcH,
         UWORD SrcMod,
         struct RastPort * RastPort,
         UWORD DestX,
         UWORD DestY,
         UWORD DestW,
         UWORD DestH,
         UBYTE SrcFormat );

Function

Fills all or part of a RastPort with a rectangular block of raw pixel
values. The source pixels are scaled to fit the destination area, i.e.
some pixels may be duplicated or dropped according to the need to
stretch or compress the source block.

Inputs

srcRect - pointer to the pixel values.
SrcW, SrcH - width and height of the source rectangle (in pixels).
SrcMod - the number of bytes in each row of the source rectangle.
RastPort - the RastPort to write to.
DestX, DestY - top-lefthand corner of portion of destination RastPort
    to write to (in pixels).
DestW, DestH - size of the destination rectangle (in pixels).
SrcFormat - the format of the source pixels. See WritePixelArray for
    possible values.

Result

count - the number of pixels written to.

UnLockBitMap()

Synopsis

void UnLockBitMap(
         APTR Handle );

Function

Releases exclusive access to a bitmap.

Inputs

Handle - handle to the bitmap to unlock.

Result

None.

UnLockBitMapTagList()

Synopsis

void UnLockBitMapTagList(
         APTR Handle,
         struct TagItem * Tags );

void UnLockBitMapTags(
         APTR Handle,
         TAG tag, ... );

Function

Releases exclusive access to a bitmap. Options for the unlocking
process are given in a taglist. The possible tags are as follows:
    UBMI_UPDATERECTS (struct RectList *) - pointer to a series of
        rectangle lists that need to be refreshed.
    UBMI_REALLYUNLOCK (BOOL) - if FALSE, the bitmap will not be
        unlocked; only rectangle updates will be done.

Inputs

Handle - handle to the bitmap to unlock.
Tags - a taglist as described above.

Result

None.

WriteLUTPixelArray()

Synopsis

LONG WriteLUTPixelArray(
         APTR srcRect,
         UWORD SrcX,
         UWORD SrcY,
         UWORD SrcMod,
         struct RastPort * rp,
         APTR CTable,
         UWORD DestX,
         UWORD DestY,
         UWORD SizeX,
         UWORD SizeY,
         UBYTE CTabFormat );

Function

Copies all or part of a rectangular block of raw pen values to a
RastPort. The pen values are converted to the RastPort's native pixel
values.

Inputs

srcRect - pointer to the pixel values.
SrcX, SrcY - top-lefthand corner of portion of source rectangle to
    copy (in pixels).
SrcMod - the number of bytes in each row of the source rectangle.
rp - the RastPort to write to.
CTable - the color table that maps the source pen values.
DestX, DestY - top-lefthand corner of portion of destination RastPort
    to write to (in pixels).
SizeX, SizeY - size of the area to copy (in pixels).
CTabFormat - format of the color table. Only one format type is
    currently supported:
        CTABFMT_XRGB8 - the colour table is an array of 256 ULONGs.
            Each entry begins with an unused byte, followed by 1 byte
            for each component, in the order red, green, blue.

Result

count - the number of pixels written to.

WritePixelArray()

Synopsis

ULONG WritePixelArray(
         APTR src,
         UWORD srcx,
         UWORD srcy,
         UWORD srcmod,
         struct RastPort * rp,
         UWORD destx,
         UWORD desty,
         UWORD width,
         UWORD height,
         UBYTE srcformat );

Function

Copies all or part of a rectangular block of raw pixel values to a
RastPort.

Inputs

srcRect - pointer to the pixel values.
srcx, srcy - top-lefthand corner of portion of source rectangle to
    copy (in pixels).
srcmod - the number of bytes in each row of the source rectangle.
rp - the RastPort to write to.
destx, desty - top-lefthand corner of portion of destination RastPort
    to write to (in pixels).
width, height - size of the area to copy (in pixels).
srcformat - the format of the source pixels. The following format
    types are supported:
        RECTFMT_RGB - 3 bytes per pixel: 1 byte per component, in
            the order red, green, blue.
        RECTFMT_RGBA - 4 bytes per pixel: 1 byte per component, in
            the order red, green, blue, alpha.
        RECTFMT_ARGB - 4 bytes per pixel: 1 byte per component, in
            the order alpha, red, green, blue.
        RECTFMT_LUT8 - 1 byte per pixel: each byte is a pen number
            rather than a direct colour value.
        RECTFMT_GREY8 - 1 byte per pixel: each byte is a greyscale
            value.
        RECTFMT_RAW - the same pixel format as the destination
            RastPort.
        RECTFMT_RGB15 - 2 bytes per pixel: one unused bit, then 5 bits
            per component, in the order red, green, blue (AROS
            extension).
        RECTFMT_BGR15 - 2 bytes per pixel: 1 unused bit, then 5 bits
            per component, in the order blue, green, red (AROS
            extension).
        RECTFMT_RGB15PC - 2 bytes per pixel, accessed as a little
            endian value: 1 unused bit, then 5 bits per component, in
            the order red, green, blue (AROS extension).
        RECTFMT_BGR15PC - 2 bytes per pixel, accessed as a little
            endian value: 1 unused bit, then 5 bits per component, in
            the order blue, green, red (AROS extension).
        RECTFMT_RGB16 - 2 bytes per pixel: 5 bits for red, then 6 bits
            for green, then 5 bits for blue (AROS extension).
        RECTFMT_BGR16 - 2 bytes per pixel: 5 bits for blue, then 6 bits
            for green, then 5 bits for red (AROS extension).
        RECTFMT_RGB16PC - 2 bytes per pixel, accessed as a little
            endian value: 5 bits for red, then 6 bits for green, then
            5 bits for blue (AROS extension).
        RECTFMT_BGR16PC - 2 bytes per pixel, accessed as a little
            endian value: 5 bits for blue, then 6 bits for green, then
            5 bits for red (AROS extension).
        RECTFMT_RGB24 - the same as RECTFMT_RGB (AROS extension).
        RECTFMT_BGR24 - 3 bytes per pixel: 1 byte per component, in
            the order blue, green, red (AROS extension).
        RECTFMT_ARGB32 - the same as RECTFMT_ARGB (AROS extension).
        RECTFMT_BGRA32 - 4 bytes per pixel: 1 byte per component, in
            the order blue, green, red, alpha (AROS extension).
        RECTFMT_RGBA32 - the same as RECTFMT_RGBA (AROS extension).
        RECTFMT_ABGR32 - 4 bytes per pixel: 1 byte per component, in
            the order alpha, blue, green, red (AROS extension).
        RECTFMT_0RGB32 - 4 bytes per pixel: 1 unused byte, then 1 byte
            per component, in the order red, green, blue (AROS
            extension).
        RECTFMT_BGR032 - 4 bytes per pixel: 1 byte per component, in
            the order blue, green, red, followed by 1 unused byte
            (AROS extension).
        RECTFMT_RGB032 - 4 bytes per pixel: 1 byte per component, in
            the order red, green, blue, followed by 1 unused byte
            (AROS extension).
        RECTFMT_0BGR32 - 4 bytes per pixel: 1 unused byte, then 1 byte
            per component, in the order blue, green, red (AROS
            extension).

Result

count - the number of pixels written to.

Notes

Because of the X11 driver you have to set the drawmode
to JAM1 with SetDrMd().

WritePixelArrayAlpha()

Synopsis

ULONG WritePixelArrayAlpha(
         APTR src,
         UWORD srcx,
         UWORD srcy,
         UWORD srcmod,
         struct RastPort * rp,
         UWORD destx,
         UWORD desty,
         UWORD width,
         UWORD height,
         ULONG globalalpha );

Function

Alpha-blends all or part of a rectangular block of raw pixel values
into a RastPort. The source data must be in 32-bit ARGB format: 1 byte
per component, in the order alpha, red, green, blue.

Inputs

srcRect - pointer to the pixel values.
srcx, srcy - top-lefthand corner of portion of source rectangle to
    use (in pixels).
srcmod - the number of bytes in each row of the source rectangle.
rp - the RastPort to write to.
destx, desty - top-lefthand corner of portion of destination RastPort
    to write to (in pixels).
width, height - size of the affected area (in pixels).
globalalpha - an alpha value applied globally to every pixel taken
    from the source rectangle (the full 32-bit range of values is
    used: 0 to 0xFFFFFFFF).

Result

count - the number of pixels written to.

Notes

Because of the X11 driver you have to set the drawmode
to JAM1 with SetDrMd().

Bugs

The globalalpha parameter is currently ignored.

WriteRGBPixel()

Synopsis

LONG WriteRGBPixel(
         struct RastPort * rp,
         UWORD x,
         UWORD y,
         ULONG pixel );

Function

Writes a new color value to a pixel in a RastPort.

Inputs

rp - the RastPort to write to.
x, y - the coordinates of the pixel to write.
pixel - the pixel's new color value in 32-bit ARGB format: 1 byte
    per component, in the order alpha, red, green, blue.

Result

error - 0 if no error occurred, or -1 if (x, y) is outside the
    RastPort.

Direitos de Cópia © 1995-2024, A Equipa de Desenvolvimento AROS. Todos Os Direitos Reservados.
Amiga®, AmigaOS®, Workbench e Intuition são marcas registadas de Amiga Inc. Todas as outras marcas comerciais pertencem aos seus respectivos proprietários.