• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2021-2023 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "minddata/dataset/kernels/image/convert_color_op.h"
18 
19 #include "minddata/dataset/core/cv_tensor.h"
20 #include "minddata/dataset/kernels/image/image_utils.h"
21 #include "minddata/dataset/util/random.h"
22 #include "minddata/dataset/util/status.h"
23 
24 namespace mindspore {
25 namespace dataset {
ConvertColorOp(ConvertMode convert_mode)26 ConvertColorOp::ConvertColorOp(ConvertMode convert_mode) : convert_mode_(convert_mode) {}
27 
Compute(const std::shared_ptr<Tensor> & input,std::shared_ptr<Tensor> * output)28 Status ConvertColorOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) {
29   IO_CHECK(input, output);
30   return ConvertColor(input, output, convert_mode_);
31 }
32 }  // namespace dataset
33 }  // namespace mindspore
34