📄 lvimgproc.h
字号:
* @param pSrcImgInfo Bayer encoded source image info
* @param pDstImgInfo Destination image info
* @param dwDstPixelFormat To which @ref PixelFormats "pixel format"
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @param hLut Handle to LUT
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
*/
LVIP_DLLENTRY BOOL WINAPI lvip_BdBilinearInterpolation
(lvip_ImgInfo* pSrcImgInfo, lvip_ImgInfo* pDstImgInfo,
U32BIT dwDstPixelFormat, U32BIT dwFlags, LVIP_LUT_HANDLE hLut);
/** Bayer Decoding: The Bilinear interpolation with Linear Color Correction method
* The interpolation with Linear Color Correction (LCC) is another adaptive algorithm and optimized
* for images with edges in horizontal and vertical direction.
* @note This function does not support LUT due to the 2-pass algorithm
* @ingroup FunctionsBayer
* @param pSrcImgInfo Pointer to source image info
* @param pDstImgInfo Pointer to destination image info
* @param dwDstPixelFormat to which @ref PixelFormats "pixel format" has to be image converted
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
*/
LVIP_DLLENTRY BOOL WINAPI lvip_BdBilinearColorCorrection
(lvip_ImgInfo* pSrcImgInfo, lvip_ImgInfo* pDstImgInfo,
U32BIT dwDstPixelFormat, U32BIT dwFlags);
/** Bayer Decoding: Variable gradients method
* One of the best known methods for Bayer decoding, but significantly slower than the bilinear interpolation.
* It is based on evaluation the color gradients in 8 directions around the pixel and selecting the
* set of best set for the color interpolation.
* - Supported input pixel formats: 8-bit mono.
* - Supported output pixel formats: 24-bit RGB, 32-bit RGB.
* - Can be done in-place: No.
*
* @ingroup FunctionsBayer
* @param pSrcImgInfo Bayer encoded source image info
* @param pDstImgInfo Destination image info
* @param dwDstPixelFormat To which @ref PixelFormats "pixel format" convert
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @param hLut Handle to LUT
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
*/
LVIP_DLLENTRY BOOL WINAPI lvip_BdVariableGradients
(lvip_ImgInfo* pSrcImgInfo, lvip_ImgInfo* pDstImgInfo,
U32BIT dwDstPixelFormat, U32BIT dwFlags, LVIP_LUT_HANDLE hLut);
/** Bayer Decoding: The Pixel Grouping method.
* A method similar to the lvip_BdVariableGradients(), but simplified and thus faster, still giving very good results.
* - Supported input pixel formats: 8-bit mono.
* - Supported output pixel formats: 24-bit RGB, 32-bit RGB.
* - Can be done in-place: No.
*
* @ingroup FunctionsBayer
* @note This function does not support LUT operations because of too high CPU load
* @param pSrcImgInfo Bayer encoded source image info
* @param pDstImgInfo Destination image info
* @param dwDstPixelFormat To which @ref PixelFormats "pixel format" convert
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
*/
LVIP_DLLENTRY BOOL WINAPI lvip_BdPixelGrouping
(lvip_ImgInfo* pSrcImgInfo, lvip_ImgInfo* pDstImgInfo,
U32BIT dwDstPixelFormat, U32BIT dwFlags);
/** This function encode an RGB image back to a Bayer encoded image.
* This function is generally for testing purposes.
* @ingroup FunctionsBayer
* @param pSrcImgInfo RGB source image info
* @param pDstImgInfo It will contain bayer encoded image
* @param dwDstPixelFormat To which @ref PixelFormats "pixel format" convert
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
*/
LVIP_DLLENTRY BOOL WINAPI lvip_BdEncodeToBayer
(lvip_ImgInfo* pSrcImgInfo, lvip_ImgInfo* pDstImgInfo,
U32BIT dwDstPixelFormat, U32BIT dwFlags);
/** This function paints a BMP (DIB) image in the specified window.
* @ingroup FunctionsDisplay
* @param pBmpInfo pointer to BITMAPINFO
* @param pBmpData pointer to bitmap data
* @param hWnd Handle to window where will be the image displayed
* @param iClipFrame Defines the thickness of an \a invisible \a frame which cuts off edges of the image
* Set iClipFrame to 0, if you do not want to use this feature
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
* @note Available in the Windows version of the library only
*/
LVIP_DLLENTRY BOOL WINAPI lvip_DisplayBmp (BITMAPINFO* pBmpInfo, U8BIT* pBmpData, HWND hWnd, int iClipFrame);
/** This function paints BMP (DIB) image in the center of specified window.
* If the specified window is larger that image then this function paints BITMAP image in center of the window.
* @ingroup FunctionsDisplay
* @param pBmpInfo pointer to BITMAPINFO
* @param pBmpData pointer to bitmap data
* @param hWnd window handle
* @param iClipFrame Defines the thickness of an \a invisible \a frame which cuts off edges of the image
* Set iClipFrame to 0, if you do not want to use this feature
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
* @note Available in the Windows version of the library only
*/
LVIP_DLLENTRY BOOL WINAPI lvip_DisplayBmpCentered (BITMAPINFO* pBmpInfo, U8BIT* pBmpData, HWND hWnd, int iClipFrame);
/** Paints the bitmap in the specified window scaled/stretched by Windows GDI to fit in.
* If bKeepAspectRatio is TRUE, the image is painted with the preserved aspect ratio, with possible
* vertical or horizontal stripes around the image in case the window does not have its client area
* in the same aspect ratio.
* @ingroup FunctionsDisplay
* @param pBmpInfo pointer to BITMAPINFO
* @param pBmpData pointer to bitmap data
* @param hWnd Handle to a window where the image is to be painted
* @param iClipFrame Defines the thickness of an \a invisible \a frame which cuts off edges of the image
* Set iClipFrame to 0, if you do not want to use this feature
* @param bKeepAspectRatio TRUE if the image has to be painted with the preserved aspect ratio
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
* @note Available in the Windows version of the library only
*/
LVIP_DLLENTRY BOOL WINAPI lvip_DisplayBmpStretched (BITMAPINFO* pBmpInfo, U8BIT* pBmpData, HWND hWnd,
int iClipFrame, BOOL bKeepAspectRatio);
/** Displays the image in the window.
* @ingroup FunctionsDisplay
* If the pixel format is not compatible
* for display, it uses pConvImgInfo for converting the image - mono images to 8-bit
* color to 24-bit RGB.\n
* If pConvImgInfo is NULL, and the image has non-displayable format, the image is not converted and displayed.
* If the pConvImgInfo is not NULL, it is used for conversion. It is the user responsibility
* to deallocate this image when not needed anymore.\n
* Recommended: Create empty @ref lvip_ImgInfo for pConvImgInfo and in the dwFlags specify the LVIP_IMG_REALLOCATE_DST
* flag. The function will allocate the appropriate image buffer for the conversion.\n
* Next time this function is called it only checks if the buffer is sufficient, if so, it does
* not reallocate it. Call lvip_DeallocateImageData() to deallocate this helper image at the end of your application.
* - Supported pixel formats: 8-bit to 16-bit mono, 15-bit RGB, 16-bit RGB, 24-bit RGB, 32-bit RGB.
*
* @param pImgInfo pointer to Image info of the image to be painted
* @param hWnd Handle to a window where the image has to be painted
* @param pConvImgInfo If conversion to displayable format has to be done, there is a need to give as param to initialized
* conversion image info structure which will be used for the conversion
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @return \b TRUE in case of success, otherwise \b FALSE - use lvip_GetLastStatus() for details
* @note Available in the Windows version of the library only
*/
LVIP_DLLENTRY BOOL WINAPI lvip_DisplayImage (lvip_ImgInfo* pImgInfo, HWND hWnd,
lvip_ImgInfo* pConvImgInfo, U32BIT dwFlags);
/** Converts the image to displayable format, if necessary.
* @ingroup FunctionsDisplay
* If the pixel format is not compatible
* for display, it uses pConvImgInfo for converting the image - mono images to 8-bit
* color to 24-bit RGB.\n
* If pConvImgInfo is NULL, and the image has non-displayable format, the image is not converted.
* If the pConvImgInfo is not NULL, it is used for conversion. It is the user responsibility
* to deallocate this image when not needed anymore.\n
* Recommended: Create empty @ref lvip_ImgInfo for pConvImgInfo and in the dwFlags specify the LVIP_IMG_REALLOCATE_DST
* flag. The function will allocate the appropriate image buffer for the conversion.\n
* Next time this function is called it only checks if the buffer is sufficient, if so, it does
* not reallocate it. Call lvip_DeallocateImageData() to deallocate this helper image at the end of your application.
* - Supported pixel formats: 8-bit to 16-bit mono, 15-bit RGB, 16-bit RGB, 24-bit RGB, 32-bit RGB.
*
* @param pImgInfo pointer to Image info of the image to be converted
* @param pConvImgInfo If conversion to displayable format has to be done, there is a need to give as param to initialized
* conversion image info structure which will be used for the conversion
* @param dwFlags Flags - OR-ed combination of @ref ImageFlags
* @return \b 0 in case of failure (use lvip_GetLastStatus() for details), 1 in case the image was converted, 2 in case no conversion was needed.
*/
LVIP_DLLENTRY S32BIT WINAPI lvip_ConvertToDisplayableFormat (lvip_ImgInfo* pImgInfo,
lvip_ImgInfo* pConvImgInfo,
U32BIT dwFlags);
// Specific functions
LVIP_DLLENTRY BOOL WINAPI lvip_3x3ThresholdSharpening (lvip_ImgInfo* pSrcImgInfo, lvip_ImgInfo* pDstImgInfo,
U32BIT dwFactor0,
U32BIT dwThreshold1, U32BIT dwFactor1,
U32BIT dwThreshold2, U32BIT dwFactor2,
U32BIT dwFlags, LVIP_LUT_HANDLE hLut);
/* Overlay: not yet documented */
/** @defgroup OverlayTextAttributes Overlay text attributes. */
//@{
/** Bold text.
* Text attribute for the lvip_SetOverlayTextParams() function: Bold text
*/
#define LVIP_TEXTATTR_BOLD 0x0001
/** Italics text.
* Text attribute for the lvip_SetOverlayTextParams() function: Italics text
*/
#define LVIP_TEXTATTR_ITALIC 0x0002
/** Underlined text.
* Text attribute for the lvip_SetOverlayTextParams() function: Underlined text
*/
#define LVIP_TEXTATTR_UNDERLINE 0x0004
/** Strikeout text.
* Text attribute for the lvip_SetOverlayTextParams() function: Strikeout text
*/
#define LVIP_TEXTATTR_STRIKEOUT 0x0008
/** Text antialiasing off.
* Text attribute for the lvip_SetOverlayTextParams() function: Text antialiasing will
* be switched off - this is useful for text on transparent background, where antialiasing
* (like ClearType) can make undesirable effects.
*/
#define LVIP_TEXTATTR_NONANTIALIASED 0x0010
/** Text with a 1 pixel shadow.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at right-bottom direction.
*/
#define LVIP_TEXTATTR_SHADOW 0x0100
/** Text with a 1 pixel outline.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel outline
* around the letters. This is useful namely for the text on transparent background - by adding the
* outline of different color, then the text is readable even if the background become of the
* same color, as the text.
*/
#define LVIP_TEXTATTR_OUTLINE 0xFF00
/** Text with a 1 pixel shadow at right-bottom direction.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at right-bottom direction (equal to @ref LVIP_TEXTATTR_SHADOW constant). This constant can be
* combined with other LVIP_TEXTATTR_SHADOW_x constants.
*/
#define LVIP_TEXTATTR_SHADOW_RB 0x0100
/** Text with a 1 pixel shadow at right-top direction.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at right-top direction. This constant can be combined with other LVIP_TEXTATTR_SHADOW_x constants.
*/
#define LVIP_TEXTATTR_SHADOW_RT 0x0200
/** Text with a 1 pixel shadow at right-top direction.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at right-top direction. This constant can be combined with other LVIP_TEXTATTR_SHADOW_x constants.
*/
#define LVIP_TEXTATTR_SHADOW_LB 0x0400
/** Text with a 1 pixel shadow at left-bottom direction.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at left-bottom direction. This constant can be combined with other LVIP_TEXTATTR_SHADOW_x constants.
*/
#define LVIP_TEXTATTR_SHADOW_LT 0x0800
/** Text with a 1 pixel shadow at left-top direction.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at left-top direction. This constant can be combined with other LVIP_TEXTATTR_SHADOW_x constants.
*/
#define LVIP_TEXTATTR_SHADOW_B 0x1000
/** Text with a 1 pixel shadow at bottom direction.
* Text attribute for the lvip_SetOverlayTextParams() function: Text with a 1 pixel shadow
* at bottom direction. T
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -