googlevision.pp 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018
  1. unit googlevision;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TImageSource = Class;
  9. TAnnotateImageRequest = Class;
  10. TAnnotateImageResponse = Class;
  11. TLatLongRect = Class;
  12. TStatus = Class;
  13. TFaceAnnotation = Class;
  14. TVertex = Class;
  15. TColorInfo = Class;
  16. TBoundingPoly = Class;
  17. TLandmark = Class;
  18. TImageContext = Class;
  19. TBatchAnnotateImagesRequest = Class;
  20. TEntityAnnotation = Class;
  21. TProperty = Class;
  22. TColor = Class;
  23. TLocationInfo = Class;
  24. TSafeSearchAnnotation = Class;
  25. TImage = Class;
  26. TDominantColorsAnnotation = Class;
  27. TFeature = Class;
  28. TBatchAnnotateImagesResponse = Class;
  29. TImageProperties = Class;
  30. TLatLng = Class;
  31. TPosition = Class;
  32. TImageSourceArray = Array of TImageSource;
  33. TAnnotateImageRequestArray = Array of TAnnotateImageRequest;
  34. TAnnotateImageResponseArray = Array of TAnnotateImageResponse;
  35. TLatLongRectArray = Array of TLatLongRect;
  36. TStatusArray = Array of TStatus;
  37. TFaceAnnotationArray = Array of TFaceAnnotation;
  38. TVertexArray = Array of TVertex;
  39. TColorInfoArray = Array of TColorInfo;
  40. TBoundingPolyArray = Array of TBoundingPoly;
  41. TLandmarkArray = Array of TLandmark;
  42. TImageContextArray = Array of TImageContext;
  43. TBatchAnnotateImagesRequestArray = Array of TBatchAnnotateImagesRequest;
  44. TEntityAnnotationArray = Array of TEntityAnnotation;
  45. TPropertyArray = Array of TProperty;
  46. TColorArray = Array of TColor;
  47. TLocationInfoArray = Array of TLocationInfo;
  48. TSafeSearchAnnotationArray = Array of TSafeSearchAnnotation;
  49. TImageArray = Array of TImage;
  50. TDominantColorsAnnotationArray = Array of TDominantColorsAnnotation;
  51. TFeatureArray = Array of TFeature;
  52. TBatchAnnotateImagesResponseArray = Array of TBatchAnnotateImagesResponse;
  53. TImagePropertiesArray = Array of TImageProperties;
  54. TLatLngArray = Array of TLatLng;
  55. TPositionArray = Array of TPosition;
  56. //Anonymous types, using auto-generated names
  57. TStatusTypedetailsItem = Class;
  58. TAnnotateImageRequestTypefeaturesArray = Array of TFeature;
  59. TAnnotateImageResponseTypelabelAnnotationsArray = Array of TEntityAnnotation;
  60. TAnnotateImageResponseTypelandmarkAnnotationsArray = Array of TEntityAnnotation;
  61. TAnnotateImageResponseTypetextAnnotationsArray = Array of TEntityAnnotation;
  62. TAnnotateImageResponseTypelogoAnnotationsArray = Array of TEntityAnnotation;
  63. TAnnotateImageResponseTypefaceAnnotationsArray = Array of TFaceAnnotation;
  64. TStatusTypedetailsArray = Array of TStatusTypedetailsItem;
  65. TFaceAnnotationTypelandmarksArray = Array of TLandmark;
  66. TBoundingPolyTypeverticesArray = Array of TVertex;
  67. TBatchAnnotateImagesRequestTyperequestsArray = Array of TAnnotateImageRequest;
  68. TEntityAnnotationTypepropertiesArray = Array of TProperty;
  69. TEntityAnnotationTypelocationsArray = Array of TLocationInfo;
  70. TDominantColorsAnnotationTypecolorsArray = Array of TColorInfo;
  71. TBatchAnnotateImagesResponseTyperesponsesArray = Array of TAnnotateImageResponse;
  72. { --------------------------------------------------------------------
  73. TImageSource
  74. --------------------------------------------------------------------}
  75. TImageSource = Class(TGoogleBaseObject)
  76. Private
  77. FgcsImageUri : String;
  78. Protected
  79. //Property setters
  80. Procedure SetgcsImageUri(AIndex : Integer; const AValue : String); virtual;
  81. Public
  82. Published
  83. Property gcsImageUri : String Index 0 Read FgcsImageUri Write SetgcsImageUri;
  84. end;
  85. TImageSourceClass = Class of TImageSource;
  86. { --------------------------------------------------------------------
  87. TAnnotateImageRequest
  88. --------------------------------------------------------------------}
  89. TAnnotateImageRequest = Class(TGoogleBaseObject)
  90. Private
  91. Fimage : TImage;
  92. FimageContext : TImageContext;
  93. Ffeatures : TAnnotateImageRequestTypefeaturesArray;
  94. Protected
  95. //Property setters
  96. Procedure Setimage(AIndex : Integer; const AValue : TImage); virtual;
  97. Procedure SetimageContext(AIndex : Integer; const AValue : TImageContext); virtual;
  98. Procedure Setfeatures(AIndex : Integer; const AValue : TAnnotateImageRequestTypefeaturesArray); virtual;
  99. //2.6.4. bug workaround
  100. {$IFDEF VER2_6}
  101. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  102. {$ENDIF VER2_6}
  103. Public
  104. Published
  105. Property image : TImage Index 0 Read Fimage Write Setimage;
  106. Property imageContext : TImageContext Index 8 Read FimageContext Write SetimageContext;
  107. Property features : TAnnotateImageRequestTypefeaturesArray Index 16 Read Ffeatures Write Setfeatures;
  108. end;
  109. TAnnotateImageRequestClass = Class of TAnnotateImageRequest;
  110. { --------------------------------------------------------------------
  111. TAnnotateImageResponse
  112. --------------------------------------------------------------------}
  113. TAnnotateImageResponse = Class(TGoogleBaseObject)
  114. Private
  115. FlabelAnnotations : TAnnotateImageResponseTypelabelAnnotationsArray;
  116. FlandmarkAnnotations : TAnnotateImageResponseTypelandmarkAnnotationsArray;
  117. FsafeSearchAnnotation : TSafeSearchAnnotation;
  118. FimagePropertiesAnnotation : TImageProperties;
  119. FtextAnnotations : TAnnotateImageResponseTypetextAnnotationsArray;
  120. FlogoAnnotations : TAnnotateImageResponseTypelogoAnnotationsArray;
  121. FfaceAnnotations : TAnnotateImageResponseTypefaceAnnotationsArray;
  122. Ferror : TStatus;
  123. Protected
  124. //Property setters
  125. Procedure SetlabelAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelabelAnnotationsArray); virtual;
  126. Procedure SetlandmarkAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelandmarkAnnotationsArray); virtual;
  127. Procedure SetsafeSearchAnnotation(AIndex : Integer; const AValue : TSafeSearchAnnotation); virtual;
  128. Procedure SetimagePropertiesAnnotation(AIndex : Integer; const AValue : TImageProperties); virtual;
  129. Procedure SettextAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypetextAnnotationsArray); virtual;
  130. Procedure SetlogoAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelogoAnnotationsArray); virtual;
  131. Procedure SetfaceAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypefaceAnnotationsArray); virtual;
  132. Procedure Seterror(AIndex : Integer; const AValue : TStatus); virtual;
  133. //2.6.4. bug workaround
  134. {$IFDEF VER2_6}
  135. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  136. {$ENDIF VER2_6}
  137. Public
  138. Published
  139. Property labelAnnotations : TAnnotateImageResponseTypelabelAnnotationsArray Index 0 Read FlabelAnnotations Write SetlabelAnnotations;
  140. Property landmarkAnnotations : TAnnotateImageResponseTypelandmarkAnnotationsArray Index 8 Read FlandmarkAnnotations Write SetlandmarkAnnotations;
  141. Property safeSearchAnnotation : TSafeSearchAnnotation Index 16 Read FsafeSearchAnnotation Write SetsafeSearchAnnotation;
  142. Property imagePropertiesAnnotation : TImageProperties Index 24 Read FimagePropertiesAnnotation Write SetimagePropertiesAnnotation;
  143. Property textAnnotations : TAnnotateImageResponseTypetextAnnotationsArray Index 32 Read FtextAnnotations Write SettextAnnotations;
  144. Property logoAnnotations : TAnnotateImageResponseTypelogoAnnotationsArray Index 40 Read FlogoAnnotations Write SetlogoAnnotations;
  145. Property faceAnnotations : TAnnotateImageResponseTypefaceAnnotationsArray Index 48 Read FfaceAnnotations Write SetfaceAnnotations;
  146. Property error : TStatus Index 56 Read Ferror Write Seterror;
  147. end;
  148. TAnnotateImageResponseClass = Class of TAnnotateImageResponse;
  149. { --------------------------------------------------------------------
  150. TLatLongRect
  151. --------------------------------------------------------------------}
  152. TLatLongRect = Class(TGoogleBaseObject)
  153. Private
  154. FmaxLatLng : TLatLng;
  155. FminLatLng : TLatLng;
  156. Protected
  157. //Property setters
  158. Procedure SetmaxLatLng(AIndex : Integer; const AValue : TLatLng); virtual;
  159. Procedure SetminLatLng(AIndex : Integer; const AValue : TLatLng); virtual;
  160. Public
  161. Published
  162. Property maxLatLng : TLatLng Index 0 Read FmaxLatLng Write SetmaxLatLng;
  163. Property minLatLng : TLatLng Index 8 Read FminLatLng Write SetminLatLng;
  164. end;
  165. TLatLongRectClass = Class of TLatLongRect;
  166. { --------------------------------------------------------------------
  167. TStatusTypedetailsItem
  168. --------------------------------------------------------------------}
  169. TStatusTypedetailsItem = Class(TGoogleBaseObject)
  170. Private
  171. Protected
  172. //Property setters
  173. Public
  174. Class Function AllowAdditionalProperties : Boolean; override;
  175. Published
  176. end;
  177. TStatusTypedetailsItemClass = Class of TStatusTypedetailsItem;
  178. { --------------------------------------------------------------------
  179. TStatus
  180. --------------------------------------------------------------------}
  181. TStatus = Class(TGoogleBaseObject)
  182. Private
  183. Fcode : integer;
  184. Fdetails : TStatusTypedetailsArray;
  185. Fmessage : String;
  186. Protected
  187. //Property setters
  188. Procedure Setcode(AIndex : Integer; const AValue : integer); virtual;
  189. Procedure Setdetails(AIndex : Integer; const AValue : TStatusTypedetailsArray); virtual;
  190. Procedure Setmessage(AIndex : Integer; const AValue : String); virtual;
  191. //2.6.4. bug workaround
  192. {$IFDEF VER2_6}
  193. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  194. {$ENDIF VER2_6}
  195. Public
  196. Published
  197. Property code : integer Index 0 Read Fcode Write Setcode;
  198. Property details : TStatusTypedetailsArray Index 8 Read Fdetails Write Setdetails;
  199. Property message : String Index 16 Read Fmessage Write Setmessage;
  200. end;
  201. TStatusClass = Class of TStatus;
  202. { --------------------------------------------------------------------
  203. TFaceAnnotation
  204. --------------------------------------------------------------------}
  205. TFaceAnnotation = Class(TGoogleBaseObject)
  206. Private
  207. FtiltAngle : integer;
  208. FunderExposedLikelihood : String;
  209. FfdBoundingPoly : TBoundingPoly;
  210. FlandmarkingConfidence : integer;
  211. FjoyLikelihood : String;
  212. FdetectionConfidence : integer;
  213. FsurpriseLikelihood : String;
  214. FangerLikelihood : String;
  215. FheadwearLikelihood : String;
  216. FpanAngle : integer;
  217. FboundingPoly : TBoundingPoly;
  218. Flandmarks : TFaceAnnotationTypelandmarksArray;
  219. FblurredLikelihood : String;
  220. FrollAngle : integer;
  221. FsorrowLikelihood : String;
  222. Protected
  223. //Property setters
  224. Procedure SettiltAngle(AIndex : Integer; const AValue : integer); virtual;
  225. Procedure SetunderExposedLikelihood(AIndex : Integer; const AValue : String); virtual;
  226. Procedure SetfdBoundingPoly(AIndex : Integer; const AValue : TBoundingPoly); virtual;
  227. Procedure SetlandmarkingConfidence(AIndex : Integer; const AValue : integer); virtual;
  228. Procedure SetjoyLikelihood(AIndex : Integer; const AValue : String); virtual;
  229. Procedure SetdetectionConfidence(AIndex : Integer; const AValue : integer); virtual;
  230. Procedure SetsurpriseLikelihood(AIndex : Integer; const AValue : String); virtual;
  231. Procedure SetangerLikelihood(AIndex : Integer; const AValue : String); virtual;
  232. Procedure SetheadwearLikelihood(AIndex : Integer; const AValue : String); virtual;
  233. Procedure SetpanAngle(AIndex : Integer; const AValue : integer); virtual;
  234. Procedure SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly); virtual;
  235. Procedure Setlandmarks(AIndex : Integer; const AValue : TFaceAnnotationTypelandmarksArray); virtual;
  236. Procedure SetblurredLikelihood(AIndex : Integer; const AValue : String); virtual;
  237. Procedure SetrollAngle(AIndex : Integer; const AValue : integer); virtual;
  238. Procedure SetsorrowLikelihood(AIndex : Integer; const AValue : String); virtual;
  239. //2.6.4. bug workaround
  240. {$IFDEF VER2_6}
  241. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  242. {$ENDIF VER2_6}
  243. Public
  244. Published
  245. Property tiltAngle : integer Index 0 Read FtiltAngle Write SettiltAngle;
  246. Property underExposedLikelihood : String Index 8 Read FunderExposedLikelihood Write SetunderExposedLikelihood;
  247. Property fdBoundingPoly : TBoundingPoly Index 16 Read FfdBoundingPoly Write SetfdBoundingPoly;
  248. Property landmarkingConfidence : integer Index 24 Read FlandmarkingConfidence Write SetlandmarkingConfidence;
  249. Property joyLikelihood : String Index 32 Read FjoyLikelihood Write SetjoyLikelihood;
  250. Property detectionConfidence : integer Index 40 Read FdetectionConfidence Write SetdetectionConfidence;
  251. Property surpriseLikelihood : String Index 48 Read FsurpriseLikelihood Write SetsurpriseLikelihood;
  252. Property angerLikelihood : String Index 56 Read FangerLikelihood Write SetangerLikelihood;
  253. Property headwearLikelihood : String Index 64 Read FheadwearLikelihood Write SetheadwearLikelihood;
  254. Property panAngle : integer Index 72 Read FpanAngle Write SetpanAngle;
  255. Property boundingPoly : TBoundingPoly Index 80 Read FboundingPoly Write SetboundingPoly;
  256. Property landmarks : TFaceAnnotationTypelandmarksArray Index 88 Read Flandmarks Write Setlandmarks;
  257. Property blurredLikelihood : String Index 96 Read FblurredLikelihood Write SetblurredLikelihood;
  258. Property rollAngle : integer Index 104 Read FrollAngle Write SetrollAngle;
  259. Property sorrowLikelihood : String Index 112 Read FsorrowLikelihood Write SetsorrowLikelihood;
  260. end;
  261. TFaceAnnotationClass = Class of TFaceAnnotation;
  262. { --------------------------------------------------------------------
  263. TVertex
  264. --------------------------------------------------------------------}
  265. TVertex = Class(TGoogleBaseObject)
  266. Private
  267. Fy : integer;
  268. Fx : integer;
  269. Protected
  270. //Property setters
  271. Procedure Sety(AIndex : Integer; const AValue : integer); virtual;
  272. Procedure Setx(AIndex : Integer; const AValue : integer); virtual;
  273. Public
  274. Published
  275. Property y : integer Index 0 Read Fy Write Sety;
  276. Property x : integer Index 8 Read Fx Write Setx;
  277. end;
  278. TVertexClass = Class of TVertex;
  279. { --------------------------------------------------------------------
  280. TColorInfo
  281. --------------------------------------------------------------------}
  282. TColorInfo = Class(TGoogleBaseObject)
  283. Private
  284. FpixelFraction : integer;
  285. Fcolor : TColor;
  286. Fscore : integer;
  287. Protected
  288. //Property setters
  289. Procedure SetpixelFraction(AIndex : Integer; const AValue : integer); virtual;
  290. Procedure Setcolor(AIndex : Integer; const AValue : TColor); virtual;
  291. Procedure Setscore(AIndex : Integer; const AValue : integer); virtual;
  292. Public
  293. Published
  294. Property pixelFraction : integer Index 0 Read FpixelFraction Write SetpixelFraction;
  295. Property color : TColor Index 8 Read Fcolor Write Setcolor;
  296. Property score : integer Index 16 Read Fscore Write Setscore;
  297. end;
  298. TColorInfoClass = Class of TColorInfo;
  299. { --------------------------------------------------------------------
  300. TBoundingPoly
  301. --------------------------------------------------------------------}
  302. TBoundingPoly = Class(TGoogleBaseObject)
  303. Private
  304. Fvertices : TBoundingPolyTypeverticesArray;
  305. Protected
  306. //Property setters
  307. Procedure Setvertices(AIndex : Integer; const AValue : TBoundingPolyTypeverticesArray); virtual;
  308. //2.6.4. bug workaround
  309. {$IFDEF VER2_6}
  310. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  311. {$ENDIF VER2_6}
  312. Public
  313. Published
  314. Property vertices : TBoundingPolyTypeverticesArray Index 0 Read Fvertices Write Setvertices;
  315. end;
  316. TBoundingPolyClass = Class of TBoundingPoly;
  317. { --------------------------------------------------------------------
  318. TLandmark
  319. --------------------------------------------------------------------}
  320. TLandmark = Class(TGoogleBaseObject)
  321. Private
  322. Fposition : TPosition;
  323. F_type : String;
  324. Protected
  325. Class Function ExportPropertyName(Const AName : String) : string; override;
  326. //Property setters
  327. Procedure Setposition(AIndex : Integer; const AValue : TPosition); virtual;
  328. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  329. Public
  330. Published
  331. Property position : TPosition Index 0 Read Fposition Write Setposition;
  332. Property _type : String Index 8 Read F_type Write Set_type;
  333. end;
  334. TLandmarkClass = Class of TLandmark;
  335. { --------------------------------------------------------------------
  336. TImageContext
  337. --------------------------------------------------------------------}
  338. TImageContext = Class(TGoogleBaseObject)
  339. Private
  340. FlatLongRect : TLatLongRect;
  341. FlanguageHints : TStringArray;
  342. Protected
  343. //Property setters
  344. Procedure SetlatLongRect(AIndex : Integer; const AValue : TLatLongRect); virtual;
  345. Procedure SetlanguageHints(AIndex : Integer; const AValue : TStringArray); virtual;
  346. //2.6.4. bug workaround
  347. {$IFDEF VER2_6}
  348. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  349. {$ENDIF VER2_6}
  350. Public
  351. Published
  352. Property latLongRect : TLatLongRect Index 0 Read FlatLongRect Write SetlatLongRect;
  353. Property languageHints : TStringArray Index 8 Read FlanguageHints Write SetlanguageHints;
  354. end;
  355. TImageContextClass = Class of TImageContext;
  356. { --------------------------------------------------------------------
  357. TBatchAnnotateImagesRequest
  358. --------------------------------------------------------------------}
  359. TBatchAnnotateImagesRequest = Class(TGoogleBaseObject)
  360. Private
  361. Frequests : TBatchAnnotateImagesRequestTyperequestsArray;
  362. Protected
  363. //Property setters
  364. Procedure Setrequests(AIndex : Integer; const AValue : TBatchAnnotateImagesRequestTyperequestsArray); virtual;
  365. //2.6.4. bug workaround
  366. {$IFDEF VER2_6}
  367. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  368. {$ENDIF VER2_6}
  369. Public
  370. Published
  371. Property requests : TBatchAnnotateImagesRequestTyperequestsArray Index 0 Read Frequests Write Setrequests;
  372. end;
  373. TBatchAnnotateImagesRequestClass = Class of TBatchAnnotateImagesRequest;
  374. { --------------------------------------------------------------------
  375. TEntityAnnotation
  376. --------------------------------------------------------------------}
  377. TEntityAnnotation = Class(TGoogleBaseObject)
  378. Private
  379. Fmid : String;
  380. Fdescription : String;
  381. Ftopicality : integer;
  382. Flocale : String;
  383. Fproperties : TEntityAnnotationTypepropertiesArray;
  384. Fscore : integer;
  385. FboundingPoly : TBoundingPoly;
  386. Flocations : TEntityAnnotationTypelocationsArray;
  387. Fconfidence : integer;
  388. Protected
  389. //Property setters
  390. Procedure Setmid(AIndex : Integer; const AValue : String); virtual;
  391. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  392. Procedure Settopicality(AIndex : Integer; const AValue : integer); virtual;
  393. Procedure Setlocale(AIndex : Integer; const AValue : String); virtual;
  394. Procedure Setproperties(AIndex : Integer; const AValue : TEntityAnnotationTypepropertiesArray); virtual;
  395. Procedure Setscore(AIndex : Integer; const AValue : integer); virtual;
  396. Procedure SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly); virtual;
  397. Procedure Setlocations(AIndex : Integer; const AValue : TEntityAnnotationTypelocationsArray); virtual;
  398. Procedure Setconfidence(AIndex : Integer; const AValue : integer); virtual;
  399. //2.6.4. bug workaround
  400. {$IFDEF VER2_6}
  401. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  402. {$ENDIF VER2_6}
  403. Public
  404. Published
  405. Property mid : String Index 0 Read Fmid Write Setmid;
  406. Property description : String Index 8 Read Fdescription Write Setdescription;
  407. Property topicality : integer Index 16 Read Ftopicality Write Settopicality;
  408. Property locale : String Index 24 Read Flocale Write Setlocale;
  409. Property properties : TEntityAnnotationTypepropertiesArray Index 32 Read Fproperties Write Setproperties;
  410. Property score : integer Index 40 Read Fscore Write Setscore;
  411. Property boundingPoly : TBoundingPoly Index 48 Read FboundingPoly Write SetboundingPoly;
  412. Property locations : TEntityAnnotationTypelocationsArray Index 56 Read Flocations Write Setlocations;
  413. Property confidence : integer Index 64 Read Fconfidence Write Setconfidence;
  414. end;
  415. TEntityAnnotationClass = Class of TEntityAnnotation;
  416. { --------------------------------------------------------------------
  417. TProperty
  418. --------------------------------------------------------------------}
  419. TProperty = Class(TGoogleBaseObject)
  420. Private
  421. Fvalue : String;
  422. Fname : String;
  423. Protected
  424. //Property setters
  425. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  426. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  427. Public
  428. Published
  429. Property value : String Index 0 Read Fvalue Write Setvalue;
  430. Property name : String Index 8 Read Fname Write Setname;
  431. end;
  432. TPropertyClass = Class of TProperty;
  433. { --------------------------------------------------------------------
  434. TColor
  435. --------------------------------------------------------------------}
  436. TColor = Class(TGoogleBaseObject)
  437. Private
  438. Fgreen : integer;
  439. Fblue : integer;
  440. Fred : integer;
  441. Falpha : integer;
  442. Protected
  443. //Property setters
  444. Procedure Setgreen(AIndex : Integer; const AValue : integer); virtual;
  445. Procedure Setblue(AIndex : Integer; const AValue : integer); virtual;
  446. Procedure Setred(AIndex : Integer; const AValue : integer); virtual;
  447. Procedure Setalpha(AIndex : Integer; const AValue : integer); virtual;
  448. Public
  449. Published
  450. Property green : integer Index 0 Read Fgreen Write Setgreen;
  451. Property blue : integer Index 8 Read Fblue Write Setblue;
  452. Property red : integer Index 16 Read Fred Write Setred;
  453. Property alpha : integer Index 24 Read Falpha Write Setalpha;
  454. end;
  455. TColorClass = Class of TColor;
  456. { --------------------------------------------------------------------
  457. TLocationInfo
  458. --------------------------------------------------------------------}
  459. TLocationInfo = Class(TGoogleBaseObject)
  460. Private
  461. FlatLng : TLatLng;
  462. Protected
  463. //Property setters
  464. Procedure SetlatLng(AIndex : Integer; const AValue : TLatLng); virtual;
  465. Public
  466. Published
  467. Property latLng : TLatLng Index 0 Read FlatLng Write SetlatLng;
  468. end;
  469. TLocationInfoClass = Class of TLocationInfo;
  470. { --------------------------------------------------------------------
  471. TSafeSearchAnnotation
  472. --------------------------------------------------------------------}
  473. TSafeSearchAnnotation = Class(TGoogleBaseObject)
  474. Private
  475. Fmedical : String;
  476. Fspoof : String;
  477. Fviolence : String;
  478. Fadult : String;
  479. Protected
  480. //Property setters
  481. Procedure Setmedical(AIndex : Integer; const AValue : String); virtual;
  482. Procedure Setspoof(AIndex : Integer; const AValue : String); virtual;
  483. Procedure Setviolence(AIndex : Integer; const AValue : String); virtual;
  484. Procedure Setadult(AIndex : Integer; const AValue : String); virtual;
  485. Public
  486. Published
  487. Property medical : String Index 0 Read Fmedical Write Setmedical;
  488. Property spoof : String Index 8 Read Fspoof Write Setspoof;
  489. Property violence : String Index 16 Read Fviolence Write Setviolence;
  490. Property adult : String Index 24 Read Fadult Write Setadult;
  491. end;
  492. TSafeSearchAnnotationClass = Class of TSafeSearchAnnotation;
  493. { --------------------------------------------------------------------
  494. TImage
  495. --------------------------------------------------------------------}
  496. TImage = Class(TGoogleBaseObject)
  497. Private
  498. Fsource : TImageSource;
  499. Fcontent : String;
  500. Protected
  501. //Property setters
  502. Procedure Setsource(AIndex : Integer; const AValue : TImageSource); virtual;
  503. Procedure Setcontent(AIndex : Integer; const AValue : String); virtual;
  504. Public
  505. Published
  506. Property source : TImageSource Index 0 Read Fsource Write Setsource;
  507. Property content : String Index 8 Read Fcontent Write Setcontent;
  508. end;
  509. TImageClass = Class of TImage;
  510. { --------------------------------------------------------------------
  511. TDominantColorsAnnotation
  512. --------------------------------------------------------------------}
  513. TDominantColorsAnnotation = Class(TGoogleBaseObject)
  514. Private
  515. Fcolors : TDominantColorsAnnotationTypecolorsArray;
  516. Protected
  517. //Property setters
  518. Procedure Setcolors(AIndex : Integer; const AValue : TDominantColorsAnnotationTypecolorsArray); virtual;
  519. //2.6.4. bug workaround
  520. {$IFDEF VER2_6}
  521. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  522. {$ENDIF VER2_6}
  523. Public
  524. Published
  525. Property colors : TDominantColorsAnnotationTypecolorsArray Index 0 Read Fcolors Write Setcolors;
  526. end;
  527. TDominantColorsAnnotationClass = Class of TDominantColorsAnnotation;
  528. { --------------------------------------------------------------------
  529. TFeature
  530. --------------------------------------------------------------------}
  531. TFeature = Class(TGoogleBaseObject)
  532. Private
  533. F_type : String;
  534. FmaxResults : integer;
  535. Protected
  536. Class Function ExportPropertyName(Const AName : String) : string; override;
  537. //Property setters
  538. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  539. Procedure SetmaxResults(AIndex : Integer; const AValue : integer); virtual;
  540. Public
  541. Published
  542. Property _type : String Index 0 Read F_type Write Set_type;
  543. Property maxResults : integer Index 8 Read FmaxResults Write SetmaxResults;
  544. end;
  545. TFeatureClass = Class of TFeature;
  546. { --------------------------------------------------------------------
  547. TBatchAnnotateImagesResponse
  548. --------------------------------------------------------------------}
  549. TBatchAnnotateImagesResponse = Class(TGoogleBaseObject)
  550. Private
  551. Fresponses : TBatchAnnotateImagesResponseTyperesponsesArray;
  552. Protected
  553. //Property setters
  554. Procedure Setresponses(AIndex : Integer; const AValue : TBatchAnnotateImagesResponseTyperesponsesArray); virtual;
  555. //2.6.4. bug workaround
  556. {$IFDEF VER2_6}
  557. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  558. {$ENDIF VER2_6}
  559. Public
  560. Published
  561. Property responses : TBatchAnnotateImagesResponseTyperesponsesArray Index 0 Read Fresponses Write Setresponses;
  562. end;
  563. TBatchAnnotateImagesResponseClass = Class of TBatchAnnotateImagesResponse;
  564. { --------------------------------------------------------------------
  565. TImageProperties
  566. --------------------------------------------------------------------}
  567. TImageProperties = Class(TGoogleBaseObject)
  568. Private
  569. FdominantColors : TDominantColorsAnnotation;
  570. Protected
  571. //Property setters
  572. Procedure SetdominantColors(AIndex : Integer; const AValue : TDominantColorsAnnotation); virtual;
  573. Public
  574. Published
  575. Property dominantColors : TDominantColorsAnnotation Index 0 Read FdominantColors Write SetdominantColors;
  576. end;
  577. TImagePropertiesClass = Class of TImageProperties;
  578. { --------------------------------------------------------------------
  579. TLatLng
  580. --------------------------------------------------------------------}
  581. TLatLng = Class(TGoogleBaseObject)
  582. Private
  583. Flatitude : double;
  584. Flongitude : double;
  585. Protected
  586. //Property setters
  587. Procedure Setlatitude(AIndex : Integer; const AValue : double); virtual;
  588. Procedure Setlongitude(AIndex : Integer; const AValue : double); virtual;
  589. Public
  590. Published
  591. Property latitude : double Index 0 Read Flatitude Write Setlatitude;
  592. Property longitude : double Index 8 Read Flongitude Write Setlongitude;
  593. end;
  594. TLatLngClass = Class of TLatLng;
  595. { --------------------------------------------------------------------
  596. TPosition
  597. --------------------------------------------------------------------}
  598. TPosition = Class(TGoogleBaseObject)
  599. Private
  600. Fy : integer;
  601. Fx : integer;
  602. Fz : integer;
  603. Protected
  604. //Property setters
  605. Procedure Sety(AIndex : Integer; const AValue : integer); virtual;
  606. Procedure Setx(AIndex : Integer; const AValue : integer); virtual;
  607. Procedure Setz(AIndex : Integer; const AValue : integer); virtual;
  608. Public
  609. Published
  610. Property y : integer Index 0 Read Fy Write Sety;
  611. Property x : integer Index 8 Read Fx Write Setx;
  612. Property z : integer Index 16 Read Fz Write Setz;
  613. end;
  614. TPositionClass = Class of TPosition;
  615. { --------------------------------------------------------------------
  616. TImagesResource
  617. --------------------------------------------------------------------}
  618. TImagesResource = Class(TGoogleResource)
  619. Public
  620. Class Function ResourceName : String; override;
  621. Class Function DefaultAPI : TGoogleAPIClass; override;
  622. Function Annotate(aBatchAnnotateImagesRequest : TBatchAnnotateImagesRequest) : TBatchAnnotateImagesResponse;
  623. end;
  624. { --------------------------------------------------------------------
  625. TVisionAPI
  626. --------------------------------------------------------------------}
  627. TVisionAPI = Class(TGoogleAPI)
  628. Private
  629. FImagesInstance : TImagesResource;
  630. Function GetImagesInstance : TImagesResource;virtual;
  631. Public
  632. //Override class functions with API info
  633. Class Function APIName : String; override;
  634. Class Function APIVersion : String; override;
  635. Class Function APIRevision : String; override;
  636. Class Function APIID : String; override;
  637. Class Function APITitle : String; override;
  638. Class Function APIDescription : String; override;
  639. Class Function APIOwnerDomain : String; override;
  640. Class Function APIOwnerName : String; override;
  641. Class Function APIIcon16 : String; override;
  642. Class Function APIIcon32 : String; override;
  643. Class Function APIdocumentationLink : String; override;
  644. Class Function APIrootUrl : string; override;
  645. Class Function APIbasePath : string;override;
  646. Class Function APIbaseURL : String;override;
  647. Class Function APIProtocol : string;override;
  648. Class Function APIservicePath : string;override;
  649. Class Function APIbatchPath : String;override;
  650. Class Function APIAuthScopes : TScopeInfoArray;override;
  651. Class Function APINeedsAuth : Boolean;override;
  652. Class Procedure RegisterAPIResources; override;
  653. //Add create function for resources
  654. Function CreateImagesResource(AOwner : TComponent) : TImagesResource;virtual;overload;
  655. Function CreateImagesResource : TImagesResource;virtual;overload;
  656. //Add default on-demand instances for resources
  657. Property ImagesResource : TImagesResource Read GetImagesInstance;
  658. end;
  659. implementation
  660. { --------------------------------------------------------------------
  661. TImageSource
  662. --------------------------------------------------------------------}
  663. Procedure TImageSource.SetgcsImageUri(AIndex : Integer; const AValue : String);
  664. begin
  665. If (FgcsImageUri=AValue) then exit;
  666. FgcsImageUri:=AValue;
  667. MarkPropertyChanged(AIndex);
  668. end;
  669. { --------------------------------------------------------------------
  670. TAnnotateImageRequest
  671. --------------------------------------------------------------------}
  672. Procedure TAnnotateImageRequest.Setimage(AIndex : Integer; const AValue : TImage);
  673. begin
  674. If (Fimage=AValue) then exit;
  675. Fimage:=AValue;
  676. MarkPropertyChanged(AIndex);
  677. end;
  678. Procedure TAnnotateImageRequest.SetimageContext(AIndex : Integer; const AValue : TImageContext);
  679. begin
  680. If (FimageContext=AValue) then exit;
  681. FimageContext:=AValue;
  682. MarkPropertyChanged(AIndex);
  683. end;
  684. Procedure TAnnotateImageRequest.Setfeatures(AIndex : Integer; const AValue : TAnnotateImageRequestTypefeaturesArray);
  685. begin
  686. If (Ffeatures=AValue) then exit;
  687. Ffeatures:=AValue;
  688. MarkPropertyChanged(AIndex);
  689. end;
  690. //2.6.4. bug workaround
  691. {$IFDEF VER2_6}
  692. Procedure TAnnotateImageRequest.SetArrayLength(Const AName : String; ALength : Longint);
  693. begin
  694. Case AName of
  695. 'features' : SetLength(Ffeatures,ALength);
  696. else
  697. Inherited SetArrayLength(AName,ALength);
  698. end;
  699. end;
  700. {$ENDIF VER2_6}
  701. { --------------------------------------------------------------------
  702. TAnnotateImageResponse
  703. --------------------------------------------------------------------}
  704. Procedure TAnnotateImageResponse.SetlabelAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelabelAnnotationsArray);
  705. begin
  706. If (FlabelAnnotations=AValue) then exit;
  707. FlabelAnnotations:=AValue;
  708. MarkPropertyChanged(AIndex);
  709. end;
  710. Procedure TAnnotateImageResponse.SetlandmarkAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelandmarkAnnotationsArray);
  711. begin
  712. If (FlandmarkAnnotations=AValue) then exit;
  713. FlandmarkAnnotations:=AValue;
  714. MarkPropertyChanged(AIndex);
  715. end;
  716. Procedure TAnnotateImageResponse.SetsafeSearchAnnotation(AIndex : Integer; const AValue : TSafeSearchAnnotation);
  717. begin
  718. If (FsafeSearchAnnotation=AValue) then exit;
  719. FsafeSearchAnnotation:=AValue;
  720. MarkPropertyChanged(AIndex);
  721. end;
  722. Procedure TAnnotateImageResponse.SetimagePropertiesAnnotation(AIndex : Integer; const AValue : TImageProperties);
  723. begin
  724. If (FimagePropertiesAnnotation=AValue) then exit;
  725. FimagePropertiesAnnotation:=AValue;
  726. MarkPropertyChanged(AIndex);
  727. end;
  728. Procedure TAnnotateImageResponse.SettextAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypetextAnnotationsArray);
  729. begin
  730. If (FtextAnnotations=AValue) then exit;
  731. FtextAnnotations:=AValue;
  732. MarkPropertyChanged(AIndex);
  733. end;
  734. Procedure TAnnotateImageResponse.SetlogoAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelogoAnnotationsArray);
  735. begin
  736. If (FlogoAnnotations=AValue) then exit;
  737. FlogoAnnotations:=AValue;
  738. MarkPropertyChanged(AIndex);
  739. end;
  740. Procedure TAnnotateImageResponse.SetfaceAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypefaceAnnotationsArray);
  741. begin
  742. If (FfaceAnnotations=AValue) then exit;
  743. FfaceAnnotations:=AValue;
  744. MarkPropertyChanged(AIndex);
  745. end;
  746. Procedure TAnnotateImageResponse.Seterror(AIndex : Integer; const AValue : TStatus);
  747. begin
  748. If (Ferror=AValue) then exit;
  749. Ferror:=AValue;
  750. MarkPropertyChanged(AIndex);
  751. end;
  752. //2.6.4. bug workaround
  753. {$IFDEF VER2_6}
  754. Procedure TAnnotateImageResponse.SetArrayLength(Const AName : String; ALength : Longint);
  755. begin
  756. Case AName of
  757. 'labelannotations' : SetLength(FlabelAnnotations,ALength);
  758. 'landmarkannotations' : SetLength(FlandmarkAnnotations,ALength);
  759. 'textannotations' : SetLength(FtextAnnotations,ALength);
  760. 'logoannotations' : SetLength(FlogoAnnotations,ALength);
  761. 'faceannotations' : SetLength(FfaceAnnotations,ALength);
  762. else
  763. Inherited SetArrayLength(AName,ALength);
  764. end;
  765. end;
  766. {$ENDIF VER2_6}
  767. { --------------------------------------------------------------------
  768. TLatLongRect
  769. --------------------------------------------------------------------}
  770. Procedure TLatLongRect.SetmaxLatLng(AIndex : Integer; const AValue : TLatLng);
  771. begin
  772. If (FmaxLatLng=AValue) then exit;
  773. FmaxLatLng:=AValue;
  774. MarkPropertyChanged(AIndex);
  775. end;
  776. Procedure TLatLongRect.SetminLatLng(AIndex : Integer; const AValue : TLatLng);
  777. begin
  778. If (FminLatLng=AValue) then exit;
  779. FminLatLng:=AValue;
  780. MarkPropertyChanged(AIndex);
  781. end;
  782. { --------------------------------------------------------------------
  783. TStatusTypedetailsItem
  784. --------------------------------------------------------------------}
  785. Class Function TStatusTypedetailsItem.AllowAdditionalProperties : Boolean;
  786. begin
  787. Result:=True;
  788. end;
  789. { --------------------------------------------------------------------
  790. TStatus
  791. --------------------------------------------------------------------}
  792. Procedure TStatus.Setcode(AIndex : Integer; const AValue : integer);
  793. begin
  794. If (Fcode=AValue) then exit;
  795. Fcode:=AValue;
  796. MarkPropertyChanged(AIndex);
  797. end;
  798. Procedure TStatus.Setdetails(AIndex : Integer; const AValue : TStatusTypedetailsArray);
  799. begin
  800. If (Fdetails=AValue) then exit;
  801. Fdetails:=AValue;
  802. MarkPropertyChanged(AIndex);
  803. end;
  804. Procedure TStatus.Setmessage(AIndex : Integer; const AValue : String);
  805. begin
  806. If (Fmessage=AValue) then exit;
  807. Fmessage:=AValue;
  808. MarkPropertyChanged(AIndex);
  809. end;
  810. //2.6.4. bug workaround
  811. {$IFDEF VER2_6}
  812. Procedure TStatus.SetArrayLength(Const AName : String; ALength : Longint);
  813. begin
  814. Case AName of
  815. 'details' : SetLength(Fdetails,ALength);
  816. else
  817. Inherited SetArrayLength(AName,ALength);
  818. end;
  819. end;
  820. {$ENDIF VER2_6}
  821. { --------------------------------------------------------------------
  822. TFaceAnnotation
  823. --------------------------------------------------------------------}
  824. Procedure TFaceAnnotation.SettiltAngle(AIndex : Integer; const AValue : integer);
  825. begin
  826. If (FtiltAngle=AValue) then exit;
  827. FtiltAngle:=AValue;
  828. MarkPropertyChanged(AIndex);
  829. end;
  830. Procedure TFaceAnnotation.SetunderExposedLikelihood(AIndex : Integer; const AValue : String);
  831. begin
  832. If (FunderExposedLikelihood=AValue) then exit;
  833. FunderExposedLikelihood:=AValue;
  834. MarkPropertyChanged(AIndex);
  835. end;
  836. Procedure TFaceAnnotation.SetfdBoundingPoly(AIndex : Integer; const AValue : TBoundingPoly);
  837. begin
  838. If (FfdBoundingPoly=AValue) then exit;
  839. FfdBoundingPoly:=AValue;
  840. MarkPropertyChanged(AIndex);
  841. end;
  842. Procedure TFaceAnnotation.SetlandmarkingConfidence(AIndex : Integer; const AValue : integer);
  843. begin
  844. If (FlandmarkingConfidence=AValue) then exit;
  845. FlandmarkingConfidence:=AValue;
  846. MarkPropertyChanged(AIndex);
  847. end;
  848. Procedure TFaceAnnotation.SetjoyLikelihood(AIndex : Integer; const AValue : String);
  849. begin
  850. If (FjoyLikelihood=AValue) then exit;
  851. FjoyLikelihood:=AValue;
  852. MarkPropertyChanged(AIndex);
  853. end;
  854. Procedure TFaceAnnotation.SetdetectionConfidence(AIndex : Integer; const AValue : integer);
  855. begin
  856. If (FdetectionConfidence=AValue) then exit;
  857. FdetectionConfidence:=AValue;
  858. MarkPropertyChanged(AIndex);
  859. end;
  860. Procedure TFaceAnnotation.SetsurpriseLikelihood(AIndex : Integer; const AValue : String);
  861. begin
  862. If (FsurpriseLikelihood=AValue) then exit;
  863. FsurpriseLikelihood:=AValue;
  864. MarkPropertyChanged(AIndex);
  865. end;
  866. Procedure TFaceAnnotation.SetangerLikelihood(AIndex : Integer; const AValue : String);
  867. begin
  868. If (FangerLikelihood=AValue) then exit;
  869. FangerLikelihood:=AValue;
  870. MarkPropertyChanged(AIndex);
  871. end;
  872. Procedure TFaceAnnotation.SetheadwearLikelihood(AIndex : Integer; const AValue : String);
  873. begin
  874. If (FheadwearLikelihood=AValue) then exit;
  875. FheadwearLikelihood:=AValue;
  876. MarkPropertyChanged(AIndex);
  877. end;
  878. Procedure TFaceAnnotation.SetpanAngle(AIndex : Integer; const AValue : integer);
  879. begin
  880. If (FpanAngle=AValue) then exit;
  881. FpanAngle:=AValue;
  882. MarkPropertyChanged(AIndex);
  883. end;
  884. Procedure TFaceAnnotation.SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly);
  885. begin
  886. If (FboundingPoly=AValue) then exit;
  887. FboundingPoly:=AValue;
  888. MarkPropertyChanged(AIndex);
  889. end;
  890. Procedure TFaceAnnotation.Setlandmarks(AIndex : Integer; const AValue : TFaceAnnotationTypelandmarksArray);
  891. begin
  892. If (Flandmarks=AValue) then exit;
  893. Flandmarks:=AValue;
  894. MarkPropertyChanged(AIndex);
  895. end;
  896. Procedure TFaceAnnotation.SetblurredLikelihood(AIndex : Integer; const AValue : String);
  897. begin
  898. If (FblurredLikelihood=AValue) then exit;
  899. FblurredLikelihood:=AValue;
  900. MarkPropertyChanged(AIndex);
  901. end;
  902. Procedure TFaceAnnotation.SetrollAngle(AIndex : Integer; const AValue : integer);
  903. begin
  904. If (FrollAngle=AValue) then exit;
  905. FrollAngle:=AValue;
  906. MarkPropertyChanged(AIndex);
  907. end;
  908. Procedure TFaceAnnotation.SetsorrowLikelihood(AIndex : Integer; const AValue : String);
  909. begin
  910. If (FsorrowLikelihood=AValue) then exit;
  911. FsorrowLikelihood:=AValue;
  912. MarkPropertyChanged(AIndex);
  913. end;
  914. //2.6.4. bug workaround
  915. {$IFDEF VER2_6}
  916. Procedure TFaceAnnotation.SetArrayLength(Const AName : String; ALength : Longint);
  917. begin
  918. Case AName of
  919. 'landmarks' : SetLength(Flandmarks,ALength);
  920. else
  921. Inherited SetArrayLength(AName,ALength);
  922. end;
  923. end;
  924. {$ENDIF VER2_6}
  925. { --------------------------------------------------------------------
  926. TVertex
  927. --------------------------------------------------------------------}
  928. Procedure TVertex.Sety(AIndex : Integer; const AValue : integer);
  929. begin
  930. If (Fy=AValue) then exit;
  931. Fy:=AValue;
  932. MarkPropertyChanged(AIndex);
  933. end;
  934. Procedure TVertex.Setx(AIndex : Integer; const AValue : integer);
  935. begin
  936. If (Fx=AValue) then exit;
  937. Fx:=AValue;
  938. MarkPropertyChanged(AIndex);
  939. end;
  940. { --------------------------------------------------------------------
  941. TColorInfo
  942. --------------------------------------------------------------------}
  943. Procedure TColorInfo.SetpixelFraction(AIndex : Integer; const AValue : integer);
  944. begin
  945. If (FpixelFraction=AValue) then exit;
  946. FpixelFraction:=AValue;
  947. MarkPropertyChanged(AIndex);
  948. end;
  949. Procedure TColorInfo.Setcolor(AIndex : Integer; const AValue : TColor);
  950. begin
  951. If (Fcolor=AValue) then exit;
  952. Fcolor:=AValue;
  953. MarkPropertyChanged(AIndex);
  954. end;
  955. Procedure TColorInfo.Setscore(AIndex : Integer; const AValue : integer);
  956. begin
  957. If (Fscore=AValue) then exit;
  958. Fscore:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. { --------------------------------------------------------------------
  962. TBoundingPoly
  963. --------------------------------------------------------------------}
  964. Procedure TBoundingPoly.Setvertices(AIndex : Integer; const AValue : TBoundingPolyTypeverticesArray);
  965. begin
  966. If (Fvertices=AValue) then exit;
  967. Fvertices:=AValue;
  968. MarkPropertyChanged(AIndex);
  969. end;
  970. //2.6.4. bug workaround
  971. {$IFDEF VER2_6}
  972. Procedure TBoundingPoly.SetArrayLength(Const AName : String; ALength : Longint);
  973. begin
  974. Case AName of
  975. 'vertices' : SetLength(Fvertices,ALength);
  976. else
  977. Inherited SetArrayLength(AName,ALength);
  978. end;
  979. end;
  980. {$ENDIF VER2_6}
  981. { --------------------------------------------------------------------
  982. TLandmark
  983. --------------------------------------------------------------------}
  984. Procedure TLandmark.Setposition(AIndex : Integer; const AValue : TPosition);
  985. begin
  986. If (Fposition=AValue) then exit;
  987. Fposition:=AValue;
  988. MarkPropertyChanged(AIndex);
  989. end;
  990. Procedure TLandmark.Set_type(AIndex : Integer; const AValue : String);
  991. begin
  992. If (F_type=AValue) then exit;
  993. F_type:=AValue;
  994. MarkPropertyChanged(AIndex);
  995. end;
  996. Class Function TLandmark.ExportPropertyName(Const AName : String) :String;
  997. begin
  998. Case AName of
  999. '_type' : Result:='type';
  1000. else
  1001. Result:=Inherited ExportPropertyName(AName);
  1002. end;
  1003. end;
  1004. { --------------------------------------------------------------------
  1005. TImageContext
  1006. --------------------------------------------------------------------}
  1007. Procedure TImageContext.SetlatLongRect(AIndex : Integer; const AValue : TLatLongRect);
  1008. begin
  1009. If (FlatLongRect=AValue) then exit;
  1010. FlatLongRect:=AValue;
  1011. MarkPropertyChanged(AIndex);
  1012. end;
  1013. Procedure TImageContext.SetlanguageHints(AIndex : Integer; const AValue : TStringArray);
  1014. begin
  1015. If (FlanguageHints=AValue) then exit;
  1016. FlanguageHints:=AValue;
  1017. MarkPropertyChanged(AIndex);
  1018. end;
  1019. //2.6.4. bug workaround
  1020. {$IFDEF VER2_6}
  1021. Procedure TImageContext.SetArrayLength(Const AName : String; ALength : Longint);
  1022. begin
  1023. Case AName of
  1024. 'languagehints' : SetLength(FlanguageHints,ALength);
  1025. else
  1026. Inherited SetArrayLength(AName,ALength);
  1027. end;
  1028. end;
  1029. {$ENDIF VER2_6}
  1030. { --------------------------------------------------------------------
  1031. TBatchAnnotateImagesRequest
  1032. --------------------------------------------------------------------}
  1033. Procedure TBatchAnnotateImagesRequest.Setrequests(AIndex : Integer; const AValue : TBatchAnnotateImagesRequestTyperequestsArray);
  1034. begin
  1035. If (Frequests=AValue) then exit;
  1036. Frequests:=AValue;
  1037. MarkPropertyChanged(AIndex);
  1038. end;
  1039. //2.6.4. bug workaround
  1040. {$IFDEF VER2_6}
  1041. Procedure TBatchAnnotateImagesRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1042. begin
  1043. Case AName of
  1044. 'requests' : SetLength(Frequests,ALength);
  1045. else
  1046. Inherited SetArrayLength(AName,ALength);
  1047. end;
  1048. end;
  1049. {$ENDIF VER2_6}
  1050. { --------------------------------------------------------------------
  1051. TEntityAnnotation
  1052. --------------------------------------------------------------------}
  1053. Procedure TEntityAnnotation.Setmid(AIndex : Integer; const AValue : String);
  1054. begin
  1055. If (Fmid=AValue) then exit;
  1056. Fmid:=AValue;
  1057. MarkPropertyChanged(AIndex);
  1058. end;
  1059. Procedure TEntityAnnotation.Setdescription(AIndex : Integer; const AValue : String);
  1060. begin
  1061. If (Fdescription=AValue) then exit;
  1062. Fdescription:=AValue;
  1063. MarkPropertyChanged(AIndex);
  1064. end;
  1065. Procedure TEntityAnnotation.Settopicality(AIndex : Integer; const AValue : integer);
  1066. begin
  1067. If (Ftopicality=AValue) then exit;
  1068. Ftopicality:=AValue;
  1069. MarkPropertyChanged(AIndex);
  1070. end;
  1071. Procedure TEntityAnnotation.Setlocale(AIndex : Integer; const AValue : String);
  1072. begin
  1073. If (Flocale=AValue) then exit;
  1074. Flocale:=AValue;
  1075. MarkPropertyChanged(AIndex);
  1076. end;
  1077. Procedure TEntityAnnotation.Setproperties(AIndex : Integer; const AValue : TEntityAnnotationTypepropertiesArray);
  1078. begin
  1079. If (Fproperties=AValue) then exit;
  1080. Fproperties:=AValue;
  1081. MarkPropertyChanged(AIndex);
  1082. end;
  1083. Procedure TEntityAnnotation.Setscore(AIndex : Integer; const AValue : integer);
  1084. begin
  1085. If (Fscore=AValue) then exit;
  1086. Fscore:=AValue;
  1087. MarkPropertyChanged(AIndex);
  1088. end;
  1089. Procedure TEntityAnnotation.SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly);
  1090. begin
  1091. If (FboundingPoly=AValue) then exit;
  1092. FboundingPoly:=AValue;
  1093. MarkPropertyChanged(AIndex);
  1094. end;
  1095. Procedure TEntityAnnotation.Setlocations(AIndex : Integer; const AValue : TEntityAnnotationTypelocationsArray);
  1096. begin
  1097. If (Flocations=AValue) then exit;
  1098. Flocations:=AValue;
  1099. MarkPropertyChanged(AIndex);
  1100. end;
  1101. Procedure TEntityAnnotation.Setconfidence(AIndex : Integer; const AValue : integer);
  1102. begin
  1103. If (Fconfidence=AValue) then exit;
  1104. Fconfidence:=AValue;
  1105. MarkPropertyChanged(AIndex);
  1106. end;
  1107. //2.6.4. bug workaround
  1108. {$IFDEF VER2_6}
  1109. Procedure TEntityAnnotation.SetArrayLength(Const AName : String; ALength : Longint);
  1110. begin
  1111. Case AName of
  1112. 'properties' : SetLength(Fproperties,ALength);
  1113. 'locations' : SetLength(Flocations,ALength);
  1114. else
  1115. Inherited SetArrayLength(AName,ALength);
  1116. end;
  1117. end;
  1118. {$ENDIF VER2_6}
  1119. { --------------------------------------------------------------------
  1120. TProperty
  1121. --------------------------------------------------------------------}
  1122. Procedure TProperty.Setvalue(AIndex : Integer; const AValue : String);
  1123. begin
  1124. If (Fvalue=AValue) then exit;
  1125. Fvalue:=AValue;
  1126. MarkPropertyChanged(AIndex);
  1127. end;
  1128. Procedure TProperty.Setname(AIndex : Integer; const AValue : String);
  1129. begin
  1130. If (Fname=AValue) then exit;
  1131. Fname:=AValue;
  1132. MarkPropertyChanged(AIndex);
  1133. end;
  1134. { --------------------------------------------------------------------
  1135. TColor
  1136. --------------------------------------------------------------------}
  1137. Procedure TColor.Setgreen(AIndex : Integer; const AValue : integer);
  1138. begin
  1139. If (Fgreen=AValue) then exit;
  1140. Fgreen:=AValue;
  1141. MarkPropertyChanged(AIndex);
  1142. end;
  1143. Procedure TColor.Setblue(AIndex : Integer; const AValue : integer);
  1144. begin
  1145. If (Fblue=AValue) then exit;
  1146. Fblue:=AValue;
  1147. MarkPropertyChanged(AIndex);
  1148. end;
  1149. Procedure TColor.Setred(AIndex : Integer; const AValue : integer);
  1150. begin
  1151. If (Fred=AValue) then exit;
  1152. Fred:=AValue;
  1153. MarkPropertyChanged(AIndex);
  1154. end;
  1155. Procedure TColor.Setalpha(AIndex : Integer; const AValue : integer);
  1156. begin
  1157. If (Falpha=AValue) then exit;
  1158. Falpha:=AValue;
  1159. MarkPropertyChanged(AIndex);
  1160. end;
  1161. { --------------------------------------------------------------------
  1162. TLocationInfo
  1163. --------------------------------------------------------------------}
  1164. Procedure TLocationInfo.SetlatLng(AIndex : Integer; const AValue : TLatLng);
  1165. begin
  1166. If (FlatLng=AValue) then exit;
  1167. FlatLng:=AValue;
  1168. MarkPropertyChanged(AIndex);
  1169. end;
  1170. { --------------------------------------------------------------------
  1171. TSafeSearchAnnotation
  1172. --------------------------------------------------------------------}
  1173. Procedure TSafeSearchAnnotation.Setmedical(AIndex : Integer; const AValue : String);
  1174. begin
  1175. If (Fmedical=AValue) then exit;
  1176. Fmedical:=AValue;
  1177. MarkPropertyChanged(AIndex);
  1178. end;
  1179. Procedure TSafeSearchAnnotation.Setspoof(AIndex : Integer; const AValue : String);
  1180. begin
  1181. If (Fspoof=AValue) then exit;
  1182. Fspoof:=AValue;
  1183. MarkPropertyChanged(AIndex);
  1184. end;
  1185. Procedure TSafeSearchAnnotation.Setviolence(AIndex : Integer; const AValue : String);
  1186. begin
  1187. If (Fviolence=AValue) then exit;
  1188. Fviolence:=AValue;
  1189. MarkPropertyChanged(AIndex);
  1190. end;
  1191. Procedure TSafeSearchAnnotation.Setadult(AIndex : Integer; const AValue : String);
  1192. begin
  1193. If (Fadult=AValue) then exit;
  1194. Fadult:=AValue;
  1195. MarkPropertyChanged(AIndex);
  1196. end;
  1197. { --------------------------------------------------------------------
  1198. TImage
  1199. --------------------------------------------------------------------}
  1200. Procedure TImage.Setsource(AIndex : Integer; const AValue : TImageSource);
  1201. begin
  1202. If (Fsource=AValue) then exit;
  1203. Fsource:=AValue;
  1204. MarkPropertyChanged(AIndex);
  1205. end;
  1206. Procedure TImage.Setcontent(AIndex : Integer; const AValue : String);
  1207. begin
  1208. If (Fcontent=AValue) then exit;
  1209. Fcontent:=AValue;
  1210. MarkPropertyChanged(AIndex);
  1211. end;
  1212. { --------------------------------------------------------------------
  1213. TDominantColorsAnnotation
  1214. --------------------------------------------------------------------}
  1215. Procedure TDominantColorsAnnotation.Setcolors(AIndex : Integer; const AValue : TDominantColorsAnnotationTypecolorsArray);
  1216. begin
  1217. If (Fcolors=AValue) then exit;
  1218. Fcolors:=AValue;
  1219. MarkPropertyChanged(AIndex);
  1220. end;
  1221. //2.6.4. bug workaround
  1222. {$IFDEF VER2_6}
  1223. Procedure TDominantColorsAnnotation.SetArrayLength(Const AName : String; ALength : Longint);
  1224. begin
  1225. Case AName of
  1226. 'colors' : SetLength(Fcolors,ALength);
  1227. else
  1228. Inherited SetArrayLength(AName,ALength);
  1229. end;
  1230. end;
  1231. {$ENDIF VER2_6}
  1232. { --------------------------------------------------------------------
  1233. TFeature
  1234. --------------------------------------------------------------------}
  1235. Procedure TFeature.Set_type(AIndex : Integer; const AValue : String);
  1236. begin
  1237. If (F_type=AValue) then exit;
  1238. F_type:=AValue;
  1239. MarkPropertyChanged(AIndex);
  1240. end;
  1241. Procedure TFeature.SetmaxResults(AIndex : Integer; const AValue : integer);
  1242. begin
  1243. If (FmaxResults=AValue) then exit;
  1244. FmaxResults:=AValue;
  1245. MarkPropertyChanged(AIndex);
  1246. end;
  1247. Class Function TFeature.ExportPropertyName(Const AName : String) :String;
  1248. begin
  1249. Case AName of
  1250. '_type' : Result:='type';
  1251. else
  1252. Result:=Inherited ExportPropertyName(AName);
  1253. end;
  1254. end;
  1255. { --------------------------------------------------------------------
  1256. TBatchAnnotateImagesResponse
  1257. --------------------------------------------------------------------}
  1258. Procedure TBatchAnnotateImagesResponse.Setresponses(AIndex : Integer; const AValue : TBatchAnnotateImagesResponseTyperesponsesArray);
  1259. begin
  1260. If (Fresponses=AValue) then exit;
  1261. Fresponses:=AValue;
  1262. MarkPropertyChanged(AIndex);
  1263. end;
  1264. //2.6.4. bug workaround
  1265. {$IFDEF VER2_6}
  1266. Procedure TBatchAnnotateImagesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1267. begin
  1268. Case AName of
  1269. 'responses' : SetLength(Fresponses,ALength);
  1270. else
  1271. Inherited SetArrayLength(AName,ALength);
  1272. end;
  1273. end;
  1274. {$ENDIF VER2_6}
  1275. { --------------------------------------------------------------------
  1276. TImageProperties
  1277. --------------------------------------------------------------------}
  1278. Procedure TImageProperties.SetdominantColors(AIndex : Integer; const AValue : TDominantColorsAnnotation);
  1279. begin
  1280. If (FdominantColors=AValue) then exit;
  1281. FdominantColors:=AValue;
  1282. MarkPropertyChanged(AIndex);
  1283. end;
  1284. { --------------------------------------------------------------------
  1285. TLatLng
  1286. --------------------------------------------------------------------}
  1287. Procedure TLatLng.Setlatitude(AIndex : Integer; const AValue : double);
  1288. begin
  1289. If (Flatitude=AValue) then exit;
  1290. Flatitude:=AValue;
  1291. MarkPropertyChanged(AIndex);
  1292. end;
  1293. Procedure TLatLng.Setlongitude(AIndex : Integer; const AValue : double);
  1294. begin
  1295. If (Flongitude=AValue) then exit;
  1296. Flongitude:=AValue;
  1297. MarkPropertyChanged(AIndex);
  1298. end;
  1299. { --------------------------------------------------------------------
  1300. TPosition
  1301. --------------------------------------------------------------------}
  1302. Procedure TPosition.Sety(AIndex : Integer; const AValue : integer);
  1303. begin
  1304. If (Fy=AValue) then exit;
  1305. Fy:=AValue;
  1306. MarkPropertyChanged(AIndex);
  1307. end;
  1308. Procedure TPosition.Setx(AIndex : Integer; const AValue : integer);
  1309. begin
  1310. If (Fx=AValue) then exit;
  1311. Fx:=AValue;
  1312. MarkPropertyChanged(AIndex);
  1313. end;
  1314. Procedure TPosition.Setz(AIndex : Integer; const AValue : integer);
  1315. begin
  1316. If (Fz=AValue) then exit;
  1317. Fz:=AValue;
  1318. MarkPropertyChanged(AIndex);
  1319. end;
  1320. { --------------------------------------------------------------------
  1321. TImagesResource
  1322. --------------------------------------------------------------------}
  1323. Class Function TImagesResource.ResourceName : String;
  1324. begin
  1325. Result:='images';
  1326. end;
  1327. Class Function TImagesResource.DefaultAPI : TGoogleAPIClass;
  1328. begin
  1329. Result:=TvisionAPI;
  1330. end;
  1331. Function TImagesResource.Annotate(aBatchAnnotateImagesRequest : TBatchAnnotateImagesRequest) : TBatchAnnotateImagesResponse;
  1332. Const
  1333. _HTTPMethod = 'POST';
  1334. _Path = 'v1/images:annotate';
  1335. _Methodid = 'vision.images.annotate';
  1336. begin
  1337. Result:=ServiceCall(_HTTPMethod,_Path,'',aBatchAnnotateImagesRequest,TBatchAnnotateImagesResponse) as TBatchAnnotateImagesResponse;
  1338. end;
  1339. { --------------------------------------------------------------------
  1340. TVisionAPI
  1341. --------------------------------------------------------------------}
  1342. Class Function TVisionAPI.APIName : String;
  1343. begin
  1344. Result:='vision';
  1345. end;
  1346. Class Function TVisionAPI.APIVersion : String;
  1347. begin
  1348. Result:='v1';
  1349. end;
  1350. Class Function TVisionAPI.APIRevision : String;
  1351. begin
  1352. Result:='20160519';
  1353. end;
  1354. Class Function TVisionAPI.APIID : String;
  1355. begin
  1356. Result:='vision:v1';
  1357. end;
  1358. Class Function TVisionAPI.APITitle : String;
  1359. begin
  1360. Result:='Google Cloud Vision API';
  1361. end;
  1362. Class Function TVisionAPI.APIDescription : String;
  1363. begin
  1364. Result:='Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.';
  1365. end;
  1366. Class Function TVisionAPI.APIOwnerDomain : String;
  1367. begin
  1368. Result:='google.com';
  1369. end;
  1370. Class Function TVisionAPI.APIOwnerName : String;
  1371. begin
  1372. Result:='Google';
  1373. end;
  1374. Class Function TVisionAPI.APIIcon16 : String;
  1375. begin
  1376. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1377. end;
  1378. Class Function TVisionAPI.APIIcon32 : String;
  1379. begin
  1380. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1381. end;
  1382. Class Function TVisionAPI.APIdocumentationLink : String;
  1383. begin
  1384. Result:='https://cloud.google.com/vision/';
  1385. end;
  1386. Class Function TVisionAPI.APIrootUrl : string;
  1387. begin
  1388. Result:='https://vision.googleapis.com/';
  1389. end;
  1390. Class Function TVisionAPI.APIbasePath : string;
  1391. begin
  1392. Result:='';
  1393. end;
  1394. Class Function TVisionAPI.APIbaseURL : String;
  1395. begin
  1396. Result:='https://vision.googleapis.com/';
  1397. end;
  1398. Class Function TVisionAPI.APIProtocol : string;
  1399. begin
  1400. Result:='rest';
  1401. end;
  1402. Class Function TVisionAPI.APIservicePath : string;
  1403. begin
  1404. Result:='';
  1405. end;
  1406. Class Function TVisionAPI.APIbatchPath : String;
  1407. begin
  1408. Result:='batch';
  1409. end;
  1410. Class Function TVisionAPI.APIAuthScopes : TScopeInfoArray;
  1411. begin
  1412. SetLength(Result,1);
  1413. Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
  1414. Result[0].Description:='View and manage your data across Google Cloud Platform services';
  1415. end;
  1416. Class Function TVisionAPI.APINeedsAuth : Boolean;
  1417. begin
  1418. Result:=True;
  1419. end;
  1420. Class Procedure TVisionAPI.RegisterAPIResources;
  1421. begin
  1422. TImageSource.RegisterObject;
  1423. TAnnotateImageRequest.RegisterObject;
  1424. TAnnotateImageResponse.RegisterObject;
  1425. TLatLongRect.RegisterObject;
  1426. TStatusTypedetailsItem.RegisterObject;
  1427. TStatus.RegisterObject;
  1428. TFaceAnnotation.RegisterObject;
  1429. TVertex.RegisterObject;
  1430. TColorInfo.RegisterObject;
  1431. TBoundingPoly.RegisterObject;
  1432. TLandmark.RegisterObject;
  1433. TImageContext.RegisterObject;
  1434. TBatchAnnotateImagesRequest.RegisterObject;
  1435. TEntityAnnotation.RegisterObject;
  1436. TProperty.RegisterObject;
  1437. TColor.RegisterObject;
  1438. TLocationInfo.RegisterObject;
  1439. TSafeSearchAnnotation.RegisterObject;
  1440. TImage.RegisterObject;
  1441. TDominantColorsAnnotation.RegisterObject;
  1442. TFeature.RegisterObject;
  1443. TBatchAnnotateImagesResponse.RegisterObject;
  1444. TImageProperties.RegisterObject;
  1445. TLatLng.RegisterObject;
  1446. TPosition.RegisterObject;
  1447. end;
  1448. Function TVisionAPI.GetImagesInstance : TImagesResource;
  1449. begin
  1450. if (FImagesInstance=Nil) then
  1451. FImagesInstance:=CreateImagesResource;
  1452. Result:=FImagesInstance;
  1453. end;
  1454. Function TVisionAPI.CreateImagesResource : TImagesResource;
  1455. begin
  1456. Result:=CreateImagesResource(Self);
  1457. end;
  1458. Function TVisionAPI.CreateImagesResource(AOwner : TComponent) : TImagesResource;
  1459. begin
  1460. Result:=TImagesResource.Create(AOwner);
  1461. Result.API:=Self.API;
  1462. end;
  1463. initialization
  1464. TVisionAPI.RegisterAPI;
  1465. end.