BasicView< FormatT, TraitsT > Class Template Reference

#include <Pt/Gfx/View.h>

Non-owning image region. More...

Inherits ViewBase.

Detailed Description

template<typename FormatT, typename TraitsT>
class Pt::Gfx::BasicView< FormatT, TraitsT >

BasicView refers to a whole image or to a sub-rectangle. It does not copy pixels and it does not own the buffer. The source image or buffer must outlive the view. Width, height, and stride come from ViewBase. The format is the source format, typed or runtime.

Construct from a source image, from a source plus a rectangle, or from a raw pointer with explicit size and padding. The free function view() is the usual way to open a region. Argb32View and ImageView are this template with a concrete or runtime format.

Writing through a pixel bound to the view changes the source image. Copying a view copies the pointer, not the pixels.