mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
222 lines
37 KiB
HTML
222 lines
37 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<title>ArduinoLibs: Bitmap.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body onload='searchBox.OnSelectItem(0);'>
|
|
<!-- Generated by Doxygen 1.7.4 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<div id="top">
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">ArduinoLibs</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li id="searchli">
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Bitmap.h</div> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
|
|
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2012 Southern Storm Software, Pty Ltd.</span>
|
|
<a name="l00003"></a>00003 <span class="comment"> *</span>
|
|
<a name="l00004"></a>00004 <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span>
|
|
<a name="l00005"></a>00005 <span class="comment"> * copy of this software and associated documentation files (the "Software"),</span>
|
|
<a name="l00006"></a>00006 <span class="comment"> * to deal in the Software without restriction, including without limitation</span>
|
|
<a name="l00007"></a>00007 <span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
|
|
<a name="l00008"></a>00008 <span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span>
|
|
<a name="l00009"></a>00009 <span class="comment"> * Software is furnished to do so, subject to the following conditions:</span>
|
|
<a name="l00010"></a>00010 <span class="comment"> *</span>
|
|
<a name="l00011"></a>00011 <span class="comment"> * The above copyright notice and this permission notice shall be included</span>
|
|
<a name="l00012"></a>00012 <span class="comment"> * in all copies or substantial portions of the Software.</span>
|
|
<a name="l00013"></a>00013 <span class="comment"> *</span>
|
|
<a name="l00014"></a>00014 <span class="comment"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS</span>
|
|
<a name="l00015"></a>00015 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
|
|
<a name="l00016"></a>00016 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
|
|
<a name="l00017"></a>00017 <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
|
|
<a name="l00018"></a>00018 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
|
|
<a name="l00019"></a>00019 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
|
|
<a name="l00020"></a>00020 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
|
|
<a name="l00021"></a>00021 <span class="comment"> */</span>
|
|
<a name="l00022"></a>00022
|
|
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef Bitmap_h</span>
|
|
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define Bitmap_h</span>
|
|
<a name="l00025"></a>00025 <span class="preprocessor"></span>
|
|
<a name="l00026"></a>00026 <span class="preprocessor">#include <inttypes.h></span>
|
|
<a name="l00027"></a>00027 <span class="preprocessor">#include <avr/pgmspace.h></span>
|
|
<a name="l00028"></a>00028
|
|
<a name="l00029"></a>00029 <span class="keyword">class </span><a class="code" href="classDMD.html" title="Handle large dot matrix displays composed of LED's.">DMD</a>;
|
|
<a name="l00030"></a>00030 <span class="keyword">class </span>String;
|
|
<a name="l00031"></a>00031
|
|
<a name="l00032"></a><a class="code" href="classBitmap.html">00032</a> <span class="keyword">class </span><a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a>
|
|
<a name="l00033"></a>00033 {
|
|
<a name="l00034"></a>00034 <span class="keyword">public</span>:
|
|
<a name="l00035"></a>00035 <a class="code" href="classBitmap.html#a40526748415c8bbc58a8510d636c20f4" title="Constructs a new in-memory bitmap that is width x height pixels in size.">Bitmap</a>(<span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a76c3b49e535761f07c553e7336daf523" title="Returns the width of the bitmap in pixels.">width</a>, <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#adcd4e3dc7594421e647b0f52da9a41a3" title="Returns the height of the bitmap in pixels.">height</a>);
|
|
<a name="l00036"></a>00036 <a class="code" href="classBitmap.html#a72d2a301ec1eb1c8d0f3d64823659a8e" title="Destroys this bitmap.">~Bitmap</a>();
|
|
<a name="l00037"></a>00037
|
|
<a name="l00038"></a><a class="code" href="classBitmap.html#a3846a240722e847d3cf11f701da1ce7b">00038</a> <span class="keywordtype">bool</span> <a class="code" href="classBitmap.html#a3846a240722e847d3cf11f701da1ce7b" title="Returns true if the memory for this bitmap is valid; false otherwise.">isValid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> fb != 0; }
|
|
<a name="l00039"></a>00039
|
|
<a name="l00040"></a><a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba">00040</a> <span class="keyword">typedef</span> uint8_t <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a>;
|
|
<a name="l00041"></a>00041
|
|
<a name="l00042"></a><a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc">00042</a> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> <a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc" title="Color value corresponding to "black".">Black</a> = 0;
|
|
<a name="l00043"></a><a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7">00043</a> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a> = 1;
|
|
<a name="l00044"></a><a class="code" href="classBitmap.html#aa89170263dc1f51f6366c1907119715e">00044</a> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> <a class="code" href="classBitmap.html#aa89170263dc1f51f6366c1907119715e" title="Special color value that is used with drawRect() and drawCircle() to indicate that the interior of th...">NoFill</a> = 2;
|
|
<a name="l00045"></a>00045
|
|
<a name="l00046"></a><a class="code" href="classBitmap.html#a76c3b49e535761f07c553e7336daf523">00046</a> <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a76c3b49e535761f07c553e7336daf523" title="Returns the width of the bitmap in pixels.">width</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _width; }
|
|
<a name="l00047"></a><a class="code" href="classBitmap.html#adcd4e3dc7594421e647b0f52da9a41a3">00047</a> <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#adcd4e3dc7594421e647b0f52da9a41a3" title="Returns the height of the bitmap in pixels.">height</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _height; }
|
|
<a name="l00048"></a><a class="code" href="classBitmap.html#af30df263729385ea2330effe3c80a1bc">00048</a> <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#af30df263729385ea2330effe3c80a1bc" title="Returns the number of bytes in each line of the bitmap's data() buffer.">stride</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _stride; }
|
|
<a name="l00049"></a><a class="code" href="classBitmap.html#ad18d3d5a1e77d541a95e93ad1f958411">00049</a> <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#ad18d3d5a1e77d541a95e93ad1f958411" title="Returns the number of bits per pixel for the bitmap; always 1.">bitsPerPixel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 1; }
|
|
<a name="l00050"></a>00050
|
|
<a name="l00051"></a><a class="code" href="classBitmap.html#a5eeed27c176eb6e4a2c39ea83444e27d">00051</a> uint8_t *<a class="code" href="classBitmap.html#a5eeed27c176eb6e4a2c39ea83444e27d" title="Returns a pointer to the start of the bitmap's data buffer.">data</a>() { <span class="keywordflow">return</span> fb; }
|
|
<a name="l00052"></a><a class="code" href="classBitmap.html#a20fea2a946545aa3b5edd78245149e5f">00052</a> <span class="keyword">const</span> uint8_t *<a class="code" href="classBitmap.html#a20fea2a946545aa3b5edd78245149e5f" title="Returns a constant pointer to the start of the bitmap's data buffer.This is an overloaded member func...">data</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> fb; }
|
|
<a name="l00053"></a>00053
|
|
<a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1" title="Clears the entire bitmap to the specified color.">clear</a>(<a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc" title="Color value corresponding to "black".">Black</a>);
|
|
<a name="l00055"></a>00055
|
|
<a name="l00056"></a>00056 <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> <a class="code" href="classBitmap.html#a35aa38b377d509d6c4f061a0b988d203" title="Returns the color of the pixel at (x, y); either Black or White.">pixel</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y) <span class="keyword">const</span>;
|
|
<a name="l00057"></a>00057 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#aac994b75418e7d37ec66829437329114" title="Sets the pixel at (x, y) to color.">setPixel</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color);
|
|
<a name="l00058"></a>00058
|
|
<a name="l00059"></a>00059 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#aa0a84f3694e343d68e7021552c69f767" title="Draws a line from (x1, y1) to (x2, y2) in color.">drawLine</a>(<span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y2, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>);
|
|
<a name="l00060"></a>00060 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#aac61e3f7f625db568e37d88b52b3b2fc" title="Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled ...">drawRect</a>(<span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y2, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> borderColor = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> fillColor = <a class="code" href="classBitmap.html#aa89170263dc1f51f6366c1907119715e" title="Special color value that is used with drawRect() and drawCircle() to indicate that the interior of th...">NoFill</a>);
|
|
<a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a568acbca3818dd85dd62fff6d0b36ffb" title="Draws a filled rectangle from (x1, y1) to (x2, y2) in color.">drawFilledRect</a>(<span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y2, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>);
|
|
<a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a933763a4f3cba79fbcf97ae6d0a864aa" title="Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor ...">drawCircle</a>(<span class="keywordtype">int</span> centerX, <span class="keywordtype">int</span> centerY, <span class="keywordtype">int</span> radius, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> borderColor = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> fillColor = <a class="code" href="classBitmap.html#aa89170263dc1f51f6366c1907119715e" title="Special color value that is used with drawRect() and drawCircle() to indicate that the interior of th...">NoFill</a>);
|
|
<a name="l00063"></a>00063 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a757291b9a39bcb0d64ac98d3a2fa061b" title="Draws a filled circle with a specific center (centerX, centerY) and radius in color.">drawFilledCircle</a>(<span class="keywordtype">int</span> centerX, <span class="keywordtype">int</span> centerY, <span class="keywordtype">int</span> radius, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>);
|
|
<a name="l00064"></a>00064
|
|
<a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a491e9c0bb20ddf5a5eb4933077c8ed72" title="Draws bitmap at (x, y) in color.">drawBitmap</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> &bitmap, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>);
|
|
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a491e9c0bb20ddf5a5eb4933077c8ed72" title="Draws bitmap at (x, y) in color.">drawBitmap</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> prog_uint8_t *bitmap, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>);
|
|
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a4321640464bc08b60348c09bff01b86a" title="Draws bitmap at (x, y) in inverted colors.">drawInvertedBitmap</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> &bitmap);
|
|
<a name="l00068"></a>00068 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a4321640464bc08b60348c09bff01b86a" title="Draws bitmap at (x, y) in inverted colors.">drawInvertedBitmap</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> prog_uint8_t *bitmap);
|
|
<a name="l00069"></a>00069
|
|
<a name="l00070"></a><a class="code" href="classBitmap.html#ab6bd47cb892b47b4c69b422ace182b87">00070</a> <span class="keyword">const</span> prog_uint8_t *<a class="code" href="classBitmap.html#ab6bd47cb892b47b4c69b422ace182b87" title="Returns the currently selected font, or null if none selected.">font</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _font; }
|
|
<a name="l00071"></a><a class="code" href="classBitmap.html#abf7adfceb267080aa9806388e96358c4">00071</a> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#abf7adfceb267080aa9806388e96358c4" title="Sets the font for use with drawText() and drawChar().">setFont</a>(<span class="keyword">const</span> prog_uint8_t *<a class="code" href="classBitmap.html#ab6bd47cb892b47b4c69b422ace182b87" title="Returns the currently selected font, or null if none selected.">font</a>) { _font = <a class="code" href="classBitmap.html#ab6bd47cb892b47b4c69b422ace182b87" title="Returns the currently selected font, or null if none selected.">font</a>; }
|
|
<a name="l00072"></a>00072
|
|
<a name="l00073"></a><a class="code" href="classBitmap.html#ab6e5f5744fd2f18478aac428b751d848">00073</a> <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> <a class="code" href="classBitmap.html#ab6e5f5744fd2f18478aac428b751d848" title="Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.">textColor</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _textColor; }
|
|
<a name="l00074"></a><a class="code" href="classBitmap.html#a8e225a4f188269bb18265ae4b49de0a3">00074</a> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a8e225a4f188269bb18265ae4b49de0a3" title="Sets the color that will be used for drawing text with drawText() and drawChar().">setTextColor</a>(<a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color) { _textColor = color; }
|
|
<a name="l00075"></a>00075
|
|
<a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a3e9bcbfb584d5020bd6f0a313ee275f0" title="Draws the len characters of str at (x, y).">drawText</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> len = -1);
|
|
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a3e9bcbfb584d5020bd6f0a313ee275f0" title="Draws the len characters of str at (x, y).">drawText</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> String &str, <span class="keywordtype">int</span> start = 0, <span class="keywordtype">int</span> len = -1);
|
|
<a name="l00078"></a>00078
|
|
<a name="l00079"></a>00079 <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a1a11f29863ee7f36a3b15c91963102bd" title="Draws a single character ch at (x, y).">drawChar</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">char</span> ch);
|
|
<a name="l00080"></a>00080
|
|
<a name="l00081"></a>00081 <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a9b79ac13077ca865e4515510297780bd" title="Returns the width in pixels of ch in the current font().">charWidth</a>(<span class="keywordtype">char</span> ch) <span class="keyword">const</span>;
|
|
<a name="l00082"></a>00082 <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a0f7607b1c7867987f4500d490a666e8a" title="Returns the width in pixels of the len characters of str in the current font(), including inter-chara...">textWidth</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> len = -1) <span class="keyword">const</span>;
|
|
<a name="l00083"></a>00083 <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a0f7607b1c7867987f4500d490a666e8a" title="Returns the width in pixels of the len characters of str in the current font(), including inter-chara...">textWidth</a>(<span class="keyword">const</span> String &str, <span class="keywordtype">int</span> start = 0, <span class="keywordtype">int</span> len = -1) <span class="keyword">const</span>;
|
|
<a name="l00084"></a>00084 <span class="keywordtype">int</span> <a class="code" href="classBitmap.html#a628bb694fcfe6eab619a4f1e152d41c4" title="Returns the height in pixels of the current text drawing font(); or zero if font() is not set...">textHeight</a>() <span class="keyword">const</span>;
|
|
<a name="l00085"></a>00085
|
|
<a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#ab22fe1f3871934987a670b559f67c67c" title="Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap d...">copy</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height, <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> *dest, <span class="keywordtype">int</span> destX, <span class="keywordtype">int</span> destY);
|
|
<a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a99da820f9280aace6b512801d5a5e2b2" title="Fills the width x height pixels starting at top-left corner (x, y) with color.">fill</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color);
|
|
<a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a99da820f9280aace6b512801d5a5e2b2" title="Fills the width x height pixels starting at top-left corner (x, y) with color.">fill</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height, <span class="keyword">const</span> prog_uint8_t *pattern, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color = <a class="code" href="classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7" title="Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...">White</a>);
|
|
<a name="l00089"></a>00089
|
|
<a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a" title="Scrolls the entire contents of the bitmap by dx and dy.">scroll</a>(<span class="keywordtype">int</span> dx, <span class="keywordtype">int</span> dy, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> fillColor = <a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc" title="Color value corresponding to "black".">Black</a>);
|
|
<a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a" title="Scrolls the entire contents of the bitmap by dx and dy.">scroll</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height, <span class="keywordtype">int</span> dx, <span class="keywordtype">int</span> dy, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> fillColor = <a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc" title="Color value corresponding to "black".">Black</a>);
|
|
<a name="l00092"></a>00092
|
|
<a name="l00093"></a>00093 <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a6d85556bcc9fac91d33f0f6f7a6430dd" title="Inverts the width x height pixels starting at top-left corner (x, y).">invert</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);
|
|
<a name="l00094"></a>00094
|
|
<a name="l00095"></a>00095 <span class="keyword">private</span>:
|
|
<a name="l00096"></a>00096 <span class="comment">// Disable copy constructor and operator=().</span>
|
|
<a name="l00097"></a>00097 <a class="code" href="classBitmap.html#a40526748415c8bbc58a8510d636c20f4" title="Constructs a new in-memory bitmap that is width x height pixels in size.">Bitmap</a>(<span class="keyword">const</span> <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> &) {}
|
|
<a name="l00098"></a>00098 <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> &operator=(<span class="keyword">const</span> <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> &) { <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
|
<a name="l00099"></a>00099
|
|
<a name="l00100"></a>00100 <span class="keywordtype">int</span> _width;
|
|
<a name="l00101"></a>00101 <span class="keywordtype">int</span> _height;
|
|
<a name="l00102"></a>00102 <span class="keywordtype">int</span> _stride;
|
|
<a name="l00103"></a>00103 uint8_t *fb;
|
|
<a name="l00104"></a>00104 <span class="keyword">const</span> prog_uint8_t *_font;
|
|
<a name="l00105"></a>00105 <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> _textColor;
|
|
<a name="l00106"></a>00106
|
|
<a name="l00107"></a>00107 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classDMD.html" title="Handle large dot matrix displays composed of LED's.">DMD</a>;
|
|
<a name="l00108"></a>00108
|
|
<a name="l00109"></a>00109 <span class="keywordtype">void</span> blit(<span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y2, <span class="keywordtype">int</span> x3, <span class="keywordtype">int</span> y3);
|
|
<a name="l00110"></a>00110 <span class="keywordtype">void</span> drawCirclePoints(<span class="keywordtype">int</span> centerX, <span class="keywordtype">int</span> centerY, <span class="keywordtype">int</span> radius, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> borderColor, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> fillColor);
|
|
<a name="l00111"></a>00111 };
|
|
<a name="l00112"></a>00112
|
|
<a name="l00113"></a><a class="code" href="classBitmap.html#a568acbca3818dd85dd62fff6d0b36ffb">00113</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a568acbca3818dd85dd62fff6d0b36ffb" title="Draws a filled rectangle from (x1, y1) to (x2, y2) in color.">Bitmap::drawFilledRect</a>(<span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y2, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color)
|
|
<a name="l00114"></a>00114 {
|
|
<a name="l00115"></a>00115 <a class="code" href="classBitmap.html#aac61e3f7f625db568e37d88b52b3b2fc" title="Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled ...">drawRect</a>(x1, y1, x2, y2, color, color);
|
|
<a name="l00116"></a>00116 }
|
|
<a name="l00117"></a>00117
|
|
<a name="l00118"></a><a class="code" href="classBitmap.html#a757291b9a39bcb0d64ac98d3a2fa061b">00118</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a757291b9a39bcb0d64ac98d3a2fa061b" title="Draws a filled circle with a specific center (centerX, centerY) and radius in color.">Bitmap::drawFilledCircle</a>(<span class="keywordtype">int</span> centerX, <span class="keywordtype">int</span> centerY, <span class="keywordtype">int</span> radius, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> color)
|
|
<a name="l00119"></a>00119 {
|
|
<a name="l00120"></a>00120 <a class="code" href="classBitmap.html#a933763a4f3cba79fbcf97ae6d0a864aa" title="Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor ...">drawCircle</a>(centerX, centerY, radius, color, color);
|
|
<a name="l00121"></a>00121 }
|
|
<a name="l00122"></a>00122
|
|
<a name="l00123"></a><a class="code" href="classBitmap.html#a4321640464bc08b60348c09bff01b86a">00123</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a4321640464bc08b60348c09bff01b86a" title="Draws bitmap at (x, y) in inverted colors.">Bitmap::drawInvertedBitmap</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> <a class="code" href="classBitmap.html" title="Represents a monochrome bitmap within main memory.">Bitmap</a> &bitmap)
|
|
<a name="l00124"></a>00124 {
|
|
<a name="l00125"></a>00125 <a class="code" href="classBitmap.html#a491e9c0bb20ddf5a5eb4933077c8ed72" title="Draws bitmap at (x, y) in color.">drawBitmap</a>(x, y, bitmap, <a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc" title="Color value corresponding to "black".">Black</a>);
|
|
<a name="l00126"></a>00126 }
|
|
<a name="l00127"></a>00127
|
|
<a name="l00128"></a><a class="code" href="classBitmap.html#ae41aa6bfa8d508d216e25d80bb93747e">00128</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#a4321640464bc08b60348c09bff01b86a" title="Draws bitmap at (x, y) in inverted colors.">Bitmap::drawInvertedBitmap</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> prog_uint8_t *bitmap)
|
|
<a name="l00129"></a>00129 {
|
|
<a name="l00130"></a>00130 <a class="code" href="classBitmap.html#a491e9c0bb20ddf5a5eb4933077c8ed72" title="Draws bitmap at (x, y) in color.">drawBitmap</a>(x, y, bitmap, <a class="code" href="classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc" title="Color value corresponding to "black".">Black</a>);
|
|
<a name="l00131"></a>00131 }
|
|
<a name="l00132"></a>00132
|
|
<a name="l00133"></a><a class="code" href="classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a">00133</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a" title="Scrolls the entire contents of the bitmap by dx and dy.">Bitmap::scroll</a>(<span class="keywordtype">int</span> dx, <span class="keywordtype">int</span> dy, <a class="code" href="classBitmap.html#a88d386944a7017aa776a177b10d8b2ba" title="Type that represents the color of a pixel in a bitmap.">Color</a> fillColor)
|
|
<a name="l00134"></a>00134 {
|
|
<a name="l00135"></a>00135 <a class="code" href="classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a" title="Scrolls the entire contents of the bitmap by dx and dy.">scroll</a>(0, 0, _width, _height, dx, dy, fillColor);
|
|
<a name="l00136"></a>00136 }
|
|
<a name="l00137"></a>00137
|
|
<a name="l00138"></a>00138 <span class="preprocessor">#endif</span>
|
|
</pre></div></div>
|
|
</div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<hr class="footer"/><address class="footer"><small>Generated on Mon Jun 18 2012 11:02:51 for ArduinoLibs by 
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
|
</body>
|
|
</html>
|