Просмотр исходного кода

Release SegmentHDSky SegmentHDCommonImage.

sdk-team 5 лет назад
Родитель
Сommit
a15a171b2d

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2020-11-13 Version: patch
+- Release SegmentHDSky SegmentHDCommonImage.
+
 2020-11-12 Version: patch
 - Support drm.
 

+ 8 - 0
imageseg/CMakeLists.txt

@@ -47,6 +47,10 @@ set(imageseg_public_header_model
 	include/alibabacloud/imageseg/model/SegmentFurnitureResult.h
 	include/alibabacloud/imageseg/model/SegmentHDBodyRequest.h
 	include/alibabacloud/imageseg/model/SegmentHDBodyResult.h
+	include/alibabacloud/imageseg/model/SegmentHDCommonImageRequest.h
+	include/alibabacloud/imageseg/model/SegmentHDCommonImageResult.h
+	include/alibabacloud/imageseg/model/SegmentHDSkyRequest.h
+	include/alibabacloud/imageseg/model/SegmentHDSkyResult.h
 	include/alibabacloud/imageseg/model/SegmentHairRequest.h
 	include/alibabacloud/imageseg/model/SegmentHairResult.h
 	include/alibabacloud/imageseg/model/SegmentHeadRequest.h
@@ -90,6 +94,10 @@ set(imageseg_src
 	src/model/SegmentFurnitureResult.cc
 	src/model/SegmentHDBodyRequest.cc
 	src/model/SegmentHDBodyResult.cc
+	src/model/SegmentHDCommonImageRequest.cc
+	src/model/SegmentHDCommonImageResult.cc
+	src/model/SegmentHDSkyRequest.cc
+	src/model/SegmentHDSkyResult.cc
 	src/model/SegmentHairRequest.cc
 	src/model/SegmentHairResult.cc
 	src/model/SegmentHeadRequest.cc

+ 16 - 0
imageseg/include/alibabacloud/imageseg/ImagesegClient.h

@@ -48,6 +48,10 @@
 #include "model/SegmentFurnitureResult.h"
 #include "model/SegmentHDBodyRequest.h"
 #include "model/SegmentHDBodyResult.h"
+#include "model/SegmentHDCommonImageRequest.h"
+#include "model/SegmentHDCommonImageResult.h"
+#include "model/SegmentHDSkyRequest.h"
+#include "model/SegmentHDSkyResult.h"
 #include "model/SegmentHairRequest.h"
 #include "model/SegmentHairResult.h"
 #include "model/SegmentHeadRequest.h"
@@ -110,6 +114,12 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::SegmentHDBodyResult> SegmentHDBodyOutcome;
 			typedef std::future<SegmentHDBodyOutcome> SegmentHDBodyOutcomeCallable;
 			typedef std::function<void(const ImagesegClient*, const Model::SegmentHDBodyRequest&, const SegmentHDBodyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHDBodyAsyncHandler;
+			typedef Outcome<Error, Model::SegmentHDCommonImageResult> SegmentHDCommonImageOutcome;
+			typedef std::future<SegmentHDCommonImageOutcome> SegmentHDCommonImageOutcomeCallable;
+			typedef std::function<void(const ImagesegClient*, const Model::SegmentHDCommonImageRequest&, const SegmentHDCommonImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHDCommonImageAsyncHandler;
+			typedef Outcome<Error, Model::SegmentHDSkyResult> SegmentHDSkyOutcome;
+			typedef std::future<SegmentHDSkyOutcome> SegmentHDSkyOutcomeCallable;
+			typedef std::function<void(const ImagesegClient*, const Model::SegmentHDSkyRequest&, const SegmentHDSkyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHDSkyAsyncHandler;
 			typedef Outcome<Error, Model::SegmentHairResult> SegmentHairOutcome;
 			typedef std::future<SegmentHairOutcome> SegmentHairOutcomeCallable;
 			typedef std::function<void(const ImagesegClient*, const Model::SegmentHairRequest&, const SegmentHairOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHairAsyncHandler;
@@ -175,6 +185,12 @@ namespace AlibabaCloud
 			SegmentHDBodyOutcome segmentHDBody(const Model::SegmentHDBodyRequest &request)const;
 			void segmentHDBodyAsync(const Model::SegmentHDBodyRequest& request, const SegmentHDBodyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			SegmentHDBodyOutcomeCallable segmentHDBodyCallable(const Model::SegmentHDBodyRequest& request) const;
+			SegmentHDCommonImageOutcome segmentHDCommonImage(const Model::SegmentHDCommonImageRequest &request)const;
+			void segmentHDCommonImageAsync(const Model::SegmentHDCommonImageRequest& request, const SegmentHDCommonImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			SegmentHDCommonImageOutcomeCallable segmentHDCommonImageCallable(const Model::SegmentHDCommonImageRequest& request) const;
+			SegmentHDSkyOutcome segmentHDSky(const Model::SegmentHDSkyRequest &request)const;
+			void segmentHDSkyAsync(const Model::SegmentHDSkyRequest& request, const SegmentHDSkyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			SegmentHDSkyOutcomeCallable segmentHDSkyCallable(const Model::SegmentHDSkyRequest& request) const;
 			SegmentHairOutcome segmentHair(const Model::SegmentHairRequest &request)const;
 			void segmentHairAsync(const Model::SegmentHairRequest& request, const SegmentHairAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			SegmentHairOutcomeCallable segmentHairCallable(const Model::SegmentHairRequest& request) const;

+ 51 - 0
imageseg/include/alibabacloud/imageseg/model/SegmentHDCommonImageRequest.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_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGEREQUEST_H_
+#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGEREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/imageseg/ImagesegExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Imageseg
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDCommonImageRequest : public RpcServiceRequest
+			{
+
+			public:
+				SegmentHDCommonImageRequest();
+				~SegmentHDCommonImageRequest();
+
+				bool getAsync()const;
+				void setAsync(bool async);
+				std::string getImageUrl()const;
+				void setImageUrl(const std::string& imageUrl);
+
+            private:
+				bool async_;
+				std::string imageUrl_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGEREQUEST_H_

+ 55 - 0
imageseg/include/alibabacloud/imageseg/model/SegmentHDCommonImageResult.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_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGERESULT_H_
+#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGERESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/imageseg/ImagesegExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Imageseg
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDCommonImageResult : public ServiceResult
+			{
+			public:
+				struct Data
+				{
+					std::string imageUrl;
+				};
+
+
+				SegmentHDCommonImageResult();
+				explicit SegmentHDCommonImageResult(const std::string &payload);
+				~SegmentHDCommonImageResult();
+				Data getData()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				Data data_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGERESULT_H_

+ 48 - 0
imageseg/include/alibabacloud/imageseg/model/SegmentHDSkyRequest.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_IMAGESEG_MODEL_SEGMENTHDSKYREQUEST_H_
+#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/imageseg/ImagesegExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Imageseg
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDSkyRequest : public RpcServiceRequest
+			{
+
+			public:
+				SegmentHDSkyRequest();
+				~SegmentHDSkyRequest();
+
+				std::string getImageURL()const;
+				void setImageURL(const std::string& imageURL);
+
+            private:
+				std::string imageURL_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYREQUEST_H_

+ 55 - 0
imageseg/include/alibabacloud/imageseg/model/SegmentHDSkyResult.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_IMAGESEG_MODEL_SEGMENTHDSKYRESULT_H_
+#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/imageseg/ImagesegExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Imageseg
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDSkyResult : public ServiceResult
+			{
+			public:
+				struct Data
+				{
+					std::string imageURL;
+				};
+
+
+				SegmentHDSkyResult();
+				explicit SegmentHDSkyResult(const std::string &payload);
+				~SegmentHDSkyResult();
+				Data getData()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				Data data_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYRESULT_H_

+ 72 - 0
imageseg/src/ImagesegClient.cc

@@ -519,6 +519,78 @@ ImagesegClient::SegmentHDBodyOutcomeCallable ImagesegClient::segmentHDBodyCallab
 	return task->get_future();
 }
 
+ImagesegClient::SegmentHDCommonImageOutcome ImagesegClient::segmentHDCommonImage(const SegmentHDCommonImageRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return SegmentHDCommonImageOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return SegmentHDCommonImageOutcome(SegmentHDCommonImageResult(outcome.result()));
+	else
+		return SegmentHDCommonImageOutcome(outcome.error());
+}
+
+void ImagesegClient::segmentHDCommonImageAsync(const SegmentHDCommonImageRequest& request, const SegmentHDCommonImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, segmentHDCommonImage(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+ImagesegClient::SegmentHDCommonImageOutcomeCallable ImagesegClient::segmentHDCommonImageCallable(const SegmentHDCommonImageRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<SegmentHDCommonImageOutcome()>>(
+			[this, request]()
+			{
+			return this->segmentHDCommonImage(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
+ImagesegClient::SegmentHDSkyOutcome ImagesegClient::segmentHDSky(const SegmentHDSkyRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return SegmentHDSkyOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return SegmentHDSkyOutcome(SegmentHDSkyResult(outcome.result()));
+	else
+		return SegmentHDSkyOutcome(outcome.error());
+}
+
+void ImagesegClient::segmentHDSkyAsync(const SegmentHDSkyRequest& request, const SegmentHDSkyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, segmentHDSky(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+ImagesegClient::SegmentHDSkyOutcomeCallable ImagesegClient::segmentHDSkyCallable(const SegmentHDSkyRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<SegmentHDSkyOutcome()>>(
+			[this, request]()
+			{
+			return this->segmentHDSky(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 ImagesegClient::SegmentHairOutcome ImagesegClient::segmentHair(const SegmentHairRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 51 - 0
imageseg/src/model/SegmentHDCommonImageRequest.cc

@@ -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.
+ */
+
+#include <alibabacloud/imageseg/model/SegmentHDCommonImageRequest.h>
+
+using AlibabaCloud::Imageseg::Model::SegmentHDCommonImageRequest;
+
+SegmentHDCommonImageRequest::SegmentHDCommonImageRequest() :
+	RpcServiceRequest("imageseg", "2019-12-30", "SegmentHDCommonImage")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+SegmentHDCommonImageRequest::~SegmentHDCommonImageRequest()
+{}
+
+bool SegmentHDCommonImageRequest::getAsync()const
+{
+	return async_;
+}
+
+void SegmentHDCommonImageRequest::setAsync(bool async)
+{
+	async_ = async;
+	setBodyParameter("Async", async ? "true" : "false");
+}
+
+std::string SegmentHDCommonImageRequest::getImageUrl()const
+{
+	return imageUrl_;
+}
+
+void SegmentHDCommonImageRequest::setImageUrl(const std::string& imageUrl)
+{
+	imageUrl_ = imageUrl;
+	setBodyParameter("ImageUrl", imageUrl);
+}
+

+ 52 - 0
imageseg/src/model/SegmentHDCommonImageResult.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 <alibabacloud/imageseg/model/SegmentHDCommonImageResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Imageseg;
+using namespace AlibabaCloud::Imageseg::Model;
+
+SegmentHDCommonImageResult::SegmentHDCommonImageResult() :
+	ServiceResult()
+{}
+
+SegmentHDCommonImageResult::SegmentHDCommonImageResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+SegmentHDCommonImageResult::~SegmentHDCommonImageResult()
+{}
+
+void SegmentHDCommonImageResult::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["ImageUrl"].isNull())
+		data_.imageUrl = dataNode["ImageUrl"].asString();
+
+}
+
+SegmentHDCommonImageResult::Data SegmentHDCommonImageResult::getData()const
+{
+	return data_;
+}
+

+ 40 - 0
imageseg/src/model/SegmentHDSkyRequest.cc

@@ -0,0 +1,40 @@
+/*
+ * 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/imageseg/model/SegmentHDSkyRequest.h>
+
+using AlibabaCloud::Imageseg::Model::SegmentHDSkyRequest;
+
+SegmentHDSkyRequest::SegmentHDSkyRequest() :
+	RpcServiceRequest("imageseg", "2019-12-30", "SegmentHDSky")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+SegmentHDSkyRequest::~SegmentHDSkyRequest()
+{}
+
+std::string SegmentHDSkyRequest::getImageURL()const
+{
+	return imageURL_;
+}
+
+void SegmentHDSkyRequest::setImageURL(const std::string& imageURL)
+{
+	imageURL_ = imageURL;
+	setBodyParameter("ImageURL", imageURL);
+}
+

+ 52 - 0
imageseg/src/model/SegmentHDSkyResult.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 <alibabacloud/imageseg/model/SegmentHDSkyResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Imageseg;
+using namespace AlibabaCloud::Imageseg::Model;
+
+SegmentHDSkyResult::SegmentHDSkyResult() :
+	ServiceResult()
+{}
+
+SegmentHDSkyResult::SegmentHDSkyResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+SegmentHDSkyResult::~SegmentHDSkyResult()
+{}
+
+void SegmentHDSkyResult::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["ImageURL"].isNull())
+		data_.imageURL = dataNode["ImageURL"].asString();
+
+}
+
+SegmentHDSkyResult::Data SegmentHDSkyResult::getData()const
+{
+	return data_;
+}
+