2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMedia_ColorConverter.h
20 * @brief This is the header file for the FMedia::_ColorConverter.
22 * This header file contains the declarations of the FMedia::_ColorConverter.
25 #ifndef _FMEDIA_INTERNAL_COLORCONVERTER_H_
26 #define _FMEDIA_INTERNAL_COLORCONVERTER_H_
28 #include <FMedia_Ffmpeg.h>
29 #include <FMediaImageTypes.h>
31 namespace Tizen { namespace Media
34 class _OSP_EXPORT_ _ColorConverter
35 : public Tizen::Base::Object
38 _ColorConverter(void);
40 virtual ~_ColorConverter(void);
43 * Initializes this instance of converter
45 * @return An error code
46 * @exception E_SUCCESS The method is successful.
47 * @exception E_INVALID_ARG The arguments to the method are invalid:
48 * All dimensions should be greater than zero.
49 * @exception E_UNSUPPORTED_FORMAT A pixelformat argument is not supported.
50 * @exception E_SYSTEM A system error has occurred.
52 result Construct(MediaPixelFormat srcFormat, int srcWidth, int srcHeight,
53 MediaPixelFormat dstFormat, int dstWidth, int dstHeight,
54 ImageScalingMethod scalingMethod = IMAGE_SCALING_METHOD_FAST_BILINEAR);
58 * convert pixel format
60 * @return An error code
61 * @exception E_SUCCESS The method is successful.
62 * @exception E_SYSTEM A system error has occurred.
64 Tizen::Base::ByteBuffer* ConvertN(const Tizen::Base::ByteBuffer& srcBuf);
67 * convert pixel format
69 * @return An error code
70 * @exception E_SUCCESS The method is successful.
71 * @exception E_SYSTEM A system error has occurred.
73 byte* ConvertN(const byte* pSrcBuf, int srcLength, int& dstLength);
75 * convert pixel format
77 * @return An error code
78 * @exception E_SUCCESS The method is successful.
79 * @exception E_SYSTEM A system error has occurred.
81 result Convert(const byte* srcBuf, int srcLength, byte* dstBuf, int dstLength);
92 MediaPixelFormat __srcFormat;
93 MediaPixelFormat __dstFormat;
94 PixelFormat __ffSrcFormat;
95 PixelFormat __ffDstFormat;
97 struct SwsContext* __pCvtCtxt;
101 }; // class _ColorConverter