Functions | |
int | mdlColor_attachColorTable (WCharCP pCtName, byte *pCtbl) |
Lets an application attach a new color table to a design file. More... | |
void | mdlColor_getColorTable (byte *pColorTable) |
Obtains a copy of the color table that is currently attached to the active design file. More... | |
StatusInt | mdlColor_getColorTableByModelRef (byte *pColorTable, DgnModelRefP modelRef) |
Obtains a copy of the color table that is currently used by the specified modelRef. More... | |
int | mdlColor_getName (WCharP pCtName) |
Returns the name of the active color table in use with the design file. More... | |
int | mdlColor_getNameByModelRef (WCharP pCtName, DgnModelRefP modelRef) |
Returns the name of the color table from the specified model. More... | |
void | mdlColor_getDefaultColorTable (byte *pColorTable) |
Obtains a copy of the default color table used by MicroStation when no color table is attached to the active design file. More... | |
void | mdlColor_getAutocadColorTable (byte *pPalette) |
Returns a pointer to a 768 byte color table. More... | |
int | mdlColor_searchRGBArray (RgbColorDef *pRgbColor, void *pRgbTable, int numColors) |
Will find the closest matching RGB to a target RGB from an array of RGB's. More... | |
StatusInt | mdlColor_rgbColorFromRawColorInFile (RgbColorDefP pRGB, UInt32 rawColor, DgnFileP dgnFile) |
If the rawColor contains RGB color then that color is returned in *pColor. More... | |
StatusInt | mdlColor_rgbColorFromRawColor (RgbColorDefP pRGB, UInt32 rawColor, DgnModelRefP modelRef) |
If the rawColor contains RGB color then that color is returned in *pColor. More... | |
StatusInt | mdlColor_rawColorFromRGBColor (UInt32 *pRawColor, RgbColorDefCP pRGBColor, DgnModelRefP modelRef) |
Set *pRawColor to represent the RGB color value specified by *pRGBColor. More... | |
UInt32 | mdlColor_v8ColorFromRawColor (UInt32 rawColor) |
The high bytes of color UInt32 are be used to optionally store a color RGB value. More... | |
int mdlColor_attachColorTable | ( | WCharCP | pCtName, |
byte * | pCtbl | ||
) |
Lets an application attach a new color
table to a design file.
Each color definition in ctbl is mapped to the closest matching color in the Color Manager's display colors. The color code associated with each design file element will then correspond to a color in the newly attached color table. (For a more detailed discussion of color tables and their relationships to design file elements, see the beginning of this section).
[in] | pCtName | The color table's name as it will appear in the MicroStation Command Window after the attachment is complete. This is also the name that will appear when the CT=? command is entered to display the currently attached color table. ctName does not necessarily correspond to a file name. |
[in] | pCtbl | Points to 256 RGB color definitions containing a total of 768 bytes. The first entry in the table defines the background color to be used in the design file. Color definitions 2 through 256 represent color indices 0 through 254 as used by design file element color codes. |
void mdlColor_getAutocadColorTable | ( | byte * | pPalette | ) |
Returns a pointer to a 768 byte color table.
[out] | pPalette | A pointer to the color table |
void mdlColor_getColorTable | ( | byte * | pColorTable | ) |
Obtains a copy of the color table that is
currently attached to the active design file.
If no color table is attached to the design file, the MicroStation default color table is copied.
[out] | pColorTable | Points to a memory area that will receive a copy of the design file's currently attached color table. This memory area must be large enough to hold 256 RGB color definitions containing a total of 768 bytes. |
StatusInt mdlColor_getColorTableByModelRef | ( | byte * | pColorTable, |
DgnModelRefP | modelRef | ||
) |
Obtains a copy of the color table that is currently used by the specified modelRef.
[out] | pColorTable | Points to a memory area that will receive a copy of the color table used by the specified modelRef. This memory area must be large enough to hold 256 RGB color definitions containing a total of 768 bytes. |
[in] | modelRef | Model for which the color table is needed |
void mdlColor_getDefaultColorTable | ( | byte * | pColorTable | ) |
Obtains a copy of the default color
table used by MicroStation when no color table is attached to the active design file.
table. This memory area must be large enough to hold 256 RGB color definitions containing a total of 768 bytes.
[out] | pColorTable | Where to store the color table. |
int mdlColor_getName | ( | WCharP | pCtName | ) |
Returns the name of the active color table in use with the design file.
[out] | pCtName | Is the address of a 64-byte array to receive the name of the color table. |
int mdlColor_getNameByModelRef | ( | WCharP | pCtName, |
DgnModelRefP | modelRef | ||
) |
Returns the name of the color table from the specified model.
[out] | pCtName | Is the address of a 64-byte array to receive the name of the color table. |
[in] | modelRef | The model to get the name of color table from. |
StatusInt mdlColor_rawColorFromRGBColor | ( | UInt32 * | pRawColor, |
RgbColorDefCP | pRGBColor, | ||
DgnModelRefP | modelRef | ||
) |
Set *pRawColor to represent the RGB color value specified by *pRGBColor.
[out] | pRawColor | raw color |
[in] | pRGBColor | RGB color |
[in] | modelRef | modelRef |
StatusInt mdlColor_rgbColorFromRawColor | ( | RgbColorDefP | pRGB, |
UInt32 | rawColor, | ||
DgnModelRefP | modelRef | ||
) |
If the rawColor contains RGB color then that color is returned in *pColor.
[out] | pRGB | RGB color value (or NULL). |
[in] | rawColor | raw color |
[in] | modelRef | modelRef for color table |
StatusInt mdlColor_rgbColorFromRawColorInFile | ( | RgbColorDefP | pRGB, |
UInt32 | rawColor, | ||
DgnFileP | dgnFile | ||
) |
If the rawColor contains RGB color then that color is returned in *pColor.
[out] | pRGB | RGB color value (or NULL). |
[in] | rawColor | raw color |
[in] | dgnFile | DGN file for color table |
int mdlColor_searchRGBArray | ( | RgbColorDef * | pRgbColor, |
void * | pRgbTable, | ||
int | numColors | ||
) |
Will find the closest matching RGB to a target RGB from an array of RGB's.
All RGB color comparisons are done by first converting the two RGB values into HSV (Hue, Saturation, Value) values, and comparing those converted values. The hue component of the HSV is given the highest priority. Comparing HSV values results in more desirable colors in terms of what the human eye expects to see.
[in] | pRgbColor | Points to the target RGB to be matched against the array of RGBs. |
[in] | pRgbTable | Points to the RGB values that are to be searched for the closest match to the RGB value pointed to by pRgbColor. |
[in] | numColors | Indicates the number of RGB triads in the array rgbTableP. |
The high bytes of color UInt32 are be used to optionally store a color RGB value.
In this case, the low (least significant) byte will continue to store the index of the closest color in the color table. This function is used to provide backward compatibilty for these new color values in V8.5. It will return the color index for these combined color values just as they would appear in V8.5 (effectively ignoring the RGB data).
[in] | rawColor | raw color - may contain RGB in high 3 bytes. |