Yuv12Format.h
1 /* Copyright (C) 2016 Marc Boris Duerner
2 
3  This library is free software; you can redistribute it and/or
4  modify it under the terms of the GNU Lesser General Public
5  License as published by the Free Software Foundation; either
6  version 2.1 of the License, or (at your option) any later version.
7 
8  As a special exception, you may use this file as part of a free
9  software library without restriction. Specifically, if other files
10  instantiate templates or use macros or inline functions from this
11  file, or you compile this file and link it with other files to
12  produce an executable, this file does not by itself cause the
13  resulting executable to be covered by the GNU General Public
14  License. This exception does not however invalidate any other
15  reasons why the executable file might be covered by the GNU Library
16  General Public License.
17 
18  This library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with this library; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26  02110-1301 USA
27 */
28 
29 #ifndef PT_GFX_YUV12FORMAT_H
30 #define PT_GFX_YUV12FORMAT_H
31 
32 #include <Pt/Gfx/Api.h>
33 #include <Pt/Gfx/ImageFormat.h>
34 
35 namespace Pt {
36 
37 namespace Gfx {
38 
39 class PT_GFX_API Yuv12Format : public ImageFormat
40 {
41  public:
42  Yuv12Format();
43 
44  protected:
45  virtual void onSetPixel(Pixel& to, const Pixel& from,
46  CompositionMode mode) const;
47 
48  virtual void onSetPixel(Pixel& to, const ConstPixel& from,
49  CompositionMode mode) const;
50 
51  virtual void onSetPixel(Pixel& pixel, const Color& c,
52  CompositionMode mode) const;
53 
54  virtual void onSetPixel(Pixel& to, const Pixel& from,
55  CompositionMode mode, Pt::uint8_t blendingAlpha) const;
56 
57  virtual void onSetPixel(Pixel& to, const ConstPixel& from,
58  CompositionMode mode, Pt::uint8_t blendingAlpha) const;
59 
60  virtual void onSetPixel(Pixel& pixel, const Color& c,
61  CompositionMode mode, Pt::uint8_t blendingAlpha) const;
62 
63  virtual void onSetPixels(Pixel& to, const Pixel& from, size_t length,
64  CompositionMode mode) const;
65 
66  virtual void onSetPixels(Pixel& to, const ConstPixel& from, size_t length,
67  CompositionMode mode) const;
68 
69  virtual void onSetPixels(Pixel& pixel, const Color& c, size_t length,
70  CompositionMode mode) const;
71 
72  virtual Color onGetColor(const Pixel& pixel) const;
73 
74  virtual Color onGetColor(const ConstPixel& pixel) const;
75 
76  virtual void onCopy(Pixel& dst, const Pixel& src, size_t length,
77  CompositionMode mode) const;
78 
79  virtual void onCopy(Pixel& dst, const ConstPixel& src, size_t length,
80  CompositionMode mode) const;
81 
82  virtual void onCopy(ImageView& to, const Point& toPos,
83  const ImageView& from, const Rect& fromRect,
84  CompositionMode mode) const;
85 
86  virtual std::size_t onImageSize(const Size& size, Pt::ssize_t padding) const;
87 };
88 
89 } // namespace
90 
91 } // namespace
92 
93 #endif
uint_type uint8_t
Unsigned 8-bit integer type.
Definition: Types.h:18