The IDXLookupTable interface is used to change the color balance for a set of samples. Each color in the pixel is used as an index in a table that indicates what the adjusted color value should be.
To use lookup tables, you must first create a lookup table with the IDXLUTBuilder interface, which sets the number and order of the operations performed on the samples. To obtain a pointer to a lookup table, you must call the Component Object Model (COM) QueryInterface method on an IDXLUTBuilder object.
The pointer returned from this call can be used to obtain the values contained in the lookup table. It can also be used as a parameter to the IDXSurfaceModifier::SetLookup member function, so that the lookup table can be applied to an entire DXSurface.IDXLookupTable* g_pLUT; g_pLUTBuilder->QueryInterface( IID_IDXLookupTable, (void **)&g_pLUT );
Lookup tables can be used to adjust an image's brightness, contrast, or to perform gamma correction.
This interface inherits from the IDXBaseObject interface.
IDXLookupTable Methods
ApplyTables Translates a set of samples in place. GetIndexValues Retrieves the component values for a specific index in the table. GetTables Retrieves a copy of the lookup tables. IsChannelIdentity Determines whether the application of a channel's table will have any effect.
Translates a set of samples in place.
Syntax
HRESULT ApplyTables( DXSAMPLE *pSamples, ULONG cSamples );
Parameters
- pSamples
- [in, out] Pointer to the buffer of samples to be translated.
- cSamples
- [in] Number of samples to be translated.
Return Value
Returns an HRESULT value that depends on the implementation of the interface.
Retrieves the component values for a specific index in the table.
Syntax
HRESULT GetIndexValues( ULONG Index, DXBASESAMPLE *pSample );
Parameters
- Index
- [in] Index into the lookup table from which to retrieve the translation values.
- pSample
- [out] Pointer to the location in which to store the translation values.
Return Value
Returns an HRESULT value that depends on the implementation of the interface.
Remarks
An ARGB component value will be returned from the table at the given index.
Retrieves a copy of the lookup tables.
Syntax
HRESULT GetTables( BYTE RedLUT[256], BYTE GreenLUT[256], BYTE BlueLUT[256], BYTE AlphaLUT[256] );
Parameters
- RedLUT
- [out] Location to store the red channel translation values.
- GreenLUT
- [out] Location to store the green channel translation values.
- BlueLUT
- [out] Location to store the blue channel translation values.
- AlphaLUT
- [out] Location to store the alpha channel translation values.
Return Value
Returns an HRESULT value that depends on the implementation of the interface.
Remarks
This method is useful for obtaining a snapshot of the tables.
Determines whether the application of a channel's table will have any effect.
Syntax
HRESULT IsChannelIdentity( DXBASESAMPLE *pSampleBools );
Parameters
- pSampleBools
- [out] Pointer to a DXBASESAMPLE structure that tells whether a color's lookup table is enabled.
Return Value
Returns an HRESULT value that depends on the implementation of the interface.
Remarks
A TRUE or FALSE value will be stored in each of the color components (alpha, red, green, and blue) of the returned structure. If a component has a return value of TRUE, that color is unaffected by a call to ApplyTables.
See Also
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.