graphics
Index
void AddAnimOb(
struct AnimOb * anOb,
struct AnimOb ** anKey,
struct RastPort * rp );
Link the AnimOb into the list pointed to by AnimKey.
Calls AddBob with all components of a Bob and initializes
all the timers of the components of this AnimOb.
You have to provide a valid GelsInfo structure that is linked
to the RastPort (InitGels())
anOb = pointer to AnimOb structure to be added to list of
AnimObs
anKey = address of a pointer to the first AnimOb in the list
(when first calling this function the content of
this address has to be NULL!)
rp = pointer to a valid RastPort with initialized GelsInfo
structure
void AddBob(
struct Bob * bob,
struct RastPort * rp );
The Bob is linked into the current gel list via AddVSprite.
The Bob's flags are set up.
Bob = pointer to Bob to be added to gel list
rp = pointer to RastPort that has an initilized GelsInfo linked
to it (see InitGels()).
ULONG AddDisplayDriverA(
APTR gfxclass,
const struct TagItem * attrs,
const struct TagItem * tags );
ULONG AddDisplayDriver(
APTR gfxclass,
const struct TagItem * attrs,
TAG tag, ... );
Add a display driver to the system.
gfxhidd - A pointer to an OOP class of the display driver
attrs - Additional attributes to supply to the driver class during
object creation
tags - An optional TagList describing how graphics.library should
handle the driver. Valid tags are:
DDRV_BootMode - A boolean value telling that a boot mode
driver is being added. Boot mode drivers
will automatically shut down on next
AddDisplayDriverA() call, unless
DDRV_KeepBootMode = TRUE is specified.
Defaults to FALSE.
DDRV_MonitorID - Starting monitor ID to assign to the driver.
Use it with care. An attempt to add already
existing ID will fail with a DD_ID_EXISTS
code. By default the next available ID will
be picked up automatically.
DDRV_ReserveIDs - The number of subsequent monitor IDs to
reserve. Reserved IDs can be reused only
with DDRV_MonitorID tag. This tag is
provided as an aid to support possible
removable display devices. Defaults to 1.
DDRV_KeepBootMode - Do not shut down boot mode drivers. Use this
tag if you are 100% sure that your driver
won't conflict with boot mode driver (like
VGA or VESA) and won't attempt to take over
its hardware. Defaults to FALSE.
DDRV_ResultID - A pointer to a ULONG location where the ID
assigned to your driver will be placed.
Useful if you reserve some ID for future use.
Note that the returned ID will be the one
just assigned to your driver instance.
Increment it yourself in order to obtain
other reserved IDs.
DDRV_IDMask - A mask for separating the monitor ID from the
HIDD-specific part. This mask specifies what
mode ID bits are the monitor ID and what bits
actually specify the mode. The default value
is 0xFFFF0000.
Using the mask you can split your monitor ID
into 'sub-Ids'. Example:
Supplied tags: DDRV_IDMask, 0xFFFFFF00,
DDRV_ResultID, &myid
After a successful call, myid will contain the
base ID assigned by graphics.library to your
driver, let's say 0x00140000. However, since
you specified a longer mask, you leave only
one byte for mode designation, and reserve
the whole range of IDs from 0x001400xx to
0x0014FFxx for different instances of your
driver. They can now be used by specifying
DDRV_MonitorID with corresponding value.
Note that for this feature to work correctly,
you also need to override ID processing in
your driver class. Default methods provided
by the hidd.graphics.graphics base class
suppose that the whole lower word of the mode
ID specifies the display mode.
It is generally not allowed to specify
shorter masks than 0xFFFF0000. The only
driver which can do this is the Amiga(TM)
chipset driver, which needs to occupy the
reserved range of IDs from 0x0000xxxx to
0x000Axxxx. In any other case, supplying a
short mask will cause undefined behavior.
Since DDRV_ReserveIDs provides a simpler way
to reserve IDs for your driver (without the
need to override mode ID processing), this
option can be considered experimental and
even private. In fact the primary reason for
it to exist is to provide support for
Amiga(tm) chipset driver.
error - One of following codes:
DD_OK - Operation completed OK.
DD_NO_MEM - There is not enough memory to set up internal
data.
DD_ID_EXISTS - Attempt to assign monitor IDs that are already
used.
DD_IN_USE - One of boot-mode drivers is in use and cannot
be shut down.
DD_DRIVER_ERROR - Failure to create driver object.
This function is AROS-specific.
void AddFont(
struct TextFont * textFont );
Add a font to the list of public fonts. After that, you can
open the font with OpenFont().
textFont - The font to add.
void AddVSprite(
struct VSprite * vs,
struct RastPort * rp );
The VSprite is linked into the current gel list using it's
y and x coordinates. The VSprite's flags are set up.
vs = pointer to VSprite to be linked into gel list
rp = pointer to RastPort that has an initialized GelsInfo linked
to it (see InitGels()).
struct BitMap * AllocBitMap(
UWORD sizex,
UWORD sizey,
ULONG depth,
ULONG flags,
struct BitMap * friend_bitmap );
Allocates and initializes a bitmap structure. Allocates and
initializes bitplane data, and sets the bitmap's planes to point to
it.
sizex, sizey - The width and height in pixels
depth - The depth of the bitmap. A depth of 1 will allocate a
bitmap for two colors, a depth of 24 will allocate a bitmap for
16 million colors. Pixels with AT LEAST this many bits will be
allocated.
flags - One of these flags:
BMF_CLEAR: Fill the bitmap with color 0.
BMF_DISPLAYABLE: to specify that this bitmap data should
be allocated in such a manner that it can be displayed.
Displayable data has more severe alignment restrictions
than non-displayable data in some systems.
Note that it may be not enough to specify only this flag
to make the bitmap really displayable. See "INTERNALS"
section below.
BMF_INTERLEAVED: tells graphics that you would like your
bitmap to be allocated with one large chunk of display
memory for all bitplanes. This minimizes color flashing on
deep displays. If there is not enough contiguous RAM for an
interleaved bitmap, graphics.library will fall back to a
non-interleaved one.
BMF_MINPLANES: causes graphics to only allocate enough
space in the bitmap structure for "depth" plane pointers.
This is for system use and should not be used by
applications use as it is inefficient, and may waste
memory.
BMF_SPECIALFMT: causes graphics to allocate a bitmap
of a standard CyberGraphX format. The format
(PIXFMT_????) must be stored in the 8 most significant bits.
BMF_RTGTAGS,
BMF_RTGCHECK,
BMF_FRIENDSTAG: Setting these flags to 1's while BMF_SPECIALFMT
and BMF_INVALID are set to 0 means that friend_bitmap
points to a taglist instead of BitMap structure.
friend_bitmap - pointer to another bitmap, or NULL. If this pointer
is passed, then the bitmap data will be allocated in
the most efficient form for blitting to friend_bitmap.
This pointer can also point to a TagList, if specified by flags.
In this case it may contain the following tags:
- BMATags_Friend (struct BitMap *)
An actual pointer to friend bitmap. Defaults to NULL.
- BMATags_Depth (ULONG)
Depth of the bitmap to create. Defaults to depth argument
of AllocBitMap().
- BMATags_Clear (BOOL)
Tells if the newly created bitmap should be explicitly
cleared. Defaults to the value of BMF_CLEAR flag in
AllocBitMap() arguments.
- BMATags_Displayable (BOOL)
Tells if the bitmap should be displayable by the hardware.
Defaults to the value of BMF_DISPLAYABLE flag in AllocBitMap()
arguments.
- BMATags_NoMemory (BOOL)
Tells AllocBitMap() not to allocate actual bitmap storage. Only
header is allocated and set up. Default value is FALSE.
- BMATags_DisplayID (ULONG)
Allocate a displayable bitmap for specified display mode.
A pointer to the new bitmap.
When allocating using a friend_bitmap bitmap, it is not safe to assume
anything about the structure of the bitmap data if that friend_bitmap
BitMap might not be a standard Amiga bitmap (for instance, if the
workbench is running on a non-Amiga display device, its
Screen->RastPort->BitMap won't be in standard Amiga format. The
only safe operations to perform on a non-standard BitMap are:
blitting it to another bitmap, which must be either a
standard Amiga bitmap, or a friend_bitmap of this bitmap.
blitting from this bitmap to a friend_bitmap bitmap or to a
standard Amiga bitmap.
attaching it to a rastport and making rendering calls.
Good arguments to pass for the friend_bitmap are your window's
RPort->BitMap, and your screen's RastPort->BitMap. Do NOT pass
&(screenptr->BitMap)!
BitMaps not allocated with BMF_DISPLAYABLE may not be used as
Intuition Custom BitMaps or as RasInfo->BitMaps. They may be
blitted to a BMF_DISPLAYABLE BitMap, using one of the BltBitMap()
family of functions.
When allocating a displayable bitmap, make sure that its size is
within limits allowed by the display driver. Use GetDisplayInfoData()
with DTAG_DIMS in order to obtain the needed information.
struct DBufInfo * AllocDBufInfo(
struct ViewPort * vp );
Allocates a double buffering structure used by ChangeVPBitMap().
vp - pointer to a ViewPort
RESULTS
Returns NULL if there wasn't enough memory (or if the viewport doesn't
support double buffering).
PLANEPTR AllocRaster(
UWORD width,
UWORD height );
Allocates memory for a single bitplane with the specified size in
pixels.
width, height - The size of the resulting bitplane in pixels.
A pointer to the single bitplane.
You should not use this function to create BitMaps. Call
AllocBitMap() instead.
struct ExtSprite * AllocSpriteDataA(
struct BitMap * bitmap,
struct TagItem * tagList );
struct ExtSprite * AllocSpriteData(
struct BitMap * bitmap,
TAG tag, ... );
bitmap - pointer to a bitmap. This bitmap provides the source data
for the sprite image
tags - pointer to a taglist
SPRITEA_Width (ULONG) - Width of the sprite. If bitmap is smaller it will
be filled on the right side with transparent
pixels. Defaults to 16.
SPRITEA_XReplication (LONG) - 0 - perform a 1 to 1 conversion
1 - each pixel from the source is replicated twice
2 - each pixel is replicated 4 times.
-1 - skip every 2nc pixel in the source bitmap
-2 - only include every fourth pixel from the source.
SPRITEA_YReplication (LONG) - like SPRITEA_YReplication, but for vertical direction.
SPRITEA_OutputHeight (ULONG) - Output height of the sprite. Must be at least as high
as the bitmap. Defaults to bitmap height.
SPRITEA_Attach - (Not implemented)
SpritePtr - pointer to a ExtSprite structure,
or NULL if there is a failure.
You should pass this pointer to FreeSpriteData()
when this sprite is not needed anymore.
void AndRectRegion(
struct Region * Reg,
struct Rectangle * Rect );
Remove everything inside 'region' that is outside 'rectangle'
region - pointer to Region structure
rectangle - pointer to Rectangle structure
This is the only *RectRegion function that cannot fail
struct Region * AndRectRegionND(
struct Region * Reg,
struct Rectangle * Rect );
Remove everything inside 'region' that is outside 'rectangle'
region - pointer to Region structure
rectangle - pointer to Rectangle structure
The resulting region or NULL in case there's no enough free memory
BOOL AndRegionRegion(
struct Region * R1,
struct Region * R2 );
AND of one region with another region, leaving result in
second region.
region1 - pointer to a region structure
region2 - pointer to a region structure
TRUE if the operation was successful, else FALSE
(out of memory)
struct Region * AndRegionRegionND(
struct Region * R1,
struct Region * R2 );
AND of one region with another region
region1 - pointer to a region structure
region2 - pointer to a region structure
The resulting region or NULL in case there's no enough free memory
void Animate(
struct AnimOb ** anKey,
struct RastPort * rp );
Animate every AnimOb in the list. In particular do the following:
- update location and velocities
- call AnimOb's special routine if supplied
- for every component of the Anim ob do:
- switch to new sequence if current sequence times out
- call the special routine of the component if supplied
- set the the coordinates of the VSprite of this
sequence to whatever these routines cause
INPUT
anKey = address of a pointer to the first AnimOb in the list
(same address that was passed to AddAnimOb!)
rp = pointer to a valid RastPort structure
AreaCircle(
rp,
cx,
cy,
r );
Calls AreaEllipse with "a" and "b" set to "r".
ULONG AreaDraw(
struct RastPort * rp,
WORD x,
WORD y );
Add a point to the vector buffer.
rp - pointer to a valid RastPort structure with a pointer to
the previously initialized AreaInfo structure.
x - x-coordinate of the point in the raster
y - y-coordinate of the point in the raster
error - 0 for success
-1 if the vector collection matrix is full
ULONG AreaEllipse(
struct RastPort * rp,
WORD cx,
WORD cy,
WORD a,
WORD b );
Add an ellipse to the vector buffer. An ellipse takes up two
entries in the buffer.
rp - pointer to a valid RastPort structure with a pointer to
the previously initialized AreaInfo structure.
cx - x coordinate of the center point relative to rastport
cy - y coordinate of the center point relative to rastport
a - horizontal radius of the ellipse (> 0)
b - vertical radius of the ellipse (> 0)
error - 0 for success
-1 if the vector collection matrix is full
LONG AreaEnd(
struct RastPort * rp );
Process the filled vector buffer.
After the operation the buffer is reinitialized for
processing of further Area functions.
Makes use of the raster given by the TmpRas structure that
is linked to the rastport.
rp - pointer to a valid RastPort structure with a pointer to
the previously initialized AreaInfo structure.
error - 0 for success
-1 a error occurred
There is still a problem when some polygons are filled that
pixels are missing. This could be due to the way lines are
drawn. All lines should be drawn from lower
y coordinates to higher y coordinates since this is the
way the algorithm calculates lines here. For example, it
might make a difference whether a line is drawn from lower
to higher y coordinates. Examples for two same lines with
different layout:
**** *****
***** ****
ULONG AreaMove(
struct RastPort * rp,
WORD x,
WORD y );
Define a new starting point in the vector list for the following
polygon defined by calls to AreaDraw(). The last polygon is closed
if it wasn't closed by the user and the new starting points are
added to the vector collection matrix.
rp - pointer to a valid RastPort structure with a pointer to
the previously initialized AreaInfo structure.
x - x-coordinate of the starting-point in the raster
y - y-coordinate of the starting-point in the raster
error - 0 for success
-1 if the vector collection matrix is full
BOOL AreRegionsEqual(
struct Region * R1,
struct Region * R2 );
region1 - pointer to a region structure
region2 - pointer to a region structure
TRUE if the regions are equal, FALSE otherwise.
void AskFont(
struct RastPort * rp,
struct TextAttr * textAttr );
Query the attributes of the current font in a RastPort.
rp - Query this RastPort.
textAttr will contain a description of the font.
ULONG AskSoftStyle(
struct RastPort * rp );
Query algorithmically generated style attributes. These are the bits
valid to set via SetSoftStyle().
pr -- pointer to rastport
Algorithmically generated style bits (bits not defined are also set).
LONG AttachPalExtra(
struct ColorMap * cm,
struct ViewPort * vp );
Allocates a PalExtra structure and attaches it to the
given ColorMap. This function must be called prior to palette
sharing. The PalExtra structure will be freed by FreeColorMap().
cm - Pointer to a color map structure
vp - Pointer to the viewport associated with the ColorMap
0 - success
1 - out of memory
BOOL AttemptLockLayerRom(
struct Layer * l );
Try to lock the current layer. If it is already locked this
function will return FALSE, TRUE otherwise.
If the layer could be locked successfully nesting will take place
which means that for every successful locking of a layer
UnlockLayerRom() has to be called for that layer to let other
tasks access that layer.
TRUE - layer is successfully locked for the task
FALSE - layer could not be locked, it's locked by another task.
ULONG BestModeIDA(
struct TagItem * TagItems );
ULONG BestModeID(
TAG tag, ... );
TagItems - pointer to an array of TagItems
BIDTAG_ViewPort (struct ViewPort *) - Viewport for which a mode is searched. Default: NULL
BIDTAG_MonitorID (ULONG) - Returned ID must use this monitor
BIDTAG_SourceID (ULONG) - Use this ModeID instead of a ViewPort.
DIPFMustHave mask is made up of the
((DisplayInfo->PropertyFlags of this ID & SPECIAL_FLAGS) |
DIPFMustHave flags).
Default:
if BIDTAG_ViewPort was passed: VPModeID(vp), else the
DIPFMustHave and DIPFMustNotHave are unchanged.
BIDTAG_Depth (UBYTE) - Minimal depth. Default:
if BIDTAG_ViewPort is passed: vp->RasInfo->BitMap->Depth,
else 1.
BIDTAG_NominalWidth (UWORD),
BIDTAG_NominalHeight (UWORD) - Aspect ratio. Default:
if BIDTAG_SourceID: SourceID NominalDimensionInfo
if BIDTAG_ViewPort: vp->DWidth and vp->DHeight
or 640 x 200.
BIDTAG_DesiredWidth (UWORD) - Width. Default: DIBTAG_NominalWidth.
BIDTAG_DesiredHeight (UWORD) - Height. Default: BIDTAG_NominalHeight.
BIDTAG_RedBits (UBYTE),
BIDTAG_GreenBits (UBYTE),
BIDTAG_BlueBits (UBYTE) - Bits per gun the mode must support. Default: 4
BIDTAG_DIPFMustHave (ULONG) - DIPF flags the resulting mode must have
BIDTAG_DIPFMustNotHave (ULONG) - DIPF flags the resulting mode must not have
ID - ID of the best mode to use, or INVALID_ID if a match
could not be found
void BitMapScale(
struct BitScaleArgs * bitScaleArgs );
Scale a source bit map to a destination bit map other than
the source bit map.
Pass a BitScaleArgs structure filled with the following arguments
to this function:
bsa_SrcX, bsa_SrcY - upper left coordinate in source bitmap
bsa_SrcWidth, bsa_SrcHeight - Width and Height of source bitmap
bsa_DestX, bsa_DestY - upper left coordinate in destination
bitmap
bsa_DestWidth, bsa_DestHeight - this function will set these
values. Use the bsa_???Factor for scaling
bsa_XSrcFactor:bsa_XDestFactor - Set these to get approximately
the same ratio as bsa_SrcWidth:bsa_DestWidth, but
usually not exactly the same number.
bsa_YSrcFactor:bsa_YDestFactor - Set these to get approximately
the same ratio as bsa_SrcHeight:DestHeight, but
usually not exactly the same number.
bsa_SrcBitMap - pointer to source bitmap to be scaled
bsa_DestBitMap - pointer to destination bitmap which will
hold the scaled bitmap. Make sure it's
big enough!
bsa_Flags - reserved for future use. Set it to zero!
bsa_XDDA, bsa_YDDA - for future use.
bsa_Reserved1, bsa_Reserved2 - for future use.
bsa_DestWidth and bsa_DestHeight will be set by this function
- Overlapping source and destination bitmaps are not supported
- Make sure that you provide enough memory for the destination
bitmap to hold the result
- In the destination bitmap only the area where the scaled
source bitmap is put into is changed. A frame of the old
bitmap is left.
LONG BltBitMap(
struct BitMap * srcBitMap,
LONG xSrc,
LONG ySrc,
struct BitMap * destBitMap,
LONG xDest,
LONG yDest,
LONG xSize,
LONG ySize,
ULONG minterm,
ULONG mask,
PLANEPTR tempA );
Moves a part of a bitmap around or into another bitmap.
srcBitMap - Copy from this bitmap.
xSrc, ySrc - This is the upper left corner of the area to copy.
destBitMap - Copy to this bitmap. May be the same as srcBitMap.
xDest, yDest - Upper left corner where to place the copy
xSize, ySize - The size of the area to copy
minterm - How to copy. Most useful values are 0x00C0 for a vanilla
copy, 0x0030 to invert the source and then copy or 0x0050
to ignore the source and just invert the destination. If
you want to calculate other values, then you must know that
channel A is set, if you are inside the rectangle, channel
B is the source and channel C is the destination of the
rectangle.
Bit ABC
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
So 0x00C0 means: D is set if one is inside the rectangle
(A is set) and B (the source) is set and cleared otherwise.
To fill the rectangle, you would want to set D when A is
set, so the value is 0x00F0.
mask - Which planes should be copied. Typically, you should set
this to ~0L.
tempA - If the copy overlaps exactly to the left or right (i.e. the
scan line addresses overlap), and tempA is non-zero, it
points to enough chip accessible memory to hold a line of a
source for the blit (i.e. CHIP RAM). BltBitMap will allocate
(and free) the needed TempA if none is provided and one is
needed. Blit overlap is determined from the relation of
the first non-masked planes in the source and destination
bit maps.
The number of planes actually involved in the blit.
If a special hardware is available, this function will use it.
As a special case, plane pointers of destBitMap can contain NULL
or -1, which will act as if the plane was filled with 0's or 1's,
respectively.
void BltBitMapRastPort(
struct BitMap * srcBitMap,
WORD xSrc,
WORD ySrc,
struct RastPort * destRP,
WORD xDest,
WORD yDest,
WORD xSize,
WORD ySize,
ULONG minterm );
Moves part of a bitmap around or into another bitmap.
void BltClear(
void * memBlock,
ULONG bytecount,
ULONG flags );
Use the blitter for clearing a block of Chip-Ram.
memBlock - pointer to beginning of memory to be cleared
flags - set bit 0 to force function to wait until
the blitter - if used - is done
set bit 1 for row/bytesperrow - mode
bytecount - if bit 1 is set to 1: bytecount contains an even number
of bytes to clear
if bit 1 is set to 0: low 16 bits are taken as number of
bytes per row and upper 16 bits
are taken as number of rows.
A cleared block of Chip-Ram.
THIS FUNCTION IS DEPRECATED except if you want to simply clear
some memory.
void BltMaskBitMapRastPort(
struct BitMap * srcBitMap,
WORD xSrc,
WORD ySrc,
struct RastPort * destRP,
WORD xDest,
WORD yDest,
WORD xSize,
WORD ySize,
ULONG minterm,
PLANEPTR bltMask );
Copies a part of a bitmap to another bitmap with using a mask.
void BltPattern(
struct RastPort * rp,
PLANEPTR mask,
WORD xMin,
WORD yMin,
WORD xMax,
WORD yMax,
ULONG byteCnt );
Blit using drawmode, areafill pattern and mask.
rp - destination RastPort for blit.
mask - Mask bitplane. Set this to NULL for a rectangle.
xMin, yMin - upper left corner.
xMax, yMax - lower right corner.
byteCnt - BytesPerRow for mask.
void BltTemplate(
PLANEPTR source,
WORD xSrc,
WORD srcMod,
struct RastPort * destRP,
WORD xDest,
WORD yDest,
WORD xSize,
WORD ySize );
Draws part of a single-bitplane image into the RastPort in the current
colors (foreground and background) and drawing mode.
source - pointer to the aligned UWORD in which the top-lefthand corner
of the template is located.
xSrc - bit offset of top-lefthand corner of template from start of
UWORD pointed to by 'source' input (0 to 15).
srcMod - number of bytes per row in template's bitplane.
destRP - destination RastPort.
xDest,yDest - upper left corner of destination.
xSize,ySize - size of destination.
The size and destination coordinates may be outside the RastPort
boundaries, in which case the affected area is safely truncated.
UWORD CalcIVG(
struct View * View,
struct ViewPort * ViewPort );
Calculate the number of blank lines above a ViewPort.
View - pointer to the View
ViewPort - pointer to the ViewPort you are interested in
count - the number of ViewPort resolution scan lines needed
to execute all the copper instructions for ViewPort,
or 0 if any error
This function is unimplemented.
void CBump(
struct UCopList * ucl );
Increment user copper list pointer. If the current user copper list
is full a new one will be created and worked on.
ucl - pointer to a UCopList structure
CWAIT() and CMOVE() automatically call this function!
LONG ChangeExtSpriteA(
struct ViewPort * vp,
struct ExtSprite * oldsprite,
struct ExtSprite * newsprite,
struct TagItem * tags );
LONG ChangeExtSprite(
struct ViewPort * vp,
struct ExtSprite * oldsprite,
struct ExtSprite * newsprite,
TAG tag, ... );
vp - pointer to ViewPort structure that this sprite is
relative to, or NULL if relative only top of View
oldsprite - pointer to the old ExtSprite structure
newsprite - pointer to the new ExtSprite structure
tags - pointer to taglist
success - 0 if there was an error
void ChangeSprite(
struct ViewPort * vp,
struct SimpleSprite * s,
void * newdata );
This function is unimplemented.
void ChangeVPBitMap(
struct ViewPort * vp,
struct BitMap * bm,
struct DBufInfo * db );
vp - pointer to a viewport
bm - pointer to a BitMap structure. This BitMap structure must be of
the same layout as the one attached to the viewport
(same depth, alignment and BytesPerRow)
db - pointer to a DBufInfo
void ClearEOL(
struct RastPort * rp );
Clear a rectangular area from the current position to the end of the
rastport, the height of which is the height of the current text font.
pr -- pointer to rastport
BOOL ClearRectRegion(
struct Region * Reg,
struct Rectangle * Rect );
Clear the given Rectangle from the given Region
region - pointer to a Region structure
rectangle - pointer to a Rectangle structure
FALSE if not enough memory was available, else TRUE
struct Region * ClearRectRegionND(
struct Region * Reg,
struct Rectangle * Rect );
Clear the given Rectangle from the given Region
region - pointer to Region structure
rectangle - pointer to Rectangle structure
The resulting region or NULL in case there's no enough free memory
void ClearRegion(
struct Region * region );
Removes all rectangles in the specified region.
region - pointer to the region structure
BOOL ClearRegionRegion(
struct Region * R1,
struct Region * R2 );
Clear the given Region region1 from the given Region region2
leaving the result in region2.
region1 - pointer to a Region structure
region2 - pointer to a Rectangle structure
FALSE if not enough memory was available, else TRUE
This function does not exist in AmigaOS.
struct Region * ClearRegionRegionND(
struct Region * R1,
struct Region * R2 );
Clear the given Region region1 from the given Region region2.
region1 - pointer to a region structure
region2 - pointer to a region structure
The resulting region or NULL in case there's no enough free memory
void ClearScreen(
struct RastPort * rp );
Clear from the current position to the end of the rastport. Clearing
means setting the colour to 0 (or to BgPen if the drawmode is JAM2).
This includes a ClearEOL().
rp -- pointer to rastport
void ClipBlit(
struct RastPort * srcRP,
WORD xSrc,
WORD ySrc,
struct RastPort * destRP,
WORD xDest,
WORD yDest,
WORD xSize,
WORD ySize,
UBYTE minterm );
Copies the contents of one rastport to another rastport.
Takes care of layered and non-layered source and destination
rastports.
If you have a window you should always use this function instead
of BltBitMap().
srcRP - Copy from this RastPort.
xSrc, ySrc - This is the upper left corner of the area to copy.
destRP - Copy to this RastPort.
xDest, yDest - Upper left corner where to place the copy
xSize, ySize - The size of the area to copy
minterm - How to copy. Most useful values are 0x00C0 for a vanilla
copy, 0x0030 to invert the source and then copy or 0x0050
to ignore the source and just invert the destination. If
you want to calculate other values, then you must know that
channel A is set, if you are inside the rectangle, channel
B is the source and channel C is the destination of the
rectangle.
Bit ABC
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
So 0x00C0 means: D is set if one is inside the rectangle
(A is set) and B (the source) is set and cleared otherwise.
To fill the rectangle, you would want to set D when A is
set, so the value is 0x00F0.
void CloseFont(
struct TextFont * textFont );
font - font pointer from OpenFont() or OpenDiskFont()
LONG CloseMonitor(
struct MonitorSpec * monitor_spec );
monitor_spec - pointer to a MonitorSpec opened via OpenMonitor(),
or NULL
error - FALSE if MonitorSpec closed uneventfully
TRUE if MonitorSpec could not be closed
void CMove(
struct UCopList * ucl,
void * reg,
WORD value );
Add a copper move instruction to the given user copper list.
The copper is told to move a value to register reg.
If you are using CMOVE() a call to CMove() and CBump() will
be made.
ucl - pointer to a UCopList structure
reg - hardware register
value - 16 bit value to be moved to the hardware register
ULONG CoerceMode(
struct ViewPort * RealViewPort,
ULONG MonitorID,
ULONG Flags );
Determine the best mode in the MonitorID to coerce RealViewPort to.
RealViewPort - ViewPort to coerce
MonitorID - Monitor number to coerce to
(i.e. a mode masked with MONITOR_ID_MASK)
Flags - PRESERVE_COLORS - keep the number of bitplanes
in the ViewPort
AVOID_FLICKER - do not coerce to an interlace mode
ID - ID of best mode to coerce to, or INVALID_ID if could not coerce
This function is unimplemented.
void CopySBitMap(
struct Layer * l );
If the layer has a superbitmap all the parts that are visible will
be refreshed with what is in the superbitmap. This function should
be called after the SuperBitMap of the layer was synchronized with
SyncSBitMap() and manipulated.
l - pointer to superbitmapped layer
The layer will show the true contents of the superbitmap that is
attached to it
void CWait(
struct UCopList * ucl,
WORD v,
WORD h );
Add a copper wait instruction to the given user copper list.
The copper is told to wait for a vertical beam position v and
a horizontal beam position h.
If you are using CWAIT() a call to CWait() and CBump() will
be made.
ucl - pointer to a UCopList structure
v - vertical beam position (relative to top of viewport)
h - horizontal beam position
It's illegal to wait for horizontal values greater than 222 decimal!
The blitter is returned to usage by other tasks.
void DisposeRegion(
struct Region * region );
Frees all memory allocated by this region, including its
RegionRectangles.
region - pointer to a Region structure
void DoCollision(
struct RastPort * rp );
Tests each gel in gel list for boundary and gel-to-gel collisions.
If a collision happens the collision handling routine is called.
The gel list must be sorted by y,x order.
void Draw(
struct RastPort * rp,
WORD x,
WORD y );
Draw a line from the current pen position to the given coordinate.
rp - destination RastPort.
x,y - line end coordinate.
Not yet implemented:
- handle layer->Scroll_X/Scroll_Y.
- handle FRST_DOT which indicates whether to draw
or to don't draw first pixel of line. Important
for COMPLEMENT drawmode.
void DrawEllipse(
struct RastPort * rp,
WORD xCenter,
WORD yCenter,
WORD a,
WORD b );
rp - destination RastPort
xCenter,yCenter - coordinate of centerpoint
a - radius in x direction
b - radius in y direction
void DrawGList(
struct RastPort * rp,
struct ViewPort * vp );
Process the gel list, draw VSprites and Bobs.
rp - RastPort where Bobs will be drawn
vp - ViewPort for VSprites
void EraseRect(
struct RastPort * rp,
LONG xMin,
LONG yMin,
LONG xMax,
LONG yMax );
Fill a rectangular area with the current BackFill hook.
If layered the BackFill hook is used.
If non-layered the region is cleared.
rp - destination RastPort
xMin,yMin - upper left corner
xMax,YMax - lower right corner
ULONG ExtendFont(
struct TextFont * font,
struct TagItem * fontTags );
Checks whether or not a TextFont has a TextFontExtension.
If no extension exists, and tags are supplied,
then it will try to build one.
font - font to check for an extension.
fontTags - tags to build the TextFontExtension from if it doesn't exist.
If a NULL pointer is given, ExtendFont will allocate default tags.
success - FALSE if the font has no TextFontExtension and an extension
can't be built. TRUE otherwise.
ULONG FindColor(
struct ColorMap * cm,
ULONG r,
ULONG g,
ULONG b,
ULONG maxpen );
Find the closest matching color in the given colormap.
cm - colormap structure
r - red level (32 bit left justified fraction)
g - green level (32 bit left justified fraction)
b - blue level (32 bit left justified fraction)
maxpen - the maximum entry in the color table to search.
The pen number with the closest match will be returned.
No new pens are allocated and therefore the returned pen
should not be released via ReleasePen().
DisplayInfoHandle FindDisplayInfo(
ULONG ID );
Search for a DisplayInfo which matches the ID key.
handle - handle to a displayinfo record with that key
or NULL if no match
BOOL Flood(
struct RastPort * rp,
ULONG mode,
LONG x,
LONG y );
rp - destination RastPort
mode - 0: fill adjacent pixels which don't have color of OPen.
1: fill adjacent pixels which have the same pen as of coordinate x,y.
x,y - coordinate to start filling.
The RastPort must have a TmpRas raster whose size is as large as of
that of the RastPort.
void FontExtent(
struct TextFont * font,
struct TextExtent * fontExtent );
Fill out a text extent structure with the maximum extent of the
characters for the font in question.
font -- The font the extent of which to calculate.
fontExtent -- TextExtent structure to hold the values.
The extent is stored in 'fontExtent'.
Neither effects of algorithmic additions nor rp_TxSpacing is included
when the bounding box and font size are calculated. Note that te_Width
only will be negative when FPF_REVPATH is specified for the font; left
moving characters are ignored considering the font width (right moving
character when FPF_REVPATH is set), but affects the bounding box size.
void FreeBitMap(
struct BitMap * bm );
Returns the memory occupied by the BitMap to the system.
bm - The result of AllocBitMap(). Must be non-NULL.
void FreeColorMap(
struct ColorMap * colormap );
Correctly frees a ColorMap structure and associated structures
that have previously been allocated via GetColorMap().
colormap - pointer to the ColorMap structure previously
allocated via GetColorMap().
Memory returned to pool of free memory.
void FreeCopList(
struct CopList * coplist );
Deallocate all memory associated with this copper list.
coplist - pointer to a CopList structure
void FreeCprList(
struct cprlist * cprList );
Deallocate all memory associated with this cprlist structure
cprlist - pointer to a cprlist structure
VOID FreeDBufInfo(
struct DBufInfo * db );
Frees structure allocated with AllocDBufInfo().
RESULTS
Frees memory occupied by 'db'; ('db' may be NULL, in that case nothing
is done).
void FreeGBuffers(
struct AnimOb * anOb,
struct RastPort * rp,
BOOL db );
Deallocate all buffers for a whole AnimOb. In particular this
means getting buffers for
- BorderLine
- SaveBuffer
- CollMask
- ImageShadow (points to the same memory as CollMask does)
- if db is set to TRUE the user wants double-buffering, so we need
- DBufPacket
- BufBuffer
anOb = pointer to AnimOb structure to be added to list of
AnimObs
rp = pointer to a valid RastPort with initialized GelsInfo
structure
db = TRUE when double-buffering is wanted
A call to GetGBuffers() that resulted in a partially allocation
of the required buffers will result in a deallocation of these
buffers. (Possible incompatibility with the real thing, though)
void FreeRaster(
PLANEPTR p,
UWORD width,
UWORD height );
Free the single bitplane allocated by AllocRaster().
p - The result of AllocRaster(). Must be non-NULL.
width, height - The size of the bitplane as passed to AllocRaster().
The memory occupied by the bitplane will be returned to the system.
void FreeSprite(
WORD pick );
Free a via GetSprite previously allocated sprite.
Don't even dare to free a sprite you didn't allocate.
pick - number of sprite in range 0-7
Sprite is made available for other tasks and the Virtual Sprite
Machine.
void FreeSpriteData(
struct ExtSprite * extsp );
Free sprite data allocated by AllocSpriteData().
extsp - The extended sprite structure to be freed.
Passing NULL is a NO-OP.
void FreeVPortCopLists(
struct ViewPort * vp );
Deallocate all memory associated with the CopList structures
for display, color, sprite and the user copper list. The
corresponding fields in this structure will be set to NULL.
vp - pointer to a ViewPort structure
ULONG GetAPen(
struct RastPort * rp );
Return the current value of the A pen for the rastport.
IPTR GetBitMapAttr(
struct BitMap * bitmap,
ULONG attribute );
Returns a specific information about a bitmap. Do not access the
bitmap directly!
bitmap - The BitMap structure to get information about.
attribute - Number of the attribute to get. See <graphics/gfx.h> for
possible values.
The information you requested. If you asked for an unknown attribute,
0 or NULL is returned.
ULONG GetBPen(
struct RastPort * rp );
Return the current value of the B pen for the rastport.
struct ColorMap * GetColorMap(
ULONG entries );
Allocates and initializes a ColorMap structure and passes back the
pointer. This enables you to do calls to SetRGB4() and LoadRGB4()
to load colors for a view port.
The ColorTable pointer in the ColorMap structure points to a hardware
specific colormap data structure which you should not interpret.
entries - the number of entries for the colormap
NULL - not enough memory could be allocated for the necessary
data structures
other - pointer to an initialized ColorMap structure that may be
stored into the ViewPort.ColorMap pointer.
ULONG GetDisplayInfoData(
DisplayInfoHandle handle,
UBYTE * buf,
ULONG size,
ULONG tagID,
ULONG ID );
Fills buffer with information about displayinfo handle.
handle - displayinfo handle
buf - pointer to destination buffer
size - buffer size in bytes
tagID - data chunk type
DTAG_DISP (DisplayInfo)
DTAG_DIMS (DimensionInfo)
DTAG_MNTR (MonitorInfo)
DTAG_NAME (NameInfo)
ID - displayinfo identifier, optionally used if handle is NULL
result - if positive, number of bytes actually transferred
if zero, no information for ID was available
ULONG GetDrMd(
struct RastPort * rp );
Get drawmode value of RastPort.
LONG GetExtSpriteA(
struct ExtSprite * sprite,
struct TagItem * tags );
LONG GetExtSprite(
struct ExtSprite * sprite,
TAG tag, ... );
sprite - pointer to programmer's ExtSprite (from AllocSpriteData())
tags - a standard tag list
Sprite_number - a sprite number or -1 for an error
BOOL GetGBuffers(
struct AnimOb * anOb,
struct RastPort * rp,
BOOL db );
Allocate all buffers for a whole AnimOb. In particular this
means getting buffers for
- BorderLine
- SaveBuffer
- CollMask
- ImageShadow (points to the same memory as CollMask does)
- if db is set to TRUE the user wants double-buffering, so we need
- DBufPacket
- BufBuffer
anOb = pointer to AnimOb structure to be added to list of
AnimObs
rp = pointer to a valid RastPort with initialized GelsInfo
structure
db = TRUE when double-buffering is wanted
TRUE, if all the memory allocations were successful, otherwise
FALSE
If an AnimOb is passed to GetGBuffers twice new buffers will
be allocated and therefore old pointers to buffers will be
lost in space.
ULONG GetOutlinePen(
struct RastPort * rp );
Get the outline pen value for a RastPort.
void GetRGB32(
struct ColorMap * cm,
ULONG firstcolor,
ULONG ncolors,
ULONG * table );
Fill the table with the 32 bit fractional RGB values from the
given colormap.
cm - ColorMap structure obtained via GetColorMap()
firstcolor - the index of first color register to get (starting with 0)
ncolors - the number of color registers to examine and write
into the table
table - a pointer to an array of 32 bit RGB triplets
the ULONG pointed to by table will be filled with the 32 bit
fractional RGB values from the colormap
table should point to an array of at least 3*ncolors longwords.
ULONG GetRGB4(
struct ColorMap * colormap,
LONG entry );
Read a value from the ColorMap. Use this function, as the colormap
is subject to change.
colormap - pointer to ColorMap structure
entry - index into colormap
-1 : if no valid entry. (index too high)
other : UWORD RGB value, 4 bits per electron gun, right justified
void GetRPAttrsA(
struct RastPort * rp,
struct TagItem * tags );
void GetRPAttrs(
struct RastPort * rp,
TAG tag, ... );
Read the current settings of a RastPort into variables.
The ti_Tag field specifies the attribute to read and the
ti_Data field points to an address where to store the result.
All results are stored as IPTRs!
rp = pointer to a RastPort structure
tags = pointer to a taglist specifying the attributes to read and
the addresses to store the results
RPTAG_Font (UBYTE) - Font for Text()
RPTAG_APen (UBYTE) - Primary rendering pen
RPTAG_BPen (UBYTE) - Secondary rendering pen
RPTAG_DrMd (UBYTE) - Drawing mode (graphics/rastport.h)
RPTAG_OutlinePen (UBYTE) - Area Outline pen
RPTAG_WriteMask (ULONG) - Bit Mask for writing
RPTAG_MaxPen (ULONG) - Maximum pen to render (see SetMaxPen())
MorphOS-compatible extensions:
RPTAG_FgColor (ULONG) - Primary rendering color in A8R8G8B8 format.
Only working on hicolor/truecolor bitmaps/screens.
RPTAG_BgColor (ULONG) - Secondary rendering color in A8R8G8B8 format.
Only working on hicolor/truecolor bitmaps/screens.
AmigaOSv4-compatible extensions:
RPTAG_RemapColorFonts (BOOL) - Automatically remap colorfonts to their color
on hicolor/truecolor screens.
AROS-specific extensions:
RPTAG_ClipRectangle (struct Rectangle *) - Rectangle to clip rendering to. Rectangle will
be cloned.
RPTAG_ClipRectangleFlags (LONG) - RPCRF_RELRIGHT | RPCRF_RELBOTTOM (see <graphics/rpattr.h>)
RPTAG_ClipRectangle and RPTAG_ClipRectangleFlags must not be
used on manually inited or cloned rastports. Instead the rastport
must have been created with CreateRastPort() or CloneRastPort().
RPTAG_SoftStyle and RPTAG_DrawBounds are not supported yet.
WORD GetSprite(
struct SimpleSprite * sprite,
WORD pick );
Try to get a hardware sprite for the simple sprite manager.
There are eight sprites available in the system and by calling
this function you can allocate one for yourself. You have to
call this function before talking to other sprite routines.
If you want a 15 color sprite, you must allocate both sprites
(see the manual!) and set the SPRITE_ATTACHED bit in the
odd sprite's posctldata array.
sprite - pointer to a SimpleSprite structure
pick - number of the sprite (0-7) of -1 if you just want
the next available sprite
-1 - if the selected sprite is not available (pick was 0-7) or
no further sprites are available (pick was -1). -1 will
also be found in the SimpleSprite structure.
0-7: The sprite number of your allocated sprite. The number will
also be found in the SimpleSprite structure.
On some machines this will never return anything else than -1!
ULONG GetVPModeID(
struct ViewPort * vp );
returns the normal display modeID, if one is currently associated
with this ViewPort
vp - pointer to ViewPort structure
modeID - a 32 bit DisplayInfoRecord identifier associated
with this ViewPort, or INVALID_ID
void GfxAssociate(
void * pointer,
struct ExtendedNode * node );
Associate a special graphics extended data structure with another
structure via the other structure's pointer. Later, when you call
GfxLookUp() with the other structure's pointer you may receive
the pointer to this special graphics extended data structure, if it
is available
pointer = a pointer to a data structure
node = an ExtendedNode structure to associate with the pointer
an association is created between the pointer and the node such
that given the pointer the node can be retrieved via GfxLookUp().
Never associate one special graphics extended data structure to
several pointers. Only one pointer is allowed!
void GfxFree(
struct ExtendedNode * node );
Free a special graphics extended data structure which was preciously
allocated by GfxNew()
node = pointer to a graphics extended data structure obtained by
GfxNew()
The node will be deallocated from memory. Graphics will disassociate
this special graphics extended node from any associated data
structure, if necessary, before freeing it (see GfxAssociate())
struct ExtendedNode * GfxLookUp(
void * pointer );
Finds a special graphics extended data structure (if an) associated
with the pointer to a data structure (e.g.: ViewExtra associated with
a View structure).
pointer = a pointer to a data structure which may have an
ExtendedNode associated with it (typically a View)
result = a pointer to the ExtendedNode that has previously been
associated with the pointer
struct ExtendedNode * GfxNew(
ULONG node_type );
Allocate a special graphics extended data structure. The type of
structure to be allocated is passed in the node_type identifier.
node_type = the type of graphics extended data structure to allocate.
(see gfxnodes.h for identifier definitions.)
A pointer to the allocated graphics node or NULL if the allocation
failed
void InitArea(
struct AreaInfo * areainfo,
void * buffer,
WORD maxvectors );
This function initializes an areainfo structure. The size of the
passed pointer to the buffer should be 5 times as large as
maxvectors (in bytes).
areainfo - pointer to AreaInfo structure to be initialized
buffer - pointer to free memory to collect vectors
maxvectors - maximum number of vectors the buffer can hold.
Areainfo structure initialized such that it will hold the vectors
created by AreaMove, AreaDraw and AreaEllipse (AreaCircle).
VOID InitBitMap(
struct BitMap * bm,
BYTE depth,
UWORD width,
UWORD height );
Initialize BitMap structure. A bitmap MUST be initialized before it's
used in any (other) graphics library function.
bm -- pointer to BitMap structure
depth -- number of bitplanes
width -- width in pixels of this bitmap
height -- height in pixels of this bitmap
The Planes[] is not affected and must be set up the caller.
void InitGels(
struct VSprite * head,
struct VSprite * tail,
struct GelsInfo * GInfo );
Makes the two VSprites head and tail of the gel list that is connected
to the GelsInfo structure. The two VSprites are linked together and
their x and y coordinates are initialized such that the serve as the
keystones of the list.
head - pointer to the VSprite structure to be used as head of the gel list
tail - pointer to the VSprite structure to be used as tail of the gel list
GInfo - pointer to the GelsInfo structure to be initialized
graphics/rastport.h graphics/gels.h
void InitGMasks(
struct AnimOb * anOb );
For every component's sequence initialize the Masks by calling
InitMasks()
anOb = pointer to the AnimOb
void InitMasks(
struct VSprite * vs );
Creates the standard BorderLine and CollMask masks of the VSprite.
VSprites and Bobs are treated accordingly.
vs = pointer to VSprite structure
void InitRastPort(
struct RastPort * rp );
Initializes a RastPort structure.
rp - The RastPort to initialize.
all entries in RastPort get zeroed out, with the following exceptions:
Mask, FgPen, AOLPen, and LinePtrn are set to -1.
The DrawMode is set to JAM2
The font is set to the standard system font
struct TmpRas * InitTmpRas(
struct TmpRas * tmpras,
void * buffer,
ULONG size );
Initializes a TmpRas structure. The user has to connect the
TmpRas structure to the rastport.
Some routines need extra memory in order to be able to operate
properly.
tmpras - pointer to a TmpRas structure to be initialized
buffer - pointer to a piece of chip memory.
size - size in bytes of buffer.
Properly initialized TmpRas structure to link to RastPort structure
for use with functions like Flood(), Text() and AreaEnd().
Alltough the RKRM says InitTmpRas is a VOID function every SDK
implements it so that it returns the tmpras argument.
The function itself is a bug.
Why does this function exist at all? The necessary memory should
be allocated in InitRastPort() or the functions that need it.
void InitView(
struct View * view );
Initializes a View structure.
view - The View to initialize.
View is initialized to it`s default values - doesn't care about
previous contents of this structure.
All values except for DxOffset,DyOffset are set to 0's.
void InitVPort(
struct ViewPort * vp );
Initializes a ViewPort structure.
view - The View to initialize.
ViewPort is initialized to it`s default values - doesn't care about
previous contents of this structure.
All values except for SpritePriorities are set to 0's.
BOOL IsPointInRegion(
struct Region * Reg,
WORD x,
WORD y );
Checks if the point (x, y) is contained in the region Reg
region1 - pointer to a region structure
x - The point's 'x' coordinate
y - The point's 'y' coordinate
TRUE if the point is contained, FALSE otherwise
This function isn't available in AmigaOS.
void LoadRGB32(
struct ViewPort * vp,
const ULONG * table );
Load RGB color values from table.
vp - ViewPort
table - pointer to table of records
1 Word with the number of colors to load
1 Word with the first color to be loaded.
3 Longwords representing a left justified 32 bit RGB triplet.
The list is terminated by a count value of 0.
ULONG table[] = { 1l << 16 + 0 , 0xffffffff , 0 , 0 , 0}
ULONG table[] = { 256l << 16 + 0 , r1 , g1 , b1 , r2 , g2 , b2 , ..... 0}
void LoadRGB4(
struct ViewPort * vp,
UWORD * colors,
WORD count );
Load RGB color values from table.
vp - ViewPort
colors - pointer to table of RGB values (0...15)
background-- 0x0RGB
color1 -- 0x0RGB
color2 -- 0x0RGB
...
count - number of UWORDs in the table
void LoadView(
struct View * view );
view - pointer to the View structure which contains the pointer to the
constructed coprocessor instructions list, or NULL
void LockLayerRom(
struct Layer * l );
Locks the layer. Returns when the layer is locked for
exclusive use.
This call behaves like when a semaphore is locked. The
same task may lock the same layer several times without
locking itself out. For every call to this function a
call to UnlockLayerRom() has to be made as the calls nest.
This function will also prevent intuition from locking the
layer so the layer should not be blocked too long.
This function does exactly the same as layers/LockLayer()
l - pointer to layer that is to be locked
Does not save all registers.
ULONG MakeVPort(
struct View * view,
struct ViewPort * viewport );
Prepare a ViewPort to be displayed. Calculate all necessary internal data.
For Amiga(tm) chipset bitmaps this includes calculating preliminary copperlists.
view - pointer to a View structure
viewport - pointer to a ViewPort structure
the viewport must have a valid pointer to a RasInfo
error - Result of the operation:
MVP_OK - Everything is OK, ViewPort is ready
MVP_NO_MEM - There was not enough memory for internal data
MVP_NO_VPE - There was no ViewPortExtra for this ViewPort and no memory to
allocate a temporary one.
MVP_NO_DSPINS - There was not enough memory for Amiga(tm) copperlist.
MVP_NO_DISPLAY - The BitMap can't be displayed using specified mode (for example,
misaligned or wrong depth).
ULONG ModeNotAvailable(
ULONG modeID );
returns an error code, indicating why this modeID is not available,
or 0 if there is no reason known why this mode should not be there
modeID - a 32 bit DisplayInfoRecord identifier
error - a general indication of why this modeID is not available,
or 0 if there is no reason why it should not be available
void Move(
struct RastPort * rp,
WORD x,
WORD y );
Move the drawing pen to (x,y).
rp - RastPort
x,y - target coordinate
void MoveSprite(
struct ViewPort * vp,
struct SimpleSprite * sprite,
WORD x,
WORD y );
Move sprite to a new position on the screen. Coordinates
are specified relatively to given ViewPort, or relatively
to the entire View (physical display) if the ViewPort is NULL.
This function works also with extended sprites, since
struct SimpleSprite is a part of struct ExtSprite.
vp - a ViewPort for relative sprite positioning or NULL
sprite - a pointer to a sprite descriptor structure
x - a new X coordinate
y - a new Y coordinate
AROS currently supports only one sprite #0 for mouse pointer.
Other sprite numbers are ignored by this function.
ViewPort is also used in order to specify the physical display.
If it's not specified, Amiga(tm) chipset display is assumed.
This is available only on Amiga(tm) architecture.
ULONG MrgCop(
struct View * view );
Prepare the view for being displayed. Calculate necessary internal data.
For Amiga(tm) chipset this function also merges together the display, color, sprite and user
coprocessor instructions into a single coprocessor instruction stream.
view - a pointer to the view structure to prepare
error - ULONG error value indicating either lack of memory to build the system data,
or that MrgCop() has no work to do - ie there where no viewPorts in the list.
Pre-v39 AmigaOS returns void.
If the given view is already on display, changes appear immediately.
struct Region * NewRegion();
Allocates memory for a new Region and initializes it
to an empty Region.
region - pointer to a newly created Region structure that
should be freed by a call to DisposeRegion()
ULONG NextDisplayInfo(
ULONG last_ID );
Go to next entry in the DisplayInfo database.
last_ID - previous displayinfo identifier
or INVALID_ID if beginning iteration
next_ID - subsequent displayinfo identifier
or INVALID_ID if no more records
LONG ObtainBestPenA(
struct ColorMap * cm,
ULONG r,
ULONG g,
ULONG b,
struct TagItem * tags );
LONG ObtainBestPen(
struct ColorMap * cm,
ULONG r,
ULONG g,
ULONG b,
TAG tag, ... );
Try to find a pen which matches the given parameters.
cm - colormap
r - red value (32 bit left justified fraction)
g - green value (32 bit left justified fraction)
b - blue value (32 bit left justified fraction)
tags - tagarray
OBP_Precision - PRECISION_GUI, PRECISION_ICON, PRECISION_IMAGE or PRECISION_EXACT.
Defaults to PRECISION_IMAGE.
OBP_FailIfBad - if TRUE ObtainBestPen returns an error when there
is no color in the given tolerance.
A pen value or -1 if no pen could be found.
You must call ReleasePen() when you're done with the pen.
LONG ObtainPen(
struct ColorMap * cm,
ULONG n,
ULONG r,
ULONG g,
ULONG b,
ULONG flags );
Attempt to allocate an entry in the colormap for exclusive
or shared use by the application. To deallocate the pen
ReleasePen() must be called.
cm - A pointer to a color map structure
n - index of the entry in the color map; if any entry is fine
pass -1
r - red value (left justified 32 bit fraction)
g - green value (left justified 32 bit fraction)
b - blue value (left justified 32 bit fraction)
flags - PEN_EXCLUSIVE - for exclusive access to a color register;
default is shared access
PEN_NO_SETCOLOR - will not change the RGB values
for the selected pen.
n = allocated pen number, -1 for failure
Shared palette entries should not be changed (via SetRGB??())
since other applications might use the same color.
A PaletteExtra structure must have been attached to the
ColorMap prior to calling this function (AttachPalExtra()).
struct TextFont * OpenFont(
const struct TextAttr * textAttr );
Searches for a text font which best matches the specified attributes.
textAttr - pointer to a TextAttr or TTextAttr font description.
Returns NULL if the font can't be found.
struct MonitorSpec * OpenMonitor(
STRPTR monitor_name,
ULONG display_id );
monitor_name - pointer to a null terminated string
display_id - optional 32 bit monitor/mode identifier
mspc - pointer to an open MonitorSpec structure
NULL if MonitorSpec could not be opened
BOOL OrRectRegion(
struct Region * Reg,
struct Rectangle * Rect );
Add the given Rectangle to the given Region (if not
already there)
region - pointer to Region structure
rectangle - pointer to Rectangle structure
TRUE if the operation was successful, else FALSE
(out of memory)
All relevant data is copied, you may throw away the
given rectangle after calling this function
struct Region * OrRectRegionND(
struct Region * Reg,
struct Rectangle * Rect );
Add the given Rectangle to the given Region (if not
already there)
region - pointer to Region structure
rectangle - pointer to Rectangle structure
The resulting region or NULL in case there's no enough free memory
BOOL OrRegionRegion(
struct Region * R1,
struct Region * R2 );
OR of one region with another region, leaving result in
second region.
region1 - pointer to a region structure
region2 - pointer to a region structure
TRUE if the operation was successful, else FALSE
(out of memory)
struct Region * OrRegionRegionND(
struct Region * R1,
struct Region * R2 );
OR of one region with another region.
region1 - pointer to a region structure
region2 - pointer to a region structure
The resulting region or NULL in case there's no enough free memory
The blitter is allocated for exclusive use by the calling task.
This function returns immediately if no other task is using
the blitter right now or if no blits are in the queues (QBlit(),
QBSBlit()). Otherwise the function will block until the blitter
can be accessed.
It is good practice to start the blitter immediately after calling
this function and then call DisownBlitter() so other tasks can
use the blitter.
void PolyDraw(
struct RastPort * rp,
LONG count,
WORD * polyTable );
Draw connected lines from an array. The first line is drawn
from the current pen position to the first entry in the array.
rp - RastPort
count - number of x,y pairs
polyTable - array of x,y pairs
Official prototype files declare count as LONG but
original ROM code only uses low 16-bits.
void QBlit(
struct bltnode * bn );
Queues a request for a blit. This request is queued at the end
of the list.
bn - pointer to blitnode structure
The routine that function in the bltnode is pointing to is
called when the blitter is ready for work. No other task will
be able to access the blitter while you're doing the blit.
Queued blits have precedence over a task that tries to own the
blitter via OwnBlitter(). So all queued blitter requests will
be done first until the task that attempts a OwnBlitter can
actually access the blitter.
Not all hardware has a blitter. On hardware where there is no
blitter, a blitter is simulated. Therefore all code that will
be executed in the function that is called must not contain
code that is hacking the blitter's register but should contain
calls to graphics functions instead.
void QBSBlit(
struct bltnode * bn );
Queues a request for a beam-synchronized blit.
bn - pointer to blitnode structure
The routine that function in the bltnode is pointing to is
called when the blitter is ready for work. No other task will
be able to access the blitter while you're doing the blit.
Queued blits have precedence over a task that tries to own the
blitter via OwnBlitter(). So all queued blitter requests will
be done first until the task that attempts a OwnBlitter can
actually access the blitter.
Not all hardware has a blitter. On hardware where there is no
blitter, a blitter is simulated. Therefore all code that will
be executed in the function that is called must not contain
code that is hacking the blitter's register but should contain
calls to graphics functions instead.
LONG ReadPixel(
struct RastPort * rp,
WORD x,
WORD y );
Read the pen number of the given x,y coordinate.
rp - RastPort
x,y - Coordinate
LONG ReadPixelArray8(
struct RastPort * rp,
WORD xstart,
WORD ystart,
WORD xstop,
WORD ystop,
UBYTE * array,
struct RastPort * temprp );
Read the pen numbers of a rectangular area into an array.
rp - RastPort
xstart,ystart - starting point
xstop,ystop - stopping point
array - array where pens are stored. Allocate at least
(((width+15)>>4)<<4)*(ystop-ystart+1) bytes.
temprp - temporary RastPort; copy of rp with
- Layers == NULL
- temprp->BitMap with Rows set to 1,
- temprp->BytesPerRow set to (((width+15)>>4)<<1),
and temporary memory allocated for
temprp->BitMap->Planes[])
The number of pixels read.
This function doesn't make sense on true-/hicolor rastports.
LONG ReadPixelLine8(
struct RastPort * rp,
LONG xstart,
LONG ystart,
ULONG width,
UBYTE * array,
struct RastPort * tempRP );
Read the pen numbers of a horizontal line into an array.
rp - RastPort
xstart,ystart - coordinate
width - count of pixels to read (must be positive).
array - array for storing of the pen numbers. Size must be
at least ((width+15)>>4)<<4 bytes.
tempRP - see ReadPixelArray8().
This function doesn't make sense on true-/hicolor rastports.
void RectFill(
struct RastPort * rp,
LONG xMin,
LONG yMin,
LONG xMax,
LONG yMax );
Fills a rectangular area with the current pens, drawing mode
and areafill pattern. If no areafill pattern is defined fill
with foreground pen.
rp - RastPort
xMin,yMin - upper left corner
xMax,yMax - lower right corner
void ReleasePen(
struct ColorMap * cm,
ULONG n );
Release a pen that was previously allocated as an exclusive
or shared pen by the application. Any other application can
then obtain this pen and make changes to the color register
entries.
cm - ColorMap structure where the pen was allocated
n - The number of the pen
An exclusive pen is deallocated for other applications to use.
A shared pen is only completely deallocated if no other
application is using it anymore.
void RemFont(
struct TextFont * textFont );
Remove a font from the list of public available fonts. Afterwards,
you can close it.
textFont - Remove this font.
void RemIBob(
struct Bob * bob,
struct RastPort * rp,
struct ViewPort * vp );
Remove a Bob immediately from RastPort and gel list.
bob - Bob
rp - RastPort
vp - ViewPort
void RemVSprite(
struct VSprite * vs );
The VSprite is unlinked from the gel list.
vs = pointer to VSprite to be removed from the gel list
UWORD ScalerDiv(
UWORD factor,
UWORD numerator,
UWORD denominator );
Use this to precalculate the width/height of the destination
bitmap. As factor give the width/height of the original bitmap
that is to be scaled via ScaleBitMap(), as numerator give
the value you will write into bsa_XSrcFactor/bsa_YSrcFactor
and as denominator the value of bsa_XDestFactor/bsa_YDestFactor.
factor - a number in the range of 0..16383
numerator - a number in the range of 1..16383
denominator - a number in the range of 1..16383
void ScrollRaster(
struct RastPort * rp,
LONG dx,
LONG dy,
LONG xMin,
LONG yMin,
LONG xMax,
LONG yMax );
Scroll the contents of a rastport (dx,dy) towards (0,0).
The empty spaces is filled by a call to RectFill().
Only the pixel in the rectangle (xMin,yMin)-(xMax,yMax)
will be affected. The lower right corner (xMax, yMax) is
automatically adjusted to the lower right corner in case
it would be outside.
After this operation the Flags bit of the layer associated
with this rastport, if there is any layer, should be tested
for simple layers in case there has any damage been created.
rp - pointer to rastport
dx,dy - distance to move in x and y direction. Positive values go
towards (0,0)
xMin,yMin - upper left hand corner of the affected rectangle
xMax,yMax - lower right hand corner of the affected rectangle
void ScrollRasterBF(
struct RastPort * rp,
LONG dx,
LONG dy,
LONG xMin,
LONG yMin,
LONG xMax,
LONG yMax );
Scroll the contents of a rastport (dx,dy) towards (0,0).
The empty spaces is filled by a call to EraseRect().
Only the pixel in the rectangle (xMin,yMin)-(xMax,yMax)
will be affected. The lower right corner (xMax, yMax) is
automatically adjusted to the lower right corner in case
it would be outside.
After this operation the Flags bit of the layer associated
with this rastport, if there is any layer, should be tested
for simple layers in case there has any damage been created.
rp - pointer to rastport
dx,dy - distance to move in x and y direction. Positive values go
towards (0,0)
xMin,yMin - upper left hand corner of the affected rectangle
xMax,yMax - lower right hand corner of the affected rectangle
BOOL ScrollRegion(
struct Region * region,
struct Rectangle * rect,
WORD dx,
WORD dy );
Scroll the rectangles in the region by the amount of pixels specified, within the
specified rectangle.
region - pointer to a region structure
rect - pointer to the rectangle within which the scrolling has to happen.
If NULL, the region's bounds are used instead.
dx, dy - the amount of pixels by which to scroll the region. Negative values mean
respectively left and up, positive values mean right and down.
TRUE if the operation succeeded, FALSE otherwise.
This function doesn't exist in AmigaOS
void ScrollVPort(
struct ViewPort * vp );
Move the ViewPort to the position specified in DxOffset and DyOffset
members of the ViewPort structure.
AROS video drivers can perform a validation of offsets, and may refuse
to scroll the screen too far (if they somehow can't provide the requested
offset). In this case offset values in the ViewPort will be updated in
order to reflect the real result of the operation.
void SetABPenDrMd(
struct RastPort * rp,
ULONG apen,
ULONG bpen,
ULONG drawMode );
Changes the foreground and background pen and the drawmode in one
step.
rp - Modify this RastPort
apen - The new foreground pen
bpen - The new background pen
drawmode - The new drawmode
This function is faster than the sequence SetAPen(), SetBPen(),
SetDrMd().
This functions turns on PenMode for the RastPort.
void SetAPen(
struct RastPort * rp,
ULONG pen );
Set primary pen for rastport
rp - RastPort
pen - pen number (0...255)
This functions turns on PenMode for the RastPort.
void SetBPen(
struct RastPort * rp,
ULONG pen );
Set secondary pen for rastport.
rp - RastPort
pen - pen number (0...255)
This functions turns on PenMode for the RastPort.
ULONG SetChipRev(
ULONG ChipRev );
ChipRev - Chip Rev that you would like to be enabled
chiprevbits - Actual bits set in GfxBase->ChipRevBits0
This function isn't implemented on all platforms.
void SetCollision(
ULONG num,
VOID_FUNC routine,
struct GelsInfo * GInfo );
Call this function to set a specified entry (num) in the
user's collision vector table with the address of the
routine to be called by DoCollision().
num = number of collision vector
routine = pointer to user's collision routine
GInfo = pointer to a GelsInfo structure
void SetDisplayDriverCallback(
APTR callback,
APTR userdata );
Specify a display driver notification callback.
The callback function is called using "C" calling convention and its
declaration should have a form:
APTR DriverNotify(APTR object, BOOL add, APTR userdata);
The function will be called upon display driver insertion and removal.
Upon insertion the parameters will be the following:
object - A pointer to a struct MonitorHandle for the new driver
add - TRUE, indicates driver insertion
userdata - User data originally passed to SetDisplayDriverCallback()
The function should return a pointer to opaque data object which will
be stored in the display driver handle structure.
Upon driver removal the parameters mean:
object - A pointer to opaque object returned by the callback when
the driver was added.
add - FALSE, indicates driver removal.
userdata - User data originally passed to SetDisplayDriverCallback()
Callback return value is ignored in removal mode.
callback - A pointer to a function to call.
userdata - User-defined data, will be passed to the callback function
This function is private to AROS. Do not use it in any end-user software,
the specification may change at any moment.
void SetDrMd(
struct RastPort * rp,
ULONG drawMode );
Set the drawing mode for lines, fills and text.
rp - RastPort
drawMode - see graphics/rastport.h for possible flags.
void SetFont(
struct RastPort * rp,
struct TextFont * textFont );
Select a new font for rendering strings in a RastPort.
rp - Change this RastPort
textFont - This is the new font
void SetMaxPen(
struct RastPort * rp,
ULONG maxpen );
Set the maximum pen value for a rastport. This will instruct the
graphics.library that the owner of the rastport will not be rendering
in any colors whose index is >maxpen. Therefore speed optimizations
on certain operations are possible and will be done.
Basically this call sets the rastport mask, if this would improve speed.
On devices where masking would slow things down (chunky pixels), it will
be a no-op.
rp = pointer to a valid RastPort structure
maxpen = longword pen value
ULONG SetOutlinePen(
struct RastPort * rp,
ULONG pen );
Set the outline pen and turn on area outline mode.
void SetRast(
struct RastPort * rp,
ULONG pen );
Set the entire contents of a specified RastPort to a specific colour.
rp -- pointer to the RastPort in question
pen -- pen number to set the bitmap pixels to
All pixels are set to the colour corresponding to the specified pen
number.
BOOL SetRegion(
struct Region * src,
struct Region * dest );
Sets the destination region to the source region.
Allocates necessary RegionRectangles if necessary
and deallocates any excessive RegionRectangles in
the destination Region. The source Region remains
untouched.
If the system runs out of memory during allocation
of RegionRectangles the destination Region will
.
TRUE if everything went alright, FALSE otherwise
(out of memory).
void SetRGB32(
struct ViewPort * vp,
ULONG n,
ULONG r,
ULONG g,
ULONG b );
Changes a single color of a viewport.
vp - Modify this viewport
n - Change this color. If the color is outside the range of
valid colors, it will be ignored.
r, g, b - The new values for the red, green and blue. The
valid range is from 0x000000 (no intensity) to
0xFFFFFFFF (full intensity).
If there is a ColorMap for this viewport, then the value will
be stored in the ColorMap.
The selected color register is changed to match your specs.
If the color value is unused then nothing will happen.
Lower order bits of the palette specification will be discarded,
depending on the color palette resolution of the target graphics
device. Use 0xffffffff for the full value, 0x7fffffff for 50%,
etc. You can find out the palette range for your screen by
querying the graphics data base.
void SetRGB32CM(
struct ColorMap * cm,
ULONG n,
ULONG r,
ULONG g,
ULONG b );
Set one color in the ColorMap.
cm - ColorMap structure obtained via GetColorMap()
n - the number of the color register to set
r - red level (32 bit left justified fraction)
g - green level (32 bit left justified fraction)
b - blue level (32 bit left justified fraction)
Store the (r,g,b) triplet at index n in the ColorMap structure.
The changes will not be immediately displayed. Use this function
before linking the ColorMap to a ViewPort. Do not access the entries
in the ColorTable yourself, as the ColorTable format is subject to
change.
void SetRGB4(
struct ViewPort * vp,
ULONG n,
ULONG r,
ULONG g,
ULONG b );
Changes a single color of a viewport.
vp - Modify this viewport
n - Change this color. If the color is outside the range of
valid colors, it will be ignored.
r, g, b - The new values for the red, green and blue. The
valid range is from 0x0 (no intensity) to
0xF (full intensity).
If there is a ColorMap for this viewport, then the value will
be stored in the ColorMap.
The selected color register is changed to match your specs.
If the color value is unused then nothing will happen.
Lower order bits of the palette specification will be discarded,
depending on the color palette resolution of the target graphics
device. Use 0xf for the full value, 0x7 for 50%,
etc. You can find out the palette range for your screen by
querying the graphics data base.
void SetRGB4CM(
struct ColorMap * cm,
WORD n,
UBYTE r,
UBYTE g,
UBYTE b );
Set one color in the ColorMap.
cm - ColorMap structure obtained via GetColorMap()
n - the number of the color register to set
r - red level (0-15)
g - green level (0-15)
b - blue level (0-15)
Store the (r,g,b) triplet at index n in the ColorMap structure.
The changes will not be immediately displayed. Use this function
before linking the ColorMap to a ViewPort.
void SetRPAttrsA(
struct RastPort * rp,
struct TagItem * tags );
void SetRPAttrs(
struct RastPort * rp,
TAG tag, ... );
Modify rastport with values from a taglist.
rp - RastPort
tags - see below
RPTAG_Font (struct TextFont *) - Font for Text()
RPTAG_APen (UBYTE) - Primary rendering pen
RPTAG_BPen (UBYTE) - Secondary rendering pen
RPTAG_DrMd (UBYTE) - Drawing mode (graphics/rastport.h)
RPTAG_OutlinePen (UBYTE) - Area Outline pen
RPTAG_WriteMask (ULONG) - Bit mask for writing
The following tags are compatible with MorphOS (V51) :
RPTAG_FgColor (ULONG) - Primary rendering color in A8R8G8B8
format. Only working on
hicolor/truecolor bitmaps/screens.
RPTAG_BgColor (ULONG) - Secondary rendering color in
A8R8G8B8 format. Only working on
hicolor/truecolor bitmaps/screens.
RPTAG_PenMode (BOOL) - TRUE if traditional pen numbers
should be used, FALSE if direct RGB
colors should be used. Has no effect
on non-RTG displays.
The following tags are compatible with AmigaOSv4 (V51) :
RPTAG_RemapColorFonts (BOOL) - Automatically remap colorfonts to
their color on hicolor/truecolor
screens.
AROS-specific extensions
RPTAG_ClipRectangle (struct Rectangle *) - Clipping rectangle
RPTAG_ClipRectangleFlags (LONG) - RPCRF_RELRIGHT | RPCRF_RELBOTTOM
(see graphics/rpattrs.h)
Setting one of RPTAG_ClipRectangle or RPTAG_ClipRectangleFlags
allocates internal extra data for the RastPort. After finishing using
this RastPort, you need to manually deallocate the extra data using
FreeVec(rp->RP_Extra).
ULONG SetSoftStyle(
struct RastPort * rp,
ULONG style,
ULONG enable );
Set the style of the current font. Only those bits set in 'enable' are
affected.
rp -- pointer to rastport
style -- the style the font should have
enable -- mask for style bits
The style bits used hereinafter (the font may not support all the styles
you wish to set). Note that this is possibly more style bits than you
affected by calling SetSoftStyle() as a font may have intrinsic style
bits set.
ULONG SetWriteMask(
struct RastPort * rp,
ULONG mask );
void SortGList(
struct RastPort * rp );
Sort the current gel list by the y and x coordinates of it's
elements.
You have to call this routine prior to calling DoCollision()
of DrawGList or make sure that the list is sorted!
rp = pointer to RastPort that has an GelsInfo linked to it
void StripFont(
struct TextFont * font );
Removes a TextFontExtension from a font.
font - font to remove extension from.
void SyncSBitMap(
struct Layer * l );
If the layer has a superbitmap all the parts that are visible will
be copied into the superbitmap. This is usually not done except when
parts of a superbitmapped layer become hidden the visible parts are
stored into the superbitmap.
l - pointer to superbitmapped layer
The superbitmap will be synchronized with the visible part. The
superbitmap attached to the layer will be up-to-date with what's
really in the layer.
void Text(
struct RastPort * rp,
CONST_STRPTR string,
ULONG count );
Write text to the rastport at the current position.
The current position is updated to a position after the text.
rp - RastPort
string - string to print
count - number of characters to print
void TextExtent(
struct RastPort * rp,
CONST_STRPTR string,
ULONG count,
struct TextExtent * textExtent );
This function determines the metric of the space that a text string
would render into.
rp - RastPort
string - address of string
count - number of characters
textExtent - storing place for the result
te_Width - same as TextLength() result: the rp_cp_x
advance that rendering this text would cause.
te_Height - same as tf_YSize. The height of the
font.
te_Extent.MinX - the offset to the left side of the
rectangle this would render into.
Often zero.
te_Extent.MinY - same as -tf_Baseline. The offset
from the baseline to the top of the
rectangle this would render into.
te_Extent.MaxX - the offset of the left side of the
rectangle this would render into.
Often the same as te_Width-1.
te_Extent.MaxY - same as tf_YSize-tf_Baseline-1.
The offset from the baseline to the
bottom of the rectangle this would
render into.
ULONG TextFit(
struct RastPort * rp,
CONST_STRPTR string,
ULONG strLen,
struct TextExtent * textExtent,
struct TextExtent * constrainingExtent,
LONG strDirection,
ULONG constrainingBitWidth,
ULONG constrainingBitHeight );
Tries to fill the given space with as many characters of the
font in rp as possible and returns that number.
rp - Use the settings in this RastPort (e.g. Font)
string - Use this string
strLen - The length of the string
textExtent - The size actually occupied will be returned here
constrainingExtent - If non-NULL, the routine will use the
dimensions of the box described here
strDirection - In which is the next character. Must be either 1
or -1. If it is -1, then string must point to the end (the
first character to check) of the text to fit (this is for
checking text which runs from right to left).
constrainingBitWidth - If constrainingExtent is NULL, then this
is the width of the bounding box.
constrainingBitHeight - If constrainingExtent is NULL, then this
is the height of the bounding box.
The number of characters which fit in the bounding box.
If any characters fit in the bounding box, then textExtent will
tell how large the minimal bounding box for the string is.
WORD TextLength(
struct RastPort * rp,
CONST_STRPTR string,
ULONG count );
Determines the length of a string in pixels.
rp - RastPort
string - address of string
count - number of characters of string
Length of string in pixels.
Use the newer TextExtent() to get more information.
struct CopList * UCopperListInit(
struct UCopList * ucl,
WORD n );
Allocates and initializes copperlist structures and buffers
internal to UCopList structure.
ucl - pointer to a UCopList structure. Must not be NULL!
n - number of instructions the buffer must be able to hold
cl - pointer to a buffer that will accept n intermediate
copper instructions
NOTE: this is a pointer to UCopList->FirstCopList!
void UnlockLayerRom(
struct Layer * l );
Unlocks a previously locked layer for access by other applications
or intuition itself.
If a task has locked a layer multiple times it must unlock it
as many times as well as locks nest.
This functions does the same as layers/UnlockLayerRom()
l - pointer to layer structure
Does not save all registers.
This function isn't implemented on all platforms.
ULONG VideoControl(
struct ColorMap * cm,
struct TagItem * tags );
ULONG VideoControlTags(
struct ColorMap * cm,
TAG tag, ... );
cm - pointer to struct ColorMap obtained via GetColorMap()
tags - pointer to a table of videocontrol tagitems
error - 0 if no error ocurred in the control operation
non-0 if bad colormap pointer, no tagitems or bad tag
Wait for the blitter to return to finish, ie. the function returns
when the blitter is idle.
This function is unimplemented.
void WaitBOVP(
struct ViewPort * vp );
vp - pointer to ViewPort structure
This function is unimplemented.
Adds the task to the TOF queue; it will be signalled when the vertical
blank interrupt occurs.
WORD WeighTAMatch(
const struct TextAttr * reqTextAttr,
const struct TextAttr * targetTextAttr,
struct TagItem * targetTags );
Determines how well two font descriptions match.
reqTextAttr - the required textattr.
targetTextAttr - textattr of potential match.
targetTags - tags for the targetTextAttr.
A weight number which measures how well the TextAttrs
match. The weight may vary from 0 (no match) to
MAXFONTMATCHWEIGHT (perfect match).
Does not yet take tags into account.
void WriteChunkyPixels(
struct RastPort * rp,
LONG xstart,
LONG ystart,
LONG xstop,
LONG ystop,
UBYTE * array,
LONG bytesperrow );
Write a rectangular region of pen values into a rastport.
rp - destination RastPort
xstart,ystart - starting point
xstop,ystop - stopping point
array - array with pen values
bytesperrow - The number of bytes per row in the source array.
This should be at least as large as the number of pixels
being written per line.
LONG WritePixel(
struct RastPort * rp,
WORD x,
WORD y );
Write the primary (A) pen colour to the given coordinates of a
RastPort.
rp - destination RastPort
x,y - coordinate
0: pixel could be written
-1: coordinate was outside rastport
LONG WritePixelArray8(
struct RastPort * rp,
ULONG xstart,
ULONG ystart,
ULONG xstop,
ULONG ystop,
UBYTE * array,
struct RastPort * temprp );
Write an array of pens into a rectangular area.
rp - destination RastPort
xstart,ystart - starting point
xstop,ystop - stopping point
array - array of pen values. Size must be at least
(((width+15)>>4)<<4)*(ystop-ystart+1) bytes.
temprp - temporary rastport
(copy of rp with Layer set to NULL,
temporary memory allocated for
temprp->BitMap with Rows set to 1,
temprp->BitMap with BytesPerRow set to ((width+15)>>4)<<1,
and temporary memory allocated for
temprp->BitMap->Planes[])
Number of plotted pixels.
LONG WritePixelLine8(
struct RastPort * rp,
LONG xstart,
LONG ystart,
ULONG width,
UBYTE * array,
struct RastPort * tempRP );
Draw a horizontal line from an array of pens.
rp - destination RastPort
xstart,ystart - start coordinate of line
width - count of pixels to write (must be positive)
array - array of pen values. Allocate at least
((width+15)>>4)<<4 bytes.
tempRP - temporary rastport
(copy of rp with Layer set to NULL,
temporary memory allocated for
temprp->BitMap with Rows set to 1,
temprp->BitMap BytesPerRow == ((width+15)>>4)<<1,
and temporary memory allocated for
temprp->BitMap->Planes[])
Number of plotted pixels.
BOOL XorRectRegion(
struct Region * Reg,
struct Rectangle * Rect );
Exclusive-OR the given rectangle to the given
region
region - pointer to a region structure
rectangle - pointer to a rectangle structure
TRUE if the operation was successful, else FALSE
(out of memory)
All relevant data is copied, you may throw away the
given rectangle after calling this function
struct Region * XorRectRegionND(
struct Region * Reg,
struct Rectangle * Rect );
Exclusive-OR the given rectangle to the given
region
region - pointer to a region structure
rectangle - pointer to a rectangle structure
The resulting region or NULL in case there's no enough free memory
All relevant data is copied, you may throw away the
given rectangle after calling this function
BOOL XorRegionRegion(
struct Region * R1,
struct Region * R2 );
Exclusive-OR of one region with another region,
leaving result in second region.
region1 - pointer to a region structure
region2 - pointer to a region structure
TRUE if the operation was successful,
FALSE otherwise (out of memory)
struct Region * XorRegionRegionND(
struct Region * R1,
struct Region * R2 );
Exclusive-OR of one region with another region.
region1 - pointer to a region structure
region2 - pointer to a region structure
The resulting region or NULL in case there's no enough free memory
This function is not present in AmigaOS
|
|