Functions | |
int | mdlColorPal_create (DgnPlatform::BSIColorPalette **ppPalette, int numEntries) |
Used to create a MicroStation color palette. More... | |
int | mdlColorPal_destroy (DgnPlatform::BSIColorPalette **ppPalette) |
Used to free a color palette and its constituent color descriptors. More... | |
int | mdlColorPal_queryEntry (void *pReply, int replyDataSize, DgnPlatform::BSIColorPalette *pPalette, int index, long queryMethodId, int screen) |
Retrieves a single entry from the specified color palette. More... | |
int | mdlColorPal_getDrawValue (long *pDrawIndex, DgnPlatform::BSIColorPalette *pPalette, int index, int screen) |
Used to acquire a draw value from a color palette entry for a given screen. More... | |
int | mdlColorPal_setPaletteFromColortable (DgnPlatform::BSIColorPalette *pPalette, byte *pCtbl) |
Set a color palette of 256 entries from a 256 color colortable. More... | |
int | mdlColorPal_modifyStatus (DgnPlatform::BSIColorPalette *pPalette, UInt32 statusMask, int setFlag) |
Change the status of a color palette. More... | |
BSIColorDescr * | mdlColorPal_getColorDescr (DgnPlatform::BSIColorPalette *pPalette, int index) |
Used to obtain a color descriptor pointer from the palette entry indicated by index. More... | |
int | mdlColorPal_getNumColors (DgnPlatform::BSIColorPalette *pPalette) |
Returns the number of color entries defined in the color palette pointed to by paletteP. More... | |
int | mdlColorPal_getElemColorDescrByModelRef (BSIColorDescr **ppCd, int colorNumber, DgnModelRefP modelRef, int screen) |
Returns a color descriptor obtained from the specified model for the given color index. More... | |
int | mdlColor_getNumLoadedColors (int screen) |
Returns the number of colors loaded for the specified screen. More... | |
int mdlColor_getNumLoadedColors | ( | int | screen | ) |
Returns the number of colors loaded for the specified screen.
[in] | screen | The index of the screen to get the information from |
int mdlColorPal_create | ( | DgnPlatform::BSIColorPalette ** | ppPalette, |
int | numEntries | ||
) |
Used to create a MicroStation color palette.
A MicroStation color palette is a collection of color descriptors. Each color descriptor, in turn, allows a programmer to define a color for drawing to a window without regard to the color capabilities of the video hardware present. For example, a color palette of 300 color descriptors may be set up even if the hardware capabilities of the current system can only display 16 colors. This helps to provide for hardware independent applications.
[out] | ppPalette | Is the address of a color palette pointer. The pointer will be set to the newly allocated palette. When an application terminates, the palette and all associated descriptors are automatically freed. After allocating a color palette, mdlColorPal_setEntries must be called to initialize the color descriptors therein. |
[in] | numEntries | Parameter specifies the number of color descriptors in the palette. |
int mdlColorPal_destroy | ( | DgnPlatform::BSIColorPalette ** | ppPalette | ) |
Used to free a color palette and its constituent color descriptors.
[in,out] | ppPalette | is the address of a color palette pointer which will be freed and afterwards set to NULL. |
BSIColorDescr* mdlColorPal_getColorDescr | ( | DgnPlatform::BSIColorPalette * | pPalette, |
int | index | ||
) |
Used to obtain a color descriptor pointer from the palette entry indicated by index.
[in] | pPalette | Is a pointer to a palette obtained from mdlColorPal_create. If pPalette is NULL, the color palette associated with the currently attached colortable is used. |
[in] | index | Indicates the entry in the palette for which a color descriptor pointer is desired. |
int mdlColorPal_getDrawValue | ( | long * | pDrawIndex, |
DgnPlatform::BSIColorPalette * | pPalette, | ||
int | index, | ||
int | screen | ||
) |
Used to acquire a draw value from a color palette
entry for a given screen.
This function rarely needs to be called from MDL applications since drawing routines accept pointers to color descriptors directly. MicroStation uses this function internally to obtain the draw values contained in color palette entries. This function is equivalent to calling mdlColorPal_getColorDescr followed by mdlColorDescr_getDrawIndex.
[out] | pDrawIndex | Is the address of a memory location to receive the draw value. Depending on the hardware/operating system platform, the draw value will be a video hardware pixel index or the native operating system's equivalent type. |
[in] | pPalette | Is a pointer to a palette obtained from mdlColorPal_create. If pPalette is NULL, the color palette associated with the currently attached colortable is used. |
[in] | index | Indicates the entry in the palette for which a draw value is desired. |
[in] | screen | Indicates for which drawing surface a draw value is desired. |
Error Code | Reason |
---|---|
MDLERR_BADSCREENNUMBER | Invalid screen parameter |
MDLERR_BADCOLORPALETTE | Invalid pPalette |
int mdlColorPal_getElemColorDescrByModelRef | ( | BSIColorDescr ** | ppCd, |
int | colorNumber, | ||
DgnModelRefP | modelRef, | ||
int | screen | ||
) |
Returns a color descriptor obtained from the specified model for the given color index.
[in,out] | ppCd | A pointer to a color descriptor pointer that indicates the structure where the data will be copied. |
[in] | colorNumber | The index of the color in the color table to get the color descriptor from. |
[in] | modelRef | The model to get the color descriptor from. |
[in] | screen | The index of the screen (if needed) |
int mdlColorPal_getNumColors | ( | DgnPlatform::BSIColorPalette * | pPalette | ) |
Returns the number of color entries defined in the color palette pointed to by paletteP.
[in] | pPalette | Parameter is a pointer to a palette obtained from mdlColorPal_create. |
int mdlColorPal_modifyStatus | ( | DgnPlatform::BSIColorPalette * | pPalette, |
UInt32 | statusMask, | ||
int | setFlag | ||
) |
Change the status of a color palette.
[out] | pPalette | Points to the palette whose status is to be changed. |
[in] | statusMask | Indicates the status bits to be affected. Currently the only valid status bit mask is PALSTATUS_SYNCHABLE. This is used by the MicroStation Color Manager to determine if a color palette should be synchronized to changes in the MicroStation color environment. By default, this status bit is set to the ON position. |
[in] | setFlag | Indicates whether the status bits should be turned on (1) or off (0). |
int mdlColorPal_queryEntry | ( | void * | pReply, |
int | replyDataSize, | ||
DgnPlatform::BSIColorPalette * | pPalette, | ||
int | index, | ||
long | queryMethodId, | ||
int | screen | ||
) |
Retrieves a single entry from the specified color palette.
[in,out] | pReply | The location to store the query reply data. |
[in] | replyDataSize | Maximum size of caller's reply data area. |
[in] | pPalette | The palette to get the entry data from. |
[in] | index | The index of the palette entry to get. |
[in] | queryMethodId | The method to use to query the palette entry. |
[in] | screen | The index of the screen (if needed). |
int mdlColorPal_setPaletteFromColortable | ( | DgnPlatform::BSIColorPalette * | pPalette, |
byte * | pCtbl | ||
) |
Set a color palette of 256 entries from a 256 color colortable.
Internally, this function will call mdlColorPal_setEntries, automatically specifying a setMethod of COLORD_RGB for each of the colors in the colortable.
[out] | pPalette | Parameter points to the color palette to be initialized. |
[in] | pCtbl | Parameter points to the RGB values to use to set the color palette. |
Error Code | Reason |
---|---|
MDLERR_BADCOLORPALETTE | Invalid pPalette |
MDLERR_BADCOLORTABLE | Invalid pCtbl |
MDLERR_PALETTEWRONGSIZE | the color palette is not 256 entries in size |