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

gfx_hidd

Index



hidd.gfx.overlay

--background_overlay-- aoHidd_Overlay_Error aoHidd_Overlay_SrcFormat aoHidd_Overlay_SrcHeight
aoHidd_Overlay_SrcWidth      

--background_overlay--

Notes

Objects of overlay class represent hardware video overlays.

Current hardware supports only one video overlay per screen, however in future
the situation may change.

hidd.gfx.overlay is an interface name. There's no such public ID since
there's actually no base class for the overlay. The whole implementation is
hardware-dependant and needs to be done separately for every driver.

Overlay classes do not need to be public. It's up to display drivers to manage
them. A moHidd_Gfx_NewOverlay method of graphics driver class is used to create
overlay objects.

aoHidd_Overlay_Error

Synopsis

[I..], ULONG *

Function

Specifies a pointer to ULONG location where error code will be written.

This attribute can be used for overlay creation in order to be able to get an
information about the actual failure reason.

Resulting error code can be one of VOERR_... values defined in
cybergraphx/cgxvideo.h:

  VOERR_OK          - there was no error
  VOERR_INVSCRMODE  - no (more) hardware overlays are supported on this card
  VOERR_NOOVLMEMORY - there is not enough VRAM to hold overlay data
  VOERR_INVSRCFMT   - given source pixel format is not supported by the card
  VOERR_NOMEMORY    - there is not enough system RAM for internal driver needs

aoHidd_Overlay_SrcFormat

Synopsis

[I..], ULONG

Function

Specifies source data pixel format. The value should be one of SRCFMT_... constants
defined in cybergraphx/cgxvideo.h:

  SRCFMT_YUV16   - 16-but YUV
  SRCFMT_YCbCr16 - 16-bit YCbCr
  SRCFMT_RGB15PC - R5G5B5, little-endian
  SRCFMT_RGB16PC - R5G6B5, little-endian

Notes

Not all formats can be supported by all drivers. Use aoHidd_Overlay_Error attribute
in order to get an explanation why overlay creation fails.

aoHidd_Overlay_SrcHeight

Synopsis

[I..], ULONG

Function

Specifies source data height in pixels.

aoHidd_Overlay_SrcWidth

Synopsis

[I..], ULONG

Function

Specifies source data width in pixels.

hidd.gfx.gc

aoHidd_GC_Background aoHidd_GC_ColorExpansionMode aoHidd_GC_ColorMask aoHidd_GC_DrawMode
aoHidd_GC_Foreground aoHidd_GC_LinePattern aoHidd_GC_LinePatternCnt moHidd_GC_SetClipRect
moHidd_GC_UnsetClipRect      

aoHidd_GC_Background

Synopsis

[.SG]

Function

Background color

aoHidd_GC_ColorExpansionMode

Synopsis

[.SG]

Function

Mode for color expansion

aoHidd_GC_ColorMask

Synopsis

[.SG]

Function

Prevents some color bits from changing.


aoHidd_GC_Foreground

Synopsis

[.SG]

Function

Foreground color

aoHidd_GC_LinePattern

Synopsis

[.SG]

Function

Pattern for line drawing

aoHidd_GC_LinePatternCnt

Synopsis

[.SG]

Function

Pattern start bit for line drawing.

moHidd_GC_SetClipRect

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_GC_SetClipRect *msg);

VOID HIDD_GC_SetClipRect(OOP_Object *obj, LONG x1, LONG y1, LONG x2, LONG y2);

Function

Install a clipping rectangle on a GC.

Inputs

obj    - a GC object
x1, y1 - top-left coordinate of the clipping rectangle
x2, y2 - bottom-right coordinate of the clipping rectangle

Result

None

Notes

Since the GC is just a data container, installing clipping rectangle doesn't magically
applies it to all operations. Graphics driver method which uses the GC needs to support
it explicitly. Currently clipping is supported only by Draw and DrawEllipse methods.

Use this method if and only if the GC object was created by you. graphics.library
internally operates on temporary GC objects, which are allocated only partially. They
don't have storage space for clipping rectangle data, and attempt to use this
method on such a GC will result in memory trashing.

moHidd_GC_UnsetClipRect

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_GC_UnsetClipRect *msg);

VOID HIDD_GC_UnsetClipRect(OOP_Object *obj);

Function

Uninstalls the clipping rectangle (whatever it is) from the GC.

Inputs

obj - a GC object

Result

None

hidd.gfx.driver

--background_graphics-- --display_modes-- aoHidd_Gfx_ActiveCallBack aoHidd_Gfx_ActiveCallBackData
aoHidd_Gfx_DefaultGC aoHidd_Gfx_DMPSLevel aoHidd_Gfx_DriverName aoHidd_Gfx_FrameBufferType
aoHidd_Gfx_HWSpriteTypes aoHidd_Gfx_IsWindowed aoHidd_Gfx_MemoryClock aoHidd_Gfx_MemorySize
aoHidd_Gfx_ModeTags aoHidd_Gfx_NoFrameBuffer aoHidd_Gfx_NumSyncs aoHidd_Gfx_SupportsGamma
aoHidd_Gfx_SupportsHWCursor moHidd_Gfx_BMToDisplayCoords moHidd_Gfx_CheckMode moHidd_Gfx_CleanViewPort
moHidd_Gfx_CopyBox moHidd_Gfx_CopyBoxMasked moHidd_Gfx_CreateObject moHidd_Gfx_DisplayToBMCoords
moHidd_Gfx_DisposeOverlay moHidd_Gfx_GetGamma moHidd_Gfx_GetMaxSpriteSize moHidd_Gfx_GetMode
moHidd_Gfx_GetPixFmt moHidd_Gfx_GetSync moHidd_Gfx_MakeViewPort moHidd_Gfx_ModeProperties
moHidd_Gfx_NewOverlay moHidd_Gfx_NextModeID moHidd_Gfx_NominalDimensions moHidd_Gfx_PrepareViewPorts
moHidd_Gfx_QueryHardware3D moHidd_Gfx_QueryModeIDs moHidd_Gfx_ReleaseModeIDs moHidd_Gfx_SetCursorPos
moHidd_Gfx_SetCursorShape moHidd_Gfx_SetCursorVisible moHidd_Gfx_SetGamma moHidd_Gfx_SetMode
moHidd_Gfx_Show moHidd_Gfx_ShowImminentReset moHidd_Gfx_ShowViewPorts  

--background_graphics--

Notes

When working with graphics drivers this is the first object you get.
It allows you to create BitMap and GC (graphics context)
object. The class' methods must be overidden by hardware-specific
subclasses where documented to do so.

--display_modes--

Notes

Each display driver object internally stores a database of supported display mode
IDs. This database is normally managed by base class, the driver does not need to
reimplement respective methods.

A display mode ID in AROS is a 32-bit integer value, the same as on AmigaOS(tm).
However mode ID layout introduced by Commodore does not fit well for RTG systems.
In order to overcome its limitations, display ID on AROS may have two forms:

1. A chipset mode ID. These are standard IDs defined by Commodore. You may find
   their definitions in graphics/modeid.h.

2. AROS RTG mode ID.

An RTG mode ID is composed of three parts in the form:

nnnn xx yy

nnnn - monitor ID. This number is maintained by system libraries. IDs are
       assigned in the order in which drivers are loaded and display hardware is
       found. Drivers do not have to care about this part, and should normally
       mask it out if they for some reason look at mode ID. In order to
       distinguish between chipset mode IDs and RTG mode IDs, order number starts
       not from zero, reserving some space for C= chipset mode IDs (which appear
       to have order numbers from 0x0000 to 0x000A). Currently RTG monitor IDs
       start from 0x0010, however with time this value may change. So don't rely
       on some particular values in RTG IDs. Use cybergraphics.library/IsCyberModeID()
       function if you want to know for sure if the given mode ID belongs to an
       RTG driver.

  xx - A sync object index in driver's mode database.
  yy - A pixelformat object in driver's mode database.

Normally the driver does not have to care about mode ID decoding. The mode
database is maintained by base class. The only useful things for the driver are
sync and pixelformat objects, from which it's possible to get different
information about the mode. They can be obtained from the base class using
HIDD_Gfx_GetMode().

Note that the driver object by itself does not know its monitor ID. Different
displays are served by different objects, any of which may belong to any class.
So all driver methods which return mode IDs will set monitor ID to zero. All
methods that take mode ID as argument are expected to ignore the monitor ID part
and do not make any assumptions about its value.

aoHidd_Gfx_ActiveCallBack

Synopsis

[.S.], void (*)(APTR userdata, OOP_Object *bitmap)

Function

Set display activation interrupt handler.

This handler needs to be called by hosted display driver, if host OS
windowing system is used for the display and mouse input is handled by the
host OS.

This way the driver can tell AROS when a display window has been activated so that
AROS will be able to switch current display correctly when working in a multi-display
configuration.

The function uses C calling convention and needs to be declared as follows:

void ActivationHandler(APTR userdata, OOP_Object *bitmap);

Parameters of this function will be:
  userdata - Whatever is specified by aoHidd_Gfx_ActiveCallBackData attribute.
  bitmap   - Currently reserved. Drivers need to set it to NULL.

The function can be called from within an interrupt, so usual restrictions apply
to it.

Set this attribute to NULL in order to disable activation handling.

Notes

When setting the activation callback function, be sure that you set correct
userdata before you actually set the callback pointer. Otherwise your callback
can be called with wrong data pointer.

Only one activation handler can be installed. Installing a new handler replaces
the previous one.

Native displays do not need to implement this attribute because there can be
no external activation events.

aoHidd_Gfx_ActiveCallBackData

Synopsis

[.S.], APTR

Function

Set user-defined data pointer for display activation handler.

aoHidd_Gfx_DefaultGC

Synopsis

[..G], OOP_Object *

Function

Get a pointer to shared default GC object.

Notes

The returned GC is preset to the following:

  DrawMode = Copy
  FG       = 0
  BG       = 0
  LinePat  = ~0
  ColMask  = ~0

You must not alter these settings even temporarily, because this GC is shared between
bitmaps and between different tasks which may perform the rendering into different
regions of the same bitmap (two windows on one screen, for example). This GC is intended
to be used for internal copying operations.

aoHidd_Gfx_DMPSLevel

Synopsis

[ISG], HIDDT_DPMSLevel

Function

Gets or sets current DPMS level for driver's display.
A value can be one of:
    vHidd_Gfx_DPMSLevel_On,
    vHidd_Gfx_DPMSLevel_Standby,
    vHidd_Gfx_DPMSLevel_Suspend,
    vHidd_Gfx_DPMSLevel_Off

If the driver does not support some state, it's up to the driver what to do.
Usually it is expected to ignore the request.

Getting this attribute should return real current state.

aoHidd_Gfx_DriverName

Synopsis

[..G], STRPTR

Function

Query CyberGraphX driver name. It is the same name which can be given to
cybergraphics.library/BestCModeIDTagList() as CYBRBIDTG_BoardName value.

Notes

By default base class returns class name as value of this attribute.
However this can (and must for some drivers listed in BestCModeIDTagList()
documentation) be overriden.

aoHidd_Gfx_FrameBufferType

Synopsis

[I.G], UBYTE

Function

Specifies fixed framebuffer type used by the driver. The value can be one of the following:

  vHidd_FrameBuffer_None     - the driver does not use framebuffer.
  vHidd_FrameBuffer_Direct   - the driver uses framefuffer which can be accessed
                               directly for both reads and writes.
  vHidd_FrameBuffer_Mirrored - the driver uses write-only framebuffer.

This attribute has to be specified during driver object creation. If this is not done,
the OS will use value of old aoHidd_Gfx_NoFrameBuffer attribute in order to distinguish
between vHidd_FrameBuffer_Direct (for FALSE) and vHidd_FrameBuffer_None (for TRUE).

Notes

A fixed framebuffer is a special bitmap in a fixed area of video RAM. If the
framebuffer is used, the driver is expected to copy a new bitmap into it in
HIDD_Gfx_Show() and optionally copy old bitmap back.

A framebuffer is needed if the hardware does not have enough VRAM to store many
bitmaps or does not have capabilities to switch the display between various VRAM
regions.

Some hardware suffers from slow VRAM reading. In this case you should use mirrored
mode. If you use it, the system will hold a bitmap in the memory buffer, and
update VRAM on demand (hence the name).

An example of driver using a framebuffer is hosted SDL driver. By design SDL works
only with single display window, which is considered a framebuffer.

aoHidd_Gfx_HWSpriteTypes

Synopsis

[..G], BOOL

Function

Return hardware sprite image types supported by the driver.

The returned value is a combination of the following bit flags:
  vHidd_SpriteType_3Plus1 - color 0 is transparent, 1-3 visible
                            (Amiga(tm) chipset sprite format)
  vHidd_SpriteType_2Plus1 - color 0 is transparent, color 1 is undefined
                             (can be whatever, for example clear or inverse),
                             colors 2-3 visible.
  vHidd_SpriteType_DirectColor - Hi- or truecolor image, or LUT image with own
                                 palette, perhaps with alpha channel

Notes

This attribute should return 0 if the driver does not support hardware mouse sprite
at all. Software sprite emulation is done by graphics.library.

Default implementation in the base class is based on aoHidd_Gfx_SupportsHWCursor
value. This is done for backwards compatibility.

aoHidd_Gfx_IsWindowed

Synopsis

[..G], BOOL

Function

Tells if the display driver is using hosted display in host OS' window, and mouse
input is handled by host OS.

Windowed displays may send activation events to AROS. This is needed in order to
correctly handle display switch in a multi-display configuration (which means that
the user has multiple windows on host OS desktop and can freely switch between them).

Notes

Even in fullscreen mode drivers should still return TRUE if the host OS manages mouse
input (for example, X11 driver). If mouse input is not managed by the host OS
(for example, with Linux framebuffer driver), return FALSE.

aoHidd_Gfx_MemoryClock

Synopsis

[..G], ULONG

Function

Query video card's memory clock in Hz. 0 is a valid value meaning 'unknown'.

aoHidd_Gfx_MemorySize

Synopsis

[..G], ULONG

Function

Query total size of video card memory in bytes.

aoHidd_Gfx_ModeTags

Synopsis

[I..], struct TagItem *

Function

Specify a pointer to a taglist which contains description of display modes
supported by the driver.

This attribute is usually appended in moRoot_New method of the display driver
class.

This attribute is mandatory for the base class, otherwise driver object creation
fails.

Mode description taglist may contain the following tags:
  - Any sync attributes - these attributes will specify values common for all sync
                          modes
  - Any pixelformat attributes - these attributes will specify values common for
                                 all pixelformat modes
  - aoHidd_Gfx_SyncTags - specifies a pointer to another separate taglist containing
                          attributes for one sync (display) mode. If this tag
                          is not supplied at all, a set of default modes will be
                          generated for the driver.
  - aoHidd_Gfx_PixFmtTags - specifies a pointer to another separate taglist containing
                            attributes for one pixelformat. This tag must be supplied
                            at least once, otherwise driver object will fail to create.

  aoHidd_Gfx_SyncTags and aoHidd_Gfx_PixFmtTags can be specified multiple times in
  order to associate more than one display mode with the driver. Note that common
  values for sync and pixelformat objects need to be placed in the taglist before
  aoHidd_Gfx_SyncTags and aoHidd_Gfx_PixFmtTags. You may specify them again between
  these tags in order to alter common values.

Example

Partial example code of display driver supporting a truecolor display with three
resolutions:

// Our pixelformat (24-bit 0BGR)
struct TagItem pftags[] =
{
    { aHidd_PixFmt_RedShift     , 24                            },
    { aHidd_PixFmt_GreenShift   , 16                            },
    { aHidd_PixFmt_BlueShift    , 8                             },
    { aHidd_PixFmt_AlphaShift   , 0                             },
    { aHidd_PixFmt_RedMask      , 0x000000FF                    },
    { aHidd_PixFmt_GreenMask    , 0x0000FF00                    },
    { aHidd_PixFmt_BlueMask     , 0x00FF0000                    },
    { aHidd_PixFmt_AlphaMask    , 0x00000000                    },
    { aHidd_PixFmt_ColorModel   , vHidd_ColorModel_TrueColor    },
    { aHidd_PixFmt_Depth        , 24                            },
    { aHidd_PixFmt_BytesPerPixel, 4                             },
    { aHidd_PixFmt_BitsPerPixel , 24                            },
    { aHidd_PixFmt_StdPixFmt    , vHidd_StdPixFmt_Native        },
    { aHidd_PixFmt_BitMapType   , vHidd_BitMapType_Chunky       },
    { TAG_DONE                  , 0UL                           }
};

// 640x480 resolution
struct TagItem tags_800_600[] =
{
    { aHidd_Sync_HDisp          , 640                    },
    { aHidd_Sync_VDisp          , 480                    },
    { TAG_DONE                  , 0UL                    }
};

// 800x600 resolution
struct TagItem tags_800_600[] =
{
    { aHidd_Sync_HDisp          , 800                    },
    { aHidd_Sync_VDisp          , 600                    },
    { TAG_DONE                  , 0UL                    }
};

// 1024x768 resolution
struct TagItem tags_1024_768[] =
{
    { aHidd_Sync_HDisp          , 1024                    },
    { aHidd_Sync_VDisp          , 768                     },
    { TAG_DONE                  , 0UL                     }
};

// Mode description taglist itself
struct TagItem mode_tags[] =
{
    // Our driver supports a single pixelformat
    { aHidd_Gfx_PixFmtTags  , (IPTR)pftags              },

    // Here go sync values common for all sync modes
    { aHidd_Sync_HMin       , 112                       },
    { aHidd_Sync_VMin       , 112                       },
    { aHidd_Sync_HMax       , 16384                     },
    { aHidd_Sync_VMax       , 16384                     },
    { aHidd_Sync_Description, (IPTR)"Example: %hx%v"    },

    // First resolution
    { aHidd_Gfx_SyncTags    , (IPTR)tags_800_600        },

    // Next two syncs will have HMax = 32768, as an example
    { aHidd_Sync_HMax       , 32768                     },

    // Two more resolutions
    { aHidd_Gfx_SyncTags    , (IPTR)tags_800_600        },
    { aHidd_Gfx_SyncTags    , (IPTR)tags_1024_768       },
    { TAG_DONE              , 0UL                       }
};

// This is the attribute list which is given to New method
// of the base class
struct TagItem mytags[] =
{
    { aHidd_Gfx_ModeTags        , (IPTR)mode_tags       },
    { TAG_DONE                  , NULL                  }
};

aoHidd_Gfx_NoFrameBuffer

Synopsis

[..G], BOOL

Function

Tells whether the driver does not need a framebuffer.

Since v1.2 this attribute is obsolete. Please use aoHidd_Gfx_FrameBufferType
in new code.

Notes

Provides FALSE if not implemented in the driver.

aoHidd_Gfx_NumSyncs

Synopsis

[..G], ULONG

Function

Gets total number of sync objects in the internal display mode database.

aoHidd_Gfx_SupportsGamma

Synopsis

[..G], UBYTE

Function

Specifies if the driver supports gamma correction tables. Default implementation
in base class returns FALSE.

aoHidd_Gfx_SupportsHWCursor

Synopsis

[..G], BOOL

Function

Tells whether the driver supports hardware mouse pointer sprite.

If the driver provides TRUE value for this attribute, it is expected to implement
HIDD_Gfx_SetCursorPos(), HIDD_Gfx_SetCursorShape() and HIDD_Gfx_SetCursorVisible()
methods.

Mouse pointer counts for one hardware sprite, so if the driver implements also
HIDD_Gfx_ModeProperties(), it should set NumHWSprites to 1 in order to provide
valid information about display modes.

The driver must implement this attribute if it implements HIDD_Gfx_ModeProperties().
Otherwise it will provide false information in graphics.library/GetDisplayInfoData().
Base class can determine NumHWSprites based on this attribute value but not vice
versa.

Notes

Default implementation in the base class returns FALSE. This causes the system to
use software sprite emulation.

This attribute is obsolete and is used only by AROS graphics.library up to v41.2. In
new drivers consider implementing aoHidd_Gfx_HWSpriteTypes attribute.

moHidd_Gfx_BMToDisplayCoords

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_BMToDisplayCoords *msg);

OOP_Object *HIDD_Gfx_BMToDisplayCoords(OOP_Object *Target, UWORD TargetX, UWORD TargetY, UWORD *DispX, UWORD *DispY);

Inputs

Target - The BitMap Object to transform the co-ordinates from.
TargetX,TargetY - The BitMap co-ordinates to transform.
DispX,DispY - Where to store the transformed co-ordinates.

moHidd_Gfx_CheckMode

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_CheckMode *msg);

BOOL HIDD_Gfx_CheckMode(OOP_Object *gfxHidd, HIDDT_ModeID modeID,
                        OOP_Object *sync, OOP_Object *pixFmt);

Function

Check if given display mode is supported by the driver.

Normally any resolution (sync) can be used together with any pixelformat. However
on some hardware there may be exceptions from this rule. In such a case this
method should be implemented, and check should be performed.

The information provided by this method is used in order to exclude unsupported
modes from the database

Default implementation in the base class just returns TRUE for all supplied values.

Note that this method can not be used in order to chech that the given mode is
really present in the database and it really refers to the given sync and
pixelformat objects. Use HIDD_Gfx_GetMode() for mode ID validation.

Inputs

gfxHidd - A display driver object
modeID  - A display mode ID
sync    - A pointer to a sync object associated with this mode
pixFmt  - A pointer to a pixelformat object associated with this mode

Result

TRUE if this mode is supported and FALSE if it's not.

Bugs

Currently base class does not call this method after driver object creation.
This needs to be fixed.

moHidd_Gfx_CleanViewPort

Synopsis

ULONG OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_CleanViewPort *msg);

ULONG HIDD_Gfx_CleanViewPort(OOP_Object *gfxHidd, struct HIDD_ViewPortData *data)

Function

Performs driver-specific cleanup on a given ViewPort.

Inputs

gfxHidd - A display driver object.
data    - a pointer to a HIDD_ViewPortData structure.

Result

The same code as used as return value for graphics.library/MakeVPort().

Notes

When graphics.library calls this method, the ViewPort is already unlinked
from its view, and the bitmap can already be deallocated.
This means that both data->Next and data->Bitmap pointers can contain invalid
values.

moHidd_Gfx_CopyBox

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_CopyBox *msg);

VOID HIDD_Gfx_CopyBox(OOP_Object *gfxHidd, OOP_Object *src, WORD srcX, WORD srcY,
                      OOP_Object *dest, WORD destX, WORD destY, UWORD width, UWORD height,
                      OOP_Object *gc);

Function

Perform rectangle copy (blit) operation from one bitmap to another.

Given bitmaps may belong to different display drivers. The driver may attempt to
use hardware for acceleration (if available), and if it's impossible, pass the
operation on to the base class.

Always check class of the supplied bitmap before attempting to look at its
private data.

A GC is used in order to specify raster operation performed between the source
and destination according to its aHidd_GC_DrawMode attribute value.

Inputs

gfxHidd - a display driver object that you are going to use for copying
src     - a pointer to source bitmap object
srcX    - an X coordinate of the source rectangle
srcY    - a Y coordinate of the source rectangle
dest    - a pointer to destination bitmap object
destX   - an X coordinate of the destination rectangle
destY   - a Y coordinate of the destination rectangle
width   - width of the rectangle to copy
height  - height of the rectangle to copy
gc      - graphics context holding draw mode on the destination

Result

None.

Notes

You must specify valid coordinates (non-negative and inside the actual bitmap
area), no checks are done.

It is valid to specify two overlapped areas of the same bitmap as source
and destination.

moHidd_Gfx_CopyBoxMasked

Synopsis

IPTR OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_CopyBoxMasked *msg);

IPTR HIDD_Gfx_CopyBoxMasked(OOP_Object *gfxHidd, OOP_Object *src, WORD srcX, WORD srcY,
                      OOP_Object *dest, WORD destX, WORD destY, UWORD width, UWORD height,
                      PLANEPTR mask, OOP_Object *gc);

Function

Perform rectangle copy (blit) operation from one bitmap to another,
using a cookie cutter mask.

Given bitmaps must be on the same display driver.

A GC is used in order to specify raster operation performed between the source
and destination according to its aHidd_GC_DrawMode attribute value.

Inputs

gfxHidd - a display driver object that you are going to use for copying
src     - a pointer to source bitmap object
srcX    - an X coordinate of the source rectangle
srcY    - a Y coordinate of the source rectangle
dest    - a pointer to destination bitmap object
destX   - an X coordinate of the destination rectangle
destY   - a Y coordinate of the destination rectangle
width   - width of the rectangle to copy
height  - height of the rectangle to copy
mask    - single bitplane mask
gc      - graphics context holding draw mode on the destination

Result

TRUE is the operation succeeded and FALSE in case of some error, for example
if the system was too low on memory.

Notes

You must specify valid coordinates (non-negative and inside the actual bitmap
area), no checks are done.

It is valid to specify two overlapped areas of the same bitmap as source
and destination.

Mask size must correspond to full source bitmap size (including alignment).

moHidd_Gfx_CreateObject

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_CreateObject *msg);

OOP_Object *HIDD_Gfx_CreateObject(OOP_Object *gfxHidd, OOP_Class *cl, struct TagItem *tagList);

Function

Create a driver specific Gfx Object of the type "classID"

Inputs

gfxHidd - The graphics driver used to create the object.
cl - The base OOP_Class of the object to be created.
tagList - Object specific attributes.

Result

pointer to the newly created OOP_Object, or NULL on failure.

Notes

   Drivers should query the gfx.hidd, or support class for the base class Ptr that
   the driver  objects should use. The gfx hidd itself defines the following -:

GC
        A GC object is just used for data storage. It is possible to subclass, however
        it is not recommended since it may not be future-proof due to the fact
        GC subclasses can not be interchanged between different drivers.
        Avoid using custom GCs.

BitMap

        Each graphics driver exposes at least one displayable bitmap class.
        More may be exposed at the drivers discretion to represent nondisplayable bitmaps
        or other driver specific bitmap types.

        Generally bitmap objects are never created directly. Instead they are created
        using the HIDD_Gfx_CreateObject() call. An implementation of this method in the
        driver should examine bitmap attributes supplied and make a decision if the bitmap
        should be created using the driver's own class or one of the system classes.

        A typical implementation should pay attention to the following bitmap attributes:

        aHIDD_BitMap_ModeID - If this attribute is supplied, the bitmap needs to be
                      either displayable by this driver, or be a friend of a
                      displayable bitmap. A friend bitmap usually repeats the
                      internal layout of its friend so that the driver may
                      perform blitting operations quickly.

        aHIDD_BitMap_Displayable - If this attribute is supplied, the bitmap NEEDS to be
                           displayable by this driver. Usually this means that
                           the bitmap object will contain video hardware state
                           information. This attribute will always be accompanied
                           by aHIDD_BitMap_ModeID.

        aHIDD_BitMap_FrameBuffer - The bitmap needs to be a framebuffer bitmap. A
                           framebuffer bitmap is necessary for some kinds of
                           hardware which have a small fixed amount of video
                           RAM which can hold only one screen at a time. Setting
                           this attribute requires that a valid ModeID be also set.

        aHIDD_BitMap_Friend - If there's no ModeID supplied, you may wish to check class
                      of friend bitmap. This can be useful if your driver uses
                      different classes for displayable and non-displayable bitmaps.
                      By default base class will pick up friend's class and use it
                      for new bitmap if nothing is specified, here you may override
                      this behavior.

        If a driver wants to specify a custom class for the bitmap being created,
        it should pass the aoHidd_BitMap_ClassPtr attribute to the base class.
        Bitmap objects should not be directly created, otherwise necessary information
        provided by the base class will be missing.

        This method must be implemented by the subclass. aHIDD_BitMap_ClassPtr or
        aHIDD_BitMap_ClassID must be provided to the base class for a displayable bitmap.

moHidd_Gfx_DisplayToBMCoords

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_DisplayToBMCoords *msg);

OOP_Object *HIDD_Gfx_DisplayToBMCoords(OOP_Object *Target, UWORD DispX, UWORD DispY, UWORD *TargetX, UWORD *TargetY);

Inputs

Target - The BitMap Object to transform the Display co-ordinates to.
DispX,DispY - The Display co-ordinates to transform.
TargetX,TargetY - Where to store the transformed co-ordinates.

moHidd_Gfx_DisposeOverlay

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_DisposeOverlay *msg);

VOID HIDD_Gfx_DisposeOverlay(OOP_Object *gfxHidd, OOP_Object *Overlay)

Function

Deletes an overlay previously created by moHidd_Gfx_NewOverlay.

Subclasses do not have to override this method
unless they allocate anything additional to an overlay object in
their HIDD_Gfx_NewOverlay() implementation.

Inputs

gfxHidd - A driver object which was used for creating a GC.
Overlay - Pointer to an overlay object to delete.

Result

None.

moHidd_Gfx_GetGamma

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_Gamma *msg);

BOOL HIDD_Gfx_GetGamma(OOP_Object *gfxHidd, UBYTE *Red, UBYTE *Green, UBYTE *Blue);

Function

Get current gamma table for the display.

This method was neither ever implemented nor used. Currently obsolete and
considered reserved.

moHidd_Gfx_GetMaxSpriteSize

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_GetMaxSpriteSize *msg);

BOOL HIDD_Gfx_GetMaxSpriteSize(OOP_Object *gfxHidd, ULONG Type, UWORD *Width, UWORD *Height);

Function

Query maximum allowed size for the given sprite type.

Inputs

gfxHidd - A display driver object
Type    - Type of the sprite image (one of vHidd_SpriteType_... values)
Width   - A pointer to UWORD where width will be placed.
Height  - A pointer to UWORD where height will be placed.

Result

FALSE is the given sprite type is not supported, otherwise TRUE.

Notes

Default implementation in the base class just return some small values
which it hopes can be supported by every driver if the driver supports given
sprite type. It is strongly suggested to reimplement this method in the display
driver.

Width and Height are considered undefined if the method returns FALSE.

moHidd_Gfx_GetMode

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_GetMode *msg);

BOOL HIDD_Gfx_GetMode(OOP_Object *gfxHidd, HIDDT_ModeID modeID,
                      OOP_Object **syncPtr, OOP_Object **pixFmtPtr);

Function

Get sync and pixelformat objects for a particular display ModeID.

Inputs

gfxHidd   - pointer to a driver object which this ModeID belongs to
syncPtr   - pointer to a storage where sync object pointer will be placed
pixFmtPtr - pointer to a storage where pixelformat object pointer will be placed

Result

TRUE upon success, FALSE in case of failure (e.g. given mode does not exist in
driver's internal database). If the function returns FALSE, sync and pixelformat
pointers will be set to NULL.

Notes

Every display mode is associated with some sync and pixelformat object. If the
method returns TRUE, object pointers are guaranteed to be valid.

moHidd_Gfx_GetPixFmt

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *o, struct pHidd_Gfx_GetPixFmt *msg);

OOP_Object *HIDD_Gfx_GetPixFmt(OOP_Object *gfxHidd, HIDDT_StdPixFmt pixFmt);

Function

Get a standard pixelformat descriptor from internal pixelformats database.

Inputs

gfxHidd - A display driver object
pixFmt  - An index of pixelformat (one of vHIDD_StdPixFmt_... values)

Result

A pointer to a pixelformat object or NULL if lookup failed

Notes

Pixelformat objects are stored in a global system-wide database. They are not
linked with a particular driver in any way and completely sharable between all
drivers.

moHidd_Gfx_GetSync

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_GetSync *msg);

OOP_Object *HIDD_Gfx_GetSync(OOP_Object *gfxHidd, ULONG num);

Function

Get a sync object from internal display mode database by index

Inputs

gfxHidd - A display driver object to query
num     - An index of sync object starting from 0

Result

A pointer to a sync object or NULL if there's no sync with such index

moHidd_Gfx_MakeViewPort

Synopsis

ULONG OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_MakeViewPort *msg);

ULONG HIDD_Gfx_MakeViewPort(OOP_Object *gfxHidd, struct HIDD_ViewPortData *data)

Function

Performs driver-specific setup on a given ViewPort.

Inputs

gfxHidd - A display driver object.
data    - a pointer to a HIDD_ViewPortData structure.

Result

The same code as used as return value for graphics.library/MakeVPort().

Notes

When graphics.library calls this method, a complete view is not built yet.
This means that data->Next pointer contains invalid data and needs to be
ignored.

It is valid to keep private data pointer in data->UserData accross calls.
Newly created HIDD_ViewPortData is guraranteed to have NULL there.

moHidd_Gfx_ModeProperties

Synopsis

ULONG OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_ModeProperties *msg);

ULONG HIDD_Gfx_ModeProperties(OOP_Object *gfxHidd, HIDDT_ModeID modeID,
                              struct HIDD_ModeProperties *props, ULONG propsLen);

Function

Obtain an information about the video mode.

Video mode description structure may grow in future, so be careful and always check
propsLen parameter value. A system may ask you for less data than you can provide.
Always return an actual value. Do not just zero out fields you don't know about,
this is not expected to be backwards compatible.

Inputs

gfxHidd  - a pointer to a display driver object whose display mode you want to query
modeID   - a mode ID to query
props    - a pointer to a storage area where HIDD_ModeProperties structure will be put
propsLen - length of the supplied buffer in bytes.

Result

Actual length of obtained structure

Notes

Returned data must reflect only real hardware capabilities. For example, do not
count emulated sprites. The system takes care about emulated features itself.

moHidd_Gfx_NewOverlay

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_NewOverlay *msg);

OOP_Object *HIDD_Gfx_NewOverlay(OOP_Object *gfxHidd, struct TagItem *tagList);

Function

Create a video overlay object.

Inputs

gfxHidd - A graphics driver object on whose display you want to create an overlay.
tagList - A list of overlay attributes. See overlay class documentation for
          their description.

Result

Pointer to the newly created overlay object or NULL in case of failure.

Notes

Default implementation in the base class always sets VOERR_INVSCRMODE error and
returns NULL meaning that hardware overlays are not supported. There's no sense
in software implementation because the software is supposed to handle software
rendering itself.

moHidd_Gfx_NextModeID

Synopsis

HIDDT_ModeID OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_NextModeID *msg);

HIDDT_ModeID HIDD_Gfx_NextModeID(OOP_Object *gfxHidd, HIDDT_ModeID modeID,
                                 OOP_Object **syncPtr, OOP_Object **pixFmtPtr);

Function

Iterate driver's internal display mode database.

Inputs

gfxHidd   - A driver object to query
modeID    - A previous mode ID or vHidd_ModeID_Invalid for start of the iteration
syncPtr   - A pointer to a storage where pointer to sync object will be placed
pixFmtPtr - A pointer to a storage where pointer to pixelformat object will be placed

Result

Next available mode ID or vHidd_ModeID_Invalid if there are no more display modes.
If the function returns vHidd_ModeID_Invalid, sync and pixelformat pointers will
be set to NULL.

moHidd_Gfx_NominalDimensions

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_NominalDimensions *msg);

OOP_Object *HIDD_Gfx_NominalDimensions(OOP_Object *gfxHidd, UWORD *width, UWORD *height, UBYTE *depth);

Inputs

gfxHidd - The graphics driver used to create the object.

moHidd_Gfx_PrepareViewPorts

Synopsis

ULONG OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_PrepareViewPorts *msg);

ULONG HIDD_Gfx_PrepareViewPorts(OOP_Object *gfxHidd, struct HIDD_ViewPortData *data, struct View *view)

Function

Performs driver-specific setup on a given view.

Inputs

gfxHidd - A display driver object.
data    - a pointer to a chain of HIDD_ViewPortData structures.
view    - A pointer to graphics.library View structure being prepared.

Result

MCOP_OK if there was no error or MCOP_NO_MEM otherwise.
MCOP_NOP is not allowed as a return value of this method.

Notes

graphics.library calls this method in MrgCop() after the complete view
is built. data->Next pointer contains valid data.

This function can be repeatedly called several times, and there is no
cleanup counterpart for it. This should be taken into account in method
implementation.

moHidd_Gfx_QueryHardware3D

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_QueryHardware3D *msg);

BOOL HIDD_Gfx_QueryHardware3D(OOP_Object *gfxHidd, OOP_Object *pixFmt);

Function

Query if the driver supports hardware-accelerated 3D graphics for the given
pixelformat.

Inputs

gfxHidd - A display driver object
pixFmt  - A pointer to a pixelformat descriptor object

Result

TRUE if the driver supports hardware-accelerated 3D for the given pixelformat,
FALSE otherwise.

moHidd_Gfx_QueryModeIDs

Synopsis

HIDDT_ModeID *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_QueryModeIDs *msg);

HIDDT_ModeID *HIDD_Gfx_QueryModeIDs(OOP_Object *gfxHidd, struct TagItem *queryTags);

Function

Obtain a table of all supported display mode IDs

The returned address points to an array of HIDDT_ModeID containing all ModeIDs
supported by this driver. The array is terminated with vHidd_ModeID_Invalid.

Inputs

gfxHidd   - A driver object which to query.
querytags - An optional taglist containing query options. Can be NULL.
            The following tags are supported:

            tHidd_GfxMode_MinWidth  (ULONG) - A minimum width of modes you are
                                              interested in
            tHidd_GfxMode_MaxWidth  (ULONG) - A maximum width of modes you are
                                              interested in
            tHidd_GfxMode_MinHeight (ULONG) - A minimum height of modes you are
                                              interested in
            tHidd_GfxMode_MaxHeight (ULONG) - A maximum height of modes you are
                                              interested in
            tHidd_GfxMode_PixFmts   (HIDDT_StdPifXmt *) - A pointer to an array
                of standard pixelformat indexes. If supplied, only mode IDs whose
                pixelformat numbers match any of given ones will be returned.

Result

A pointer to an array of ModeIDs or NULL in case of failure

moHidd_Gfx_ReleaseModeIDs

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_ReleaseModeIDs *msg);

VOID HIDD_Gfx_ReleaseModeIDs(OOP_Object *gfxHidd, HIDDT_ModeID *modeIDs);

Function

Free array of display mode IDs returned by HIDD_Gfx_QueryModeIDs()

Inputs

gfxHidd - A driver object used to obtain the array
modeIDs - A pointer to an array

Result

None.

moHidd_Gfx_SetCursorPos

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_SetCursorPos *msg);

BOOL HIDD_Gfx_SetCursorPos(OOP_Object *gfxHidd, WORD x, WORD y);

Function

Set current mouse pointer position.

This is a real position on top-left image corner relative to top-left corner of
the physical display. Neither logical screen origin nor hotspot are taken into
account here.

The default implementation in the base class does nothing and just returns TRUE.
If a software pointer emulation is used, this method will never be called.

Inputs

gfxHidd - a display driver object, on whose display you wish to position the pointer
x       - An x coordinate of the pointer (relative to the physical screen origin)
y       - A y coordinate of the pointer (relative to the physical screen origin)

Result

Always TRUE. Reserved for future, do not use it.

Notes

This method is called by graphics.library/MoveSprite() which has no return value.
However, for historical reasons, this method has a return value. Drivers should
always return TRUE in order to ensure future compatibility.

moHidd_Gfx_SetCursorShape

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_SetCursorShape *msg);

BOOL HIDD_Gfx_SetCursorShape(OOP_Object *gfxHidd, OOP_Object *shape,
                             WORD xoffset, WORD yoffset);

Function

Set mouse pointer shape.

A pointer image is contained in the specified bitmap object. The bitmap object
may contain a colormap if the system wants to specify own colors for the pointer.
The supplied colormap will also contain alpha channel values.

It is up to driver what to do if, for example, alpha channel is not supported by
the hardware. Or if given bitmap type is not supported (for example truecolor
bitmap on LUT-only hardware). It is expected that the driver converts bitmap
data to a more appropriate form in such a case.

A hotspot is given as an offset from the actual hotspot to the top-left corner
of the pointer image. It is generally needed only for hosted display drivers
which utilize host's support for mouse pointer.

The default implementation in the base class just does nothing. A software mouse
pointer is implemented in a special layer called fakegfx.hidd inside
graphics.library. If a software pointer emulation is used, this method will
never be called.

Inputs

gfxHidd - a display driver object, for whose display you wish to change the pointer
shape   - a pointer to a bitmap object, containing pointer bitmap
xoffset - a horizontal hotspot offset
yoffset - a vertical hotspot offset

Result

TRUE on success, FALSE on failure

moHidd_Gfx_SetCursorVisible

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_SetCursorVisible *msg);

VOID HIDD_Gfx_SetCursorVisible(OOP_Object *gfxHidd, BOOL visible);

Function

Control mouse pointer visiblity.

The default implementation in the base class does nothing. If a software pointer
emulation is used, this method will never be called.

Inputs

gfxHidd - a display driver object, on whose display you wish to turn
    pointer on or off
visible - TRUE to enable pointer display, FALSE to disable it

Result

None.

moHidd_Gfx_SetGamma

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_Gamma *msg);

BOOL HIDD_Gfx_SetGamma(OOP_Object *gfxHidd, UBYTE *Red, UBYTE *Green, UBYTE *Blue);

Function

Set current gamma table for the display.

A gamma table consists of three 256-byte tables: one for red component, one for
green and one for blue.

Inputs

gfxHidd - A display driver object
Red     - A pointer to a 256-byte array for red component
Green   - A pointer to a 256-byte array for green component
Blue    - A pointer to a 256-byte array for blue component

Result

FALSE if the driver doesn't support gamma correction, otherwise TRUE

moHidd_Gfx_SetMode

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_SetMode *msg);

BOOL HIDD_Gfx_SetMode(OOP_Object *gfxHidd, OOP_Object *sync);

Function

Update display mode according to changed sync object

Inputs

gfxHidd - A display driver to operate on
sync    - A modified sync object pointer

Result

TRUE if everything went OK and FALSE in case of some error

Notes

This method is used to inform the driver that some external program has changed
sync data and wants to update the display if needed. It's up to the implementation to
check that current display is really using this sync (frontmost screen uses this mode).

moHidd_Gfx_Show

Synopsis

OOP_Object *OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_Show *msg);

OOP_Object *HIDD_Gfx_Show(OOP_Object *gfxHidd, OOP_Object *bitMap, ULONG flags);

Function

Change currently displayed bitmap on the screen.

The bitmap object supplied must have been created with aHidd_BitMap_Displayable
attribute set to TRUE.

The function's behavior differs a lot depending on whether the driver uses a
framebuffer or video hardware is able to switch screens itself.

If the driver uses a framebuffer bitmap, it is supposed to copy the supplied bitmap
into the framebuffer and return a framebuffer pointer. It also can be asked to
copy back old framebuffer contents into previous bitmap object. It is driver's
job to keep track of which bitmap object was displayed last time. This is what
default implementation does. Note that it is very basic, and even does not support
changing display resolution. It's not recommended to rely on it in production
drivers (unless your video hardware supports only one mode).

If the driver does not use a framebuffer, it is supposed to reprogram the hardware
here to display an appropriate region of video RAM. Do not call the base class
in this case, its implementation relies on framebuffer existance and will always
return NULL which indicates an error.

It is valid to get NULL value in bitMap parameter. This means that there is
nothing to display and the screen needs to be blanked out. It is valid for
non-framebuffer-based driver to return NULL as a reply then. In all other cases
NULL return value means an error.

Please avoid returning errors at all. graphics.library/LoadView() has no error
indication. An error during showing a bitmap would leave the display in
unpredictable state.

If the driver does not use a framebuffer, consider using HIDD_Gfx_ShowViewPorts().
It's more straightforward, flexible and offers support for screen composition.

Inputs

gfxHidd - a display driver object, whose display you wish to change.
bitMap  - a pointer to a bitmap object which needs to be shown or NULL.
flags   - currently only one flag is defined:

fHidd_Gfx_Show_CopyBack - Copy back the image data from framebuffer bitmap
                          to old displayed bitmap. Used only if the driver
                          needs a framebuffer.

Result

A pointer to a currently displayed bitmap object or NULL (read FUNCTION paragraph for
detailed description)

Notes

Drivers which use mirrored video data buffer do not have to update the display
immediately in this method. moHidd_BitMap_UpdateRect will be sent to the returned
bitmap if it's not NULL. Of course display blanking (if NULL bitmap was received)
needs to be performed immediately.

moHidd_Gfx_ShowImminentReset

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, OOP_Msg msg);

Function

Indicate upcoming machine reset. Obsolete.

Since graphics.library v41.4 this method is not used any more. Considered
reserved. Do not use it in any way.

Inputs

None.

Result

None.

moHidd_Gfx_ShowViewPorts

Synopsis

ULONG OOP_DoMethod(OOP_Object *obj, struct pHidd_Gfx_ShowViewPorts *msg);

ULONG HIDD_Gfx_ShowViewPorts(OOP_Object *gfxHidd, struct HIDD_ViewPortData *data, struct View *view);

Function

Show one or more bitmaps on the screen.

It is completely up to the driver how to implement this function. The driver may
or may not support hardware-assisted screens composition. Bitmaps are sorted
in the list in descending z-order. The driver is expected to put at least frontmost
bitmap on display.

It is valid to get NULL pointer as data parameter. This means that there's
nothing to show and the screen should go blank.

Bitmaps display offsets are stored in their aHidd_BitMap_LeftEdge and
aHidd_BitMap_TopEdge attributes. This function is not expected to modify their
values somehow. They are assumed to be preserved between calls unless changed
explicitly by the system.

If you implement this method, you don't have to implement HIDD_Gfx_Show() because
it will never be called.

Note that there is no more error indication - the driver is expected to be
error-free here.

Inputs

gfxHidd - a display driver object, whose display you wish to change.
data    - a singly linked list of bitmap objects to show

Result

TRUE if this method is supported by the driver, FALSE otherwise

hidd.gfx.bitmap

--background_bitmap-- aoHidd_BitMap_Align aoHidd_BitMap_BytesPerRow aoHidd_BitMap_ClassID
aoHidd_BitMap_ClassPtr aoHidd_BitMap_ColorMap aoHidd_BitMap_Depth aoHidd_BitMap_Displayable
aoHidd_BitMap_FrameBuffer aoHidd_BitMap_Friend aoHidd_BitMap_GfxHidd aoHidd_BitMap_Height
aoHidd_BitMap_IsLinearMem aoHidd_BitMap_LeftEdge aoHidd_BitMap_ModeID aoHidd_BitMap_PixFmt
aoHidd_BitMap_PixFmtTags aoHidd_BitMap_StdPixFmt aoHidd_BitMap_TopEdge aoHidd_BitMap_Visible
aoHidd_BitMap_Width moHidd_BitMap_BitMapScale moHidd_BitMap_BlitColorExpansion moHidd_BitMap_BytesPerLine
moHidd_BitMap_Clear moHidd_BitMap_DrawEllipse moHidd_BitMap_DrawLine moHidd_BitMap_DrawPixel
moHidd_BitMap_DrawPolygon moHidd_BitMap_DrawRect moHidd_BitMap_DrawText moHidd_BitMap_FillEllipse
moHidd_BitMap_FillPolygon moHidd_BitMap_FillRect moHidd_BitMap_FillSpan moHidd_BitMap_FillText
moHidd_BitMap_GetImage moHidd_BitMap_GetImageLUT moHidd_BitMap_MapColor moHidd_BitMap_ObtainDirectAccess
moHidd_BitMap_PutAlphaImage moHidd_BitMap_PutAlphaTemplate moHidd_BitMap_PutImage moHidd_BitMap_PutImageLUT
moHidd_BitMap_PutPattern moHidd_BitMap_PutPixel moHidd_BitMap_PutTemplate moHidd_BitMap_PutTranspImageLUT
moHidd_BitMap_ReleaseDirectAccess moHidd_BitMap_SetColorMap moHidd_BitMap_SetColors moHidd_BitMap_SetRGBConversionFunction
moHidd_BitMap_UnmapPixel moHidd_BitMap_UpdateRect    

--background_bitmap--

Notes

Every display driver should implement at least one bitmap class for displayable
bitmaps.

Normally this class doesn't need to have public ID. In order to use it the driver
should pass class pointer as aoHidd_BitMap_ClassPtr value to the graphics base class
in its moHidd_Gfx_CreateObject implementation.

BitMap base class is in C++ terminology a pure virtual
baseclass. It will not allocate any bitmap data at all;
that is up to the subclass to do.

The main task of the BitMap baseclass is to store some information about the bitmap
like its size and pixelformat. A pixelformat is an object of private class which
stores the actual information about the format.

There are two ways that we can find out the pixfmt in our moHidd_Gfx_CreateObject
implementation:

Displayable bitmap -
    The tags will contain a modeid.
    One can use this modeid to get a pointer to an
    already registered pixfmt.

Non-displayable bitmap -
    The aoHidd_BitMap_StdPixFmt or aoHidd_BitMap_Friend attribute will always be
    passed.

aoHidd_BitMap_Align

Synopsis

[I.G]

Function

Specify number of pixels to align bitmap data width to.

This attribute can be added in order to enforce alignment needed for example by
blitting hardware. It will have an impact on default aoHidd_BitMap_BytesPerRow
value.

Direct specification of aoHidd_BitMap_BytesPerRow attribute overrides any value
of this attribute.

Notes

Default value of this attribute is 16. This alignment is required by graphics.library
for AmigaOS(tm) compatibility reasons.

aoHidd_BitMap_BytesPerRow

Synopsis

[ISG], ULONG

Function

Specify or query number of bytes per row in the bitmap storage buffer.

Setting this attribute doesn't actually cause changing buffer layout, just updates
the information about it. Use this only from within subclasses and only if you
exactly know why you do this.

Specifying this attribute during object creation overrides the value calculated
based on aoHidd_BitMap_Width and aoHidd_BitMap_Align values. Useful for wrapping
own buffers into bitmap objects, for example, in conjunction with
aoHidd_ChunkyBM_Buffer.

Notes

The returned value includes possible padding needed for alignment.

aoHidd_BitMap_ClassID

Synopsis

[I..]

Function

Explicitly specify bitmap's class ID.

The purpose of this attribute is to let graphics driver base class to select a class
on which to call OOP_NewObject() in its moHidd_Gfx_CreateObject implementation.

If neither this attribute nor aoHidd_BitMap_ClassPtr attribute is provided for
moHidd_Gfx_CreateObject, graphics base class will do its best in order to find out the
correct class based on aoHidd_StdPixFmt attribute value or aoHidd_BitMap_ClassPtr value
of friend bitmap.

Bugs

The pointer to a given class will not be remembered as aoHidd_BitMap_ClassPtr value.

See also

aoHidd_BitMap_ClassPtr CLID_Hidd_Gfx/moHidd_Gfx_CreateObject


aoHidd_BitMap_ClassPtr

Synopsis

[I..], OOP_Class *

Function

Explicitly specify bitmap's class pointer.

This attribute is not actually a bitmap's attribute. Your display driver class can
supply it to base class' moHidd_Gfx_CreateObject method in order to select a class on
which to call OOP_NewObject().

If neither this attribute nor aoHidd_BitMap_ClassID attribute is provided for
moHidd_Gfx_CreateObject, graphics base class will do its best in order to find out the
correct class based on aoHidd_StdPixFmt attribute value or friend bitmap.

Notes

If a friend bitmap is given, the new bitmap will have the same class, if your driver
doesn't override it by supplying explicit class specification (using either
aoHidd_BitMap_ClassPtr or aoHidd_BitMap_ClassID attribute).

See also

aoHidd_BitMap_ClassID CLID_Hidd_Gfx/moHidd_Gfx_CreateObject


aoHidd_BitMap_ColorMap

Synopsis

[..G], OOP_Object *

Function

Return associated colormap (palette) object.

By default only displayable bitmaps have colormaps. However a colormap can be attached
to any bitmap using moHidd_BitMap_SetColors or moHidd_BitMap_SetColorMap.

Note that manual attaching of a colormap to a nondisplayable bitmap may cause undesired
side-effects on graphics.library behavior. It's better not to do this at all. The system
knows what it does better than you.

See also

moHidd_BitMap_SetColorMap moHidd_BitMap_SetColors.


aoHidd_BitMap_Depth

Synopsis

[G.I]

Function

Specify or query the actual bitmap depth.

This a convenience attribute to simplify handling planar bitmaps, whose actual depth
may vary. Default implementation in base class simply returns depth of bitmap's
pixelformat, and is ignored during initialization. Planar bitmap class returns the
actual depth here. If your specific bitmap class also operates on bitmaps with variable
depths, you need to implement this attribute in it.

aoHidd_BitMap_Displayable

Synopsis

[I.G], BOOL

Function

The bitmap is displayable. A displayable bitmap is always managed by a display
driver and must have valid display mode ID specification.

If this attribute is not supplied during bitmap creation, its value defaults
to FALSE.

aoHidd_BitMap_FrameBuffer

Synopsis

[I.G], BOOL

Function

Specifies that the bitmap is a framebuffer bitmap.

A detailed description of a framebuffer is given in CLID_Hidd_Gfx/moHidd_Gfx_CreateObject
and in CLID_Hidd_Gfx/moHidd_Gfx_Show documentation.

Specifying this attribute causes also implicit setting of aoHidd_BitMap_Displayable
to TRUE.

aoHidd_BitMap_Friend

Synopsis

[I.G], OOP_Object *

Function

Specify a friend bitmap. The bitmap will be allocated so that it
is optimized for blitting to this bitmap.

Display drivers may query this attribute and then query friend bitmap
for anything they want (like pixelformat, mode ID, etc).

Note that explicit specification of mode ID and/or standard pixelformat
should override defaults provided by friend bitmap (i.e. actually breaking
the friendship).

aoHidd_BitMap_GfxHidd

Synopsis

[I.G], OOP_Object *

Function

Specify display driver object this bitmap was created with.

Normally the user doesn't have to supply this attribute. Instead you should use
driver's moHidd_Gfx_CreateObject method in order to create bitmaps. In this case
aoHidd_BitMap_GfxHidd attribute will be provided by graphics driver base class
with the correct value.

It is illegal to manually create bitmap objects with no driver associated.
graphics.library maintains at least a memory driver for nondisplayable
bitmaps in system RAM without any acceleration.

See also

CLID_Hidd_Gfx/moHidd_Gfx_CreateObject


aoHidd_BitMap_Height

Synopsis

[ISG], UWORD

Function

Specifies bitmap height in pixels.

Setting this attribute does not cause actual bitmap resize, just updates the information
about it. Use this only from within subclasses only if you know what you do. For example
SDL hosted driver sets it when framebufer changes the resolution.

aoHidd_BitMap_IsLinearMem

Synopsis

[..G], BOOL

Function

Check if the bitmap provides linear memory access. This means that bitmap's
pixelbuffer is directly addressable by the CPU.

Bitmaps with no linear memory may implement moHidd_BitMap_ObtainDirectAccess,
but this means that this method will rely on mirrored buffer. In such a case
the user must call moHidd_BitMap_UpdateRect after modifying bitmap's contents.

Notes

Used by cybergraphics.library/GetCyberMapAttr() for providing CYBRMATTR_ISLINEARMEM
value.

Bugs

Currently no display drivers implement this attribute despite many native mode
drivers actually provide linear memory.

aoHidd_BitMap_LeftEdge

Synopsis

[.SG]

Function

Controls horizontal position of a scrollable screen bitmap.

Size of displayable bitmaps may differ from actual screen size. In this case the
bitmap can be scrolled around the whole display area. If the bitmap is larger than
the display, only its part can be visible.

Setting this attribute causes changing left origin point of the bitmap. The value
of this attribute represents an offset from the physical edge of the display to the
logical edge of the bitmap. This means that if a large bitmap scrolls to the left in
order to reveal its right part, the offset will be negative. If the bitmap scrolls
to the left (possibly revealing another bitmap behind it), the offset will be positive.

It's up to the display driver to set scroll limits. If the value of the attribute
becomes unacceptable for any reason, the driver should adjust it and provide the real
resulting value back.

Notes

Implementing screen scrolling does not enforce to implement screen composition, despite
the composition is really based on scrolling (in case of composition scrolling a bitmap
off-display is expected to reveal another bitmap behind it instead of empty space).

aoHidd_BitMap_ModeID

Synopsis

[ISG], HIDDT_ModeID

Function

Specify display mode ID for displayable bitmap.

A displayable bitmap must have this attribute supplied with valid value. A nondisplayable
one may miss it, however it may remember it if it was created as a friend of displayable
one. This way you may create another displayable bitmap as a friend of nondisplayable
one which in turn is a friend of displayable one.

This attribute can be set on a framebuffer bitmap. Doing so means an explicit request
for the driver to change current display mode on the hardware. Dependent parameters
(width, height and pixelformat) will be automatically adjusted, if not explicitly
specified in the attributes list.

Notes

If the given ModeID is not supported, the operation causes an error. You can check
for this by checking return value of OOP_SetAttrs() function. It will be TRUE in
case of success and FALSE upon failure. In case of failure none of bitmap attributes
will be changed.

aoHidd_BitMap_PixFmt

Synopsis

[I.G], OOP_Object *

Function

Specify or query pixelformat descriptor object associated with the bitmap.

Every bitmap has some associated pixelformat object. Pixelformat objects are
shared data storages, so many bitmaps may refer to the same pixelformat objects.

Notes

This attribute is internally specified during bitmap creation, but it's illegal
to do this for the user. CreateObject method of graphics driver performs an explicit
check against this. It's up to graphics base classes to figure out its value.

aoHidd_BitMap_PixFmtTags

Synopsis

[...]

Function

Private, very obsolete and currently has no function. Considered reserved.

aoHidd_BitMap_StdPixFmt

Synopsis

[I..], HIDDT_StdPixFmt

Function

Specify standard pixelformat code (one of vHidd_StdPixFmt_... values) for the
bitmap.

Values less than num_Hidd_PseudoStdPixFmt are illegal for this attribute.

The bitmap class itself ignores this attribute. It is processed by
CLID_Hidd_Gfx/moHidd_Gfx_CreateObject method in order to look up a corresponding
pixelformat object in the system's database.

Notes

Bitmaps with this attribute set should be created as RAM bitmaps with direct CPU
access. It is not recommended to replace them with, for example, virtual surfaces on
hosted AROS. Such bitmaps are expected to be directly addressable and breaking
this may cause undesired side effects.

See also

aoHidd_BitMap_PixFmt CLID_Hidd_Gfx/moHidd_Gfx_CreateObject


aoHidd_BitMap_TopEdge

Synopsis

[.SG]

Function

Controls vertical position of a scrollable screen bitmap.

Size of displayable bitmaps may differ from actual screen size. In this case the
bitmap can be scrolled around the whole display area. If the bitmap is larger than
the display, only its part can be visible.

Setting this attribute causes changing top origin point of the bitmap. The value
of this attribute represents an offset from the physical edge of the display to the
logical edge of the bitmap. This means that if a large bitmap scrolls upwards in
order to reveal its bottom part, the offset will be negative. If the bitmap scrolls
downwards (possibly revealing another bitmap behind it), the offset will be positive.

It's up to the display driver to set scroll limits. If the value of the attribute
becomes unacceptable for any reason, the driver should adjust it and provide the real
resulting value back.

Notes

Implementing screen scrolling does not enforce to implement screen composition, despite
the composition is really based on scrolling (in case of composition scrolling a bitmap
off-display is expected to reveal another bitmap behind it instead of empty space).

aoHidd_BitMap_Visible

Synopsis

[..G], BOOL

Function

Check if the bitmap is currently visible on screen

Bugs

Not all display drivers implement this attribute. No AROS components currently rely
on its value.

aoHidd_BitMap_Width

Synopsis

[ISG], UWORD

Function

Specifies bitmap width in pixels.

Setting this attribute does not cause actual bitmap resize, just updates the information
about it. Use this only from within subclasses only if you know what you do. For example
SDL hosted driver sets it when framebufer changes the resolution.

moHidd_BitMap_BitMapScale

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_BitMapScale * msg);

VOID HIDD_BM_BitMapScale(OOP_Object *obj, OOP_Object *src, OOP_Object *dest,
                         struct BitScaleArgs * bsa, OOP_Object *gc);

Inputs

obj  -
src  -
dest -
bsa  -
gc   -

moHidd_BitMap_BlitColorExpansion

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_BlitColorExpansion *msg);

VOID HIDD_BM_BlitColorExpansion (OOP_Object *obj, OOP_Object *gc, OOP_Object *srcBitMap,
                                 WORD srcX, WORD srcY, WORD destX, WORD destY,
                                 UWORD width, UWORD height);

Function

Perform a color expansion of the mask in srcBitMap according to foreground and background
colors and expansion mode specified by the supplied GC. Pixels which are set to zero in
the mask bitmap will be either painted by background (in opaque mode) or left without
change (in transparent mode). Pixels which are set to nonzero in the mask will be painted
by foreground color.

The result of expansion is blitted onto the destination bitmap accorging to GC's draw mode.

Inputs

obj           - A bitmap to draw on
gc            - A GC object to use for drawing
srcBitMap     - A bitmap object containing mask image.
srcX, srcY    - A top-left coordinate of the used rectangle in the source bitmap
destX, destY  - A top-left coordinate of the destination rectangle to draw in
width, height - A size of the rectangle to blit

Result

None.

Notes

This method was previously used by graphics.library/Text() to draw fonts with no
styles specified. Currently graphics.library always uses BltTemplate() and this
method is considered obsolete.

moHidd_BitMap_BytesPerLine

Synopsis

ULONG OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_BytesPerLine *msg);

ULONG HIDD_BM_BytesPerLine(OOP_Object *obj, HIDDT_StdPixFmt pixFmt, UWORD width);

Function

This method is currently not used and reserved.

Inputs

obj    -
pixFmt -
width  -

moHidd_BitMap_Clear

Synopsis

OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_Clear *msg);

VOID HIDD_BM_Clear (OOP_Object *obj, OOP_Object *gc);

Function

Sets all pixels of the drawing area to the background color.

Inputs

obj - A bitmap to clear.
gc  - A GC object, specifies background color value

Notes

This method is not used by the system and considered reserved. However it can
be useful for display driver's own needs.

Bugs

Default implementation in the base class sets all pixels to zero color instead of
the background color from GC

moHidd_BitMap_DrawEllipse

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawEllipse *msg);

VOID HIDD_BM_DrawEllipse (OOP_Object *obj, OOP_Object *gc, WORD x, WORD y,
                          WORD rx, WORD ry);

Function

Draws a hollow ellipse from the center point (x,y) with the radii
rx and ry in the specified bitmap.
The function does not clip the ellipse against the drawing area.

Inputs

obj   - A bitmap to draw on
gc    - A GC object to use for drawing
x,y   - Coordinates of center point in pixels
rx,ry - ry and ry radius in pixels

Result

None.

Bugs

Because of overflow the current code do not work with big
values of rx and ry.

moHidd_BitMap_DrawLine

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawPixel *msg);

VOID HIDD_BM_DrawLine(OOP_Object *obj, OOP_Object *gc, WORD x1, WORD y1,
                      WORD x2, WORD y2);

Function

Draws a line from (x1,y1) to (x2,y2) in the specified gc.
The function does not clip the line against the drawing area.

Inputs

obj   - A bitmap to draw on
gc    - A graphics context object to use
x1,y1 - start point of the line in pixels
x2,y2 - end point of the line in pixels

Result

None.

moHidd_BitMap_DrawPixel

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawPixel *msg);

VOID HIDD_BM_DrawPixel(OOP_Object *obj, OOP_Object *gc, WORD x, WORD y);

Function

Changes the pixel at (x,y). The color of the pixel depends on the
attributes of gc, eg. colors, drawmode, colormask etc.
This function does not check the coordinates.

Inputs

obj  - A bitmap to draw on
gc   - A GC (graphics context) object to use for drawing
x, y - Coordinates of the pixel to draw

Result

None.

moHidd_BitMap_DrawPolygon

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawPolygon *msg);

VOID HIDD_BM_DrawPolygon (OOP_Object *obj, OOP_Object *gc, UWORD n, WORD *coords);

Function

Draws a hollow polygon from the list of coordinates in coords[].
The function does not clip the polygon against the drawing area.

Inputs

obj    - A bitmap to draw on
gc     - A GC object to use for drawing
n      - number of coordinate pairs
coords - array of n (x, y) coordinates in pixels

Result

None.

Notes

This method is not used by the system and considered reserved.

moHidd_BitMap_DrawRect

Synopsis

OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawRect *msg);

VOID HIDD_BM_DrawRect (OOP_Object *obj, OOP_Object *gc, WORD minX, WORD minY,
                  WORD maxX, WORD maxY);

Function

Draws a hollow rectangle. minX and minY specifies the upper
left corner of the rectangle. minY and maxY specifies the lower
right corner of the rectangle.
The function does not clip the rectangle against the drawing area.

Inputs

obj        - A bitmap to draw on
gc         - A GC object to use for drawing
minX, minY - upper left corner of the rectangle in pixels
maxX, maxY - lower right corner of the rectangle in pixels

Result

None.

Notes

This method is not used by the system and considered reserved.

moHidd_BitMap_DrawText

Synopsis

OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawText *msg);

VOID HIDD_BM_DrawText (OOP_Object *obj, OOP_Object *gc, WORD x, WORD y,
                       STRPTR text, UWORD length);

Function

Draws the first length characters of text at (x, y).
The function does not clip the text against the drawing area.

Inputs

obj    - A bitmap to draw on
gc     - A GC object to use for drawing and font specification
x, y   - Position to start drawing in pixels. The x
         coordinate is relativ to the left side of the
         first character.
         The y coordinate is relative to the baseline of the font.
text   - Pointer to a Latin 1 string
length - Number of characters to draw

Result

None.

Notes

At the moment text drawing is processed entirely by graphics.library
using BltTemplate(), which in turn uses moHodd_BitMap_PutTemplate.
This method is considered obsolete.

Bugs

The default implementation in the base class does not process styles,
color and alpha-blended fonts.

moHidd_BitMap_FillEllipse

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawEllipse *msg);

VOID HIDD_BM_FillEllipse (OOP_Object *obj, OOP_Object *gc, WORD x, WORD y,
                          WORD ry, WORD rx);

Function

Draws a solid ellipse from the center point (x,y) with the radii
rx and ry in the specified bitmap.
The function does not clip the ellipse against the drawing area.

Inputs

obj   - A bitmap to draw on
gc    - A GC object to use for drawing
x,y   - Coordinates of center point in pixels
rx,ry - ry and ry radius in pixels

Result

None.

Example

Because of overflow the current code do not work with big
values of rx and ry.

Notes

This method is not used by the system and considered reserved.

moHidd_BitMap_FillPolygon

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawPolygon *msg);

VOID HIDD_BM_FillPolygon (OOP_Object *obj, OOP_Object *gc, UWORD n, WORD *coords);

Function

This method was initially designed for drawing solid polygons, however it was never
used and implemented. At the moment it is considered reserved, its synopsis and
semantics may change in future.

Inputs

obj    - A bitmap to draw on
gc     - A GC object to use for drawing
n      - number of coordinate pairs
coords - array of n (x, y) coordinates in pixels

Result

None

Bugs

Never used and implemented

moHidd_BitMap_FillRect

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawRect *msg);

VOID HIDD_BM_FillRect (OOP_Object *obj, OOP_Object *gc, WORD minX, WORD minY,
                       WORD maxX, WORD maxY);

Function

Draws a solid rectangle. minX and minY specifies the upper
left corner of the rectangle. maxX and maxY specifies the lower
right corner of the rectangle.
The function does not clip the rectangle against the drawing area.

Inputs

obj        - A bitmap to draw on
gc         - A GC object to use for drawing
minX, minY - upper left corner of the rectangle in pixels
maxX, maxY - lower right corner of the rectangle in pixels

Result

None.

moHidd_BitMap_FillSpan

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawText *msg);

Function

Reserved, never implemented method. The definition will change in future.

Result

None.

moHidd_BitMap_FillText

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_DrawText *msg);

VOID HIDD_BM_FillText (OOP_Object *obj, OOP_Object *gc, WORD x, WORD y,
                       STRPTR text, UWORD length);

Function

Historically this method was designed to draw a text with background.
It was never implemented.

Currently this method is considered reserved. Its synopsis and semantics
may change in future.

Inputs

obj    - A bitmap to draw on
gc     - A GC object to use for drawing
x, y   - Position to start drawing in pixels. The x
         coordinate is relative to the left side of the
         first character.
         The y coordinate is relative to the baseline of the font.
text   - Pointer to a Latin 1 string
length - Number of characters to draw

moHidd_BitMap_GetImage

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_GetImage *msg);

VOID HIDD_BM_GetImage (OOP_Object *obj, UBYTE *pixels, ULONG modulo, WORD x, WORD y,
                       WORD width, WORD height, HIDDT_StdPixFmt pixFmt);

Inputs

obj    -
pixels -
modulo -
x, y   -
width  -
height -
pixFmt -

moHidd_BitMap_GetImageLUT

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_GetImageLUT *msg);

VOID HIDD_BM_GetImageLUT (OOP_Object *obj, UBYTE *pixels, ULONG modulo, WORD x, WORD y,
                          WORD width, WORD height, HIDDT_PixelLUT *pixlut);

Inputs

obj    -
pixels -
modulo -
x, y   -
width  -
height -
pixlut -

moHidd_BitMap_MapColor

Synopsis

HIDDT_Pixel OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_MapColor *msg);

HIDDT_Pixel HIDD_BM_MapColor(OOP_Object *obj, HIDDT_Color *color);

Inputs

obj   -
color -

moHidd_BitMap_ObtainDirectAccess

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_ObtainDirectAccess *msg);

BOOL HIDD_BM_ObtainDirectAccess(OOP_Object *obj, UBYTE **addressReturn,
                                ULONG *widthReturn, ULONG *heightReturn,
                                ULONG *bankSizeReturn, ULONG *memSizeReturn);

Inputs

obj            -
addressReturn  -
widthReturn    -
heightReturn   -
bankSizeReturn -
memSizeReturn  -

Result

BOOL

moHidd_BitMap_PutAlphaImage

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_PutAlphaImage *msg);

VOID HIDD_BM_PutAlphaImage (OOP_Object *obj, OOP_Object *gc, UBYTE *pixels, ULONG modulo,
                            WORD x, WORD y, WORD width, WORD height);

Function

Perform an alpha-blending operation between a bitmap and ARGB pixel array.

Inputs

obj    - A bitmap to operate on
gc     - A GC object, internally needed to perform the operation. All its attributes
         are ignored.
pixels - A pointer to an array of pixels
modulo - Number of bytes per row in pixel array
x, y   - Top-left corner of affected bitmap's region
width  - Width of the modified rectangle.
height - Height of the modified rectangle.

Result

None.

Notes

Do not rely on 'gc' parameter being valid when implementing this method in own
display driver. This parameter is actually obsolete, and will be set to NULL in
future AROS versions. Current base class implementation ignores it.

moHidd_BitMap_PutAlphaTemplate

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_PutAlphaTemplate *msg);

VOID HIDD_BM_PutAlphaTemplate (OOP_Object *obj, OOP_Object *gc, UBYTE *alpha, ULONG modulo,
                               WORD x, WORD y, WORD width, WORD height, BOOL invertalpha);

Function

Perform a drawing with current foreground color, using 8-bit alpha channel mask. The following
GC attributes are considered:
    Foreground     - a foreground color
    Background     - a background color
    DrawMode       - if set to Invert, foreground and background colors will be ignored. Instead,
                     pixels, for which alpha channel value is greater than 127, will be inverted.
                     Other pixels will be left unchanged.
    ColorExpansion - if set to Opaque, alpha blending will happen between foreground and background
                     colors, instead of between foreground color and old bitmap contents.

Inputs

obj         - A bitmap to draw on
gc          - A GC object specifying drawing parameters
alpha       - A pointer to an 8-bit per pixel alpha channel mask
modulo      - Number of bytes per line in the mask
x, y        - Top-left corner of the affected bitmap's region
width       - Width of the affected bitmap's region
height      - Height of the affected bitmap's region
invertalpha - If set to TRUE, alpha mask values will be treated in inverted form

Result

None

moHidd_BitMap_PutImage

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_PutImage *msg);

VOID HIDD_BM_PutImage (OOP_Object *obj, OOP_Object *gc, UBYTE *pixels, ULONG modulo,
                       WORD x, WORD y, WORD width, WORD height, HIDDT_StdPixFmt pixFmt);

Inputs

obj    -
gc     -
pixels -
modulo -
x, y   -
width  -
height -
pixFmt -

moHidd_BitMap_PutImageLUT

Synopsis

VOID OOP_DoMethod(OOP_Object *o, struct pHidd_BitMap_PutImageLUT *msg);

VOID HIDD_BM_PutImageLUT (OOP_Object *obj, OOP_Object *gc, UBYTE *pixels, ULONG modulo,
                          WORD x, WORD y, WORD width, WORD height, HIDDT_PixelLUT *pixlut);

Inputs

obj    -
gc     -
pixels -
modulo -
x, y   -
width  -
height -
pixlut -

moHidd_BitMap_PutPattern

Synopsis

VOID OOP_DoMethod(OOP_Object *o, struct pHidd_BitMap_PutPattern *msg);

VOID HIDD_BM_PutPattern(OOP_Object *obj, OOP_Object *gc, UBYTE *pattern,
                        WORD patternsrcx, WORD patternsrcy, WORD patternheight, WORD patterndepth,
                        HIDDT_PixelLUT *patternlut, BOOL invertpattern, UBYTE *mask,
                        ULONG maskmodulo, WORD masksrcx, WORD x, WORD y,
                        WORD width, WORD height);

Inputs

obj           - A bitmap to draw on
gc            - A GC object to use for drawing
pattern       -
patternsrcx   -
patternsrcy   -
patternheight -
patterndepth  -
patternlut    -
invertpattern -
mask          -
maskmodulo    -
masksrcx      -
x, y          -
width         -
height        -

Result

None

moHidd_BitMap_PutPixel

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_PutPixel *msg);

VOID HIDD_BM_PutPixel(OOP_Object *obj, WORD x, WORD y,
    HIDDT_Pixel pixel);

Function

Sets a new color value for the pixel at (x,y). The actual color stored
may be an approximation, due to the limited color depth or palette size
of the bitmap. This function does not check the coordinates.

Inputs

obj  -  bitmap to write to.
x, y - coordinates of the pixel to write.
pixel - the pixel's new color value.

Result

None.

moHidd_BitMap_PutTemplate

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_PutTemplate *msg);

VOID HIDD_BM_PutTemplate (OOP_Object *obj, OOP_Object *gc, UBYTE *masktemplate, ULONG modulo,
                          WORD srcx, WORD x, WORD y, WORD width, WORD height, BOOL inverttemplate);

Function

Apply a single-bit mask to the given portion of the bitmap. Pixels set to 1 in the mask will be filled
by foreground color. Pixels set to 0 in the mask will be filled by background color or left unchanged,
according to the following GC attributes:
    Foreground     - a foreground color
    Background     - a background color
    DrawMode       - if set to Invert, foreground and background colors will be ignored. Instead,
                     pixels which are set to 1 in the mask, will be inverted. Other pixels will be
                     left unchanged.
    ColorExpansion - if set to Transparent, only pixels which are set to 1 in the mask, will be modified.
                     Other pixels will not be changed (background color will be ignored).

Inputs

obj            - A bitmap to draw on
gc             - A GC object, holding operation parameters
masktemplate       - A pointer to a bit mask
modulo         - Number of bytes per line in the mask
srcx           - Horizontal offset of the mask
x, y           - Top-left corner of the bitmap's region to affect
width          - Width of the affected region
height         - Height of the affected region
inverttemplate - If set to TRUE, bit mask will be interpreted in inverted form

Result

None

moHidd_BitMap_PutTranspImageLUT

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_PutTranspImageLUT *msg);

VOID HIDD_BM_PutTranspImageLUT (OOP_Object *obj, OOP_Object *gc, UBYTE *pixels,
                                ULONG modulo, WORD x, WORD y, WORD width, WORD height,
                                HIDDT_PixelLUT *pixlut, UBYTE transparent);

Function

Copy an array of 8-bit LUT pixels to the bitmap at the specified position making
one of colors transparent.

Pixels are converted to bitmap's native format using either user-supplied LUT (if
given) or bitmap's own colormap.

Draw mode of the supplied GC is ignored, the operation is always bulk copy.

Inputs

obj         - A bitmap to draw image on
gc          - A GC used for drawing
pixels      - A pointer to source pixel array
modulo      - Total number of bytes per line in the source array
x, y        - Top-left corner of the destination rectangle
width       - Width of the image to draw
height      - Height of the image to draw
pixlut      - An optional pointer to a LUT to use. NULL means using bitmap's
              own colormap (if available)
transparent - Value of pixels in the source array which will be made
              transparent

Result

None

moHidd_BitMap_ReleaseDirectAccess

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_ReleaseDirectAccess *msg);

VOID HIDD_BM_ReleaseDirectAccess(OOP_Object *obj);

Inputs

obj -

moHidd_BitMap_SetColorMap

Synopsis

OOP_Object * OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_SetColorMap *msg);

OOP_Object * HIDD_BM_SetColorMap(OOP_Object *obj, OOP_Object *colorMap);

Inputs

obj      -
colorMap -

moHidd_BitMap_SetColors

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_SetColors *msg);

BOOL HIDD_BM_SetColors (OOP_Object *obj, HIDDT_Color *colors,
                        UWORD firstColor, UWORD numColors);

Function

Sets values for one or more colors in the colormap object associated with the
bitmap.

The colormap will be created if it does not exist.

Only ARGB values from the source array are taken into account. pixval member is
updated with the real pixel value for every color.

Inputs

obj        - A bitmap object whose colormap needs to be set
colors     - A pointer to source data array
firstColor - Number of the first color to set
numColors  - Number of subsequent colors to set

Result

TRUE on success, FALSE in case of some error (like out of memory)

See also

CLID_Hidd_ColorMap/moHidd_ColorMap_SetColors


moHidd_BitMap_SetRGBConversionFunction

Synopsis

HIDDT_RGBConversionFunction
OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_SetRGBConversionFunction *msg);

HIDDT_RGBConversionFunction
HIDD_BM_SetRGBConversionFunction(OOP_Object *obj, HIDDT_StdPixFmt srcPixFmt,
                                 HIDDT_StdPixFmt dstPixFmt,
                                 HIDDT_RGBConversionFunction function);

moHidd_BitMap_UnmapPixel

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_UnmapPixel *msg);

VOID HIDD_BM_UnmapPixel(OOP_Object *obj, HIDDT_Pixel pixel, HIDDT_Color *color);

Inputs

obj   -
pixel -
color -

moHidd_BitMap_UpdateRect

Synopsis

VOID OOP_DoMethod(OOP_Object *obj, struct pHidd_BitMap_UpdateRect *msg);

VOID HIDD_BM_UpdateRect(OOP_Object *obj, WORD x, WORD y, WORD width, WORD height);

Function

Update displayed image of the given rectangle.

Some drivers (like VGA and VESA) may work not with VRAM directly, but with a mirrored
copy of it. Usually it is done in case if VRAM reading is slow. This method is called
by the system after it completes any drawing operation, in order to make sure that
changes made are visible on the actual screen. If your driver uses mirroring, this method
should copy the given rectangle (at least) from the mirror buffer to the actual VRAM.

This method is also called after changing currently visible bitmap (after moHidd_Gfx_Show
method call) in order to allow the mirroring driver to refresh the screen after current bitmap
changed. Note that moHidd_Gfx_ShowViewPorts is very different and moHidd_BitMap_UpdateRect
will not be called if it succeeded!

Inputs

obj    - an object whose image to refresh
x, y   - A top-left edge of the rectangle to refresh
width  - Width of the rectangle to refresh
height - Height of the rectangle to refresh

Result

None.

Notes

This method is called also on offscreen bitmaps. You should track visible state of your bitmap
and ignore these calls if it's not currently visible on the screen.

hidd.gfx.pixfmt

aoHidd_PixFmt_CgxPixFmt      

aoHidd_PixFmt_CgxPixFmt

Synopsis

[..G], ULONG

Function

Returns pixelformat number according to CyberGraphX standard or -1
if the pixelformat has no correct representation in CGX (for example,
planar pixelformats).

CLID_Hidd_ColorMap

aoHidd_ColorMap_NumEntries moHidd_ColorMap_GetColor moHidd_ColorMap_GetPixel moHidd_ColorMap_SetColors

aoHidd_ColorMap_NumEntries

Synopsis

[I.G], ULONG

Function

Number of colors in the colormap.

moHidd_ColorMap_GetColor

Synopsis

BOOL OOP_DoMethod(OOP_Object *o, struct pHidd_ColorMap_GetColor *msg);

BOOL HIDD_CM_GetColor(OOP_Object *obj, ULONG colorNo, HIDDT_Color *colorReturn);

Inputs

obj         -
colorNo     -
colorReturn -

moHidd_ColorMap_GetPixel

Synopsis

HIDDT_Pixel OOP_DoMethod(OOP_Object *obj, struct pHidd_ColorMap_GetPixel *msg);

HIDDT_Pixel HIDD_CM_GetPixel(OOP_Object *obj, ULONG pixelNo);

Inputs

obj     -
pixelNo -

moHidd_ColorMap_SetColors

Synopsis

BOOL OOP_DoMethod(OOP_Object *obj, struct pHidd_ColorMap_SetColors *msg);

BOOL HIDD_CM_SetColors(OOP_Object *obj, HIDDT_Color *colors, ULONG firstColor,
                       ULONG numColors, OOP_Object *pixFmt);

Inputs

obj        -
colors     -
firstColor -
numColors  -
pixFmt     -

hidd.gfx.bitmap.planarbm

--background_planarbm-- aoHidd_PlanarBM_AllocPlanes aoHidd_PlanarBM_BitMap  

--background_planarbm--

Notes

This is a class representing a planar Amiga(tm) bitmap in AROS graphics subsystem.

When you create an object of this class, an associated planar bitmap will be created.
However, it's possible to use this class with pre-existing bitmaps, making them
available to the Gfx Hidd subsystem.

aoHidd_PlanarBM_AllocPlanes

Synopsis

[I..], BOOL

Function

Set this attribute to FALSE if you want to create an empty bitmap object containing
no bitmap data. Useful if you want to create an empty object to be associated with
existing bitmap later.

Notes

This attribute is obsolete. It's equal to supplying aoHidd_PlanarBM_BitMap attribute
with a NULL value.

aoHidd_PlanarBM_BitMap

Synopsis

[ISG], struct BitMap *

Function

Allows to specify or retrieve a raw planar bitmap structure associated with the object.
Useful for direct access to the bitmap within subclasses, as well as for associating
an object with already existing BitMap structure.

It is valid to pass this attribute with a NULL value. In this case the object becomes
empty and contains no actual bitmap.

Notes

If the object was created with own bitmap data (with no aoHidd_PlanarBM_BitMap specified
during creation), this data will be deallocated when you set this attribute.

It's up to you to deallocate own bitmaps, set using this attribute. Even if the object
is disposed, it won't deallocate user-supplied bitmap.

Docutils System Messages

System Message: ERROR/3 (/home/vsts/work/1/b/documentation/web/documentation/developers/autodocs/gfx_hidd.en, line 1585); backlink

Unknown target name: "mohidd_gfx_newgc".

System Message: ERROR/3 (/home/vsts/work/1/b/documentation/web/documentation/developers/autodocs/gfx_hidd.en, line 4802); backlink

Unknown target name: "aohidd_pixfmt_stdpixfmt".

Copyright © 1995-2024, The AROS Development Team. All rights reserved.
Amiga®, AmigaOS®, Workbench and Intuition are trademarks of Amiga Inc. All other trademarks belong to their respective owners.