30 #ifndef PT_GFX_IMAGEFORMAT_H
31 #define PT_GFX_IMAGEFORMAT_H
33 #include <Pt/Gfx/Api.h>
34 #include <Pt/Gfx/Color.h>
35 #include <Pt/Gfx/Point.h>
36 #include <Pt/Gfx/Rect.h>
37 #include <Pt/Gfx/CompositionMode.h>
53 : _pixelStride(pixelStride)
68 return _pixelStride == a._pixelStride;
71 bool operator!=(
const ImageFormat& a)
const
73 return _pixelStride != a._pixelStride;
76 PT_GFX_API
static const ImageFormat& rgb16();
78 PT_GFX_API
static const ImageFormat& rgb32();
80 PT_GFX_API
static const ImageFormat& argb32();
86 CompositionMode mode)
const
87 { onSetPixel(to, from, mode); }
92 CompositionMode mode)
const
93 { onSetPixel(to, from, mode); }
98 CompositionMode mode)
const
99 { onSetPixel(to, c, mode); }
104 CompositionMode mode,
Pt::uint8_t blendingAlpha)
const
105 { onSetPixel(to, from, mode, blendingAlpha); }
110 CompositionMode mode,
Pt::uint8_t blendingAlpha)
const
111 { onSetPixel(to, from, mode, blendingAlpha); }
116 CompositionMode mode,
Pt::uint8_t blendingAlpha)
const
117 { onSetPixel(to, c, mode, blendingAlpha); }
122 CompositionMode mode)
const
123 { onSetPixels(to, from, length, mode); }
128 CompositionMode mode)
const
129 { onSetPixels(to, from, length, mode); }
134 CompositionMode mode)
const
135 { onSetPixels(to, c, length, mode); }
140 {
return onGetColor(pixel); }
145 {
return onGetColor(pixel); }
150 CompositionMode mode)
const
151 { onCopy(dst, src, length, mode); }
156 CompositionMode mode)
const
157 { onCopy(dst, src, length, mode); }
162 const ImageView& from,
const Rect& fromRect,
163 CompositionMode mode)
const;
168 {
return onImageSize(size, padding); }
171 virtual void onSetPixel(
Pixel& to,
const Pixel& from,
172 CompositionMode mode)
const = 0;
175 CompositionMode mode)
const = 0;
177 virtual void onSetPixel(
Pixel& pixel,
const Color& c,
178 CompositionMode mode)
const = 0;
180 virtual void onSetPixel(
Pixel& to,
const Pixel& from,
181 CompositionMode mode,
Pt::uint8_t blendingAlpha)
const = 0;
184 CompositionMode mode,
Pt::uint8_t blendingAlpha)
const = 0;
186 virtual void onSetPixel(
Pixel& pixel,
const Color& c,
187 CompositionMode mode,
Pt::uint8_t blendingAlpha)
const = 0;
189 virtual void onSetPixels(
Pixel& to,
const Pixel& from,
size_t length,
190 CompositionMode mode)
const = 0;
192 virtual void onSetPixels(
Pixel& to,
const ConstPixel& from,
size_t length,
193 CompositionMode mode)
const = 0;
195 virtual void onSetPixels(
Pixel& pixel,
const Color& c,
size_t length,
196 CompositionMode mode)
const = 0;
198 virtual Color onGetColor(
const Pixel& pixel)
const = 0;
200 virtual Color onGetColor(
const ConstPixel& pixel)
const = 0;
202 virtual void onCopy(
Pixel& dst,
const Pixel& src,
size_t length,
203 CompositionMode mode)
const = 0;
206 CompositionMode mode)
const = 0;
209 const ImageView& from,
const Rect& fromRect,
210 CompositionMode mode)
const = 0;
212 virtual std::size_t onImageSize(
const Size& size, Pt::ssize_t padding)
const = 0;
215 std::size_t _pixelStride;
Point with X ynd X coordinates.
Definition: Point.h:45
View on image data.
Definition: ImageView.h:192
Pixel in an image.
Definition: ImageView.h:48
Const pixel in an image.
Definition: ImageView.h:135
uint_type uint8_t
Unsigned 8-bit integer type.
Definition: Types.h:18