123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #ifndef __TYPE_DEF_H__
- #define __TYPE_DEF_H__
- #if defined(JVISION_LIB_EXPORT)
- #define JVision_API __declspec(dllexport)
- #else
- #define JVision_API __declspec(dllimport)
- #endif
- #include <string>
- #define M_PI (3.14159256)
- namespace JVision
- {
-
- typedef JVision_API unsigned char* ImageDataPtr;
-
- typedef JVision_API int ResultCode;
-
- typedef JVision_API int ParamID;
-
- typedef JVision_API std::string ParamVal;
-
- struct JVision_API Point
- {
- double x;
- double y;
- double angle;
- };
- struct JVision_API Point2D
- {
- double x;
- double y;
- };
- struct JVision_API CircleResult
- {
- double x;
- double y;
- double radius;
- };
- enum class JVision_API ImageFormat : int
- {
- INVALID = 0,
- GRAY8,
- RGB888,
- ARGB32,
- RGB32,
- YUV422,
- };
- struct JVision_API ImageInfo
- {
- ImageInfo();
- ImageInfo(int w, int h, int c, ImageFormat f, unsigned char* d);
- ImageInfo(unsigned char* d, int w, int h, int c)
- : width(w)
- , height(h)
- , channel(c)
- , data(nullptr)
- {
- int imageSize = w * h * c;
- data = new unsigned char[imageSize];
- memcpy(data, d, imageSize);
- }
- ImageInfo(const ImageInfo& other);
- ImageInfo(ImageInfo&& other) noexcept;
- ImageInfo& operator=(ImageInfo& other);
- ImageInfo& operator=(ImageInfo&& other) noexcept;
- ~ImageInfo();
- int width;
- int height;
- int channel;
- ImageFormat format;
- unsigned char* data;
- };
- }
- #endif
|