Selaa lähdekoodia

Release GenerateSuperResolutionImage.

sdk-team 3 vuotta sitten
vanhempi
sitoutus
0fe965ef54

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1440
+1.36.1441

+ 4 - 0
imageenhan/CMakeLists.txt

@@ -37,6 +37,8 @@ set(imageenhan_public_header_model
 	include/alibabacloud/imageenhan/model/ErasePersonResult.h
 	include/alibabacloud/imageenhan/model/ExtendImageStyleRequest.h
 	include/alibabacloud/imageenhan/model/ExtendImageStyleResult.h
+	include/alibabacloud/imageenhan/model/GenerateCartoonizedImageRequest.h
+	include/alibabacloud/imageenhan/model/GenerateCartoonizedImageResult.h
 	include/alibabacloud/imageenhan/model/GenerateDynamicImageRequest.h
 	include/alibabacloud/imageenhan/model/GenerateDynamicImageResult.h
 	include/alibabacloud/imageenhan/model/GenerateImageWithTextRequest.h
@@ -82,6 +84,8 @@ set(imageenhan_src
 	src/model/ErasePersonResult.cc
 	src/model/ExtendImageStyleRequest.cc
 	src/model/ExtendImageStyleResult.cc
+	src/model/GenerateCartoonizedImageRequest.cc
+	src/model/GenerateCartoonizedImageResult.cc
 	src/model/GenerateDynamicImageRequest.cc
 	src/model/GenerateDynamicImageResult.cc
 	src/model/GenerateImageWithTextRequest.cc

+ 8 - 0
imageenhan/include/alibabacloud/imageenhan/ImageenhanClient.h

@@ -38,6 +38,8 @@
 #include "model/ErasePersonResult.h"
 #include "model/ExtendImageStyleRequest.h"
 #include "model/ExtendImageStyleResult.h"
+#include "model/GenerateCartoonizedImageRequest.h"
+#include "model/GenerateCartoonizedImageResult.h"
 #include "model/GenerateDynamicImageRequest.h"
 #include "model/GenerateDynamicImageResult.h"
 #include "model/GenerateImageWithTextRequest.h"
@@ -97,6 +99,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::ExtendImageStyleResult> ExtendImageStyleOutcome;
 			typedef std::future<ExtendImageStyleOutcome> ExtendImageStyleOutcomeCallable;
 			typedef std::function<void(const ImageenhanClient*, const Model::ExtendImageStyleRequest&, const ExtendImageStyleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ExtendImageStyleAsyncHandler;
+			typedef Outcome<Error, Model::GenerateCartoonizedImageResult> GenerateCartoonizedImageOutcome;
+			typedef std::future<GenerateCartoonizedImageOutcome> GenerateCartoonizedImageOutcomeCallable;
+			typedef std::function<void(const ImageenhanClient*, const Model::GenerateCartoonizedImageRequest&, const GenerateCartoonizedImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateCartoonizedImageAsyncHandler;
 			typedef Outcome<Error, Model::GenerateDynamicImageResult> GenerateDynamicImageOutcome;
 			typedef std::future<GenerateDynamicImageOutcome> GenerateDynamicImageOutcomeCallable;
 			typedef std::function<void(const ImageenhanClient*, const Model::GenerateDynamicImageRequest&, const GenerateDynamicImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateDynamicImageAsyncHandler;
@@ -165,6 +170,9 @@ namespace AlibabaCloud
 			ExtendImageStyleOutcome extendImageStyle(const Model::ExtendImageStyleRequest &request)const;
 			void extendImageStyleAsync(const Model::ExtendImageStyleRequest& request, const ExtendImageStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			ExtendImageStyleOutcomeCallable extendImageStyleCallable(const Model::ExtendImageStyleRequest& request) const;
+			GenerateCartoonizedImageOutcome generateCartoonizedImage(const Model::GenerateCartoonizedImageRequest &request)const;
+			void generateCartoonizedImageAsync(const Model::GenerateCartoonizedImageRequest& request, const GenerateCartoonizedImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			GenerateCartoonizedImageOutcomeCallable generateCartoonizedImageCallable(const Model::GenerateCartoonizedImageRequest& request) const;
 			GenerateDynamicImageOutcome generateDynamicImage(const Model::GenerateDynamicImageRequest &request)const;
 			void generateDynamicImageAsync(const Model::GenerateDynamicImageRequest& request, const GenerateDynamicImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GenerateDynamicImageOutcomeCallable generateDynamicImageCallable(const Model::GenerateDynamicImageRequest& request) const;

+ 51 - 0
imageenhan/include/alibabacloud/imageenhan/model/GenerateCartoonizedImageRequest.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_IMAGEENHAN_MODEL_GENERATECARTOONIZEDIMAGEREQUEST_H_
+#define ALIBABACLOUD_IMAGEENHAN_MODEL_GENERATECARTOONIZEDIMAGEREQUEST_H_
+
+#include <alibabacloud/imageenhan/ImageenhanExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace AlibabaCloud {
+namespace Imageenhan {
+namespace Model {
+class ALIBABACLOUD_IMAGEENHAN_EXPORT GenerateCartoonizedImageRequest : public RpcServiceRequest {
+public:
+	GenerateCartoonizedImageRequest();
+	~GenerateCartoonizedImageRequest();
+	std::string getImageType() const;
+	void setImageType(const std::string &imageType);
+	std::string getIndex() const;
+	void setIndex(const std::string &index);
+	bool getAsync() const;
+	void setAsync(bool async);
+	std::string getImageUrl() const;
+	void setImageUrl(const std::string &imageUrl);
+
+private:
+	std::string imageType_;
+	std::string index_;
+	bool async_;
+	std::string imageUrl_;
+};
+} // namespace Model
+} // namespace Imageenhan
+} // namespace AlibabaCloud
+#endif // !ALIBABACLOUD_IMAGEENHAN_MODEL_GENERATECARTOONIZEDIMAGEREQUEST_H_

+ 59 - 0
imageenhan/include/alibabacloud/imageenhan/model/GenerateCartoonizedImageResult.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_IMAGEENHAN_MODEL_GENERATECARTOONIZEDIMAGERESULT_H_
+#define ALIBABACLOUD_IMAGEENHAN_MODEL_GENERATECARTOONIZEDIMAGERESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/imageenhan/ImageenhanExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Imageenhan
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_IMAGEENHAN_EXPORT GenerateCartoonizedImageResult : public ServiceResult
+			{
+			public:
+				struct Data
+				{
+					std::string resultUrl;
+				};
+
+
+				GenerateCartoonizedImageResult();
+				explicit GenerateCartoonizedImageResult(const std::string &payload);
+				~GenerateCartoonizedImageResult();
+				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_IMAGEENHAN_MODEL_GENERATECARTOONIZEDIMAGERESULT_H_

+ 36 - 0
imageenhan/src/ImageenhanClient.cc

@@ -339,6 +339,42 @@ ImageenhanClient::ExtendImageStyleOutcomeCallable ImageenhanClient::extendImageS
 	return task->get_future();
 }
 
+ImageenhanClient::GenerateCartoonizedImageOutcome ImageenhanClient::generateCartoonizedImage(const GenerateCartoonizedImageRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return GenerateCartoonizedImageOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return GenerateCartoonizedImageOutcome(GenerateCartoonizedImageResult(outcome.result()));
+	else
+		return GenerateCartoonizedImageOutcome(outcome.error());
+}
+
+void ImageenhanClient::generateCartoonizedImageAsync(const GenerateCartoonizedImageRequest& request, const GenerateCartoonizedImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, generateCartoonizedImage(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+ImageenhanClient::GenerateCartoonizedImageOutcomeCallable ImageenhanClient::generateCartoonizedImageCallable(const GenerateCartoonizedImageRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<GenerateCartoonizedImageOutcome()>>(
+			[this, request]()
+			{
+			return this->generateCartoonizedImage(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 ImageenhanClient::GenerateDynamicImageOutcome ImageenhanClient::generateDynamicImage(const GenerateDynamicImageRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 63 - 0
imageenhan/src/model/GenerateCartoonizedImageRequest.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 <alibabacloud/imageenhan/model/GenerateCartoonizedImageRequest.h>
+
+using AlibabaCloud::Imageenhan::Model::GenerateCartoonizedImageRequest;
+
+GenerateCartoonizedImageRequest::GenerateCartoonizedImageRequest()
+    : RpcServiceRequest("imageenhan", "2019-09-30", "GenerateCartoonizedImage") {
+  setMethod(HttpRequest::Method::Post);
+}
+
+GenerateCartoonizedImageRequest::~GenerateCartoonizedImageRequest() {}
+
+std::string GenerateCartoonizedImageRequest::getImageType() const {
+  return imageType_;
+}
+
+void GenerateCartoonizedImageRequest::setImageType(const std::string &imageType) {
+  imageType_ = imageType;
+  setBodyParameter(std::string("ImageType"), imageType);
+}
+
+std::string GenerateCartoonizedImageRequest::getIndex() const {
+  return index_;
+}
+
+void GenerateCartoonizedImageRequest::setIndex(const std::string &index) {
+  index_ = index;
+  setBodyParameter(std::string("Index"), index);
+}
+
+bool GenerateCartoonizedImageRequest::getAsync() const {
+  return async_;
+}
+
+void GenerateCartoonizedImageRequest::setAsync(bool async) {
+  async_ = async;
+  setBodyParameter(std::string("Async"), async ? "true" : "false");
+}
+
+std::string GenerateCartoonizedImageRequest::getImageUrl() const {
+  return imageUrl_;
+}
+
+void GenerateCartoonizedImageRequest::setImageUrl(const std::string &imageUrl) {
+  imageUrl_ = imageUrl;
+  setBodyParameter(std::string("ImageUrl"), imageUrl);
+}
+

+ 66 - 0
imageenhan/src/model/GenerateCartoonizedImageResult.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 <alibabacloud/imageenhan/model/GenerateCartoonizedImageResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Imageenhan;
+using namespace AlibabaCloud::Imageenhan::Model;
+
+GenerateCartoonizedImageResult::GenerateCartoonizedImageResult() :
+	ServiceResult()
+{}
+
+GenerateCartoonizedImageResult::GenerateCartoonizedImageResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+GenerateCartoonizedImageResult::~GenerateCartoonizedImageResult()
+{}
+
+void GenerateCartoonizedImageResult::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 GenerateCartoonizedImageResult::getMessage()const
+{
+	return message_;
+}
+
+GenerateCartoonizedImageResult::Data GenerateCartoonizedImageResult::getData()const
+{
+	return data_;
+}
+
+std::string GenerateCartoonizedImageResult::getCode()const
+{
+	return code_;
+}
+