Release RetouchSkin LiquifyFace.

This commit is contained in:
sdk-team
2021-09-24 07:26:00 +00:00
parent e2b6c81588
commit 53b22dba98
13 changed files with 568 additions and 1 deletions

View File

@@ -1599,6 +1599,42 @@ FacebodyClient::HandPostureOutcomeCallable FacebodyClient::handPostureCallable(c
return task->get_future();
}
FacebodyClient::LiquifyFaceOutcome FacebodyClient::liquifyFace(const LiquifyFaceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return LiquifyFaceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return LiquifyFaceOutcome(LiquifyFaceResult(outcome.result()));
else
return LiquifyFaceOutcome(outcome.error());
}
void FacebodyClient::liquifyFaceAsync(const LiquifyFaceRequest& request, const LiquifyFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, liquifyFace(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::LiquifyFaceOutcomeCallable FacebodyClient::liquifyFaceCallable(const LiquifyFaceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<LiquifyFaceOutcome()>>(
[this, request]()
{
return this->liquifyFace(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::ListBodyDbsOutcome FacebodyClient::listBodyDbs(const ListBodyDbsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2103,6 +2139,42 @@ FacebodyClient::RetouchBodyOutcomeCallable FacebodyClient::retouchBodyCallable(c
return task->get_future();
}
FacebodyClient::RetouchSkinOutcome FacebodyClient::retouchSkin(const RetouchSkinRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RetouchSkinOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RetouchSkinOutcome(RetouchSkinResult(outcome.result()));
else
return RetouchSkinOutcome(outcome.error());
}
void FacebodyClient::retouchSkinAsync(const RetouchSkinRequest& request, const RetouchSkinAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, retouchSkin(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::RetouchSkinOutcomeCallable FacebodyClient::retouchSkinCallable(const RetouchSkinRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RetouchSkinOutcome()>>(
[this, request]()
{
return this->retouchSkin(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::SearchBodyTraceOutcome FacebodyClient::searchBodyTrace(const SearchBodyTraceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -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/facebody/model/LiquifyFaceRequest.h>
using AlibabaCloud::Facebody::Model::LiquifyFaceRequest;
LiquifyFaceRequest::LiquifyFaceRequest() :
RpcServiceRequest("facebody", "2019-12-30", "LiquifyFace")
{
setMethod(HttpRequest::Method::Post);
}
LiquifyFaceRequest::~LiquifyFaceRequest()
{}
float LiquifyFaceRequest::getSlimDegree()const
{
return slimDegree_;
}
void LiquifyFaceRequest::setSlimDegree(float slimDegree)
{
slimDegree_ = slimDegree;
setBodyParameter("SlimDegree", std::to_string(slimDegree));
}
std::string LiquifyFaceRequest::getImageURL()const
{
return imageURL_;
}
void LiquifyFaceRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View 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/LiquifyFaceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
LiquifyFaceResult::LiquifyFaceResult() :
ServiceResult()
{}
LiquifyFaceResult::LiquifyFaceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
LiquifyFaceResult::~LiquifyFaceResult()
{}
void LiquifyFaceResult::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 LiquifyFaceResult::getMessage()const
{
return message_;
}
LiquifyFaceResult::Data LiquifyFaceResult::getData()const
{
return data_;
}
std::string LiquifyFaceResult::getCode()const
{
return code_;
}

View 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/RetouchSkinRequest.h>
using AlibabaCloud::Facebody::Model::RetouchSkinRequest;
RetouchSkinRequest::RetouchSkinRequest() :
RpcServiceRequest("facebody", "2019-12-30", "RetouchSkin")
{
setMethod(HttpRequest::Method::Post);
}
RetouchSkinRequest::~RetouchSkinRequest()
{}
float RetouchSkinRequest::getRetouchDegree()const
{
return retouchDegree_;
}
void RetouchSkinRequest::setRetouchDegree(float retouchDegree)
{
retouchDegree_ = retouchDegree;
setBodyParameter("RetouchDegree", std::to_string(retouchDegree));
}
float RetouchSkinRequest::getWhiteningDegree()const
{
return whiteningDegree_;
}
void RetouchSkinRequest::setWhiteningDegree(float whiteningDegree)
{
whiteningDegree_ = whiteningDegree;
setBodyParameter("WhiteningDegree", std::to_string(whiteningDegree));
}
std::string RetouchSkinRequest::getImageURL()const
{
return imageURL_;
}
void RetouchSkinRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View 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/RetouchSkinResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
RetouchSkinResult::RetouchSkinResult() :
ServiceResult()
{}
RetouchSkinResult::RetouchSkinResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RetouchSkinResult::~RetouchSkinResult()
{}
void RetouchSkinResult::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 RetouchSkinResult::getMessage()const
{
return message_;
}
RetouchSkinResult::Data RetouchSkinResult::getData()const
{
return data_;
}
std::string RetouchSkinResult::getCode()const
{
return code_;
}