1 /*
2  * Copyright (C) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef MOCK_ABS_IMAGE_DECODER_H
17 #define MOCK_ABS_IMAGE_DECODER_H
18 
19 #include "abs_image_decoder.h"
20 
21 namespace OHOS {
22 namespace ImagePlugin {
23 using namespace Media;
24 
25 class MockAbsImageDecoder : public AbsImageDecoder {
26 public:
27     MockAbsImageDecoder() = default;
~MockAbsImageDecoder()28     ~MockAbsImageDecoder() {}
29 
SetSource(InputDataStream & sourceStream)30     void SetSource(InputDataStream &sourceStream) {}
31 
Reset()32     void Reset() {}
33 
SetDecodeOptions(uint32_t index,const PixelDecodeOptions & opts,PlImageInfo & info)34     uint32_t SetDecodeOptions(uint32_t index, const PixelDecodeOptions &opts, PlImageInfo &info)
35     {
36         return Media::SUCCESS;
37     }
38 
Decode(uint32_t index,DecodeContext & context)39     uint32_t Decode(uint32_t index, DecodeContext &context)
40     {
41         return Media::SUCCESS;
42     }
43 
PromoteIncrementalDecode(uint32_t index,ProgDecodeContext & context)44     uint32_t PromoteIncrementalDecode(uint32_t index, ProgDecodeContext &context)
45     {
46         return returnValue_;
47     }
48 
GetImageSize(uint32_t index,Size & size)49     uint32_t GetImageSize(uint32_t index, Size &size)
50     {
51         return Media::SUCCESS;
52     }
53 
54 private:
55     uint32_t returnValue_;
56 };
57 } // namespace ImagePlugin
58 } // namespace OHOS
59 
60 #endif // MOCK_ABS_IMAGE_DECODER_H