MM Developer's Guide
MM Interfaces | MM Methods | MM Types and Misc API


IMoaMmColor



Interface ID: IID_IMoaMmColor
Pointer type: PIMoaMmColor
Inheritance: IMoaUnknown
Header file: mmiClr.h

Description

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.

Constants and Structures

MoaMmColorSpec
MoaMmRGBTriple
MoaMmColorIndex
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;


Methods

ValueToColor()
ColorToValue()
RGBToIndex()
IndexToRGB()

ColorToValue()

Syntax

ColorToValue(PIMoaMmColor This,
ConstPMoaMmColorSpec pColor,
PMoaMmValue pValue)

Parameters

This
Pointer to the IMoaMmColor interface

pColor
ConstPMoaMmColorSpec 
ConstPointer to a moaMmColorSpec used as the basis for the new value

pValue
PMoaMmValue  
Pointer to a MoaMnValue that receives the result

Returns

MoaError

Description

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()

Syntax

IndexToRGB(PIMoaMmColor This,
MoaMmColorIndex index,
PMoaMmRGBTriple pRGBColor)

Parameters

This
Pointer to the IMoaMmColor interface

index
MoaMmColorIndex  The color index of the palette entry

pRGBColor
PMoaMmRGBTriple  Pointer to a MoaMmRGBTriple to receive the result

Returns

MoaError
 
 
Description

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()

Syntax

RGBToIndex(PIMoaMmColor This,
ConstPMoaMmRGBTriple pRGBColor,
PMoaMmColorIndex pIndex)

Parameters

This
Pointer to the IMoaMmColor interface

pRGBColor
ConstPMoaMmRGBTriple  

pIndex
PMoaMmColorIndex  

Returns

MoaError

Description

Cross-platform method to convert RGB value specified to the closest corresponding index in the current color palette.


ValueToColor()

Syntax

ValueToColor(PIMoaMmColor This,
ConstPMoaMmValue pValue,
PMoaMmColorSpec pColor)

Parameters

This
Pointer to the IMoaMmColor interface

pValue
ConstPMoaMmValue  Const pointer to a color-type MoaMmValue

pColor
PMoaMmColorSpec  Pointer to a MoaMmColorSpec to receive the result

Returns

MoaError

Description

Obtains the MoaMmColorSpec for a color-type MoaMmValue. pMoaMmColorSpec is a pointer to a MoaMmColorSpec to receive the result. Returns kMoaMmErr_colorExpected if pValue is not a color-type value.

Copyright © 1995-2007 Adobe Macromedia Software LLC, Inc.