Interface ID: IID_IMoaMmColor
Pointer type: PIMoaMmColor
Inheritance: IMoaUnknown
Header file: mmiClr.h
This interface provides methods used to manipulate a MoaMmColorSpec. ColorToValue()
and ValueToColor() convert between MoaMmColorSpec and MoaMmValue type. Included
for convenience are IndexToRGB() and RGBToIndex(), which are exact duplicates
of methods in IMoaUtils2.
typedef MoaByte MoaMmColorIndex, FAR * PMoaMmColorIndex; typedef struct { MoaByte red; MoaByte green; MoaByte blue; } MoaMmRGBTriple, FAR *PMoaMmRGBTriple; typedef const MoaMmRGBTriple FAR * ConstPMoaMmRGBTriple; typedef struct { union { MoaMmRGBTriple rgb; /* rgb color */ MoaMmColorIndex index; /* palette index */ } color; MoaByte type; } MoaMmColorSpec, FAR *PMoaMmColorSpec; typedef const MoaMmColorSpec FAR * ConstPMoaMmColorSpec;
- ColorToValue(PIMoaMmColor This,
- ConstPMoaMmColorSpec pColor,
PMoaMmValue pValue)
This
IMoaMmColor
interfacepColor
ConstPMoaMmColorSpec
pValue
PMoaMmValue
MoaError
Creates a new color type MoaMmValue from a MoaMmColorSpec. On entry, pColor contains a pointer to a MoaMmColorSpec to be used as the basis for the new value. pValue contains a pointer to a MoaMmValue to receive the result. This call populates the MoaMmValue at pValue with a new MoaMmValue, overwriting any current value. Make sure to release any preexisting value before making this call. The caller is responsible for releasing the returned value. See IMoaValue::ValueRelease().
- IndexToRGB(PIMoaMmColor This,
- MoaMmColorIndex index,
PMoaMmRGBTriple pRGBColor)
This
IMoaMmColor
interfaceindex
MoaMmColorIndex
The color index of the palette
entry pRGBColor
PMoaMmRGBTriple
Pointer to a MoaMmRGBTriple
to receive the resultMoaError
Replaces Index2Color() on the Macintosh. Cross-platform method to convert color
index specified to the corresponding RGB color in the current color palette.
The palette currently in use by the playback window device is used for the lookup.
The device must be set to indexed color (less than or equal to 8 bits pixel
depth) for this method to work properly. If the device is set to a direct color
mode (greater than 8 bits), the results are unpredictable. index specifies the
color index of the palette entry of interest. pRGBColor contains a pointer to
a MoaMmRGBTriple to receive the result.
- RGBToIndex(PIMoaMmColor This,
- ConstPMoaMmRGBTriple pRGBColor,
PMoaMmColorIndex pIndex)
This
IMoaMmColor
interfacepRGBColor
ConstPMoaMmRGBTriple
pIndex
PMoaMmColorIndex
MoaError
Description
Cross-platform method to convert RGB value specified to the closest corresponding index in the current color palette.
- ValueToColor(PIMoaMmColor This,
- ConstPMoaMmValue pValue,
PMoaMmColorSpec pColor)
This
IMoaMmColor
interfacepValue
ConstPMoaMmValue
Const pointer to a color-type
MoaMmValue pColor
PMoaMmColorSpec
Pointer to a MoaMmColorSpec
to receive the resultMoaError