Get_BinaryValue, Get_BValue, Get_GValue, Get_Histogram, Get_PixelValue, Get_Profile, Get_RValue, Int_AnalyzeFunction, RGB, WavelengthToColor
Description
Get_BValue(
dword Int_Color
);
This function extracts the blue value from the 32-bit RGB value.
Parameters
Int_Color
The RGB color as a 32bit integer. Use the RGB function to get the value.
See Also
Get_PixelValue, Get_Profile, Get_RValue, Get_GValue
Description
Get_BinaryValue( intInt_X
, intInt_Y
);
The function returns nonzero if there is any binary layer at the specified pixel, otherwise it returns zero. The function tests only selected (visible) binary layers. If there is no binary layer or none selected it returns zero.
Description
Get_GValue(
dword Int_Color
);
This function extracts the green value from the 32-bit RGB value.
Parameters
Int_Color
The RGB color as a 32bit integer. Use the RGB function to get the value.
See Also
Get_PixelValue, Get_Profile, Get_RValue, Get_BValue
Description
INT Get_Histogram( intmode
, int *lpModeData
, dword *lpMean
, dword *lpMin
, dword *lpMax
, dword *lpMaxFreq
, int *lpRed
, int *lpGreen
, int *lpBlue
, int *lpIntensity
);
This function can be used for getting the histogram in a whole image, in a rectangle, in a circle or under a binary image.
Parameters
mode
Defines if the histogram should be taken from the whole image, a rectangle, a circle or under binary.
lpModeData
Array of four integers must be passed. If the probe is rectangle, the first parameter defines the left coordinate, second the upper coordinate, third the width and fourth the height of the probe. All in pixels. If the probe is circle, the first and second parameters are X and Y and the third parameter is the radius of the probe. All in pixels. This parameter is not used if the histogram is taken from full image or under binary.
lpMean
Array of four DWORDs, where the mean red, green, blue and intensity values are filled in this order.
lpMin
Array of four DWORDs, where the minimum red, green, blue and intensity values are filled in this order.
lpMax
Array of four DWORDs, where the maximum red, green, blue and intensity values are filled in this order.
lpRed
Points to red frequencies. For a gray image it points to gray frequencies. Integer array must be passed. Mind that the required length of the array depends on the bit depth of the image.
lpGreen
Points to green frequencies. Filled on output for a color image. Integer array must be passed. Mind that the required length of the array depends on the bit depth of the image.
//gets the histogram in whole image int rect[4]; dword mean[4]; dword min[4]; dword max[4]; dword maxFrekv[4]; int red[4096]; //max for 12 bit images! int green[4096]; int blue[4096]; int intensity[4096]; //rectangle [0, 0, 10, 10], not used in this sample rect[0] = 0; rect[1] = 0; rect[2] = 10; rect[3] = 10; Get_Histogram(0, rect, mean, min, max, maxFrekv, red, green, blue, intensity); ShowVars("red", 2);
See Also
Get_PixelValue, Get_Profile, Get_RValue, Get_GValue, Get_BValue, Int_AnalyzeFunction, Int_RescaleHist
Description
Get_PixelValue( intInt_X
, intInt_Y
, intInt_Radius
);
This function retrieves the color or intensity for gray images covered by a circle (pixel).
Parameters
// Get_PixelValue example - picks up the average gray or RGB values under the disk with radius 10 pixels. dword keys[2], key; char buf[256], buf2[256], text[256]; dword val; int red, green, blue; int x, y; int type; SetCommandText("Get_PixelValue example. Waiting for mouse click or Esc..."); strcpy(buf, " NIS-Elements API Example - Get_PixelValue\tTo define the center of the disk, click primary mouse button. To cancel, press Esc. "); Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100); keys[0] = VK_ESC; keys[1] = VK_LBUTTON; while(TRUE) { strcpy(buf, " NIS-Elements API Example - Get_PixelValue\t"); key = Int_GetEvents(&keys,2); if(key == keys[0]) break; if(key == keys[1]) { Int_GetMousePos(&x,&y); val =Get_PixelValue(x,y,10); type = Get_Info(INFO_PICTURETYPE); if(type != PT_GRAY8) { red = Get_RValue(val); blue = Get_BValue(val); green = Get_GValue(val); sprintf(buf2, "coor = %i,%i RGB = %i,%i,%i ","x, y, red, green, blue"); } else sprintf(buf2, "coor = %i,%i gray = %i ","x, y, val"); strcpy(text, buf); strcat(text, buf2); Int_CreateTextWindow(text,0,RGB(0,0,128),RGB_WHITE,100); Wait(1.8); strcpy(buf, " NIS-Elements API Example - Get_PixelValue\tTo define the center of the disk, click primary mouse button. To cancel, press Esc. "); Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100); } } Int_CloseTextWindow();
See Also
Get_Profile, Get_RValue, Get_GValue, Get_BValue, Get_Histogram
Description
int Get_Profile( intInt_X
, intInt_Y
, intInt_X1
, intInt_Y1
, void *Int_LpRed
, void *Int_LpGreen
, void *Int_LpBlue
, void *Int_LpIntensity
, intInt_Num
);
This function retrieves the profile under the line.
Parameters
Int_LpRed
An array for red component (first component for multichannel images). Filled on output. Macro is responsible for a buffer allocation.
Int_LpGreen
An array for green component (second component for multichannel images). Filled on output. Macro is responsible for a buffer allocation.
Int_LpBlue
An array for blue component (third component for multichannel images). Filled on output. Macro is responsible for a buffer allocation.
Note
All arrays are filled byte after byte for images with bit depth <= 8 and word after word for images with bit depth greater than 8.
See Also
Get_PixelValue, Get_RValue, Get_GValue, Get_BValue, Int_AnalyzeFunction, Get_Histogram
Description
Get_RValue(
dword Int_Color
);
This function extracts the red value from the 32-bit RGB value.
Parameters
Int_Color
The RGB color as a 32bit integer. Use the RGB function to get the value.
See Also
Get_PixelValue, Get_Profile, Get_GValue, Get_BValue
Description
Int_AnalyzeFunction( double *lpData
, inttype
, intnum
, int *lpMin
, int *lpMax
, int *lpInflex
);
This function finds local minima, local maxima and inflexes in the data array and fills the appropriate min, max and inflex arrays.
Parameters
lpData
Points to data to be analyzed. Filled on input. Macro is responsible for a buffer allocation.
lpMin
Index array, that specifies local minima in the source lpData array. Filled on output. Macro is responsible for buffer allocation. If lpMin[0] = 0, then default values for extreme detection are taken; it means that neighborhood for polynom is 4 points on the left, 4 points on the right, data is fitted with polynom of order 3 and 3 derivation points on the left is < resp > 0 and 3 derivation points on the right > resp < 0 for minima resp maxima. If lpMin[0] != 0, then lpMin[0] ... neighborhood for polynom lpMin[1] ... polynom order; lpMin[2] ... neighborhood for extreme detection; lpMax[0] ... neighborhood for extreme detection;
// Int_Analyze example - detects an inflex point of the cubic function. double data[128]; int min[128], max[128], inflexes[128]; int i; double t; char buf[256]; strcpy(buf, "API Example - Int_AnalyzeFunction. Please, wait..."); Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100); SetCommandText("Working..."); // Calculate values for cubic function for(i=-64; i<64; i=i+1) { t=i; t=t/10; t=t*t*t; data[i+64]=t; } // Find inflex points for cubic function Int_AnalyzeFunction(data, DOUBLE, 128, NULL, NULL, inflexes); // Creating graph window, titles and data Int_GSCreateWindow("API Example", WP_CENTERED,1,1,400,400); Int_GSSetClr(BACKGROUND, RGB_WHITE); Int_GSTitles("X Axis", "Y Axis", "(X-64)*(X-64)*(X-64)/1000"); Int_GSFunData(data, NULL, NULL, NULL, 128); // Creating additional text for the value of inflex point i=inflexes[1]; sprintf(buf,"inflex=%i", "i"); Int_GSUserText(buf); // Selecting fonts for title,... Int_GSSetFont(GS_TITLE, "Arial", 35, GS_FOBOLD, FALSE); Int_GSSetFont(GS_XYTITLE, "Arial", 25, GS_FOBOLD, FALSE); Int_GSSetFont(GS_LEGEND, "Arial", 25, GS_FODEFAULT, FALSE); Int_GSSetFont(GS_LABEL, "Arial", 25, GS_FODEFAULT, FALSE); Int_GSShow(GS_FUNCTION); Int_CloseTextWindow();
Description
RGB( intredC
, intgreenC
, intblueC
);
This function selects an RGB color based on supplied parameters.
Parameters
Return Values
Note
If all three intensities are specified as zero, the result color is black. If all three intensities are specified 255, the result color is white.
See Also
Get_Info