Home > C: Programming > Function Descriptions > History back  Previous chapter  Next chapter  Print  

is_SetConvertParam

uEye Camera Manual Version 3.80

is_SetConvertParam

Windows_Logo

Linux_Logo

USB 2.0

GigE

USB 2.0

GigE

Syntax

INT is_SetConvertParam (HIDS hCam,
BOOL ColorCorrection,
INT BayerConversionMode, INT ColorMode, INT Gamma,
double* WhiteBalanceMultipliers)

Description

Using is_SetConvertParam(), you can set the parameters for converting a raw Bayer image to a color image. To convert the image, use the is_ConvertImage() function.

Input Parameters

hCam

Camera handle

ColorCorrection

Enables / disables color correction.

BayerConversionMode

Sets the Bayer conversion mode.

IS_SET_BAYER_CV_BETTER

Normal quality

IS_SET_BAYER_CV_BEST

Best quality (higher CPU load)

ColorMode

Sets the color mode for the output image.

For a list of all available color formats and the associated input parameters, see the Appendix: Color and Memory Formats section.

Gamma

Gamma value multiplied by 100. Range: [1…1000]

WhiteBalanceMultipliers

Pointer to an array containing the red, green and blue gain values

Return Values

IS_SUCCESS

Function executed successfully

IS_NO_SUCCESS

General error message

IS_INVALID_COLOR_FORMAT

Invalid ColorMode parameter

IS_INVALID_PARAMETER

Other invalid parameter.

Related Functions

is_ConvertImage()
is_SetColorMode()
is_SetColorConverter()

Code Sample

Conversion of a raw Bayer image to RGB24. The memory is allocated automatically.


INT nRet;

char * pcSource;

INT nIDSource;

INT nX,nY,nBits,nPitch;

 

// Create raw Bayer test image

is_AllocImageMem (hCam, 256, 256, 8, &pcSource, &nIDSource);

is_InquireImageMem (hCam, pcSource, nIDSource, &nX ,&nY, &nBits, &nPitch);

for (int j = 0; j<nY; j++)

{

   for (int i = 0; i<nX; i++)

   {

       pcSource[i + j * nPitch] = i;

   }

}

 

// Define conversion parameters (example)

INT Gamma = 120;

double rgbGains[3];

rgbGains[0] = 1.0 ; // Red channel gain

rgbGains[1] = 3.0 ; // Green channel gain

rgbGains[2] = 1.0 ; // Blue channel gain

 

char* pcDest; // Pointer to the newly allocated image memory

INT nIDDest; // ID of the newly allocated image memory

 

 

// Set conversion parameters

nRet = is_SetConvertParam(hCam, TRUE, IS_SET_BAYER_CV_BETTER, IS_CM_RGB8_PACKED, Gamma, rgbGains);

 

// Convert image

if (nRet == IS_SUCCESS)

{

   pcDest = NULL;

  is_ConvertImage(hCam, pcSource, nIDSource, &pcDest, &nIDDest, 0);

}

 

// Release allocated image memory

is_FreeImageMem (hCam, pcSource, nIDSource);

is_FreeImageMem (hCam, pcDest, nIDDest);


Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!


© 2010 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com