00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _AI_BASIC_TYPES_
00018 #define _AI_BASIC_TYPES_
00019
00020 #include "ASConfig.h"
00021
00022 #include <stdint.h>
00023 #include <stddef.h>
00024
00025 namespace ai
00026 {
00027 using int8 = int8_t;
00028 using uint8 = uint8_t;
00029 using int16 = int16_t;
00030 using uint16 = uint16_t;
00031 using int32 = int32_t;
00032 using uint32 = uint32_t;
00033 using int64 = int64_t;
00034 using uint64 = uint64_t;
00035
00036 using sizediff_t = ptrdiff_t;
00037 using intptr = intptr_t;
00038 using uintptr = uintptr_t;
00039 using SizeType = size_t;
00040
00041 }
00042
00043 using AIReal = double;
00044 using AIFloat = float;
00045
00047 using AIDouble = double;
00048
00050 struct AIDoubleRect {
00051 AIDouble left, top, right, bottom;
00052 };
00053
00054 using AIRealRect = AIDoubleRect;
00055 using AIRealRectPtr = AIRealRect*;
00056
00057 typedef struct _t_AIFloatRect {
00058 AIFloat left, top, right, bottom;
00059 } AIFloatRect, *AIFloatRectPtr;
00060
00061 typedef struct _t_AIRealMatrix {
00062 AIReal a, b, c, d, tx, ty;
00064 void Init()
00065 {
00066 a = 1.0; b = 0.0;
00067 c = 0.0; d = 1.0;
00068 tx = 0.0; ty = 0.0;
00069 }
00070 bool operator==(const _t_AIRealMatrix& other) const
00071 {
00072 return a == other.a && b == other.b &&
00073 c == other.c && d == other.d &&
00074 tx == other.tx && ty == other.ty;
00075 }
00076 } AIRealMatrix, *AIRealMatrixPtr;
00077
00078 typedef struct _t_AIRealPoint {
00079 AIReal h, v;
00080 bool operator==(const _t_AIRealPoint& other) const
00081 {
00082 return h == other.h && v == other.v;
00083 }
00084 } AIRealPoint, *AIRealPointPtr;
00085
00086
00088 typedef struct _t_AIRect {
00090 ai::int32 left, top, right, bottom;
00091 } AIRect;
00092
00093
00095 typedef struct _t_AIPoint {
00097 ai::int32 h, v;
00098 } AIPoint;
00099
00100
00101
00102
00103
00104
00105
00107 #ifdef MAC_ENV
00108
00109 typedef unsigned char AIBoolean;
00110 #endif
00111
00112 #ifdef WIN_ENV
00113
00114 typedef int AIBoolean;
00115 #endif
00116
00117 #ifdef LINUX_ENV
00118 typedef unsigned char AIBoolean;
00119 #endif
00120
00121 #endif // _AI_BASIC_TYPES_
00122