29 #ifndef PT_GFX_BASIC_IMAGE_TRAITS_H
30 #define PT_GFX_BASIC_IMAGE_TRAITS_H
32 #include <Pt/Gfx/Api.h>
42 template <
typename FormatT>
45 typedef typename FormatT::Pixel Pixel;
46 typedef typename FormatT::ConstPixel ConstPixel;
48 static std::size_t pixelStride(
const FormatT& format)
50 return format.pixelStride();
53 static std::size_t imageSize(
const FormatT& format, Pt::ssize_t width, Pt::ssize_t height,
56 return format.imageSize(width, height, padding);
59 static std::unique_ptr<FormatT> clone(
const FormatT& format)
61 return std::unique_ptr<FormatT>(
new FormatT(format) );