diff --git a/VERSION b/VERSION index 752c87fc0..ad2c28c0b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1862 \ No newline at end of file +1.36.1863 \ No newline at end of file diff --git a/aigen/CMakeLists.txt b/aigen/CMakeLists.txt new file mode 100644 index 000000000..e910b770a --- /dev/null +++ b/aigen/CMakeLists.txt @@ -0,0 +1,102 @@ +# +# Copyright 2009-2017 Alibaba Cloud All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(aigen_public_header + include/alibabacloud/aigen/AigenClient.h + include/alibabacloud/aigen/AigenExport.h ) + +set(aigen_public_header_model + include/alibabacloud/aigen/model/GenerateCosplayImageRequest.h + include/alibabacloud/aigen/model/GenerateCosplayImageResult.h + include/alibabacloud/aigen/model/GenerateTextDeformationRequest.h + include/alibabacloud/aigen/model/GenerateTextDeformationResult.h + include/alibabacloud/aigen/model/GenerateTextTextureRequest.h + include/alibabacloud/aigen/model/GenerateTextTextureResult.h + include/alibabacloud/aigen/model/InteractiveFullSegmentationRequest.h + include/alibabacloud/aigen/model/InteractiveFullSegmentationResult.h + include/alibabacloud/aigen/model/InteractiveScribbleSegmentationRequest.h + include/alibabacloud/aigen/model/InteractiveScribbleSegmentationResult.h ) + +set(aigen_src + src/AigenClient.cc + src/model/GenerateCosplayImageRequest.cc + src/model/GenerateCosplayImageResult.cc + src/model/GenerateTextDeformationRequest.cc + src/model/GenerateTextDeformationResult.cc + src/model/GenerateTextTextureRequest.cc + src/model/GenerateTextTextureResult.cc + src/model/InteractiveFullSegmentationRequest.cc + src/model/InteractiveFullSegmentationResult.cc + src/model/InteractiveScribbleSegmentationRequest.cc + src/model/InteractiveScribbleSegmentationResult.cc ) + +add_library(aigen ${LIB_TYPE} + ${aigen_public_header} + ${aigen_public_header_model} + ${aigen_src}) + +set_target_properties(aigen + PROPERTIES + LINKER_LANGUAGE CXX + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}aigen + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(aigen + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_AIGEN_LIBRARY) +endif() + +target_include_directories(aigen + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(aigen + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(aigen + jsoncpp) + target_include_directories(aigen + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(aigen + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(aigen + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(aigen + PRIVATE /usr/include/jsoncpp) + target_link_libraries(aigen + jsoncpp) +endif() + +install(FILES ${aigen_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aigen) +install(FILES ${aigen_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aigen/model) +install(TARGETS aigen + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/aigen/include/alibabacloud/aigen/AigenClient.h b/aigen/include/alibabacloud/aigen/AigenClient.h new file mode 100644 index 000000000..6df0f95c4 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/AigenClient.h @@ -0,0 +1,86 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_AIGENCLIENT_H_ +#define ALIBABACLOUD_AIGEN_AIGENCLIENT_H_ + +#include +#include +#include +#include +#include "AigenExport.h" +#include "model/GenerateCosplayImageRequest.h" +#include "model/GenerateCosplayImageResult.h" +#include "model/GenerateTextDeformationRequest.h" +#include "model/GenerateTextDeformationResult.h" +#include "model/GenerateTextTextureRequest.h" +#include "model/GenerateTextTextureResult.h" +#include "model/InteractiveFullSegmentationRequest.h" +#include "model/InteractiveFullSegmentationResult.h" +#include "model/InteractiveScribbleSegmentationRequest.h" +#include "model/InteractiveScribbleSegmentationResult.h" + + +namespace AlibabaCloud +{ + namespace Aigen + { + class ALIBABACLOUD_AIGEN_EXPORT AigenClient : public RpcServiceClient + { + public: + typedef Outcome GenerateCosplayImageOutcome; + typedef std::future GenerateCosplayImageOutcomeCallable; + typedef std::function&)> GenerateCosplayImageAsyncHandler; + typedef Outcome GenerateTextDeformationOutcome; + typedef std::future GenerateTextDeformationOutcomeCallable; + typedef std::function&)> GenerateTextDeformationAsyncHandler; + typedef Outcome GenerateTextTextureOutcome; + typedef std::future GenerateTextTextureOutcomeCallable; + typedef std::function&)> GenerateTextTextureAsyncHandler; + typedef Outcome InteractiveFullSegmentationOutcome; + typedef std::future InteractiveFullSegmentationOutcomeCallable; + typedef std::function&)> InteractiveFullSegmentationAsyncHandler; + typedef Outcome InteractiveScribbleSegmentationOutcome; + typedef std::future InteractiveScribbleSegmentationOutcomeCallable; + typedef std::function&)> InteractiveScribbleSegmentationAsyncHandler; + + AigenClient(const Credentials &credentials, const ClientConfiguration &configuration); + AigenClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + AigenClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~AigenClient(); + GenerateCosplayImageOutcome generateCosplayImage(const Model::GenerateCosplayImageRequest &request)const; + void generateCosplayImageAsync(const Model::GenerateCosplayImageRequest& request, const GenerateCosplayImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GenerateCosplayImageOutcomeCallable generateCosplayImageCallable(const Model::GenerateCosplayImageRequest& request) const; + GenerateTextDeformationOutcome generateTextDeformation(const Model::GenerateTextDeformationRequest &request)const; + void generateTextDeformationAsync(const Model::GenerateTextDeformationRequest& request, const GenerateTextDeformationAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GenerateTextDeformationOutcomeCallable generateTextDeformationCallable(const Model::GenerateTextDeformationRequest& request) const; + GenerateTextTextureOutcome generateTextTexture(const Model::GenerateTextTextureRequest &request)const; + void generateTextTextureAsync(const Model::GenerateTextTextureRequest& request, const GenerateTextTextureAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GenerateTextTextureOutcomeCallable generateTextTextureCallable(const Model::GenerateTextTextureRequest& request) const; + InteractiveFullSegmentationOutcome interactiveFullSegmentation(const Model::InteractiveFullSegmentationRequest &request)const; + void interactiveFullSegmentationAsync(const Model::InteractiveFullSegmentationRequest& request, const InteractiveFullSegmentationAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + InteractiveFullSegmentationOutcomeCallable interactiveFullSegmentationCallable(const Model::InteractiveFullSegmentationRequest& request) const; + InteractiveScribbleSegmentationOutcome interactiveScribbleSegmentation(const Model::InteractiveScribbleSegmentationRequest &request)const; + void interactiveScribbleSegmentationAsync(const Model::InteractiveScribbleSegmentationRequest& request, const InteractiveScribbleSegmentationAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + InteractiveScribbleSegmentationOutcomeCallable interactiveScribbleSegmentationCallable(const Model::InteractiveScribbleSegmentationRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_AIGEN_AIGENCLIENT_H_ diff --git a/aigen/include/alibabacloud/aigen/AigenExport.h b/aigen/include/alibabacloud/aigen/AigenExport.h new file mode 100644 index 000000000..85b26da58 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/AigenExport.h @@ -0,0 +1,32 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_AIGENEXPORT_H_ +#define ALIBABACLOUD_AIGEN_AIGENEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_AIGEN_LIBRARY) +# define ALIBABACLOUD_AIGEN_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_AIGEN_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_AIGEN_EXPORT +#endif + +#endif // !ALIBABACLOUD_AIGEN_AIGENEXPORT_H_ \ No newline at end of file diff --git a/aigen/include/alibabacloud/aigen/model/GenerateCosplayImageRequest.h b/aigen/include/alibabacloud/aigen/model/GenerateCosplayImageRequest.h new file mode 100644 index 000000000..1e73c50ff --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/GenerateCosplayImageRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_GENERATECOSPLAYIMAGEREQUEST_H_ +#define ALIBABACLOUD_AIGEN_MODEL_GENERATECOSPLAYIMAGEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Aigen { +namespace Model { +class ALIBABACLOUD_AIGEN_EXPORT GenerateCosplayImageRequest : public RpcServiceRequest { +public: + GenerateCosplayImageRequest(); + ~GenerateCosplayImageRequest(); + std::string getTemplateImageUrl() const; + void setTemplateImageUrl(const std::string &templateImageUrl); + std::string getFaceImageUrl() const; + void setFaceImageUrl(const std::string &faceImageUrl); + bool getAsync() const; + void setAsync(bool async); + long getStyle() const; + void setStyle(long style); + +private: + std::string templateImageUrl_; + std::string faceImageUrl_; + bool async_; + long style_; +}; +} // namespace Model +} // namespace Aigen +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIGEN_MODEL_GENERATECOSPLAYIMAGEREQUEST_H_ diff --git a/aigen/include/alibabacloud/aigen/model/GenerateCosplayImageResult.h b/aigen/include/alibabacloud/aigen/model/GenerateCosplayImageResult.h new file mode 100644 index 000000000..225f6ceaf --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/GenerateCosplayImageResult.h @@ -0,0 +1,59 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_GENERATECOSPLAYIMAGERESULT_H_ +#define ALIBABACLOUD_AIGEN_MODEL_GENERATECOSPLAYIMAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aigen + { + namespace Model + { + class ALIBABACLOUD_AIGEN_EXPORT GenerateCosplayImageResult : public ServiceResult + { + public: + struct Data + { + std::string resultUrl; + }; + + + GenerateCosplayImageResult(); + explicit GenerateCosplayImageResult(const std::string &payload); + ~GenerateCosplayImageResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AIGEN_MODEL_GENERATECOSPLAYIMAGERESULT_H_ \ No newline at end of file diff --git a/aigen/include/alibabacloud/aigen/model/GenerateTextDeformationRequest.h b/aigen/include/alibabacloud/aigen/model/GenerateTextDeformationRequest.h new file mode 100644 index 000000000..eb3b696be --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/GenerateTextDeformationRequest.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTDEFORMATIONREQUEST_H_ +#define ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTDEFORMATIONREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Aigen { +namespace Model { +class ALIBABACLOUD_AIGEN_EXPORT GenerateTextDeformationRequest : public RpcServiceRequest { +public: + GenerateTextDeformationRequest(); + ~GenerateTextDeformationRequest(); + std::string getTextContent() const; + void setTextContent(const std::string &textContent); + std::string getFontName() const; + void setFontName(const std::string &fontName); + std::string getTtfUrl() const; + void setTtfUrl(const std::string &ttfUrl); + long getN() const; + void setN(long n); + bool getAsync() const; + void setAsync(bool async); + std::string getPrompt() const; + void setPrompt(const std::string &prompt); + std::string getOutputImageRatio() const; + void setOutputImageRatio(const std::string &outputImageRatio); + +private: + std::string textContent_; + std::string fontName_; + std::string ttfUrl_; + long n_; + bool async_; + std::string prompt_; + std::string outputImageRatio_; +}; +} // namespace Model +} // namespace Aigen +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTDEFORMATIONREQUEST_H_ diff --git a/aigen/include/alibabacloud/aigen/model/GenerateTextDeformationResult.h b/aigen/include/alibabacloud/aigen/model/GenerateTextDeformationResult.h new file mode 100644 index 000000000..67c0763c9 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/GenerateTextDeformationResult.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTDEFORMATIONRESULT_H_ +#define ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTDEFORMATIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aigen + { + namespace Model + { + class ALIBABACLOUD_AIGEN_EXPORT GenerateTextDeformationResult : public ServiceResult + { + public: + struct Data + { + std::string resultUrl; + }; + + + GenerateTextDeformationResult(); + explicit GenerateTextDeformationResult(const std::string &payload); + ~GenerateTextDeformationResult(); + std::string getMessage()const; + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTDEFORMATIONRESULT_H_ \ No newline at end of file diff --git a/aigen/include/alibabacloud/aigen/model/GenerateTextTextureRequest.h b/aigen/include/alibabacloud/aigen/model/GenerateTextTextureRequest.h new file mode 100644 index 000000000..63dd26ac9 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/GenerateTextTextureRequest.h @@ -0,0 +1,72 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTTEXTUREREQUEST_H_ +#define ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTTEXTUREREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Aigen { +namespace Model { +class ALIBABACLOUD_AIGEN_EXPORT GenerateTextTextureRequest : public RpcServiceRequest { +public: + GenerateTextTextureRequest(); + ~GenerateTextTextureRequest(); + std::string getTextContent() const; + void setTextContent(const std::string &textContent); + std::string getTextureStyle() const; + void setTextureStyle(const std::string &textureStyle); + std::string getFontName() const; + void setFontName(const std::string &fontName); + std::string getTtfUrl() const; + void setTtfUrl(const std::string &ttfUrl); + long getN() const; + void setN(long n); + bool getAsync() const; + void setAsync(bool async); + bool getAlphaChannel() const; + void setAlphaChannel(bool alphaChannel); + std::string getImageUrl() const; + void setImageUrl(const std::string &imageUrl); + long getImageShortSize() const; + void setImageShortSize(long imageShortSize); + std::string getPrompt() const; + void setPrompt(const std::string &prompt); + std::string getOutputImageRatio() const; + void setOutputImageRatio(const std::string &outputImageRatio); + +private: + std::string textContent_; + std::string textureStyle_; + std::string fontName_; + std::string ttfUrl_; + long n_; + bool async_; + bool alphaChannel_; + std::string imageUrl_; + long imageShortSize_; + std::string prompt_; + std::string outputImageRatio_; +}; +} // namespace Model +} // namespace Aigen +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTTEXTUREREQUEST_H_ diff --git a/aigen/include/alibabacloud/aigen/model/GenerateTextTextureResult.h b/aigen/include/alibabacloud/aigen/model/GenerateTextTextureResult.h new file mode 100644 index 000000000..365856db1 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/GenerateTextTextureResult.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTTEXTURERESULT_H_ +#define ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTTEXTURERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aigen + { + namespace Model + { + class ALIBABACLOUD_AIGEN_EXPORT GenerateTextTextureResult : public ServiceResult + { + public: + struct Data + { + std::string resultUrl; + }; + + + GenerateTextTextureResult(); + explicit GenerateTextTextureResult(const std::string &payload); + ~GenerateTextTextureResult(); + std::string getMessage()const; + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AIGEN_MODEL_GENERATETEXTTEXTURERESULT_H_ \ No newline at end of file diff --git a/aigen/include/alibabacloud/aigen/model/InteractiveFullSegmentationRequest.h b/aigen/include/alibabacloud/aigen/model/InteractiveFullSegmentationRequest.h new file mode 100644 index 000000000..5f2f93cb6 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/InteractiveFullSegmentationRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_INTERACTIVEFULLSEGMENTATIONREQUEST_H_ +#define ALIBABACLOUD_AIGEN_MODEL_INTERACTIVEFULLSEGMENTATIONREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Aigen { +namespace Model { +class ALIBABACLOUD_AIGEN_EXPORT InteractiveFullSegmentationRequest : public RpcServiceRequest { +public: + InteractiveFullSegmentationRequest(); + ~InteractiveFullSegmentationRequest(); + std::string getReturnFormat() const; + void setReturnFormat(const std::string &returnFormat); + bool getAsync() const; + void setAsync(bool async); + std::string getImageUrl() const; + void setImageUrl(const std::string &imageUrl); + +private: + std::string returnFormat_; + bool async_; + std::string imageUrl_; +}; +} // namespace Model +} // namespace Aigen +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIGEN_MODEL_INTERACTIVEFULLSEGMENTATIONREQUEST_H_ diff --git a/aigen/include/alibabacloud/aigen/model/InteractiveFullSegmentationResult.h b/aigen/include/alibabacloud/aigen/model/InteractiveFullSegmentationResult.h new file mode 100644 index 000000000..801942942 --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/InteractiveFullSegmentationResult.h @@ -0,0 +1,59 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_INTERACTIVEFULLSEGMENTATIONRESULT_H_ +#define ALIBABACLOUD_AIGEN_MODEL_INTERACTIVEFULLSEGMENTATIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aigen + { + namespace Model + { + class ALIBABACLOUD_AIGEN_EXPORT InteractiveFullSegmentationResult : public ServiceResult + { + public: + struct Data + { + std::string resultUrl; + }; + + + InteractiveFullSegmentationResult(); + explicit InteractiveFullSegmentationResult(const std::string &payload); + ~InteractiveFullSegmentationResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AIGEN_MODEL_INTERACTIVEFULLSEGMENTATIONRESULT_H_ \ No newline at end of file diff --git a/aigen/include/alibabacloud/aigen/model/InteractiveScribbleSegmentationRequest.h b/aigen/include/alibabacloud/aigen/model/InteractiveScribbleSegmentationRequest.h new file mode 100644 index 000000000..957377a5e --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/InteractiveScribbleSegmentationRequest.h @@ -0,0 +1,66 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_INTERACTIVESCRIBBLESEGMENTATIONREQUEST_H_ +#define ALIBABACLOUD_AIGEN_MODEL_INTERACTIVESCRIBBLESEGMENTATIONREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Aigen { +namespace Model { +class ALIBABACLOUD_AIGEN_EXPORT InteractiveScribbleSegmentationRequest : public RpcServiceRequest { +public: + InteractiveScribbleSegmentationRequest(); + ~InteractiveScribbleSegmentationRequest(); + std::string getPosScribbleImageUrl() const; + void setPosScribbleImageUrl(const std::string &posScribbleImageUrl); + std::string getIntegratedMaskUrl() const; + void setIntegratedMaskUrl(const std::string &integratedMaskUrl); + std::string getMaskImageUrl() const; + void setMaskImageUrl(const std::string &maskImageUrl); + std::string getReturnForm() const; + void setReturnForm(const std::string &returnForm); + std::string getNegScribbleImageUrl() const; + void setNegScribbleImageUrl(const std::string &negScribbleImageUrl); + std::string getReturnFormat() const; + void setReturnFormat(const std::string &returnFormat); + std::string getEdgeFeathering() const; + void setEdgeFeathering(const std::string &edgeFeathering); + std::string getImageUrl() const; + void setImageUrl(const std::string &imageUrl); + std::string getPostprocessOption() const; + void setPostprocessOption(const std::string &postprocessOption); + +private: + std::string posScribbleImageUrl_; + std::string integratedMaskUrl_; + std::string maskImageUrl_; + std::string returnForm_; + std::string negScribbleImageUrl_; + std::string returnFormat_; + std::string edgeFeathering_; + std::string imageUrl_; + std::string postprocessOption_; +}; +} // namespace Model +} // namespace Aigen +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_AIGEN_MODEL_INTERACTIVESCRIBBLESEGMENTATIONREQUEST_H_ diff --git a/aigen/include/alibabacloud/aigen/model/InteractiveScribbleSegmentationResult.h b/aigen/include/alibabacloud/aigen/model/InteractiveScribbleSegmentationResult.h new file mode 100644 index 000000000..d4fc922be --- /dev/null +++ b/aigen/include/alibabacloud/aigen/model/InteractiveScribbleSegmentationResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_AIGEN_MODEL_INTERACTIVESCRIBBLESEGMENTATIONRESULT_H_ +#define ALIBABACLOUD_AIGEN_MODEL_INTERACTIVESCRIBBLESEGMENTATIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aigen + { + namespace Model + { + class ALIBABACLOUD_AIGEN_EXPORT InteractiveScribbleSegmentationResult : public ServiceResult + { + public: + struct Data + { + std::string resultUrl; + }; + + + InteractiveScribbleSegmentationResult(); + explicit InteractiveScribbleSegmentationResult(const std::string &payload); + ~InteractiveScribbleSegmentationResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AIGEN_MODEL_INTERACTIVESCRIBBLESEGMENTATIONRESULT_H_ \ No newline at end of file diff --git a/aigen/src/AigenClient.cc b/aigen/src/AigenClient.cc new file mode 100644 index 000000000..31698ce14 --- /dev/null +++ b/aigen/src/AigenClient.cc @@ -0,0 +1,233 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::Aigen; +using namespace AlibabaCloud::Aigen::Model; + +namespace +{ + const std::string SERVICE_NAME = "aigen"; +} + +AigenClient::AigenClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +AigenClient::AigenClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +AigenClient::AigenClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +AigenClient::~AigenClient() +{} + +AigenClient::GenerateCosplayImageOutcome AigenClient::generateCosplayImage(const GenerateCosplayImageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GenerateCosplayImageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GenerateCosplayImageOutcome(GenerateCosplayImageResult(outcome.result())); + else + return GenerateCosplayImageOutcome(outcome.error()); +} + +void AigenClient::generateCosplayImageAsync(const GenerateCosplayImageRequest& request, const GenerateCosplayImageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, generateCosplayImage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AigenClient::GenerateCosplayImageOutcomeCallable AigenClient::generateCosplayImageCallable(const GenerateCosplayImageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->generateCosplayImage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AigenClient::GenerateTextDeformationOutcome AigenClient::generateTextDeformation(const GenerateTextDeformationRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GenerateTextDeformationOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GenerateTextDeformationOutcome(GenerateTextDeformationResult(outcome.result())); + else + return GenerateTextDeformationOutcome(outcome.error()); +} + +void AigenClient::generateTextDeformationAsync(const GenerateTextDeformationRequest& request, const GenerateTextDeformationAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, generateTextDeformation(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AigenClient::GenerateTextDeformationOutcomeCallable AigenClient::generateTextDeformationCallable(const GenerateTextDeformationRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->generateTextDeformation(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AigenClient::GenerateTextTextureOutcome AigenClient::generateTextTexture(const GenerateTextTextureRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GenerateTextTextureOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GenerateTextTextureOutcome(GenerateTextTextureResult(outcome.result())); + else + return GenerateTextTextureOutcome(outcome.error()); +} + +void AigenClient::generateTextTextureAsync(const GenerateTextTextureRequest& request, const GenerateTextTextureAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, generateTextTexture(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AigenClient::GenerateTextTextureOutcomeCallable AigenClient::generateTextTextureCallable(const GenerateTextTextureRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->generateTextTexture(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AigenClient::InteractiveFullSegmentationOutcome AigenClient::interactiveFullSegmentation(const InteractiveFullSegmentationRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return InteractiveFullSegmentationOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return InteractiveFullSegmentationOutcome(InteractiveFullSegmentationResult(outcome.result())); + else + return InteractiveFullSegmentationOutcome(outcome.error()); +} + +void AigenClient::interactiveFullSegmentationAsync(const InteractiveFullSegmentationRequest& request, const InteractiveFullSegmentationAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, interactiveFullSegmentation(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AigenClient::InteractiveFullSegmentationOutcomeCallable AigenClient::interactiveFullSegmentationCallable(const InteractiveFullSegmentationRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->interactiveFullSegmentation(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AigenClient::InteractiveScribbleSegmentationOutcome AigenClient::interactiveScribbleSegmentation(const InteractiveScribbleSegmentationRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return InteractiveScribbleSegmentationOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return InteractiveScribbleSegmentationOutcome(InteractiveScribbleSegmentationResult(outcome.result())); + else + return InteractiveScribbleSegmentationOutcome(outcome.error()); +} + +void AigenClient::interactiveScribbleSegmentationAsync(const InteractiveScribbleSegmentationRequest& request, const InteractiveScribbleSegmentationAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, interactiveScribbleSegmentation(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AigenClient::InteractiveScribbleSegmentationOutcomeCallable AigenClient::interactiveScribbleSegmentationCallable(const InteractiveScribbleSegmentationRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->interactiveScribbleSegmentation(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/aigen/src/model/GenerateCosplayImageRequest.cc b/aigen/src/model/GenerateCosplayImageRequest.cc new file mode 100644 index 000000000..3d84eee4c --- /dev/null +++ b/aigen/src/model/GenerateCosplayImageRequest.cc @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Aigen::Model::GenerateCosplayImageRequest; + +GenerateCosplayImageRequest::GenerateCosplayImageRequest() + : RpcServiceRequest("aigen", "2024-01-11", "GenerateCosplayImage") { + setMethod(HttpRequest::Method::Post); +} + +GenerateCosplayImageRequest::~GenerateCosplayImageRequest() {} + +std::string GenerateCosplayImageRequest::getTemplateImageUrl() const { + return templateImageUrl_; +} + +void GenerateCosplayImageRequest::setTemplateImageUrl(const std::string &templateImageUrl) { + templateImageUrl_ = templateImageUrl; + setBodyParameter(std::string("TemplateImageUrl"), templateImageUrl); +} + +std::string GenerateCosplayImageRequest::getFaceImageUrl() const { + return faceImageUrl_; +} + +void GenerateCosplayImageRequest::setFaceImageUrl(const std::string &faceImageUrl) { + faceImageUrl_ = faceImageUrl; + setBodyParameter(std::string("FaceImageUrl"), faceImageUrl); +} + +bool GenerateCosplayImageRequest::getAsync() const { + return async_; +} + +void GenerateCosplayImageRequest::setAsync(bool async) { + async_ = async; + setBodyParameter(std::string("Async"), async ? "true" : "false"); +} + +long GenerateCosplayImageRequest::getStyle() const { + return style_; +} + +void GenerateCosplayImageRequest::setStyle(long style) { + style_ = style; + setBodyParameter(std::string("Style"), std::to_string(style)); +} + diff --git a/aigen/src/model/GenerateCosplayImageResult.cc b/aigen/src/model/GenerateCosplayImageResult.cc new file mode 100644 index 000000000..2f4fad589 --- /dev/null +++ b/aigen/src/model/GenerateCosplayImageResult.cc @@ -0,0 +1,66 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Aigen; +using namespace AlibabaCloud::Aigen::Model; + +GenerateCosplayImageResult::GenerateCosplayImageResult() : + ServiceResult() +{} + +GenerateCosplayImageResult::GenerateCosplayImageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GenerateCosplayImageResult::~GenerateCosplayImageResult() +{} + +void GenerateCosplayImageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["ResultUrl"].isNull()) + data_.resultUrl = dataNode["ResultUrl"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GenerateCosplayImageResult::getMessage()const +{ + return message_; +} + +GenerateCosplayImageResult::Data GenerateCosplayImageResult::getData()const +{ + return data_; +} + +std::string GenerateCosplayImageResult::getCode()const +{ + return code_; +} + diff --git a/aigen/src/model/GenerateTextDeformationRequest.cc b/aigen/src/model/GenerateTextDeformationRequest.cc new file mode 100644 index 000000000..920a42855 --- /dev/null +++ b/aigen/src/model/GenerateTextDeformationRequest.cc @@ -0,0 +1,90 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Aigen::Model::GenerateTextDeformationRequest; + +GenerateTextDeformationRequest::GenerateTextDeformationRequest() + : RpcServiceRequest("aigen", "2024-01-11", "GenerateTextDeformation") { + setMethod(HttpRequest::Method::Post); +} + +GenerateTextDeformationRequest::~GenerateTextDeformationRequest() {} + +std::string GenerateTextDeformationRequest::getTextContent() const { + return textContent_; +} + +void GenerateTextDeformationRequest::setTextContent(const std::string &textContent) { + textContent_ = textContent; + setBodyParameter(std::string("TextContent"), textContent); +} + +std::string GenerateTextDeformationRequest::getFontName() const { + return fontName_; +} + +void GenerateTextDeformationRequest::setFontName(const std::string &fontName) { + fontName_ = fontName; + setBodyParameter(std::string("FontName"), fontName); +} + +std::string GenerateTextDeformationRequest::getTtfUrl() const { + return ttfUrl_; +} + +void GenerateTextDeformationRequest::setTtfUrl(const std::string &ttfUrl) { + ttfUrl_ = ttfUrl; + setBodyParameter(std::string("TtfUrl"), ttfUrl); +} + +long GenerateTextDeformationRequest::getN() const { + return n_; +} + +void GenerateTextDeformationRequest::setN(long n) { + n_ = n; + setBodyParameter(std::string("N"), std::to_string(n)); +} + +bool GenerateTextDeformationRequest::getAsync() const { + return async_; +} + +void GenerateTextDeformationRequest::setAsync(bool async) { + async_ = async; + setBodyParameter(std::string("Async"), async ? "true" : "false"); +} + +std::string GenerateTextDeformationRequest::getPrompt() const { + return prompt_; +} + +void GenerateTextDeformationRequest::setPrompt(const std::string &prompt) { + prompt_ = prompt; + setBodyParameter(std::string("Prompt"), prompt); +} + +std::string GenerateTextDeformationRequest::getOutputImageRatio() const { + return outputImageRatio_; +} + +void GenerateTextDeformationRequest::setOutputImageRatio(const std::string &outputImageRatio) { + outputImageRatio_ = outputImageRatio; + setBodyParameter(std::string("OutputImageRatio"), outputImageRatio); +} + diff --git a/aigen/src/model/GenerateTextDeformationResult.cc b/aigen/src/model/GenerateTextDeformationResult.cc new file mode 100644 index 000000000..f8393d1d2 --- /dev/null +++ b/aigen/src/model/GenerateTextDeformationResult.cc @@ -0,0 +1,59 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Aigen; +using namespace AlibabaCloud::Aigen::Model; + +GenerateTextDeformationResult::GenerateTextDeformationResult() : + ServiceResult() +{} + +GenerateTextDeformationResult::GenerateTextDeformationResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GenerateTextDeformationResult::~GenerateTextDeformationResult() +{} + +void GenerateTextDeformationResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["ResultUrl"].isNull()) + data_.resultUrl = dataNode["ResultUrl"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GenerateTextDeformationResult::getMessage()const +{ + return message_; +} + +GenerateTextDeformationResult::Data GenerateTextDeformationResult::getData()const +{ + return data_; +} + diff --git a/aigen/src/model/GenerateTextTextureRequest.cc b/aigen/src/model/GenerateTextTextureRequest.cc new file mode 100644 index 000000000..63a268f29 --- /dev/null +++ b/aigen/src/model/GenerateTextTextureRequest.cc @@ -0,0 +1,126 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Aigen::Model::GenerateTextTextureRequest; + +GenerateTextTextureRequest::GenerateTextTextureRequest() + : RpcServiceRequest("aigen", "2024-01-11", "GenerateTextTexture") { + setMethod(HttpRequest::Method::Post); +} + +GenerateTextTextureRequest::~GenerateTextTextureRequest() {} + +std::string GenerateTextTextureRequest::getTextContent() const { + return textContent_; +} + +void GenerateTextTextureRequest::setTextContent(const std::string &textContent) { + textContent_ = textContent; + setBodyParameter(std::string("TextContent"), textContent); +} + +std::string GenerateTextTextureRequest::getTextureStyle() const { + return textureStyle_; +} + +void GenerateTextTextureRequest::setTextureStyle(const std::string &textureStyle) { + textureStyle_ = textureStyle; + setParameter(std::string("TextureStyle"), textureStyle); +} + +std::string GenerateTextTextureRequest::getFontName() const { + return fontName_; +} + +void GenerateTextTextureRequest::setFontName(const std::string &fontName) { + fontName_ = fontName; + setBodyParameter(std::string("FontName"), fontName); +} + +std::string GenerateTextTextureRequest::getTtfUrl() const { + return ttfUrl_; +} + +void GenerateTextTextureRequest::setTtfUrl(const std::string &ttfUrl) { + ttfUrl_ = ttfUrl; + setBodyParameter(std::string("TtfUrl"), ttfUrl); +} + +long GenerateTextTextureRequest::getN() const { + return n_; +} + +void GenerateTextTextureRequest::setN(long n) { + n_ = n; + setBodyParameter(std::string("N"), std::to_string(n)); +} + +bool GenerateTextTextureRequest::getAsync() const { + return async_; +} + +void GenerateTextTextureRequest::setAsync(bool async) { + async_ = async; + setBodyParameter(std::string("Async"), async ? "true" : "false"); +} + +bool GenerateTextTextureRequest::getAlphaChannel() const { + return alphaChannel_; +} + +void GenerateTextTextureRequest::setAlphaChannel(bool alphaChannel) { + alphaChannel_ = alphaChannel; + setBodyParameter(std::string("AlphaChannel"), alphaChannel ? "true" : "false"); +} + +std::string GenerateTextTextureRequest::getImageUrl() const { + return imageUrl_; +} + +void GenerateTextTextureRequest::setImageUrl(const std::string &imageUrl) { + imageUrl_ = imageUrl; + setBodyParameter(std::string("ImageUrl"), imageUrl); +} + +long GenerateTextTextureRequest::getImageShortSize() const { + return imageShortSize_; +} + +void GenerateTextTextureRequest::setImageShortSize(long imageShortSize) { + imageShortSize_ = imageShortSize; + setBodyParameter(std::string("ImageShortSize"), std::to_string(imageShortSize)); +} + +std::string GenerateTextTextureRequest::getPrompt() const { + return prompt_; +} + +void GenerateTextTextureRequest::setPrompt(const std::string &prompt) { + prompt_ = prompt; + setBodyParameter(std::string("Prompt"), prompt); +} + +std::string GenerateTextTextureRequest::getOutputImageRatio() const { + return outputImageRatio_; +} + +void GenerateTextTextureRequest::setOutputImageRatio(const std::string &outputImageRatio) { + outputImageRatio_ = outputImageRatio; + setBodyParameter(std::string("OutputImageRatio"), outputImageRatio); +} + diff --git a/aigen/src/model/GenerateTextTextureResult.cc b/aigen/src/model/GenerateTextTextureResult.cc new file mode 100644 index 000000000..41e3b11c4 --- /dev/null +++ b/aigen/src/model/GenerateTextTextureResult.cc @@ -0,0 +1,59 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Aigen; +using namespace AlibabaCloud::Aigen::Model; + +GenerateTextTextureResult::GenerateTextTextureResult() : + ServiceResult() +{} + +GenerateTextTextureResult::GenerateTextTextureResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GenerateTextTextureResult::~GenerateTextTextureResult() +{} + +void GenerateTextTextureResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["ResultUrl"].isNull()) + data_.resultUrl = dataNode["ResultUrl"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GenerateTextTextureResult::getMessage()const +{ + return message_; +} + +GenerateTextTextureResult::Data GenerateTextTextureResult::getData()const +{ + return data_; +} + diff --git a/aigen/src/model/InteractiveFullSegmentationRequest.cc b/aigen/src/model/InteractiveFullSegmentationRequest.cc new file mode 100644 index 000000000..77d5765b4 --- /dev/null +++ b/aigen/src/model/InteractiveFullSegmentationRequest.cc @@ -0,0 +1,54 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Aigen::Model::InteractiveFullSegmentationRequest; + +InteractiveFullSegmentationRequest::InteractiveFullSegmentationRequest() + : RpcServiceRequest("aigen", "2024-01-11", "InteractiveFullSegmentation") { + setMethod(HttpRequest::Method::Post); +} + +InteractiveFullSegmentationRequest::~InteractiveFullSegmentationRequest() {} + +std::string InteractiveFullSegmentationRequest::getReturnFormat() const { + return returnFormat_; +} + +void InteractiveFullSegmentationRequest::setReturnFormat(const std::string &returnFormat) { + returnFormat_ = returnFormat; + setBodyParameter(std::string("ReturnFormat"), returnFormat); +} + +bool InteractiveFullSegmentationRequest::getAsync() const { + return async_; +} + +void InteractiveFullSegmentationRequest::setAsync(bool async) { + async_ = async; + setBodyParameter(std::string("Async"), async ? "true" : "false"); +} + +std::string InteractiveFullSegmentationRequest::getImageUrl() const { + return imageUrl_; +} + +void InteractiveFullSegmentationRequest::setImageUrl(const std::string &imageUrl) { + imageUrl_ = imageUrl; + setBodyParameter(std::string("ImageUrl"), imageUrl); +} + diff --git a/aigen/src/model/InteractiveFullSegmentationResult.cc b/aigen/src/model/InteractiveFullSegmentationResult.cc new file mode 100644 index 000000000..9b53dda0b --- /dev/null +++ b/aigen/src/model/InteractiveFullSegmentationResult.cc @@ -0,0 +1,66 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Aigen; +using namespace AlibabaCloud::Aigen::Model; + +InteractiveFullSegmentationResult::InteractiveFullSegmentationResult() : + ServiceResult() +{} + +InteractiveFullSegmentationResult::InteractiveFullSegmentationResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +InteractiveFullSegmentationResult::~InteractiveFullSegmentationResult() +{} + +void InteractiveFullSegmentationResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["ResultUrl"].isNull()) + data_.resultUrl = dataNode["ResultUrl"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string InteractiveFullSegmentationResult::getMessage()const +{ + return message_; +} + +InteractiveFullSegmentationResult::Data InteractiveFullSegmentationResult::getData()const +{ + return data_; +} + +std::string InteractiveFullSegmentationResult::getCode()const +{ + return code_; +} + diff --git a/aigen/src/model/InteractiveScribbleSegmentationRequest.cc b/aigen/src/model/InteractiveScribbleSegmentationRequest.cc new file mode 100644 index 000000000..1e2eb2b6f --- /dev/null +++ b/aigen/src/model/InteractiveScribbleSegmentationRequest.cc @@ -0,0 +1,108 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Aigen::Model::InteractiveScribbleSegmentationRequest; + +InteractiveScribbleSegmentationRequest::InteractiveScribbleSegmentationRequest() + : RpcServiceRequest("aigen", "2024-01-11", "InteractiveScribbleSegmentation") { + setMethod(HttpRequest::Method::Post); +} + +InteractiveScribbleSegmentationRequest::~InteractiveScribbleSegmentationRequest() {} + +std::string InteractiveScribbleSegmentationRequest::getPosScribbleImageUrl() const { + return posScribbleImageUrl_; +} + +void InteractiveScribbleSegmentationRequest::setPosScribbleImageUrl(const std::string &posScribbleImageUrl) { + posScribbleImageUrl_ = posScribbleImageUrl; + setBodyParameter(std::string("PosScribbleImageUrl"), posScribbleImageUrl); +} + +std::string InteractiveScribbleSegmentationRequest::getIntegratedMaskUrl() const { + return integratedMaskUrl_; +} + +void InteractiveScribbleSegmentationRequest::setIntegratedMaskUrl(const std::string &integratedMaskUrl) { + integratedMaskUrl_ = integratedMaskUrl; + setBodyParameter(std::string("IntegratedMaskUrl"), integratedMaskUrl); +} + +std::string InteractiveScribbleSegmentationRequest::getMaskImageUrl() const { + return maskImageUrl_; +} + +void InteractiveScribbleSegmentationRequest::setMaskImageUrl(const std::string &maskImageUrl) { + maskImageUrl_ = maskImageUrl; + setBodyParameter(std::string("MaskImageUrl"), maskImageUrl); +} + +std::string InteractiveScribbleSegmentationRequest::getReturnForm() const { + return returnForm_; +} + +void InteractiveScribbleSegmentationRequest::setReturnForm(const std::string &returnForm) { + returnForm_ = returnForm; + setBodyParameter(std::string("ReturnForm"), returnForm); +} + +std::string InteractiveScribbleSegmentationRequest::getNegScribbleImageUrl() const { + return negScribbleImageUrl_; +} + +void InteractiveScribbleSegmentationRequest::setNegScribbleImageUrl(const std::string &negScribbleImageUrl) { + negScribbleImageUrl_ = negScribbleImageUrl; + setBodyParameter(std::string("NegScribbleImageUrl"), negScribbleImageUrl); +} + +std::string InteractiveScribbleSegmentationRequest::getReturnFormat() const { + return returnFormat_; +} + +void InteractiveScribbleSegmentationRequest::setReturnFormat(const std::string &returnFormat) { + returnFormat_ = returnFormat; + setBodyParameter(std::string("ReturnFormat"), returnFormat); +} + +std::string InteractiveScribbleSegmentationRequest::getEdgeFeathering() const { + return edgeFeathering_; +} + +void InteractiveScribbleSegmentationRequest::setEdgeFeathering(const std::string &edgeFeathering) { + edgeFeathering_ = edgeFeathering; + setBodyParameter(std::string("EdgeFeathering"), edgeFeathering); +} + +std::string InteractiveScribbleSegmentationRequest::getImageUrl() const { + return imageUrl_; +} + +void InteractiveScribbleSegmentationRequest::setImageUrl(const std::string &imageUrl) { + imageUrl_ = imageUrl; + setBodyParameter(std::string("ImageUrl"), imageUrl); +} + +std::string InteractiveScribbleSegmentationRequest::getPostprocessOption() const { + return postprocessOption_; +} + +void InteractiveScribbleSegmentationRequest::setPostprocessOption(const std::string &postprocessOption) { + postprocessOption_ = postprocessOption; + setBodyParameter(std::string("PostprocessOption"), postprocessOption); +} + diff --git a/aigen/src/model/InteractiveScribbleSegmentationResult.cc b/aigen/src/model/InteractiveScribbleSegmentationResult.cc new file mode 100644 index 000000000..ec72b317b --- /dev/null +++ b/aigen/src/model/InteractiveScribbleSegmentationResult.cc @@ -0,0 +1,52 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Aigen; +using namespace AlibabaCloud::Aigen::Model; + +InteractiveScribbleSegmentationResult::InteractiveScribbleSegmentationResult() : + ServiceResult() +{} + +InteractiveScribbleSegmentationResult::InteractiveScribbleSegmentationResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +InteractiveScribbleSegmentationResult::~InteractiveScribbleSegmentationResult() +{} + +void InteractiveScribbleSegmentationResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["ResultUrl"].isNull()) + data_.resultUrl = dataNode["ResultUrl"].asString(); + +} + +InteractiveScribbleSegmentationResult::Data InteractiveScribbleSegmentationResult::getData()const +{ + return data_; +} +