Conversions.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Functions for image type conversions:
6 * to/from Grayscale, RGB, YUY, etc.
7 *
8 * Copyright: Artec Group
9 *
10 ********************************************************************/
11 
12 #ifndef _CONVERSIONS_H_
13 #define _CONVERSIONS_H_
14 
15 #include <artec/sdk/base/IImage.h>
16 
17 namespace artec { namespace sdk { namespace base
18 {
19 
21 {
26  Rotation_ForceDword = 0x7fffffff /* force 32-bit size enum */
27 };
28 
29 extern "C"
30 {
31 
32 /** Rotate image
33 */
35  rotateImage(IImage** dst, const IImage* src, Rotation direction);
36 
37 /** Mirror image
38 */
40  mirrorImage(IImage** dst, const IImage* src, Mirror direction);
41 
42 /** Convert given image to gray scale (1 channel) format.
43 * Fast algorithm. Select component with maximum value.
44 * @param image - image, that should be in RGB or BGR (3 channels), YUY(2 channels), or GS(1 channel) format.
45 * @details supported format list:
46 * PixelFormat_BGR
47 * PixelFormat_BGRX
48 * PixelFormat_RG
49 * PixelFormat_RGB
50 * PixelFormat_RGBX
51 * PixelFormat_RG_USHORT
52 * PixelFormat_RGB_USHORT
53 * PixelFormat_RGBX_USHORT
54 * PixelFormat_RG_SINT
55 * PixelFormat_RGB_SINT
56 * PixelFormat_RGBX_SINT
57 * PixelFormat_YUY
58 * output format - PixelFormat_Mono
59 * @return ErrorCode_ArgumentInvalid, for all other formats
60 */
62  toGrayscale(IImage** dst, const IImage* src);
63 
64 /** Change R and B channels in given 3-channeled image
65 * @param image - image, that should be in RGB or BGR (3 channels), YUY(2 channels), or GS(1 channel) format.
66 * @details supported format list:
67 * PixelFormat_RGB
68 * PixelFormat_BGR - just make image copy
69 * PixelFormat_YUY
70 * output format - PixelFormat_BGR
71 * @return ErrorCode_ArgumentInvalid, for all other formats
72 */
74  toBGR(IImage** dst, const IImage* src);
75 
76 /** Change R and B channels in given 3-channeled image
77 * @param image - image, that should be in RGB or BGR (3 channels), YUY(2 channels), or GS(1 channel) format.
78 * @details supported format list:
79 * PixelFormat_BGR
80 * PixelFormat_RGB - just make image copy
81 * PixelFormat_YUY
82 * output format - PixelFormat_RGB
83 * @return ErrorCode_ArgumentInvalid, for all other formats
84 */
86  toRGB(IImage** dst, const IImage* src);
87 
88 /** Convert given image to gray scale (1 channel) format.
89 * Accurate algorithm.
90 * Convert only PixelFormat_BGR image to grayscale PixelFormat_Mono image.
91 */
93  bgr2grey(IImage** dst, const IImage* src);
94 
95 }
96 
97 } } } // namespace artec::sdk::base
98 
99 #endif // _CONVERSIONS_H_
ErrorCode ABASESDK_LINK_SPEC mirrorImage(IImage **dst, const IImage *src, Mirror direction)
ErrorCode ABASESDK_LINK_SPEC toGrayscale(IImage **dst, const IImage *src)
ErrorCode ABASESDK_LINK_SPEC bgr2grey(IImage **dst, const IImage *src)
ErrorCode ABASESDK_LINK_SPEC toBGR(IImage **dst, const IImage *src)
ErrorCode ABASESDK_LINK_SPEC rotateImage(IImage **dst, const IImage *src, Rotation direction)
#define ABASESDK_LINK_SPEC
Definition: BaseSdkDefines.h:7
ErrorCode ABASESDK_LINK_SPEC toRGB(IImage **dst, const IImage *src)