10 #ifndef BPPPOSITIONINDICATOR_HPP 11 #define BPPPOSITIONINDICATOR_HPP 14 #include <boost/exception/info.hpp> 43 typedef boost::error_info<struct Info_IndicatorMinimumSize, std::uint16_t>
49 typedef boost::error_info<struct Info_IndicatorRange, std::uint16_t>
95 std::uint16_t minSize = 4;
107 int position(
int pos,
int len)
const;
133 std::uint16_t minMarkerSize,
134 bool backgroundState =
false 135 ) : minSize(minMarkerSize), bstate(backgroundState) { }
153 std::uint16_t minMarkerSize = 4,
154 bool backgroundState =
false 197 void minMarkerSize(std::uint16_t size);
243 void range(std::uint16_t r);
263 return idim.
w > idim.
h;
269 return idim.
h >= idim.
w;
293 void render(
BppImage *dest,
int start,
int end = 0);
317 render(dest.get(), start, end);
323 #endif // #ifndef BPPPOSITIONINDICATOR_HPP ImageDimensions idim
The size of the indicator.
ImageLocation ipos
The location to render the indicator.
void backgroundState(bool s)
Changes the pixel state used for the background of the indicator.
BppPositionIndicator(std::uint16_t minMarkerSize, bool backgroundState=false)
Makes a new indicator with its position and dimensions left uninitialized.
Stores a location within an image.
void render(const BppImageSptr &dest, int start, int end=0)
Renders the indicator with the marker showing the given position.
void maxPosition(std::uint16_t p)
Returns the maximum position that will be represented by the indicator.
bool markerState() const
Returns the pixel state used for the position marker of the indicator.
Stores the dimensions of an image.
boost::error_info< struct Info_IndicatorMinimumSize, std::uint16_t > PositionMarkMinimumSize
Error attribute with the length of the position mark in pixels.
std::shared_ptr< BppImage > BppImageSptr
const ImageDimensions & dimensions() const
Returns the dimensions (size) of the rendered indicator.
bool backgroundState() const
Returns the pixel state used for the background of the indicator.
The base class for errors from the BppPositionIndicator.
An attempt was made to set the range to zero.
boost::error_info< struct Info_IndicatorRange, std::uint16_t > IndicatorRange
Error attribute with the range of positions for a position indicator.
bool horizontal() const
True when the indicator's marker will move horizontally.
void position(const ImageLocation &pos)
Changes the upper left position where the indictor will be drawn.
std::uint16_t maxPosition() const
Returns the maximum position that will be represented by the indicator.
An attempt was made to set the dimensions to a size that is too small to fit the position mark with e...
void markerState(bool s)
Changes the pixel state used for the position marker of the indicator.
An attempt was made to set a minimum marker size that is less than one, or that is too large to fit w...
std::uint16_t minMarkerSize() const
Returns the minimum size of the position marker in pixels.
std::uint16_t range() const
Returns the range of positions that will be represented by the indicator.
bool vertical() const
True when the indicator's marker will move vertically.
General graphics related code.
std::uint16_t rng
The range of position values that may be used.
const ImageLocation & position() const
Returns the upper left position where the indictor will be drawn.
An image that uses a single bit to represent the state of each pixel; a black or white picture...
A generalized position indicator that can be used to render a simple scroll bar, progress bar...