\hypertarget{classBitmap}{
\section{Bitmap Class Reference}
\label{classBitmap}\index{Bitmap@{Bitmap}}
}
{\tt \#include $<$Bitmap.h$>$}

\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap::Bitmap\-Colour\_\-s} \hyperlink{classBitmap_w0}{Bitmap\-Colour}
\item 
enum \hyperlink{classBitmap_w6}{Margin} \{ \par
\hyperlink{classBitmap_w6w1}{Left} = 0, 
\hyperlink{classBitmap_w6w2}{Right} = 1, 
\hyperlink{classBitmap_w6w3}{Top} = 2, 
\hyperlink{classBitmap_w6w4}{Bottom} = 3, 
\par
\hyperlink{classBitmap_w6w5}{All}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hyperlink{classBitmap_a0}{Bitmap} (const int width, const int height, const int bpp=1, bool expandable=true, const int maxwidth=-1, const int maxheight=-1)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Create a new bitmap with the given parameters. \item\end{CompactList}\item 
\hyperlink{classBitmap_a1}{$\sim$Bitmap} ()
\item 
void \hyperlink{classBitmap_a2}{paint} (const int x, const int y, const int w, const int h, const \hyperlink{Byte_8h_a1}{Byte} $\ast$b)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Paint a bitmap onto the master bitmap. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a3}{rule} (const int x, const int y, const int w, const int h)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Draws on the master bitmap a block (a `rule' in Te\-X terms) of height h and width w pixels. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a4}{strut} (const int x, const int y, const int l, const int r, const int t, const int b)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Draws a `strut' on the master bitmap. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a5}{write} (const string filename, const string format)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Writes the bitmap out to the specified file. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a6}{freeze} ()
\begin{CompactList}\small\item\em Freeze the bitmap and bounding box. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a7}{crop} ()
\begin{CompactList}\small\item\em Crops the bitmap. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a8}{crop} (\hyperlink{classBitmap_w6}{Margin} spec, int pixels, bool absolute=false)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Specifies a crop. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a9}{blur} ()
\begin{CompactList}\small\item\em Makes a very simple-minded attempt to antialias the bitmap by blurring it. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a10}{clear} ()
\begin{CompactList}\small\item\em Resets the bitmap to its initial state. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a11}{set\-Transparent} (const bool sw)
\begin{CompactList}\small\item\em Sets the current bitmap to be transparent, if possible. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a12}{set\-RGB} (const bool fg, const \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap\-Colour} $\ast$)
\begin{CompactList}\small\item\em Sets the foreground or background colour. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a13}{scale\-Down} (const int factor)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Scales down the bitmap by a numerical factor. \item\end{CompactList}\item 
bool \hyperlink{classBitmap_a14}{empty} () const
\begin{CompactList}\small\item\em Is the bitmap empty? If nothing has (yet) been written to the bitmap, or if everything that was written was out of bounds, then the bitmap is empty. \item\end{CompactList}\item 
bool \hyperlink{classBitmap_a15}{overlaps} () const
\begin{CompactList}\small\item\em Does the bitmap overlap its canvas? This can only be true before a (implicit or explicit) call to \hyperlink{classBitmap_a6}{freeze}, since that normalizes the bounding box variables. \item\end{CompactList}\item 
int $\ast$ \hyperlink{classBitmap_a16}{bounding\-Box} ()
\begin{CompactList}\small\item\em Obtain a bounding box for the current bitmap. \item\end{CompactList}\item 
int \hyperlink{classBitmap_a17}{get\-Width} () const
\begin{CompactList}\small\item\em Returns the total width of the bitmap. \item\end{CompactList}\item 
int \hyperlink{classBitmap_a18}{get\-Height} () const
\begin{CompactList}\small\item\em Returns the total height of the bitmap. \item\end{CompactList}\item 
void \hyperlink{classBitmap_a19}{mark} (const double x, const double y)
\begin{CompactList}\small\item\em Marks a particular spot in the bitmap. \item\end{CompactList}\item 
\hyperlink{classBitmap_1_1BitmapMark}{Bitmap\-Mark} $\ast$ \hyperlink{classBitmap_a20}{get\-Mark} ()
\begin{CompactList}\small\item\em Obtains the mark for this bitmap. \item\end{CompactList}\item 
\hyperlink{classBitmap_1_1const__iterator}{const\_\-iterator} \hyperlink{classBitmap_a21}{begin} ()
\begin{CompactList}\small\item\em Returns the beginning of a sequence of bitmap rows. \item\end{CompactList}\item 
\hyperlink{classBitmap_1_1const__iterator}{const\_\-iterator} \hyperlink{classBitmap_a22}{end} () const
\begin{CompactList}\small\item\em Returns the end of a sequence of bitmap rows. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void \hyperlink{classBitmap_e0}{crop\-Default} (\hyperlink{classBitmap_w6}{Margin} spec, int pixels, bool absolute=false)  throw (Bitmap\-Error)
\begin{CompactList}\small\item\em Specifies a default crop. \item\end{CompactList}\item 
void \hyperlink{classBitmap_e1}{set\-Default\-RGB} (const bool fg, const \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap\-Colour} $\ast$)
\begin{CompactList}\small\item\em Sets the default foreground or background colours. \item\end{CompactList}\item 
\hyperlink{verbosity_8h_a6}{verbosities} \hyperlink{classBitmap_e2}{verbosity} (const \hyperlink{verbosity_8h_a6}{verbosities} level)
\begin{CompactList}\small\item\em Sets the verbosity of the current class. \item\end{CompactList}\item 
void \hyperlink{classBitmap_e3}{log\-Bitmap\-Info} (const char $\ast$prefix)
\begin{CompactList}\small\item\em Sets whether bitmap information is logged. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Attributes}
\begin{CompactItemize}
\item 
\hyperlink{classBitmap_1_1const__iterator}{const\_\-iterator} \hyperlink{classBitmap_o0}{running\-Iterator\_\-}
\end{CompactItemize}
\subsection*{Static Public Attributes}
\begin{CompactItemize}
\item 
\hyperlink{classBitmap_1_1const__iterator}{const\_\-iterator} \hyperlink{classBitmap_s0}{end\-Iterator\_\-}
\end{CompactItemize}


\subsection{Member Typedef Documentation}
\hypertarget{classBitmap_w0}{
\index{Bitmap@{Bitmap}!BitmapColour@{BitmapColour}}
\index{BitmapColour@{BitmapColour}!Bitmap@{Bitmap}}
\subsubsection[BitmapColour]{\setlength{\rightskip}{0pt plus 5cm}typedef struct \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap::Bitmap\-Colour\_\-s}  \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap::Bitmap\-Colour}}}
\label{classBitmap_w0}




\subsection{Member Enumeration Documentation}
\hypertarget{classBitmap_w6}{
\index{Bitmap@{Bitmap}!Margin@{Margin}}
\index{Margin@{Margin}!Bitmap@{Bitmap}}
\subsubsection[Margin]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{classBitmap_w6}{Bitmap::Margin}}}
\label{classBitmap_w6}


\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{Left@{Left}!Bitmap@{Bitmap}}\index{Bitmap@{Bitmap}!Left@{Left}}\item[{\em 
\hypertarget{classBitmap_w6w1}{
Left}
\label{classBitmap_w6w1}
}]\index{Right@{Right}!Bitmap@{Bitmap}}\index{Bitmap@{Bitmap}!Right@{Right}}\item[{\em 
\hypertarget{classBitmap_w6w2}{
Right}
\label{classBitmap_w6w2}
}]\index{Top@{Top}!Bitmap@{Bitmap}}\index{Bitmap@{Bitmap}!Top@{Top}}\item[{\em 
\hypertarget{classBitmap_w6w3}{
Top}
\label{classBitmap_w6w3}
}]\index{Bottom@{Bottom}!Bitmap@{Bitmap}}\index{Bitmap@{Bitmap}!Bottom@{Bottom}}\item[{\em 
\hypertarget{classBitmap_w6w4}{
Bottom}
\label{classBitmap_w6w4}
}]\index{All@{All}!Bitmap@{Bitmap}}\index{Bitmap@{Bitmap}!All@{All}}\item[{\em 
\hypertarget{classBitmap_w6w5}{
All}
\label{classBitmap_w6w5}
}]\end{description}
\end{Desc}



\subsection{Constructor \& Destructor Documentation}
\hypertarget{classBitmap_a0}{
\index{Bitmap@{Bitmap}!Bitmap@{Bitmap}}
\index{Bitmap@{Bitmap}!Bitmap@{Bitmap}}
\subsubsection[Bitmap]{\setlength{\rightskip}{0pt plus 5cm}Bitmap::Bitmap (const int {\em w}, const int {\em h}, const int {\em bpp} = {\tt 1}, bool {\em expandable} = {\tt true}, const int {\em maxwidth} = {\tt -1}, const int {\em maxheight} = {\tt -1})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a0}


Create a new bitmap with the given parameters. 

Coordinates on the bitmap run from 0 to W-1, and 0 to H-1, with point (0,0) in the top-left corner, the {\em x\/}-axis increasing to the right, and the {\em y\/}-axis increasing downwards.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em w}]the width of the bitmap, in pixels\item[{\em h}]the height of the bitmap, in pixels\item[{\em bpp}]the number of bits-per-pixel (default is 1)\item[{\em expandable}]if true (the default), the bitmap is expandable; if false, the bitmap is fixed at the specified size\item[{\em maxwidth}]if {\tt expandable} is true, and {\tt maxwidth} is greater than or equal to {\tt w}, this is the maximum horizontal size the bitmap will expand to; if it is less than {\tt w} (which includes negative, the default), the maximum width is set to a default multiplier of the width {\tt w}\item[{\em maxheight}]if {\tt expandable} is true, and {\tt maxheight} is greater than or equal to {\tt h}, this is the maximum vertical size the bitmap will expand to; if {\tt maxheight} is less than {\tt h} (which includes negative, the default), the maximum vertical size will be such that {\tt maxheight/h==maxwidth/w}\end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if the arguments are inconsistent \end{description}
\end{Desc}
\hypertarget{classBitmap_a1}{
\index{Bitmap@{Bitmap}!~Bitmap@{$\sim$Bitmap}}
\index{~Bitmap@{$\sim$Bitmap}!Bitmap@{Bitmap}}
\subsubsection[$\sim$Bitmap]{\setlength{\rightskip}{0pt plus 5cm}Bitmap::$\sim$\hyperlink{classBitmap}{Bitmap} ()}}
\label{classBitmap_a1}




\subsection{Member Function Documentation}
\hypertarget{classBitmap_a21}{
\index{Bitmap@{Bitmap}!begin@{begin}}
\index{begin@{begin}!Bitmap@{Bitmap}}
\subsubsection[begin]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classBitmap_1_1const__iterator}{Bitmap::const\_\-iterator} Bitmap::begin ()}}
\label{classBitmap_a21}


Returns the beginning of a sequence of bitmap rows. 

Freezes the bitmap as a side-effect. \hypertarget{classBitmap_a9}{
\index{Bitmap@{Bitmap}!blur@{blur}}
\index{blur@{blur}!Bitmap@{Bitmap}}
\subsubsection[blur]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::blur ()}}
\label{classBitmap_a9}


Makes a very simple-minded attempt to antialias the bitmap by blurring it. 

Opening the DVI file with a magnification setting, and then calling \hyperlink{classBitmap_a13}{scale\-Down} will generally produce a much better effect.

Freezes the bitmap as a side-effect. \hypertarget{classBitmap_a16}{
\index{Bitmap@{Bitmap}!boundingBox@{boundingBox}}
\index{boundingBox@{boundingBox}!Bitmap@{Bitmap}}
\subsubsection[boundingBox]{\setlength{\rightskip}{0pt plus 5cm}int $\ast$ Bitmap::bounding\-Box ()}}
\label{classBitmap_a16}


Obtain a bounding box for the current bitmap. 

This returns a four-element array consisting of, in order, \begin{itemize}
\item \mbox{[}0\mbox{]} = the coordinate of the leftmost blackened pixel, \item \mbox{[}1\mbox{]} = the coordinate of the topmost blackened pixel, \item \mbox{[}2\mbox{]} = one more than the coordinate of the rightmost blackened pixel, and \item \mbox{[}3\mbox{]} = one more than the coordinate of the bottommost blackened pixel. \end{itemize}
Thus {\tt \mbox{[}2\mbox{]}-\mbox{[}0\mbox{]}} is the number of pixels which the blackened area occupies. Note that `blackened pixels' here includes those notionally blackened by the {\tt \hyperlink{classBitmap_a4}{strut()}} method. If the bitmap has been cropped, this bounding box reflects the crop margins.

The returned array occupies static storage, and is always current as of the last time this method was called.

The methods {\tt \hyperlink{classBitmap_a17}{get\-Width()}} and {\tt \hyperlink{classBitmap_a18}{get\-Height()}} return the size of the bitmap irrespective of the bounding box and any cropping.

It is possible for the bounding-box to be bigger than the bitmap, if rules or bitmaps have been painted on the bitmap in such a way that they overlap the boundaries of the bitmap, {\em and\/} if it is called before an explicit or implicit call to {\tt \hyperlink{classBitmap_a6}{freeze()}}. This can also be detected by a call to {\tt \hyperlink{classBitmap_a15}{overlaps()}} before any call to {\tt \hyperlink{classBitmap_a6}{freeze()}}. It is never bigger than the bitmap after the bitmap is frozen.

Note that the order of the four dimensions is {\em not\/} that of the Postscript Bounding\-Box, which is (llx, lly, urx, ury) rather than here, effectively, (ulx, uly, lrx, lry). This is because the position of the upper-left corner (ulx, uly) is the natural Te\-X reference point.

\begin{Desc}
\item[Returns:]the position of the bitmap bounding-box, in the order (ulx, uly, lrx, lry) \end{Desc}
\hypertarget{classBitmap_a10}{
\index{Bitmap@{Bitmap}!clear@{clear}}
\index{clear@{clear}!Bitmap@{Bitmap}}
\subsubsection[clear]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::clear ()}}
\label{classBitmap_a10}


Resets the bitmap to its initial state. 

This clears the bitmap by setting all the pixels to white, unfreezing it, and resetting the bounding box and crops to their initial states. It does not deallocate any memory, however, so if the bitmap has expanded in the past, the reset bitmap is the same size.

It does not reset the transparency flag or adjust the colour setting, or reset the pixel depth. This latter behaviour {\em may\/} change in future. \hypertarget{classBitmap_a8}{
\index{Bitmap@{Bitmap}!crop@{crop}}
\index{crop@{crop}!Bitmap@{Bitmap}}
\subsubsection[crop]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::crop (\hyperlink{classBitmap_w6}{Margin} {\em spec}, int {\em pixels}, bool {\em absolute} = {\tt false})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a8}


Specifies a crop. 

If the {\tt absolute} flag is true, then set up a crop for the margin specified in {\tt spec}: for the left and right margins, the crop in {\tt pixels} is a distance from the {\em left\/} margin; for the top and bottom crops, it is from the {\em top\/} margin. If the {\tt absolute} flag is false, then the distance in the {\tt pixels} parameter is the distance `outward' of the eventual bounding-box, or at the edge of the bitmap, whichever comes first.

Since the implication of this is that a call \small\begin{alltt}
   .crop(All, x, true);
 \end{alltt}\normalsize 
 would set the crop box to be zero size, this combination is forbidden.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em spec}]the margin the crop is being specified for \item[{\em pixels}]the size of the margin, or the position when {\tt absolute} is true \item[{\em absolute}]if true, then the margin specified is an absolute position relative to the left or top margin as appropriate; if false, then it is relative to the eventual size and position of the bounding box \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if {\tt spec=All} when {\tt absolute} is true \end{description}
\end{Desc}
\hypertarget{classBitmap_a7}{
\index{Bitmap@{Bitmap}!crop@{crop}}
\index{crop@{crop}!Bitmap@{Bitmap}}
\subsubsection[crop]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::crop ()}}
\label{classBitmap_a7}


Crops the bitmap. 

This applies the cropping specified in methods \hyperlink{classBitmap_a8}{crop(Margin,int,bool)} and \hyperlink{classBitmap_e0}{crop\-Default}.

Freezes the bitmap as a side-effect. \hypertarget{classBitmap_e0}{
\index{Bitmap@{Bitmap}!cropDefault@{cropDefault}}
\index{cropDefault@{cropDefault}!Bitmap@{Bitmap}}
\subsubsection[cropDefault]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::crop\-Default (\hyperlink{classBitmap_w6}{Margin} {\em spec}, int {\em pixels}, bool {\em absolute} = {\tt false})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{classBitmap_e0}


Specifies a default crop. 

This is exactly the same as \hyperlink{classBitmap_a8}{crop(Margin,int,bool)}, except that it specifies this for all the bitmaps subsequently created by this class.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em spec}]the margin the crop is being specified for \item[{\em pixels}]the size of the margin, or the position when {\tt absolute} is true \item[{\em absolute}]if true, then the margin specified is an absolute position relative to the left or top margin as appropriate; if false, then it is relative to the eventual size and position of the bounding box \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if {\tt spec=All} when {\tt absolute} is true \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{classBitmap_a8}{crop(Margin,int,bool)} \end{Desc}
\hypertarget{classBitmap_a14}{
\index{Bitmap@{Bitmap}!empty@{empty}}
\index{empty@{empty}!Bitmap@{Bitmap}}
\subsubsection[empty]{\setlength{\rightskip}{0pt plus 5cm}bool Bitmap::empty () const\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classBitmap_a14}


Is the bitmap empty? If nothing has (yet) been written to the bitmap, or if everything that was written was out of bounds, then the bitmap is empty. 

\begin{Desc}
\item[Returns:]true if the bitmap is empty \end{Desc}
\hypertarget{classBitmap_a22}{
\index{Bitmap@{Bitmap}!end@{end}}
\index{end@{end}!Bitmap@{Bitmap}}
\subsubsection[end]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classBitmap_1_1const__iterator}{Bitmap::const\_\-iterator} Bitmap::end () const}}
\label{classBitmap_a22}


Returns the end of a sequence of bitmap rows. 

\hypertarget{classBitmap_a6}{
\index{Bitmap@{Bitmap}!freeze@{freeze}}
\index{freeze@{freeze}!Bitmap@{Bitmap}}
\subsubsection[freeze]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::freeze ()}}
\label{classBitmap_a6}


Freeze the bitmap and bounding box. 

This prevents any further changes to the bitmap by the methods {\tt \hyperlink{classBitmap_a2}{paint()}}, {\tt \hyperlink{classBitmap_a3}{rule()}} and {\tt \hyperlink{classBitmap_a4}{strut()}}. Other methods in this class such as {\tt \hyperlink{classBitmap_a7}{crop()}} and {\tt \hyperlink{classBitmap_a9}{blur()}} call this method implicitly.

If method {\tt \hyperlink{classBitmap_a16}{bounding\-Box()}} is called before this method, it is possible for it to report a size larger than the bitmap, if rules or bitmaps have been placed so that they overlap the bitmap's boundaries. The call to {\tt freeze} normalises the bounding box so that this is no longer the case. \hypertarget{classBitmap_a18}{
\index{Bitmap@{Bitmap}!getHeight@{getHeight}}
\index{getHeight@{getHeight}!Bitmap@{Bitmap}}
\subsubsection[getHeight]{\setlength{\rightskip}{0pt plus 5cm}int Bitmap::get\-Height () const\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classBitmap_a18}


Returns the total height of the bitmap. 

This may not the the initial size of the bitmap, if it has expanded since then. \begin{Desc}
\item[Returns:]height of bitmap \end{Desc}
\hypertarget{classBitmap_a20}{
\index{Bitmap@{Bitmap}!getMark@{getMark}}
\index{getMark@{getMark}!Bitmap@{Bitmap}}
\subsubsection[getMark]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classBitmap_1_1BitmapMark}{Bitmap::Bitmap\-Mark} $\ast$ Bitmap::get\-Mark ()}}
\label{classBitmap_a20}


Obtains the mark for this bitmap. 

\begin{Desc}
\item[Returns:]a pointer to the mark information, or 0 if no mark has been registered. This points to static storage, which should not be deleted, and which may be overwritten. \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{classBitmap_a19}{mark} \end{Desc}
\hypertarget{classBitmap_a17}{
\index{Bitmap@{Bitmap}!getWidth@{getWidth}}
\index{getWidth@{getWidth}!Bitmap@{Bitmap}}
\subsubsection[getWidth]{\setlength{\rightskip}{0pt plus 5cm}int Bitmap::get\-Width () const\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classBitmap_a17}


Returns the total width of the bitmap. 

This may not the the initial size of the bitmap, if it has expanded since then. \begin{Desc}
\item[Returns:]width of bitmap \end{Desc}
\hypertarget{classBitmap_e3}{
\index{Bitmap@{Bitmap}!logBitmapInfo@{logBitmapInfo}}
\index{logBitmapInfo@{logBitmapInfo}!Bitmap@{Bitmap}}
\subsubsection[logBitmapInfo]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::log\-Bitmap\-Info (const char $\ast$ {\em prefix})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{classBitmap_e3}


Sets whether bitmap information is logged. 

If logging is enabled, then the details of the bitmaps are sent to the {\tt stdout} prefixed by the given string.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prefix}]if non-null, then bitmap activity is logged on stdout with this prefix; if null, such logging is turned off \end{description}
\end{Desc}
\hypertarget{classBitmap_a19}{
\index{Bitmap@{Bitmap}!mark@{mark}}
\index{mark@{mark}!Bitmap@{Bitmap}}
\subsubsection[mark]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::mark (const double {\em x}, const double {\em y})}}
\label{classBitmap_a19}


Marks a particular spot in the bitmap. 

This spot can be retrieved later using \hyperlink{classBitmap_a20}{get\-Mark}. The top-left pixel in the bitmap has mark coordinates (0,0). The input coordinates are not restricted to be on the bitmap.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x}]the x-coordinate of the mark, increasing to the right \item[{\em y}]the y-coordinate of the mark, increasing downwards \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{classBitmap_1_1BitmapMark}{Bitmap\-Mark} \end{Desc}
\hypertarget{classBitmap_a15}{
\index{Bitmap@{Bitmap}!overlaps@{overlaps}}
\index{overlaps@{overlaps}!Bitmap@{Bitmap}}
\subsubsection[overlaps]{\setlength{\rightskip}{0pt plus 5cm}bool Bitmap::overlaps () const}}
\label{classBitmap_a15}


Does the bitmap overlap its canvas? This can only be true before a (implicit or explicit) call to \hyperlink{classBitmap_a6}{freeze}, since that normalizes the bounding box variables. 

\begin{Desc}
\item[Returns:]true if the bitmap overlaps its canvas; always false after any call to {\tt \hyperlink{classBitmap_a6}{freeze()}} \end{Desc}
\hypertarget{classBitmap_a2}{
\index{Bitmap@{Bitmap}!paint@{paint}}
\index{paint@{paint}!Bitmap@{Bitmap}}
\subsubsection[paint]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::paint (const int {\em x}, const int {\em y}, const int {\em w}, const int {\em h}, const \hyperlink{Byte_8h_a1}{Byte} $\ast$ {\em b})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a2}


Paint a bitmap onto the master bitmap. 

The bitmap to be added is given in a one-dimensional array {\tt b}, which is {\tt w} pixels wide and {\tt h} high. Like the master bitmap, the {\em x\/} axis runs horizontally and the {\em y\/} axis vertically downwards.

The pixel at position {\em (x,y)\/} on the new bitmap is at position {\tt b\mbox{[}y$\ast$w+x\mbox{]}} in the input bitmap array. This new bitmap is painted onto the master bitmap with its top left corner pixel (namely position {\em (0,0)\/}) occupying pixel {\em (x,y)\/} on the master bitmap, and pixel {\em (a,b)\/} occupying pixel {\em (x+a,y+b)\/} unless this would be off the master bitmap.

Any parts of the new bitmap falling outside the boundary of the master are cropped.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x}]the pixel in the top-left corner of the new bitmap (coordinate {\em (0,0)\/}) is located at position {\em (x,y)\/} of the master bitmap XXX NO, should be the reference point!!! \item[{\em y}](see parameter {\em x\/}) \item[{\em w}]the width of the new bitmap, in pixels \item[{\em h}]the height of the new bitmap, in pixels \item[{\em b}]the new bitmap, as a one-dimensional array \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if this is called after method {\tt \hyperlink{classBitmap_a6}{freeze()}} \end{description}
\end{Desc}
\hypertarget{classBitmap_a3}{
\index{Bitmap@{Bitmap}!rule@{rule}}
\index{rule@{rule}!Bitmap@{Bitmap}}
\subsubsection[rule]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::rule (const int {\em x}, const int {\em y}, const int {\em w}, const int {\em h})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a3}


Draws on the master bitmap a block (a `rule' in Te\-X terms) of height h and width w pixels. 

The bottom left corner of the rule occupies pixel (x,y) on the master bitmap.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x}]the (pixel in the) bottom-left corner of the rule is located at position {\em (x,y)\/} of the master bitmap \item[{\em y}](see parameter {\em x\/}) \item[{\em w}]the width of the new rule, in pixels \item[{\em h}]the height of the new rule, in pixels \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if this is called after method {\tt \hyperlink{classBitmap_a6}{freeze()}} \end{description}
\end{Desc}
\hypertarget{classBitmap_a13}{
\index{Bitmap@{Bitmap}!scaleDown@{scaleDown}}
\index{scaleDown@{scaleDown}!Bitmap@{Bitmap}}
\subsubsection[scaleDown]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::scale\-Down (const int {\em factor})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a13}


Scales down the bitmap by a numerical factor. 

The resulting bitmap has a linear dimension smaller than the original by the given factor. The pixels in the resulting bitmap are resampled so that this gives a basic anti-aliasing effect.

We throw an exception if you try to scale down an empty bitmap, simply on the grounds that this is probably an error, and you want to know about it.

Freezes the bitmap as a side-effect.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em factor}]the scaling factor, in the range 2..8 \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if the scaling factor is outside the range 2..8, or if the bitmap is empty \end{description}
\end{Desc}
\hypertarget{classBitmap_e1}{
\index{Bitmap@{Bitmap}!setDefaultRGB@{setDefaultRGB}}
\index{setDefaultRGB@{setDefaultRGB}!Bitmap@{Bitmap}}
\subsubsection[setDefaultRGB]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::set\-Default\-RGB (const bool {\em fg}, const \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap\-Colour} $\ast$ {\em rgb})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{classBitmap_e1}


Sets the default foreground or background colours. 

This is just like {\tt set\-RGB}, except that it applies to all bitmaps subsequently created by this class.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fg}]if true, sets the foreground colour; if false, the background \item[{\em rgb}]the colour the ground is set to \end{description}
\end{Desc}
\hypertarget{classBitmap_a12}{
\index{Bitmap@{Bitmap}!setRGB@{setRGB}}
\index{setRGB@{setRGB}!Bitmap@{Bitmap}}
\subsubsection[setRGB]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::set\-RGB (const bool {\em fg}, const \hyperlink{structBitmap_1_1BitmapColour__s}{Bitmap\-Colour} $\ast$ {\em rgb})}}
\label{classBitmap_a12}


Sets the foreground or background colour. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fg}]if true, sets the foreground colour; if false, the background \item[{\em rgb}]the colour the ground is set to \end{description}
\end{Desc}
\hypertarget{classBitmap_a11}{
\index{Bitmap@{Bitmap}!setTransparent@{setTransparent}}
\index{setTransparent@{setTransparent}!Bitmap@{Bitmap}}
\subsubsection[setTransparent]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::set\-Transparent (const bool {\em sw})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classBitmap_a11}


Sets the current bitmap to be transparent, if possible. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sw}]if true, the current bitmap is set to be transparent \end{description}
\end{Desc}
\hypertarget{classBitmap_a4}{
\index{Bitmap@{Bitmap}!strut@{strut}}
\index{strut@{strut}!Bitmap@{Bitmap}}
\subsubsection[strut]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::strut (const int {\em x}, const int {\em y}, const int {\em l}, const int {\em r}, const int {\em t}, const int {\em b})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a4}


Draws a `strut' on the master bitmap. 

This is essentially the same as the {\tt \hyperlink{classBitmap_a3}{rule()}} method, except that it doesn't draw in any pixels. Its only effect is to make sure that the boundingbox includes at least the {\em x\/}-values {\em \mbox{[}x-l,x+r-1\mbox{]}\/}, and the {\em y\/}-values {\em \mbox{[}y-t+1,y+b\mbox{]}\/}. That is, the area indicated by the strut is {\tt l+r} pixels wide by {\tt t+b} pixels deep. The parameters l, r, t, and b must all be non-negative. This implies that the call {\tt rule(x, y, w, h)} has the same effect on the bounding box as {\tt rule(x, y, 0, w, h, 0)}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x}]the x-coordinate of the reference point of the strut \item[{\em y}]the y-coordinate of the reference point of the strut \item[{\em l}]bounding box must be leftwards of {\tt x-l} \item[{\em r}]bounding box must be rightwards of {\tt x+r} \item[{\em t}]bounding box must be above {\tt y-t} \item[{\em b}]bounding box must be below {\tt y+b} \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if this is called after method {\tt \hyperlink{classBitmap_a6}{freeze()}}, or if one of l, r, t, b is negative \end{description}
\end{Desc}
\hypertarget{classBitmap_e2}{
\index{Bitmap@{Bitmap}!verbosity@{verbosity}}
\index{verbosity@{verbosity}!Bitmap@{Bitmap}}
\subsubsection[verbosity]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{verbosity_8h_a6}{verbosities} Bitmap::verbosity (const \hyperlink{verbosity_8h_a6}{verbosities} {\em level})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{classBitmap_e2}


Sets the verbosity of the current class. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em level}]the required verbosity \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the previous verbosity level \end{Desc}
\hypertarget{classBitmap_a5}{
\index{Bitmap@{Bitmap}!write@{write}}
\index{write@{write}!Bitmap@{Bitmap}}
\subsubsection[write]{\setlength{\rightskip}{0pt plus 5cm}void Bitmap::write (const string {\em filename}, const string {\em format})  throw (\hyperlink{classBitmapError}{Bitmap\-Error})}}
\label{classBitmap_a5}


Writes the bitmap out to the specified file. 

The {\tt format} parameter specifies the format of this file, and should be one of the bitmap types listed in the sequence starting with \hyperlink{classBitmapImage_e3}{Bitmap\-Image\#first\-Bitmap\-Image\-Format}; if this is not available, we try writing out in the default format, and if that fails in turn (something is clearly badly wrong) we throw an error.

Freezes the bitmap as a side-effect.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]the name of the output filename \item[{\em format}]one of the format names known to class {\tt \hyperlink{classBitmapImage}{Bitmap\-Image}} \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em Bitmap\-Error}]if we cannot write out a bitmap even in the default format \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{classBitmapImage}{Bitmap\-Image} \end{Desc}


\subsection{Member Data Documentation}
\hypertarget{classBitmap_s0}{
\index{Bitmap@{Bitmap}!endIterator_@{endIterator\_\-}}
\index{endIterator_@{endIterator\_\-}!Bitmap@{Bitmap}}
\subsubsection[endIterator\_\-]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classBitmap_1_1const__iterator}{Bitmap::const\_\-iterator} \hyperlink{classBitmap_s0}{Bitmap::end\-Iterator\_\-}\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{classBitmap_s0}


\hypertarget{classBitmap_o0}{
\index{Bitmap@{Bitmap}!runningIterator_@{runningIterator\_\-}}
\index{runningIterator_@{runningIterator\_\-}!Bitmap@{Bitmap}}
\subsubsection[runningIterator\_\-]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classBitmap_1_1const__iterator}{const\_\-iterator} \hyperlink{classBitmap_o0}{Bitmap::running\-Iterator\_\-}}}
\label{classBitmap_o0}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
\hyperlink{Bitmap_8h}{Bitmap.h}\item 
\hyperlink{Bitmap_8cc}{Bitmap.cc}\end{CompactItemize}
