12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018 |
- unit googlevision;
- {$MODE objfpc}
- {$H+}
- interface
- uses sysutils, classes, googleservice, restbase, googlebase;
- type
-
- //Top-level schema types
- TImageSource = Class;
- TAnnotateImageRequest = Class;
- TAnnotateImageResponse = Class;
- TLatLongRect = Class;
- TStatus = Class;
- TFaceAnnotation = Class;
- TVertex = Class;
- TColorInfo = Class;
- TBoundingPoly = Class;
- TLandmark = Class;
- TImageContext = Class;
- TBatchAnnotateImagesRequest = Class;
- TEntityAnnotation = Class;
- TProperty = Class;
- TColor = Class;
- TLocationInfo = Class;
- TSafeSearchAnnotation = Class;
- TImage = Class;
- TDominantColorsAnnotation = Class;
- TFeature = Class;
- TBatchAnnotateImagesResponse = Class;
- TImageProperties = Class;
- TLatLng = Class;
- TPosition = Class;
- TImageSourceArray = Array of TImageSource;
- TAnnotateImageRequestArray = Array of TAnnotateImageRequest;
- TAnnotateImageResponseArray = Array of TAnnotateImageResponse;
- TLatLongRectArray = Array of TLatLongRect;
- TStatusArray = Array of TStatus;
- TFaceAnnotationArray = Array of TFaceAnnotation;
- TVertexArray = Array of TVertex;
- TColorInfoArray = Array of TColorInfo;
- TBoundingPolyArray = Array of TBoundingPoly;
- TLandmarkArray = Array of TLandmark;
- TImageContextArray = Array of TImageContext;
- TBatchAnnotateImagesRequestArray = Array of TBatchAnnotateImagesRequest;
- TEntityAnnotationArray = Array of TEntityAnnotation;
- TPropertyArray = Array of TProperty;
- TColorArray = Array of TColor;
- TLocationInfoArray = Array of TLocationInfo;
- TSafeSearchAnnotationArray = Array of TSafeSearchAnnotation;
- TImageArray = Array of TImage;
- TDominantColorsAnnotationArray = Array of TDominantColorsAnnotation;
- TFeatureArray = Array of TFeature;
- TBatchAnnotateImagesResponseArray = Array of TBatchAnnotateImagesResponse;
- TImagePropertiesArray = Array of TImageProperties;
- TLatLngArray = Array of TLatLng;
- TPositionArray = Array of TPosition;
- //Anonymous types, using auto-generated names
- TStatusTypedetailsItem = Class;
- TAnnotateImageRequestTypefeaturesArray = Array of TFeature;
- TAnnotateImageResponseTypelabelAnnotationsArray = Array of TEntityAnnotation;
- TAnnotateImageResponseTypelandmarkAnnotationsArray = Array of TEntityAnnotation;
- TAnnotateImageResponseTypetextAnnotationsArray = Array of TEntityAnnotation;
- TAnnotateImageResponseTypelogoAnnotationsArray = Array of TEntityAnnotation;
- TAnnotateImageResponseTypefaceAnnotationsArray = Array of TFaceAnnotation;
- TStatusTypedetailsArray = Array of TStatusTypedetailsItem;
- TFaceAnnotationTypelandmarksArray = Array of TLandmark;
- TBoundingPolyTypeverticesArray = Array of TVertex;
- TBatchAnnotateImagesRequestTyperequestsArray = Array of TAnnotateImageRequest;
- TEntityAnnotationTypepropertiesArray = Array of TProperty;
- TEntityAnnotationTypelocationsArray = Array of TLocationInfo;
- TDominantColorsAnnotationTypecolorsArray = Array of TColorInfo;
- TBatchAnnotateImagesResponseTyperesponsesArray = Array of TAnnotateImageResponse;
-
- { --------------------------------------------------------------------
- TImageSource
- --------------------------------------------------------------------}
-
- TImageSource = Class(TGoogleBaseObject)
- Private
- FgcsImageUri : String;
- Protected
- //Property setters
- Procedure SetgcsImageUri(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property gcsImageUri : String Index 0 Read FgcsImageUri Write SetgcsImageUri;
- end;
- TImageSourceClass = Class of TImageSource;
-
- { --------------------------------------------------------------------
- TAnnotateImageRequest
- --------------------------------------------------------------------}
-
- TAnnotateImageRequest = Class(TGoogleBaseObject)
- Private
- Fimage : TImage;
- FimageContext : TImageContext;
- Ffeatures : TAnnotateImageRequestTypefeaturesArray;
- Protected
- //Property setters
- Procedure Setimage(AIndex : Integer; const AValue : TImage); virtual;
- Procedure SetimageContext(AIndex : Integer; const AValue : TImageContext); virtual;
- Procedure Setfeatures(AIndex : Integer; const AValue : TAnnotateImageRequestTypefeaturesArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property image : TImage Index 0 Read Fimage Write Setimage;
- Property imageContext : TImageContext Index 8 Read FimageContext Write SetimageContext;
- Property features : TAnnotateImageRequestTypefeaturesArray Index 16 Read Ffeatures Write Setfeatures;
- end;
- TAnnotateImageRequestClass = Class of TAnnotateImageRequest;
-
- { --------------------------------------------------------------------
- TAnnotateImageResponse
- --------------------------------------------------------------------}
-
- TAnnotateImageResponse = Class(TGoogleBaseObject)
- Private
- FlabelAnnotations : TAnnotateImageResponseTypelabelAnnotationsArray;
- FlandmarkAnnotations : TAnnotateImageResponseTypelandmarkAnnotationsArray;
- FsafeSearchAnnotation : TSafeSearchAnnotation;
- FimagePropertiesAnnotation : TImageProperties;
- FtextAnnotations : TAnnotateImageResponseTypetextAnnotationsArray;
- FlogoAnnotations : TAnnotateImageResponseTypelogoAnnotationsArray;
- FfaceAnnotations : TAnnotateImageResponseTypefaceAnnotationsArray;
- Ferror : TStatus;
- Protected
- //Property setters
- Procedure SetlabelAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelabelAnnotationsArray); virtual;
- Procedure SetlandmarkAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelandmarkAnnotationsArray); virtual;
- Procedure SetsafeSearchAnnotation(AIndex : Integer; const AValue : TSafeSearchAnnotation); virtual;
- Procedure SetimagePropertiesAnnotation(AIndex : Integer; const AValue : TImageProperties); virtual;
- Procedure SettextAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypetextAnnotationsArray); virtual;
- Procedure SetlogoAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelogoAnnotationsArray); virtual;
- Procedure SetfaceAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypefaceAnnotationsArray); virtual;
- Procedure Seterror(AIndex : Integer; const AValue : TStatus); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property labelAnnotations : TAnnotateImageResponseTypelabelAnnotationsArray Index 0 Read FlabelAnnotations Write SetlabelAnnotations;
- Property landmarkAnnotations : TAnnotateImageResponseTypelandmarkAnnotationsArray Index 8 Read FlandmarkAnnotations Write SetlandmarkAnnotations;
- Property safeSearchAnnotation : TSafeSearchAnnotation Index 16 Read FsafeSearchAnnotation Write SetsafeSearchAnnotation;
- Property imagePropertiesAnnotation : TImageProperties Index 24 Read FimagePropertiesAnnotation Write SetimagePropertiesAnnotation;
- Property textAnnotations : TAnnotateImageResponseTypetextAnnotationsArray Index 32 Read FtextAnnotations Write SettextAnnotations;
- Property logoAnnotations : TAnnotateImageResponseTypelogoAnnotationsArray Index 40 Read FlogoAnnotations Write SetlogoAnnotations;
- Property faceAnnotations : TAnnotateImageResponseTypefaceAnnotationsArray Index 48 Read FfaceAnnotations Write SetfaceAnnotations;
- Property error : TStatus Index 56 Read Ferror Write Seterror;
- end;
- TAnnotateImageResponseClass = Class of TAnnotateImageResponse;
-
- { --------------------------------------------------------------------
- TLatLongRect
- --------------------------------------------------------------------}
-
- TLatLongRect = Class(TGoogleBaseObject)
- Private
- FmaxLatLng : TLatLng;
- FminLatLng : TLatLng;
- Protected
- //Property setters
- Procedure SetmaxLatLng(AIndex : Integer; const AValue : TLatLng); virtual;
- Procedure SetminLatLng(AIndex : Integer; const AValue : TLatLng); virtual;
- Public
- Published
- Property maxLatLng : TLatLng Index 0 Read FmaxLatLng Write SetmaxLatLng;
- Property minLatLng : TLatLng Index 8 Read FminLatLng Write SetminLatLng;
- end;
- TLatLongRectClass = Class of TLatLongRect;
-
- { --------------------------------------------------------------------
- TStatusTypedetailsItem
- --------------------------------------------------------------------}
-
- TStatusTypedetailsItem = Class(TGoogleBaseObject)
- Private
- Protected
- //Property setters
- Public
- Class Function AllowAdditionalProperties : Boolean; override;
- Published
- end;
- TStatusTypedetailsItemClass = Class of TStatusTypedetailsItem;
-
- { --------------------------------------------------------------------
- TStatus
- --------------------------------------------------------------------}
-
- TStatus = Class(TGoogleBaseObject)
- Private
- Fcode : integer;
- Fdetails : TStatusTypedetailsArray;
- Fmessage : String;
- Protected
- //Property setters
- Procedure Setcode(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setdetails(AIndex : Integer; const AValue : TStatusTypedetailsArray); virtual;
- Procedure Setmessage(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property code : integer Index 0 Read Fcode Write Setcode;
- Property details : TStatusTypedetailsArray Index 8 Read Fdetails Write Setdetails;
- Property message : String Index 16 Read Fmessage Write Setmessage;
- end;
- TStatusClass = Class of TStatus;
-
- { --------------------------------------------------------------------
- TFaceAnnotation
- --------------------------------------------------------------------}
-
- TFaceAnnotation = Class(TGoogleBaseObject)
- Private
- FtiltAngle : integer;
- FunderExposedLikelihood : String;
- FfdBoundingPoly : TBoundingPoly;
- FlandmarkingConfidence : integer;
- FjoyLikelihood : String;
- FdetectionConfidence : integer;
- FsurpriseLikelihood : String;
- FangerLikelihood : String;
- FheadwearLikelihood : String;
- FpanAngle : integer;
- FboundingPoly : TBoundingPoly;
- Flandmarks : TFaceAnnotationTypelandmarksArray;
- FblurredLikelihood : String;
- FrollAngle : integer;
- FsorrowLikelihood : String;
- Protected
- //Property setters
- Procedure SettiltAngle(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetunderExposedLikelihood(AIndex : Integer; const AValue : String); virtual;
- Procedure SetfdBoundingPoly(AIndex : Integer; const AValue : TBoundingPoly); virtual;
- Procedure SetlandmarkingConfidence(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetjoyLikelihood(AIndex : Integer; const AValue : String); virtual;
- Procedure SetdetectionConfidence(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetsurpriseLikelihood(AIndex : Integer; const AValue : String); virtual;
- Procedure SetangerLikelihood(AIndex : Integer; const AValue : String); virtual;
- Procedure SetheadwearLikelihood(AIndex : Integer; const AValue : String); virtual;
- Procedure SetpanAngle(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly); virtual;
- Procedure Setlandmarks(AIndex : Integer; const AValue : TFaceAnnotationTypelandmarksArray); virtual;
- Procedure SetblurredLikelihood(AIndex : Integer; const AValue : String); virtual;
- Procedure SetrollAngle(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetsorrowLikelihood(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property tiltAngle : integer Index 0 Read FtiltAngle Write SettiltAngle;
- Property underExposedLikelihood : String Index 8 Read FunderExposedLikelihood Write SetunderExposedLikelihood;
- Property fdBoundingPoly : TBoundingPoly Index 16 Read FfdBoundingPoly Write SetfdBoundingPoly;
- Property landmarkingConfidence : integer Index 24 Read FlandmarkingConfidence Write SetlandmarkingConfidence;
- Property joyLikelihood : String Index 32 Read FjoyLikelihood Write SetjoyLikelihood;
- Property detectionConfidence : integer Index 40 Read FdetectionConfidence Write SetdetectionConfidence;
- Property surpriseLikelihood : String Index 48 Read FsurpriseLikelihood Write SetsurpriseLikelihood;
- Property angerLikelihood : String Index 56 Read FangerLikelihood Write SetangerLikelihood;
- Property headwearLikelihood : String Index 64 Read FheadwearLikelihood Write SetheadwearLikelihood;
- Property panAngle : integer Index 72 Read FpanAngle Write SetpanAngle;
- Property boundingPoly : TBoundingPoly Index 80 Read FboundingPoly Write SetboundingPoly;
- Property landmarks : TFaceAnnotationTypelandmarksArray Index 88 Read Flandmarks Write Setlandmarks;
- Property blurredLikelihood : String Index 96 Read FblurredLikelihood Write SetblurredLikelihood;
- Property rollAngle : integer Index 104 Read FrollAngle Write SetrollAngle;
- Property sorrowLikelihood : String Index 112 Read FsorrowLikelihood Write SetsorrowLikelihood;
- end;
- TFaceAnnotationClass = Class of TFaceAnnotation;
-
- { --------------------------------------------------------------------
- TVertex
- --------------------------------------------------------------------}
-
- TVertex = Class(TGoogleBaseObject)
- Private
- Fy : integer;
- Fx : integer;
- Protected
- //Property setters
- Procedure Sety(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setx(AIndex : Integer; const AValue : integer); virtual;
- Public
- Published
- Property y : integer Index 0 Read Fy Write Sety;
- Property x : integer Index 8 Read Fx Write Setx;
- end;
- TVertexClass = Class of TVertex;
-
- { --------------------------------------------------------------------
- TColorInfo
- --------------------------------------------------------------------}
-
- TColorInfo = Class(TGoogleBaseObject)
- Private
- FpixelFraction : integer;
- Fcolor : TColor;
- Fscore : integer;
- Protected
- //Property setters
- Procedure SetpixelFraction(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setcolor(AIndex : Integer; const AValue : TColor); virtual;
- Procedure Setscore(AIndex : Integer; const AValue : integer); virtual;
- Public
- Published
- Property pixelFraction : integer Index 0 Read FpixelFraction Write SetpixelFraction;
- Property color : TColor Index 8 Read Fcolor Write Setcolor;
- Property score : integer Index 16 Read Fscore Write Setscore;
- end;
- TColorInfoClass = Class of TColorInfo;
-
- { --------------------------------------------------------------------
- TBoundingPoly
- --------------------------------------------------------------------}
-
- TBoundingPoly = Class(TGoogleBaseObject)
- Private
- Fvertices : TBoundingPolyTypeverticesArray;
- Protected
- //Property setters
- Procedure Setvertices(AIndex : Integer; const AValue : TBoundingPolyTypeverticesArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property vertices : TBoundingPolyTypeverticesArray Index 0 Read Fvertices Write Setvertices;
- end;
- TBoundingPolyClass = Class of TBoundingPoly;
-
- { --------------------------------------------------------------------
- TLandmark
- --------------------------------------------------------------------}
-
- TLandmark = Class(TGoogleBaseObject)
- Private
- Fposition : TPosition;
- F_type : String;
- Protected
- Class Function ExportPropertyName(Const AName : String) : string; override;
- //Property setters
- Procedure Setposition(AIndex : Integer; const AValue : TPosition); virtual;
- Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property position : TPosition Index 0 Read Fposition Write Setposition;
- Property _type : String Index 8 Read F_type Write Set_type;
- end;
- TLandmarkClass = Class of TLandmark;
-
- { --------------------------------------------------------------------
- TImageContext
- --------------------------------------------------------------------}
-
- TImageContext = Class(TGoogleBaseObject)
- Private
- FlatLongRect : TLatLongRect;
- FlanguageHints : TStringArray;
- Protected
- //Property setters
- Procedure SetlatLongRect(AIndex : Integer; const AValue : TLatLongRect); virtual;
- Procedure SetlanguageHints(AIndex : Integer; const AValue : TStringArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property latLongRect : TLatLongRect Index 0 Read FlatLongRect Write SetlatLongRect;
- Property languageHints : TStringArray Index 8 Read FlanguageHints Write SetlanguageHints;
- end;
- TImageContextClass = Class of TImageContext;
-
- { --------------------------------------------------------------------
- TBatchAnnotateImagesRequest
- --------------------------------------------------------------------}
-
- TBatchAnnotateImagesRequest = Class(TGoogleBaseObject)
- Private
- Frequests : TBatchAnnotateImagesRequestTyperequestsArray;
- Protected
- //Property setters
- Procedure Setrequests(AIndex : Integer; const AValue : TBatchAnnotateImagesRequestTyperequestsArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property requests : TBatchAnnotateImagesRequestTyperequestsArray Index 0 Read Frequests Write Setrequests;
- end;
- TBatchAnnotateImagesRequestClass = Class of TBatchAnnotateImagesRequest;
-
- { --------------------------------------------------------------------
- TEntityAnnotation
- --------------------------------------------------------------------}
-
- TEntityAnnotation = Class(TGoogleBaseObject)
- Private
- Fmid : String;
- Fdescription : String;
- Ftopicality : integer;
- Flocale : String;
- Fproperties : TEntityAnnotationTypepropertiesArray;
- Fscore : integer;
- FboundingPoly : TBoundingPoly;
- Flocations : TEntityAnnotationTypelocationsArray;
- Fconfidence : integer;
- Protected
- //Property setters
- Procedure Setmid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
- Procedure Settopicality(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setlocale(AIndex : Integer; const AValue : String); virtual;
- Procedure Setproperties(AIndex : Integer; const AValue : TEntityAnnotationTypepropertiesArray); virtual;
- Procedure Setscore(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly); virtual;
- Procedure Setlocations(AIndex : Integer; const AValue : TEntityAnnotationTypelocationsArray); virtual;
- Procedure Setconfidence(AIndex : Integer; const AValue : integer); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property mid : String Index 0 Read Fmid Write Setmid;
- Property description : String Index 8 Read Fdescription Write Setdescription;
- Property topicality : integer Index 16 Read Ftopicality Write Settopicality;
- Property locale : String Index 24 Read Flocale Write Setlocale;
- Property properties : TEntityAnnotationTypepropertiesArray Index 32 Read Fproperties Write Setproperties;
- Property score : integer Index 40 Read Fscore Write Setscore;
- Property boundingPoly : TBoundingPoly Index 48 Read FboundingPoly Write SetboundingPoly;
- Property locations : TEntityAnnotationTypelocationsArray Index 56 Read Flocations Write Setlocations;
- Property confidence : integer Index 64 Read Fconfidence Write Setconfidence;
- end;
- TEntityAnnotationClass = Class of TEntityAnnotation;
-
- { --------------------------------------------------------------------
- TProperty
- --------------------------------------------------------------------}
-
- TProperty = Class(TGoogleBaseObject)
- Private
- Fvalue : String;
- Fname : String;
- Protected
- //Property setters
- Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property value : String Index 0 Read Fvalue Write Setvalue;
- Property name : String Index 8 Read Fname Write Setname;
- end;
- TPropertyClass = Class of TProperty;
-
- { --------------------------------------------------------------------
- TColor
- --------------------------------------------------------------------}
-
- TColor = Class(TGoogleBaseObject)
- Private
- Fgreen : integer;
- Fblue : integer;
- Fred : integer;
- Falpha : integer;
- Protected
- //Property setters
- Procedure Setgreen(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setblue(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setred(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setalpha(AIndex : Integer; const AValue : integer); virtual;
- Public
- Published
- Property green : integer Index 0 Read Fgreen Write Setgreen;
- Property blue : integer Index 8 Read Fblue Write Setblue;
- Property red : integer Index 16 Read Fred Write Setred;
- Property alpha : integer Index 24 Read Falpha Write Setalpha;
- end;
- TColorClass = Class of TColor;
-
- { --------------------------------------------------------------------
- TLocationInfo
- --------------------------------------------------------------------}
-
- TLocationInfo = Class(TGoogleBaseObject)
- Private
- FlatLng : TLatLng;
- Protected
- //Property setters
- Procedure SetlatLng(AIndex : Integer; const AValue : TLatLng); virtual;
- Public
- Published
- Property latLng : TLatLng Index 0 Read FlatLng Write SetlatLng;
- end;
- TLocationInfoClass = Class of TLocationInfo;
-
- { --------------------------------------------------------------------
- TSafeSearchAnnotation
- --------------------------------------------------------------------}
-
- TSafeSearchAnnotation = Class(TGoogleBaseObject)
- Private
- Fmedical : String;
- Fspoof : String;
- Fviolence : String;
- Fadult : String;
- Protected
- //Property setters
- Procedure Setmedical(AIndex : Integer; const AValue : String); virtual;
- Procedure Setspoof(AIndex : Integer; const AValue : String); virtual;
- Procedure Setviolence(AIndex : Integer; const AValue : String); virtual;
- Procedure Setadult(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property medical : String Index 0 Read Fmedical Write Setmedical;
- Property spoof : String Index 8 Read Fspoof Write Setspoof;
- Property violence : String Index 16 Read Fviolence Write Setviolence;
- Property adult : String Index 24 Read Fadult Write Setadult;
- end;
- TSafeSearchAnnotationClass = Class of TSafeSearchAnnotation;
-
- { --------------------------------------------------------------------
- TImage
- --------------------------------------------------------------------}
-
- TImage = Class(TGoogleBaseObject)
- Private
- Fsource : TImageSource;
- Fcontent : String;
- Protected
- //Property setters
- Procedure Setsource(AIndex : Integer; const AValue : TImageSource); virtual;
- Procedure Setcontent(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property source : TImageSource Index 0 Read Fsource Write Setsource;
- Property content : String Index 8 Read Fcontent Write Setcontent;
- end;
- TImageClass = Class of TImage;
-
- { --------------------------------------------------------------------
- TDominantColorsAnnotation
- --------------------------------------------------------------------}
-
- TDominantColorsAnnotation = Class(TGoogleBaseObject)
- Private
- Fcolors : TDominantColorsAnnotationTypecolorsArray;
- Protected
- //Property setters
- Procedure Setcolors(AIndex : Integer; const AValue : TDominantColorsAnnotationTypecolorsArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property colors : TDominantColorsAnnotationTypecolorsArray Index 0 Read Fcolors Write Setcolors;
- end;
- TDominantColorsAnnotationClass = Class of TDominantColorsAnnotation;
-
- { --------------------------------------------------------------------
- TFeature
- --------------------------------------------------------------------}
-
- TFeature = Class(TGoogleBaseObject)
- Private
- F_type : String;
- FmaxResults : integer;
- Protected
- Class Function ExportPropertyName(Const AName : String) : string; override;
- //Property setters
- Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
- Procedure SetmaxResults(AIndex : Integer; const AValue : integer); virtual;
- Public
- Published
- Property _type : String Index 0 Read F_type Write Set_type;
- Property maxResults : integer Index 8 Read FmaxResults Write SetmaxResults;
- end;
- TFeatureClass = Class of TFeature;
-
- { --------------------------------------------------------------------
- TBatchAnnotateImagesResponse
- --------------------------------------------------------------------}
-
- TBatchAnnotateImagesResponse = Class(TGoogleBaseObject)
- Private
- Fresponses : TBatchAnnotateImagesResponseTyperesponsesArray;
- Protected
- //Property setters
- Procedure Setresponses(AIndex : Integer; const AValue : TBatchAnnotateImagesResponseTyperesponsesArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property responses : TBatchAnnotateImagesResponseTyperesponsesArray Index 0 Read Fresponses Write Setresponses;
- end;
- TBatchAnnotateImagesResponseClass = Class of TBatchAnnotateImagesResponse;
-
- { --------------------------------------------------------------------
- TImageProperties
- --------------------------------------------------------------------}
-
- TImageProperties = Class(TGoogleBaseObject)
- Private
- FdominantColors : TDominantColorsAnnotation;
- Protected
- //Property setters
- Procedure SetdominantColors(AIndex : Integer; const AValue : TDominantColorsAnnotation); virtual;
- Public
- Published
- Property dominantColors : TDominantColorsAnnotation Index 0 Read FdominantColors Write SetdominantColors;
- end;
- TImagePropertiesClass = Class of TImageProperties;
-
- { --------------------------------------------------------------------
- TLatLng
- --------------------------------------------------------------------}
-
- TLatLng = Class(TGoogleBaseObject)
- Private
- Flatitude : double;
- Flongitude : double;
- Protected
- //Property setters
- Procedure Setlatitude(AIndex : Integer; const AValue : double); virtual;
- Procedure Setlongitude(AIndex : Integer; const AValue : double); virtual;
- Public
- Published
- Property latitude : double Index 0 Read Flatitude Write Setlatitude;
- Property longitude : double Index 8 Read Flongitude Write Setlongitude;
- end;
- TLatLngClass = Class of TLatLng;
-
- { --------------------------------------------------------------------
- TPosition
- --------------------------------------------------------------------}
-
- TPosition = Class(TGoogleBaseObject)
- Private
- Fy : integer;
- Fx : integer;
- Fz : integer;
- Protected
- //Property setters
- Procedure Sety(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setx(AIndex : Integer; const AValue : integer); virtual;
- Procedure Setz(AIndex : Integer; const AValue : integer); virtual;
- Public
- Published
- Property y : integer Index 0 Read Fy Write Sety;
- Property x : integer Index 8 Read Fx Write Setx;
- Property z : integer Index 16 Read Fz Write Setz;
- end;
- TPositionClass = Class of TPosition;
-
- { --------------------------------------------------------------------
- TImagesResource
- --------------------------------------------------------------------}
-
- TImagesResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function Annotate(aBatchAnnotateImagesRequest : TBatchAnnotateImagesRequest) : TBatchAnnotateImagesResponse;
- end;
-
-
- { --------------------------------------------------------------------
- TVisionAPI
- --------------------------------------------------------------------}
-
- TVisionAPI = Class(TGoogleAPI)
- Private
- FImagesInstance : TImagesResource;
- Function GetImagesInstance : TImagesResource;virtual;
- Public
- //Override class functions with API info
- Class Function APIName : String; override;
- Class Function APIVersion : String; override;
- Class Function APIRevision : String; override;
- Class Function APIID : String; override;
- Class Function APITitle : String; override;
- Class Function APIDescription : String; override;
- Class Function APIOwnerDomain : String; override;
- Class Function APIOwnerName : String; override;
- Class Function APIIcon16 : String; override;
- Class Function APIIcon32 : String; override;
- Class Function APIdocumentationLink : String; override;
- Class Function APIrootUrl : string; override;
- Class Function APIbasePath : string;override;
- Class Function APIbaseURL : String;override;
- Class Function APIProtocol : string;override;
- Class Function APIservicePath : string;override;
- Class Function APIbatchPath : String;override;
- Class Function APIAuthScopes : TScopeInfoArray;override;
- Class Function APINeedsAuth : Boolean;override;
- Class Procedure RegisterAPIResources; override;
- //Add create function for resources
- Function CreateImagesResource(AOwner : TComponent) : TImagesResource;virtual;overload;
- Function CreateImagesResource : TImagesResource;virtual;overload;
- //Add default on-demand instances for resources
- Property ImagesResource : TImagesResource Read GetImagesInstance;
- end;
- implementation
- { --------------------------------------------------------------------
- TImageSource
- --------------------------------------------------------------------}
- Procedure TImageSource.SetgcsImageUri(AIndex : Integer; const AValue : String);
- begin
- If (FgcsImageUri=AValue) then exit;
- FgcsImageUri:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TAnnotateImageRequest
- --------------------------------------------------------------------}
- Procedure TAnnotateImageRequest.Setimage(AIndex : Integer; const AValue : TImage);
- begin
- If (Fimage=AValue) then exit;
- Fimage:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageRequest.SetimageContext(AIndex : Integer; const AValue : TImageContext);
- begin
- If (FimageContext=AValue) then exit;
- FimageContext:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageRequest.Setfeatures(AIndex : Integer; const AValue : TAnnotateImageRequestTypefeaturesArray);
- begin
- If (Ffeatures=AValue) then exit;
- Ffeatures:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TAnnotateImageRequest.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'features' : SetLength(Ffeatures,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TAnnotateImageResponse
- --------------------------------------------------------------------}
- Procedure TAnnotateImageResponse.SetlabelAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelabelAnnotationsArray);
- begin
- If (FlabelAnnotations=AValue) then exit;
- FlabelAnnotations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.SetlandmarkAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelandmarkAnnotationsArray);
- begin
- If (FlandmarkAnnotations=AValue) then exit;
- FlandmarkAnnotations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.SetsafeSearchAnnotation(AIndex : Integer; const AValue : TSafeSearchAnnotation);
- begin
- If (FsafeSearchAnnotation=AValue) then exit;
- FsafeSearchAnnotation:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.SetimagePropertiesAnnotation(AIndex : Integer; const AValue : TImageProperties);
- begin
- If (FimagePropertiesAnnotation=AValue) then exit;
- FimagePropertiesAnnotation:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.SettextAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypetextAnnotationsArray);
- begin
- If (FtextAnnotations=AValue) then exit;
- FtextAnnotations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.SetlogoAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypelogoAnnotationsArray);
- begin
- If (FlogoAnnotations=AValue) then exit;
- FlogoAnnotations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.SetfaceAnnotations(AIndex : Integer; const AValue : TAnnotateImageResponseTypefaceAnnotationsArray);
- begin
- If (FfaceAnnotations=AValue) then exit;
- FfaceAnnotations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAnnotateImageResponse.Seterror(AIndex : Integer; const AValue : TStatus);
- begin
- If (Ferror=AValue) then exit;
- Ferror:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TAnnotateImageResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'labelannotations' : SetLength(FlabelAnnotations,ALength);
- 'landmarkannotations' : SetLength(FlandmarkAnnotations,ALength);
- 'textannotations' : SetLength(FtextAnnotations,ALength);
- 'logoannotations' : SetLength(FlogoAnnotations,ALength);
- 'faceannotations' : SetLength(FfaceAnnotations,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TLatLongRect
- --------------------------------------------------------------------}
- Procedure TLatLongRect.SetmaxLatLng(AIndex : Integer; const AValue : TLatLng);
- begin
- If (FmaxLatLng=AValue) then exit;
- FmaxLatLng:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TLatLongRect.SetminLatLng(AIndex : Integer; const AValue : TLatLng);
- begin
- If (FminLatLng=AValue) then exit;
- FminLatLng:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TStatusTypedetailsItem
- --------------------------------------------------------------------}
- Class Function TStatusTypedetailsItem.AllowAdditionalProperties : Boolean;
- begin
- Result:=True;
- end;
- { --------------------------------------------------------------------
- TStatus
- --------------------------------------------------------------------}
- Procedure TStatus.Setcode(AIndex : Integer; const AValue : integer);
- begin
- If (Fcode=AValue) then exit;
- Fcode:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TStatus.Setdetails(AIndex : Integer; const AValue : TStatusTypedetailsArray);
- begin
- If (Fdetails=AValue) then exit;
- Fdetails:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TStatus.Setmessage(AIndex : Integer; const AValue : String);
- begin
- If (Fmessage=AValue) then exit;
- Fmessage:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TStatus.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'details' : SetLength(Fdetails,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TFaceAnnotation
- --------------------------------------------------------------------}
- Procedure TFaceAnnotation.SettiltAngle(AIndex : Integer; const AValue : integer);
- begin
- If (FtiltAngle=AValue) then exit;
- FtiltAngle:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetunderExposedLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FunderExposedLikelihood=AValue) then exit;
- FunderExposedLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetfdBoundingPoly(AIndex : Integer; const AValue : TBoundingPoly);
- begin
- If (FfdBoundingPoly=AValue) then exit;
- FfdBoundingPoly:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetlandmarkingConfidence(AIndex : Integer; const AValue : integer);
- begin
- If (FlandmarkingConfidence=AValue) then exit;
- FlandmarkingConfidence:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetjoyLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FjoyLikelihood=AValue) then exit;
- FjoyLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetdetectionConfidence(AIndex : Integer; const AValue : integer);
- begin
- If (FdetectionConfidence=AValue) then exit;
- FdetectionConfidence:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetsurpriseLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FsurpriseLikelihood=AValue) then exit;
- FsurpriseLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetangerLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FangerLikelihood=AValue) then exit;
- FangerLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetheadwearLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FheadwearLikelihood=AValue) then exit;
- FheadwearLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetpanAngle(AIndex : Integer; const AValue : integer);
- begin
- If (FpanAngle=AValue) then exit;
- FpanAngle:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly);
- begin
- If (FboundingPoly=AValue) then exit;
- FboundingPoly:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.Setlandmarks(AIndex : Integer; const AValue : TFaceAnnotationTypelandmarksArray);
- begin
- If (Flandmarks=AValue) then exit;
- Flandmarks:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetblurredLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FblurredLikelihood=AValue) then exit;
- FblurredLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetrollAngle(AIndex : Integer; const AValue : integer);
- begin
- If (FrollAngle=AValue) then exit;
- FrollAngle:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFaceAnnotation.SetsorrowLikelihood(AIndex : Integer; const AValue : String);
- begin
- If (FsorrowLikelihood=AValue) then exit;
- FsorrowLikelihood:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TFaceAnnotation.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'landmarks' : SetLength(Flandmarks,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TVertex
- --------------------------------------------------------------------}
- Procedure TVertex.Sety(AIndex : Integer; const AValue : integer);
- begin
- If (Fy=AValue) then exit;
- Fy:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVertex.Setx(AIndex : Integer; const AValue : integer);
- begin
- If (Fx=AValue) then exit;
- Fx:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TColorInfo
- --------------------------------------------------------------------}
- Procedure TColorInfo.SetpixelFraction(AIndex : Integer; const AValue : integer);
- begin
- If (FpixelFraction=AValue) then exit;
- FpixelFraction:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TColorInfo.Setcolor(AIndex : Integer; const AValue : TColor);
- begin
- If (Fcolor=AValue) then exit;
- Fcolor:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TColorInfo.Setscore(AIndex : Integer; const AValue : integer);
- begin
- If (Fscore=AValue) then exit;
- Fscore:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TBoundingPoly
- --------------------------------------------------------------------}
- Procedure TBoundingPoly.Setvertices(AIndex : Integer; const AValue : TBoundingPolyTypeverticesArray);
- begin
- If (Fvertices=AValue) then exit;
- Fvertices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TBoundingPoly.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'vertices' : SetLength(Fvertices,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TLandmark
- --------------------------------------------------------------------}
- Procedure TLandmark.Setposition(AIndex : Integer; const AValue : TPosition);
- begin
- If (Fposition=AValue) then exit;
- Fposition:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TLandmark.Set_type(AIndex : Integer; const AValue : String);
- begin
- If (F_type=AValue) then exit;
- F_type:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Class Function TLandmark.ExportPropertyName(Const AName : String) :String;
- begin
- Case AName of
- '_type' : Result:='type';
- else
- Result:=Inherited ExportPropertyName(AName);
- end;
- end;
- { --------------------------------------------------------------------
- TImageContext
- --------------------------------------------------------------------}
- Procedure TImageContext.SetlatLongRect(AIndex : Integer; const AValue : TLatLongRect);
- begin
- If (FlatLongRect=AValue) then exit;
- FlatLongRect:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TImageContext.SetlanguageHints(AIndex : Integer; const AValue : TStringArray);
- begin
- If (FlanguageHints=AValue) then exit;
- FlanguageHints:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TImageContext.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'languagehints' : SetLength(FlanguageHints,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TBatchAnnotateImagesRequest
- --------------------------------------------------------------------}
- Procedure TBatchAnnotateImagesRequest.Setrequests(AIndex : Integer; const AValue : TBatchAnnotateImagesRequestTyperequestsArray);
- begin
- If (Frequests=AValue) then exit;
- Frequests:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TBatchAnnotateImagesRequest.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'requests' : SetLength(Frequests,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TEntityAnnotation
- --------------------------------------------------------------------}
- Procedure TEntityAnnotation.Setmid(AIndex : Integer; const AValue : String);
- begin
- If (Fmid=AValue) then exit;
- Fmid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Setdescription(AIndex : Integer; const AValue : String);
- begin
- If (Fdescription=AValue) then exit;
- Fdescription:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Settopicality(AIndex : Integer; const AValue : integer);
- begin
- If (Ftopicality=AValue) then exit;
- Ftopicality:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Setlocale(AIndex : Integer; const AValue : String);
- begin
- If (Flocale=AValue) then exit;
- Flocale:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Setproperties(AIndex : Integer; const AValue : TEntityAnnotationTypepropertiesArray);
- begin
- If (Fproperties=AValue) then exit;
- Fproperties:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Setscore(AIndex : Integer; const AValue : integer);
- begin
- If (Fscore=AValue) then exit;
- Fscore:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.SetboundingPoly(AIndex : Integer; const AValue : TBoundingPoly);
- begin
- If (FboundingPoly=AValue) then exit;
- FboundingPoly:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Setlocations(AIndex : Integer; const AValue : TEntityAnnotationTypelocationsArray);
- begin
- If (Flocations=AValue) then exit;
- Flocations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TEntityAnnotation.Setconfidence(AIndex : Integer; const AValue : integer);
- begin
- If (Fconfidence=AValue) then exit;
- Fconfidence:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TEntityAnnotation.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'properties' : SetLength(Fproperties,ALength);
- 'locations' : SetLength(Flocations,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TProperty
- --------------------------------------------------------------------}
- Procedure TProperty.Setvalue(AIndex : Integer; const AValue : String);
- begin
- If (Fvalue=AValue) then exit;
- Fvalue:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TProperty.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TColor
- --------------------------------------------------------------------}
- Procedure TColor.Setgreen(AIndex : Integer; const AValue : integer);
- begin
- If (Fgreen=AValue) then exit;
- Fgreen:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TColor.Setblue(AIndex : Integer; const AValue : integer);
- begin
- If (Fblue=AValue) then exit;
- Fblue:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TColor.Setred(AIndex : Integer; const AValue : integer);
- begin
- If (Fred=AValue) then exit;
- Fred:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TColor.Setalpha(AIndex : Integer; const AValue : integer);
- begin
- If (Falpha=AValue) then exit;
- Falpha:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TLocationInfo
- --------------------------------------------------------------------}
- Procedure TLocationInfo.SetlatLng(AIndex : Integer; const AValue : TLatLng);
- begin
- If (FlatLng=AValue) then exit;
- FlatLng:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TSafeSearchAnnotation
- --------------------------------------------------------------------}
- Procedure TSafeSearchAnnotation.Setmedical(AIndex : Integer; const AValue : String);
- begin
- If (Fmedical=AValue) then exit;
- Fmedical:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSafeSearchAnnotation.Setspoof(AIndex : Integer; const AValue : String);
- begin
- If (Fspoof=AValue) then exit;
- Fspoof:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSafeSearchAnnotation.Setviolence(AIndex : Integer; const AValue : String);
- begin
- If (Fviolence=AValue) then exit;
- Fviolence:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSafeSearchAnnotation.Setadult(AIndex : Integer; const AValue : String);
- begin
- If (Fadult=AValue) then exit;
- Fadult:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TImage
- --------------------------------------------------------------------}
- Procedure TImage.Setsource(AIndex : Integer; const AValue : TImageSource);
- begin
- If (Fsource=AValue) then exit;
- Fsource:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TImage.Setcontent(AIndex : Integer; const AValue : String);
- begin
- If (Fcontent=AValue) then exit;
- Fcontent:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TDominantColorsAnnotation
- --------------------------------------------------------------------}
- Procedure TDominantColorsAnnotation.Setcolors(AIndex : Integer; const AValue : TDominantColorsAnnotationTypecolorsArray);
- begin
- If (Fcolors=AValue) then exit;
- Fcolors:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TDominantColorsAnnotation.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'colors' : SetLength(Fcolors,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TFeature
- --------------------------------------------------------------------}
- Procedure TFeature.Set_type(AIndex : Integer; const AValue : String);
- begin
- If (F_type=AValue) then exit;
- F_type:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TFeature.SetmaxResults(AIndex : Integer; const AValue : integer);
- begin
- If (FmaxResults=AValue) then exit;
- FmaxResults:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Class Function TFeature.ExportPropertyName(Const AName : String) :String;
- begin
- Case AName of
- '_type' : Result:='type';
- else
- Result:=Inherited ExportPropertyName(AName);
- end;
- end;
- { --------------------------------------------------------------------
- TBatchAnnotateImagesResponse
- --------------------------------------------------------------------}
- Procedure TBatchAnnotateImagesResponse.Setresponses(AIndex : Integer; const AValue : TBatchAnnotateImagesResponseTyperesponsesArray);
- begin
- If (Fresponses=AValue) then exit;
- Fresponses:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TBatchAnnotateImagesResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'responses' : SetLength(Fresponses,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TImageProperties
- --------------------------------------------------------------------}
- Procedure TImageProperties.SetdominantColors(AIndex : Integer; const AValue : TDominantColorsAnnotation);
- begin
- If (FdominantColors=AValue) then exit;
- FdominantColors:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TLatLng
- --------------------------------------------------------------------}
- Procedure TLatLng.Setlatitude(AIndex : Integer; const AValue : double);
- begin
- If (Flatitude=AValue) then exit;
- Flatitude:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TLatLng.Setlongitude(AIndex : Integer; const AValue : double);
- begin
- If (Flongitude=AValue) then exit;
- Flongitude:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TPosition
- --------------------------------------------------------------------}
- Procedure TPosition.Sety(AIndex : Integer; const AValue : integer);
- begin
- If (Fy=AValue) then exit;
- Fy:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPosition.Setx(AIndex : Integer; const AValue : integer);
- begin
- If (Fx=AValue) then exit;
- Fx:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPosition.Setz(AIndex : Integer; const AValue : integer);
- begin
- If (Fz=AValue) then exit;
- Fz:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TImagesResource
- --------------------------------------------------------------------}
- Class Function TImagesResource.ResourceName : String;
- begin
- Result:='images';
- end;
- Class Function TImagesResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TvisionAPI;
- end;
- Function TImagesResource.Annotate(aBatchAnnotateImagesRequest : TBatchAnnotateImagesRequest) : TBatchAnnotateImagesResponse;
- Const
- _HTTPMethod = 'POST';
- _Path = 'v1/images:annotate';
- _Methodid = 'vision.images.annotate';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,'',aBatchAnnotateImagesRequest,TBatchAnnotateImagesResponse) as TBatchAnnotateImagesResponse;
- end;
- { --------------------------------------------------------------------
- TVisionAPI
- --------------------------------------------------------------------}
- Class Function TVisionAPI.APIName : String;
- begin
- Result:='vision';
- end;
- Class Function TVisionAPI.APIVersion : String;
- begin
- Result:='v1';
- end;
- Class Function TVisionAPI.APIRevision : String;
- begin
- Result:='20160519';
- end;
- Class Function TVisionAPI.APIID : String;
- begin
- Result:='vision:v1';
- end;
- Class Function TVisionAPI.APITitle : String;
- begin
- Result:='Google Cloud Vision API';
- end;
- Class Function TVisionAPI.APIDescription : String;
- begin
- Result:='Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.';
- end;
- Class Function TVisionAPI.APIOwnerDomain : String;
- begin
- Result:='google.com';
- end;
- Class Function TVisionAPI.APIOwnerName : String;
- begin
- Result:='Google';
- end;
- Class Function TVisionAPI.APIIcon16 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-16.gif';
- end;
- Class Function TVisionAPI.APIIcon32 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-32.gif';
- end;
- Class Function TVisionAPI.APIdocumentationLink : String;
- begin
- Result:='https://cloud.google.com/vision/';
- end;
- Class Function TVisionAPI.APIrootUrl : string;
- begin
- Result:='https://vision.googleapis.com/';
- end;
- Class Function TVisionAPI.APIbasePath : string;
- begin
- Result:='';
- end;
- Class Function TVisionAPI.APIbaseURL : String;
- begin
- Result:='https://vision.googleapis.com/';
- end;
- Class Function TVisionAPI.APIProtocol : string;
- begin
- Result:='rest';
- end;
- Class Function TVisionAPI.APIservicePath : string;
- begin
- Result:='';
- end;
- Class Function TVisionAPI.APIbatchPath : String;
- begin
- Result:='batch';
- end;
- Class Function TVisionAPI.APIAuthScopes : TScopeInfoArray;
- begin
- SetLength(Result,1);
- Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
- Result[0].Description:='View and manage your data across Google Cloud Platform services';
-
- end;
- Class Function TVisionAPI.APINeedsAuth : Boolean;
- begin
- Result:=True;
- end;
- Class Procedure TVisionAPI.RegisterAPIResources;
- begin
- TImageSource.RegisterObject;
- TAnnotateImageRequest.RegisterObject;
- TAnnotateImageResponse.RegisterObject;
- TLatLongRect.RegisterObject;
- TStatusTypedetailsItem.RegisterObject;
- TStatus.RegisterObject;
- TFaceAnnotation.RegisterObject;
- TVertex.RegisterObject;
- TColorInfo.RegisterObject;
- TBoundingPoly.RegisterObject;
- TLandmark.RegisterObject;
- TImageContext.RegisterObject;
- TBatchAnnotateImagesRequest.RegisterObject;
- TEntityAnnotation.RegisterObject;
- TProperty.RegisterObject;
- TColor.RegisterObject;
- TLocationInfo.RegisterObject;
- TSafeSearchAnnotation.RegisterObject;
- TImage.RegisterObject;
- TDominantColorsAnnotation.RegisterObject;
- TFeature.RegisterObject;
- TBatchAnnotateImagesResponse.RegisterObject;
- TImageProperties.RegisterObject;
- TLatLng.RegisterObject;
- TPosition.RegisterObject;
- end;
- Function TVisionAPI.GetImagesInstance : TImagesResource;
- begin
- if (FImagesInstance=Nil) then
- FImagesInstance:=CreateImagesResource;
- Result:=FImagesInstance;
- end;
- Function TVisionAPI.CreateImagesResource : TImagesResource;
- begin
- Result:=CreateImagesResource(Self);
- end;
- Function TVisionAPI.CreateImagesResource(AOwner : TComponent) : TImagesResource;
- begin
- Result:=TImagesResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- initialization
- TVisionAPI.RegisterAPI;
- end.
|