19 std::uint16_t minMarkSize,
21 ) : ipos(indicatorPos), idim(indicatorDim), bstate(backgroundState)
24 if (indicatorDim.
empty() || ((indicatorDim.
h < 3) && (indicatorDim.
w < 3))) {
80 return pos * (len - 2) /
rng + 1;
110 }
else if (ep == len) {
116 start = end = (start + end) / 2;
ImageDimensions idim
The size of the indicator.
ImageLocation ipos
The location to render the indicator.
boost::error_info< struct Info_ImageDimensions, ImageDimensions > ImageErrorDimensions
Image dimensions relevant to the error.
Stores a location within an image.
std::int16_t y
Vertical coordinate.
std::int16_t x
Horizontal coordinate.
constexpr bool empty() const
True if the dimensions indicate zero area.
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.
const ImageDimensions & dimensions() const
Returns the dimensions (size) of the rendered indicator.
BppPositionIndicator()=default
Makes a new indicator with its position, dimensions, and range left uninitialized.
An attempt was made to set the range to zero.
void drawBox(ImageLocation ul, ImageDimensions id, Operation op=OpSet)
Draws a box into this image.
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 swapAxes()
Swaps the dimensions's axes.
bool bstate
The pixel state used for the background, the area not covered by the indicator mark/slider thingy...
void render(BppImage *dest, int start, int end=0)
Renders the indicator with the marker showing the given position.
An attempt was made to set the dimensions to a size that is too small to fit the position mark with e...
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 minSize
The minimum length of the position marker.
std::uint16_t rng
The range of position values that may be used.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
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...
void swapAxes()
Swaps the location's axes.