LBitmap::ChannelMix

#include "ltwrappr.h"

virtual L_INT LBitmap::ChannelMix (pRedFactor, pGreenFactor, pBlueFactor)

COLORDATA L_FAR* pRedFactor;

/* pointer to a structure */

COLORDATA L_FAR* pGreenFactor;

/* pointer to a structure */

COLORDATA L_FAR* pBlueFactor;

/* pointer to a structure */

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

Parameter

Description

pRedFactor

Pointer to a COLORDATA structure that contains the values to use for redistributing the bitmap's red values.

pGreenFactor

Pointer to a COLORDATA structure that contains the values to use for redistributing the bitmap's green values.

pBlueFactor

Pointer to a COLORDATA structure that contains the values to use for redistributing the bitmap's blue values.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function is used to rebalance the colors in a bitmap. It can be used to make color adjustments and corrections.

This function supports 1-, 2-, 3-, 4-, 5-, 6-, 7-, 8-, 24- and 48-bit bitmaps and can support regions for 24- and 48-bit bitmaps. If the bitmap has a region, the effect will be applied on the region only.

This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ConvertToColoredGray, LBitmap::BalanceColors, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale

Topics:

Correcting Colors

 

Raster Image Functions: Modifying Intensity Values

 

Color Halftones and Halftone Images

 

Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

 

Raster Image Functions: Correcting Colors

Example

/* The following example applies the LBitmap::ChannelMix function to it: */
void TestFunction(LAnimationWindow *BitmapWindow) 
{
  COLORDATA RedFact, GreenFact, BlueFact; 
  RedFact.uStructSize = sizeof(COLORDATA); 
  GreenFact.uStructSize = sizeof(COLORDATA); 
  BlueFact.uStructSize = sizeof(COLORDATA); 
  RedFact.nRedFactor = 250; 
  RedFact.nGreenFactor = 255; 
  RedFact.nBlueFactor = 222; 
  RedFact.nConstant = 0; 
  GreenFact.nRedFactor = 100; 
  GreenFact.nGreenFactor = 0; 
  GreenFact.nBlueFactor = 250; 
  GreenFact.nConstant = 0; 
  BlueFact.nRedFactor = 5; 
  BlueFact.nGreenFactor = 0; 
  BlueFact.nBlueFactor = 0; 
  BlueFact.nConstant = 0; 
   
  BitmapWindow->ChannelMix( &RedFact, &GreenFact, &BlueFact); 
}