Artec 3D Scanning SDK  2.0
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 grayscale (1 channel) format.
43 * Fast algorithm. Select component with the 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 */
61  toGrayscale(IImage** dst, const IImage* src);
62 
63 /** Change R and B channels in given 3-channeled image
64 * @param image - image that should be in RGB or BGR (3 channels), YUY(2 channels), or GS(1 channel) format.
65 * @details supported format list:
66 * PixelFormat_RGB
67 * PixelFormat_BGR - just make image copy
68 * PixelFormat_YUY
69 * output format - PixelFormat_BGR
70 */
72  toBGR(IImage** dst, const IImage* src);
73 
74 /** Change R and B channels in the given 3-channeled image
75 * @param image - image that should be in RGB or BGR (3 channels), YUY(2 channels), or GS(1 channel) format.
76 * @details supported format list:
77 * PixelFormat_BGR
78 * PixelFormat_RGB - just make image copy
79 * PixelFormat_YUY
80 * output format - PixelFormat_RGB
81 */
83  toRGB(IImage** dst, const IImage* src);
84 
85 /** Convert given image to grayscale (1 channel) format.
86 * Accurate algorithm.
87 * Convert only PixelFormat_BGR image to grayscale PixelFormat_Mono image.
88 */
90  bgr2grey(IImage** dst, const IImage* src);
91 
92 }
93 
94 } } } // namespace artec::sdk::base
95 
96 #endif // _CONVERSIONS_H_
ErrorCode ABASESDK_LINK_SPEC mirrorImage(IImage **dst, const IImage *src, Mirror direction)
Mirror image.
ErrorCode ABASESDK_LINK_SPEC toGrayscale(IImage **dst, const IImage *src)
Convert given image to grayscale (1 channel) format.
ErrorCode ABASESDK_LINK_SPEC bgr2grey(IImage **dst, const IImage *src)
Convert given image to grayscale (1 channel) format.
ErrorCode ABASESDK_LINK_SPEC toBGR(IImage **dst, const IImage *src)
Change R and B channels in given 3-channeled image.
ErrorCode ABASESDK_LINK_SPEC rotateImage(IImage **dst, const IImage *src, Rotation direction)
Rotate image.
#define ABASESDK_LINK_SPEC
ErrorCode ABASESDK_LINK_SPEC toRGB(IImage **dst, const IImage *src)
Change R and B channels in the given 3-channeled image.