Release RetouchBody.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2021-08-24 Version: 1.36.859
|
||||
- Release RetouchBody.
|
||||
|
||||
2021-08-20 Version: 1.36.858
|
||||
- Update Dyvmsapi SDK.
|
||||
- Add GetCallInfo.
|
||||
|
||||
@@ -133,6 +133,8 @@ set(facebody_public_header_model
|
||||
include/alibabacloud/facebody/model/RecognizeHandGestureResult.h
|
||||
include/alibabacloud/facebody/model/RecognizePublicFaceRequest.h
|
||||
include/alibabacloud/facebody/model/RecognizePublicFaceResult.h
|
||||
include/alibabacloud/facebody/model/RetouchBodyRequest.h
|
||||
include/alibabacloud/facebody/model/RetouchBodyResult.h
|
||||
include/alibabacloud/facebody/model/SearchBodyTraceRequest.h
|
||||
include/alibabacloud/facebody/model/SearchBodyTraceResult.h
|
||||
include/alibabacloud/facebody/model/SearchFaceRequest.h
|
||||
@@ -258,6 +260,8 @@ set(facebody_src
|
||||
src/model/RecognizeHandGestureResult.cc
|
||||
src/model/RecognizePublicFaceRequest.cc
|
||||
src/model/RecognizePublicFaceResult.cc
|
||||
src/model/RetouchBodyRequest.cc
|
||||
src/model/RetouchBodyResult.cc
|
||||
src/model/SearchBodyTraceRequest.cc
|
||||
src/model/SearchBodyTraceResult.cc
|
||||
src/model/SearchFaceRequest.cc
|
||||
|
||||
@@ -134,6 +134,8 @@
|
||||
#include "model/RecognizeHandGestureResult.h"
|
||||
#include "model/RecognizePublicFaceRequest.h"
|
||||
#include "model/RecognizePublicFaceResult.h"
|
||||
#include "model/RetouchBodyRequest.h"
|
||||
#include "model/RetouchBodyResult.h"
|
||||
#include "model/SearchBodyTraceRequest.h"
|
||||
#include "model/SearchBodyTraceResult.h"
|
||||
#include "model/SearchFaceRequest.h"
|
||||
@@ -321,6 +323,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::RecognizePublicFaceResult> RecognizePublicFaceOutcome;
|
||||
typedef std::future<RecognizePublicFaceOutcome> RecognizePublicFaceOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::RecognizePublicFaceRequest&, const RecognizePublicFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizePublicFaceAsyncHandler;
|
||||
typedef Outcome<Error, Model::RetouchBodyResult> RetouchBodyOutcome;
|
||||
typedef std::future<RetouchBodyOutcome> RetouchBodyOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::RetouchBodyRequest&, const RetouchBodyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RetouchBodyAsyncHandler;
|
||||
typedef Outcome<Error, Model::SearchBodyTraceResult> SearchBodyTraceOutcome;
|
||||
typedef std::future<SearchBodyTraceOutcome> SearchBodyTraceOutcomeCallable;
|
||||
typedef std::function<void(const FacebodyClient*, const Model::SearchBodyTraceRequest&, const SearchBodyTraceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchBodyTraceAsyncHandler;
|
||||
@@ -509,6 +514,9 @@ namespace AlibabaCloud
|
||||
RecognizePublicFaceOutcome recognizePublicFace(const Model::RecognizePublicFaceRequest &request)const;
|
||||
void recognizePublicFaceAsync(const Model::RecognizePublicFaceRequest& request, const RecognizePublicFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizePublicFaceOutcomeCallable recognizePublicFaceCallable(const Model::RecognizePublicFaceRequest& request) const;
|
||||
RetouchBodyOutcome retouchBody(const Model::RetouchBodyRequest &request)const;
|
||||
void retouchBodyAsync(const Model::RetouchBodyRequest& request, const RetouchBodyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RetouchBodyOutcomeCallable retouchBodyCallable(const Model::RetouchBodyRequest& request) const;
|
||||
SearchBodyTraceOutcome searchBodyTrace(const Model::SearchBodyTraceRequest &request)const;
|
||||
void searchBodyTraceAsync(const Model::SearchBodyTraceRequest& request, const SearchBodyTraceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SearchBodyTraceOutcomeCallable searchBodyTraceCallable(const Model::SearchBodyTraceRequest& request) const;
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_FACEBODY_MODEL_RETOUCHBODYREQUEST_H_
|
||||
#define ALIBABACLOUD_FACEBODY_MODEL_RETOUCHBODYREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/facebody/FacebodyExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Facebody
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_FACEBODY_EXPORT RetouchBodyRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RetouchBodyRequest();
|
||||
~RetouchBodyRequest();
|
||||
|
||||
float getLengthenDegree()const;
|
||||
void setLengthenDegree(float lengthenDegree);
|
||||
float getSlimDegree()const;
|
||||
void setSlimDegree(float slimDegree);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
float lengthenDegree_;
|
||||
float slimDegree_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_FACEBODY_MODEL_RETOUCHBODYREQUEST_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_FACEBODY_MODEL_RETOUCHBODYRESULT_H_
|
||||
#define ALIBABACLOUD_FACEBODY_MODEL_RETOUCHBODYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/facebody/FacebodyExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Facebody
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_FACEBODY_EXPORT RetouchBodyResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string imageURL;
|
||||
};
|
||||
|
||||
|
||||
RetouchBodyResult();
|
||||
explicit RetouchBodyResult(const std::string &payload);
|
||||
~RetouchBodyResult();
|
||||
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_FACEBODY_MODEL_RETOUCHBODYRESULT_H_
|
||||
@@ -2067,6 +2067,42 @@ FacebodyClient::RecognizePublicFaceOutcomeCallable FacebodyClient::recognizePubl
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::RetouchBodyOutcome FacebodyClient::retouchBody(const RetouchBodyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RetouchBodyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RetouchBodyOutcome(RetouchBodyResult(outcome.result()));
|
||||
else
|
||||
return RetouchBodyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void FacebodyClient::retouchBodyAsync(const RetouchBodyRequest& request, const RetouchBodyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, retouchBody(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
FacebodyClient::RetouchBodyOutcomeCallable FacebodyClient::retouchBodyCallable(const RetouchBodyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RetouchBodyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->retouchBody(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::SearchBodyTraceOutcome FacebodyClient::searchBodyTrace(const SearchBodyTraceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
62
facebody/src/model/RetouchBodyRequest.cc
Normal file
62
facebody/src/model/RetouchBodyRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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/facebody/model/RetouchBodyRequest.h>
|
||||
|
||||
using AlibabaCloud::Facebody::Model::RetouchBodyRequest;
|
||||
|
||||
RetouchBodyRequest::RetouchBodyRequest() :
|
||||
RpcServiceRequest("facebody", "2019-12-30", "RetouchBody")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RetouchBodyRequest::~RetouchBodyRequest()
|
||||
{}
|
||||
|
||||
float RetouchBodyRequest::getLengthenDegree()const
|
||||
{
|
||||
return lengthenDegree_;
|
||||
}
|
||||
|
||||
void RetouchBodyRequest::setLengthenDegree(float lengthenDegree)
|
||||
{
|
||||
lengthenDegree_ = lengthenDegree;
|
||||
setBodyParameter("LengthenDegree", std::to_string(lengthenDegree));
|
||||
}
|
||||
|
||||
float RetouchBodyRequest::getSlimDegree()const
|
||||
{
|
||||
return slimDegree_;
|
||||
}
|
||||
|
||||
void RetouchBodyRequest::setSlimDegree(float slimDegree)
|
||||
{
|
||||
slimDegree_ = slimDegree;
|
||||
setBodyParameter("SlimDegree", std::to_string(slimDegree));
|
||||
}
|
||||
|
||||
std::string RetouchBodyRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RetouchBodyRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
66
facebody/src/model/RetouchBodyResult.cc
Normal file
66
facebody/src/model/RetouchBodyResult.cc
Normal file
@@ -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/facebody/model/RetouchBodyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Facebody;
|
||||
using namespace AlibabaCloud::Facebody::Model;
|
||||
|
||||
RetouchBodyResult::RetouchBodyResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RetouchBodyResult::RetouchBodyResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RetouchBodyResult::~RetouchBodyResult()
|
||||
{}
|
||||
|
||||
void RetouchBodyResult::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();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string RetouchBodyResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
RetouchBodyResult::Data RetouchBodyResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string RetouchBodyResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user