Functions | |
double | mdlColor_intensityOf (UInt32 red, UInt32 green, UInt32 blue) |
Returns the intensity of an RGB triad. More... | |
int | mdlColor_getBestBWContrast (UInt32 red, UInt32 green, UInt32 blue) |
Returns the best contrast value for the specified RGB triad. More... | |
int | mdlColor_interpolateColors (byte *pInterpRgbs, RgbColorDef *pStart, RgbColorDef *pEnd, int rangeCount, int hsvRgbFlag) |
Used to generate a graduating scale of RGB values from a beginning and ending set of RGB values. More... | |
int | mdlColor_elementColorToRGB (byte *pRgb, int *pMstrElemColor, DgnModelRefP modelRef, UInt32 elementColor, DgnPlatform::HsvColorDef *pHsvTable) |
Used to obtain the RGB value corresponding to a design file colortable color number. More... | |
int | mdlColor_singleRgbToFixedColor (byte *pFixedIndex, int redValue, int grnValue, int bluValue) |
Finds the color index in the current color table for the given RGB triad. More... | |
void | mdlColor_paletteToFixedColors (byte *pFixedPalette, byte *pRedMap, byte *pGrnMap, byte *pBluMap, int paletteSize) |
Finds the color entries for the specified RGB color entries. More... | |
int | mdlColor_byteMapToFixedColors (byte *pFixed, byte *pByteMap, byte *pRedMap, byte *pGrnMap, byte *pBluMap, int paletteSize, Point2d *pSize) |
Applies a palette of fixed colors from the RGB entries to the specified byte-mapped image. More... | |
int | mdlColor_packByteToFixedColors (byte *pFixed, byte *pPackByte, byte *pRedMap, byte *pGrnMap, byte *pBluMap, int paletteSize, Point2d *pSize) |
Applies a palette of fixed colors from the RGB entries to the specified packbyte image. More... | |
int | mdlColor_rgbToFixedColors (byte *pFixed, byte *pRgb, Point2d *pSize) |
Applies the palette of fixed colors to the specified RBG image. More... | |
int | mdlColor_elementColorToRGBInFile (byte *pRgb, DgnFileP dgnFile, UInt32 elementColor, DgnPlatform::HsvColorDef *pHsvTable) |
Used to obtain the RGB value corresponding to a design file colortable color number. More... | |
int | mdlColor_elementColorFromRGBInFile (DgnFileP dgnFile, byte *pRgb) |
Used to obtain an appropriate element color number corresponding to a given DGN file and an RGB value. More... | |
int | mdlColor_elementColorFromRGB (DgnModelRefP modelRef, byte *pRgb) |
Used to obtain an appropriate element color number corresponding to a given model reference and an RGB value. More... | |
void | mdlColor_rgbToHsv (DgnPlatform::HsvColorDef *pHsv, RgbColorDef const *pRgb) |
Translates an RGB (Red-Green-Blue) color definition into its corresponding HSV (Hue-Saturation-Value) color definition. More... | |
void | mdlColor_hsvToRgb (RgbColorDef *pRgb, DgnPlatform::HsvColorDef const *pHsv) |
mdlColor_hsvToRgb translates an HSV (Hue-Saturation-Value) color definition into its corresponding RGB (Red-Green-Blue) color definition. More... | |
double | mdlColor_luminosityOf (UInt32 red, UInt32 green, UInt32 blue) |
Returns the luminosity of an RGB triad. More... | |
double | mdlColor_brightnessOf (UInt32 red, UInt32 green, UInt32 blue) |
Returns the brightness of an RGB triad. More... | |
Returns the brightness of an RGB triad.
The red, green and blue members of the RGB are passed in as individual parameters.
[in] | red | Red component of RGB |
[in] | green | Green component of RGB |
[in] | blue | Blue component of RGB |
int mdlColor_byteMapToFixedColors | ( | byte * | pFixed, |
byte * | pByteMap, | ||
byte * | pRedMap, | ||
byte * | pGrnMap, | ||
byte * | pBluMap, | ||
int | paletteSize, | ||
Point2d * | pSize | ||
) |
Applies a palette of fixed colors from the RGB entries to the specified byte-mapped image.
[out] | pFixed | The fixed color image (must be malloc'ed by caller) |
[in] | pByteMap | The byte-mapped image |
[in] | pRedMap | Red palette entries |
[in] | pGrnMap | Green palette entries |
[in] | pBluMap | Blue palette entries |
[in] | paletteSize | Number of palette entries |
[in] | pSize | The size of the image in pixels, X and Y |
int mdlColor_elementColorFromRGB | ( | DgnModelRefP | modelRef, |
byte * | pRgb | ||
) |
Used to obtain an appropriate element color number corresponding to a given model reference and an RGB value.
[in] | modelRef | Indicates the master design file (MASTERFILE) or an attached reference file. |
[in] | pRgb | Points to an RGB value that needs a corresponding colortable color number. |
int mdlColor_elementColorFromRGBInFile | ( | DgnFileP | dgnFile, |
byte * | pRgb | ||
) |
Used to obtain an appropriate element color number corresponding to a given DGN file and an RGB value.
[in] | dgnFile | Indicates the design file where the intended color map resides. |
[in] | pRgb | Points to an RGB value that needs a corresponding colortable color number. |
int mdlColor_elementColorToRGB | ( | byte * | pRgb, |
int * | pMstrElemColor, | ||
DgnModelRefP | modelRef, | ||
UInt32 | elementColor, | ||
DgnPlatform::HsvColorDef * | pHsvTable | ||
) |
Used to obtain the RGB value corresponding to a
design file colortable color number.
It can also be used to translate reference file color numbers to the closest matching master design file color number when different color tables are attached to each design file.
[out] | pRgb | Points to a buffer to receive the RGB value. |
[in] | pMstrElemColor | Is only valid when colorIndex is an index to a reference file's color table; otherwise pMstrElemColorP is ignored. (colorIndex will be an index to a reference file's color table when fileNum is greater than zero). The integer pointed to by mstrElemColorP will be updated to contain the closest matching color to colorIndex that exists in the master colortable index. |
[in] | modelRef | Indicates to which model's colortable the colorIndex parameter applies. If set to MASTERFILE, the active model's color table is used. |
[in] | elementColor | Is the element color value (may contain true color in high bytes). |
[in] | pHsvTable | Is a pointer to the master design file's colortable converted to HSV values. This is usually set to NULL. |
int mdlColor_elementColorToRGBInFile | ( | byte * | pRgb, |
DgnFileP | dgnFile, | ||
UInt32 | elementColor, | ||
DgnPlatform::HsvColorDef * | pHsvTable | ||
) |
Used to obtain the RGB value corresponding to a design file colortable color number.
It can also be used to translate reference file color numbers to the closest matching master design file color number when different color tables are attached to each design file.
[out] | pRgb | Points to a buffer to receive the RGB value. |
[in] | dgnFile | Indicates to which file's colortable the colorIndex parameter applies. |
[in] | elementColor | Is the element color value (may contain true color in high bytes). |
[in] | pHsvTable | Is a pointer to the master design file's colortable converted to HSV values. This is usually set to NULL. |
Returns the best contrast value for the specified RGB triad.
The red, green and blue members of the RGB are passed in as individual parameters.
[in] | red | Red component of RGB |
[in] | green | Green component of RGB |
[in] | blue | Blue component of RGB |
void mdlColor_hsvToRgb | ( | RgbColorDef * | pRgb, |
DgnPlatform::HsvColorDef const * | pHsv | ||
) |
mdlColor_hsvToRgb translates an HSV (Hue-Saturation-Value) color definition into its corresponding RGB (Red-Green-Blue) color definition.
[out] | pRgb | Is a pointer to where the translated color definition should be placed. |
[in] | pHsv | Is a pointer to the Hue-Saturation-Value definition to be translated. |
Returns the intensity of an RGB triad.
The red, green and blue members of the RGB are passed in as individual parameters.
[in] | red | Red component of RGB |
[in] | green | Green component of RGB |
[in] | blue | Blue component of RGB |
int mdlColor_interpolateColors | ( | byte * | pInterpRgbs, |
RgbColorDef * | pStart, | ||
RgbColorDef * | pEnd, | ||
int | rangeCount, | ||
int | hsvRgbFlag | ||
) |
Used to generate a graduating scale of RGB values from a beginning and ending set of RGB values.
The scale starts with the RGB value pointed to by startP and gradually blends over to the value pointed to by pEnd.
[out] | pInterpRgbs | Points to an array of RGB values to be filled in. The memory for this array must be allocated by the caller. |
[in] | pStart | Points to a beginning RGB value specifying one end of the color scale. |
[in] | pEnd | Points to an ending RGB value specifying the opposite end of the color scale from pStart. |
[in] | rangeCount | Indicates the number of RGB values to be generated in the scale. The array pointed to by interpRgbP must be large enough to hold rangeCount RGBs. |
[in] | hsvRgbFlag | Indicates whether the color interpolation should be generated across RGB or HSV space. Zero indicates HSV color space. Non-zero indicates RGB color space. |
Returns the luminosity of an RGB triad.
The red, green and blue members of the RGB are passed in as individual parameters.
[in] | red | Red component of RGB |
[in] | green | Green component of RGB |
[in] | blue | Blue component of RGB |
int mdlColor_packByteToFixedColors | ( | byte * | pFixed, |
byte * | pPackByte, | ||
byte * | pRedMap, | ||
byte * | pGrnMap, | ||
byte * | pBluMap, | ||
int | paletteSize, | ||
Point2d * | pSize | ||
) |
Applies a palette of fixed colors from the RGB entries to the specified packbyte image.
[out] | pFixed | The fixed color image (must be malloc'ed by caller) |
[in] | pPackByte | The packbyte image |
[in] | pRedMap | Red palette entries |
[in] | pGrnMap | Green palette entries |
[in] | pBluMap | Blue palette entries |
[in] | paletteSize | Number of palette entries |
[in] | pSize | The size of the image in pixels, X and Y |
void mdlColor_paletteToFixedColors | ( | byte * | pFixedPalette, |
byte * | pRedMap, | ||
byte * | pGrnMap, | ||
byte * | pBluMap, | ||
int | paletteSize | ||
) |
Finds the color entries for the specified RGB color entries.
[out] | pFixedPalette | the array of fixed colors in the color palette |
[in] | pRedMap | Red palette entries |
[in] | pGrnMap | Green palette entries |
[in] | pBluMap | Blue palette entries |
[in] | paletteSize | Number of palette entries |
Applies the palette of fixed colors to the specified RBG image.
[out] | pFixed | The fixed color image (must be malloc'ed by caller) |
[in] | pRgb | The RGB image to apply the colors to |
[in] | pSize | The size of the image, X and Y |
void mdlColor_rgbToHsv | ( | DgnPlatform::HsvColorDef * | pHsv, |
RgbColorDef const * | pRgb | ||
) |
Translates an RGB (Red-Green-Blue) color definition into its corresponding HSV (Hue-Saturation-Value) color definition.
[out] | pHsv | Is a pointer to where the translated color definition should be placed. |
[in] | pRgb | Is a pointer to the Red-Green-Blue definition to be translated into an HSV color. |
int mdlColor_singleRgbToFixedColor | ( | byte * | pFixedIndex, |
int | redValue, | ||
int | grnValue, | ||
int | bluValue | ||
) |
Finds the color index in the current color table for the given RGB triad.
[out] | pFixedIndex | the color table index for the given color |
[in] | redValue | Red component of RGB |
[in] | grnValue | Green component of RGB |
[in] | bluValue | Blue component of RGB |