You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

871 lines
42 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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Otter: Otter.Texture Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="otterlogosmall.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Otter
&#160;<span id="projectnumber">0.9.8.91</span>
</div>
<div id="projectbrief">2d Game Development Framework based on SFML.Net</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Packages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li>
<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="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_otter_1_1_texture.html','');});
</script>
<div id="doc-content">
<!-- 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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Properties</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>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="class_otter_1_1_texture-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Otter.Texture Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Class representing a texture. Can perform pixel operations on the CPU, but those will be pretty slow and shouldn't be used that much.
<a href="class_otter_1_1_texture.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae02f5d30b223b8e3166cc2c2d1e756f6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#ae02f5d30b223b8e3166cc2c2d1e756f6">Texture</a> (string source, bool useCache=true)</td></tr>
<tr class="memdesc:ae02f5d30b223b8e3166cc2c2d1e756f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a texture from a file path. <a href="#ae02f5d30b223b8e3166cc2c2d1e756f6">More...</a><br/></td></tr>
<tr class="separator:ae02f5d30b223b8e3166cc2c2d1e756f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d2f020e91ffcc9449733a1a1a4dfe09"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a4d2f020e91ffcc9449733a1a1a4dfe09">Texture</a> (Stream stream, bool useCache=true)</td></tr>
<tr class="memdesc:a4d2f020e91ffcc9449733a1a1a4dfe09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a texture from a stream of bytes. <a href="#a4d2f020e91ffcc9449733a1a1a4dfe09">More...</a><br/></td></tr>
<tr class="separator:a4d2f020e91ffcc9449733a1a1a4dfe09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6204dbe89d7a6141763f6cc2986c369c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a6204dbe89d7a6141763f6cc2986c369c">Texture</a> (<a class="el" href="class_otter_1_1_texture.html">Texture</a> copy)</td></tr>
<tr class="memdesc:a6204dbe89d7a6141763f6cc2986c369c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new texture from a copy of another texture. No cache option for this. <a href="#a6204dbe89d7a6141763f6cc2986c369c">More...</a><br/></td></tr>
<tr class="separator:a6204dbe89d7a6141763f6cc2986c369c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a505bb66d4456c290d15cb1d9d00c2fad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a505bb66d4456c290d15cb1d9d00c2fad">Texture</a> (byte[] bytes, bool useCache=true)</td></tr>
<tr class="memdesc:a505bb66d4456c290d15cb1d9d00c2fad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a texture from a byte array. <a href="#a505bb66d4456c290d15cb1d9d00c2fad">More...</a><br/></td></tr>
<tr class="separator:a505bb66d4456c290d15cb1d9d00c2fad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8853912e9a385d37bba6fca6423a2c06"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a8853912e9a385d37bba6fca6423a2c06">Texture</a> (int width, int height)</td></tr>
<tr class="memdesc:a8853912e9a385d37bba6fca6423a2c06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty texture of width and height. This does not use the cache. <a href="#a8853912e9a385d37bba6fca6423a2c06">More...</a><br/></td></tr>
<tr class="separator:a8853912e9a385d37bba6fca6423a2c06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9265516887ced52c8cf1008c9305202d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a9265516887ced52c8cf1008c9305202d">CopyPixels</a> (<a class="el" href="class_otter_1_1_texture.html">Texture</a> from, int fromX, int fromY, int toX, int toY)</td></tr>
<tr class="memdesc:a9265516887ced52c8cf1008c9305202d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy pixels from one texture to another using blitting. <a href="#a9265516887ced52c8cf1008c9305202d">More...</a><br/></td></tr>
<tr class="separator:a9265516887ced52c8cf1008c9305202d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0c5f673c26c1afaad04ac4f00e8ba86"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0c5f673c26c1afaad04ac4f00e8ba86"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>CopyPixels</b> (<a class="el" href="class_otter_1_1_texture.html">Texture</a> from, int fromX, int fromY, int fromWidth, int fromHeight, int toX, int toY)</td></tr>
<tr class="separator:aa0c5f673c26c1afaad04ac4f00e8ba86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6fdf4f66704c52664b529ae7abd3f72"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#aa6fdf4f66704c52664b529ae7abd3f72">CreateImage</a> (bool forceNewImage=false)</td></tr>
<tr class="memdesc:aa6fdf4f66704c52664b529ae7abd3f72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads the image internally in the texture for image manipulation. This is handled automatically, but it's exposed so that it can be manually controlled. <a href="#aa6fdf4f66704c52664b529ae7abd3f72">More...</a><br/></td></tr>
<tr class="separator:aa6fdf4f66704c52664b529ae7abd3f72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6a9821b6e5fd33dad1e52cd881a6d93"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_otter_1_1_color.html">Color</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#ab6a9821b6e5fd33dad1e52cd881a6d93">GetPixel</a> (int x, int y)</td></tr>
<tr class="memdesc:ab6a9821b6e5fd33dad1e52cd881a6d93"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the <a class="el" href="class_otter_1_1_color.html" title="Class that represents a color with red, green, blue, and alpha channels. ">Color</a> from a specific pixel on the texture. Warning: This is slow! <a href="#ab6a9821b6e5fd33dad1e52cd881a6d93">More...</a><br/></td></tr>
<tr class="separator:ab6a9821b6e5fd33dad1e52cd881a6d93"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ad721262d446d6bc110558ccab7c1bd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a7ad721262d446d6bc110558ccab7c1bd">SaveToFile</a> (string path)</td></tr>
<tr class="memdesc:a7ad721262d446d6bc110558ccab7c1bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save the texture to a file. The supported image formats are bmp, png, tga and jpg. <a href="#a7ad721262d446d6bc110558ccab7c1bd">More...</a><br/></td></tr>
<tr class="separator:a7ad721262d446d6bc110558ccab7c1bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78cbc1cb9cf1188732f7510cb6d099f8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a78cbc1cb9cf1188732f7510cb6d099f8">SetPixel</a> (int x, int y, <a class="el" href="class_otter_1_1_color.html">Color</a> color)</td></tr>
<tr class="memdesc:a78cbc1cb9cf1188732f7510cb6d099f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the color of a specific pixel on the texture. <a href="#a78cbc1cb9cf1188732f7510cb6d099f8">More...</a><br/></td></tr>
<tr class="separator:a78cbc1cb9cf1188732f7510cb6d099f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07fe60305c9e435d553e34cfe3d3398c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a07fe60305c9e435d553e34cfe3d3398c">SetRect</a> (int x, int y, int width, int height, <a class="el" href="class_otter_1_1_color.html">Color</a> color)</td></tr>
<tr class="memdesc:a07fe60305c9e435d553e34cfe3d3398c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the color of a rectangle of pixels on the texture. <a href="#a07fe60305c9e435d553e34cfe3d3398c">More...</a><br/></td></tr>
<tr class="separator:a07fe60305c9e435d553e34cfe3d3398c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac154c072a7da449877011335399fb1bf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#ac154c072a7da449877011335399fb1bf">Update</a> ()</td></tr>
<tr class="memdesc:ac154c072a7da449877011335399fb1bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the texture to reflect changes made from SetPixel. <a href="#ac154c072a7da449877011335399fb1bf">More...</a><br/></td></tr>
<tr class="separator:ac154c072a7da449877011335399fb1bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01c6abecda0ca0576f53109ccfed2b27"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a01c6abecda0ca0576f53109ccfed2b27">SetBytes</a> (byte[] bytes)</td></tr>
<tr class="memdesc:a01c6abecda0ca0576f53109ccfed2b27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the texture with a byte array. Note: Updates immediately. Probably not the fastest. <a href="#a01c6abecda0ca0576f53109ccfed2b27">More...</a><br/></td></tr>
<tr class="separator:a01c6abecda0ca0576f53109ccfed2b27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba6aaab13a72a66d3fb3cc065a29e3e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#aba6aaab13a72a66d3fb3cc065a29e3e8">SetBytes</a> (byte[] bytes, int width, int height, int x=0, int y=0)</td></tr>
<tr class="memdesc:aba6aaab13a72a66d3fb3cc065a29e3e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the texture with a byte array, at the given position and size. Note: Updates immediately. Probably not the fastest. <a href="#aba6aaab13a72a66d3fb3cc065a29e3e8">More...</a><br/></td></tr>
<tr class="separator:aba6aaab13a72a66d3fb3cc065a29e3e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a42efff351f63707d57f7c479683487e8"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a42efff351f63707d57f7c479683487e8">DefaultSmooth</a> = false</td></tr>
<tr class="memdesc:a42efff351f63707d57f7c479683487e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default setting to use for smoothing textures. Much easier to set this at the start of a program rather than adjust the settings for every single texture you use. <a href="#a42efff351f63707d57f7c479683487e8">More...</a><br/></td></tr>
<tr class="separator:a42efff351f63707d57f7c479683487e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:a763e2294f5819441d5008a0e342c6898"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a763e2294f5819441d5008a0e342c6898">Height</a><code> [get]</code></td></tr>
<tr class="memdesc:a763e2294f5819441d5008a0e342c6898"><td class="mdescLeft">&#160;</td><td class="mdescRight">The height of the texture. <a href="#a763e2294f5819441d5008a0e342c6898">More...</a><br/></td></tr>
<tr class="separator:a763e2294f5819441d5008a0e342c6898"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02930cf4acf79faa2c9a07be621dd05a"><td class="memItemLeft" align="right" valign="top">byte[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a02930cf4acf79faa2c9a07be621dd05a">Pixels</a><code> [get, set]</code></td></tr>
<tr class="memdesc:a02930cf4acf79faa2c9a07be621dd05a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The array of pixels in the texture in bytes. <a href="#a02930cf4acf79faa2c9a07be621dd05a">More...</a><br/></td></tr>
<tr class="separator:a02930cf4acf79faa2c9a07be621dd05a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cae97067de121b03f7738b9b9401f59"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_otter_1_1_rectangle.html">Rectangle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a5cae97067de121b03f7738b9b9401f59">Region</a><code> [get]</code></td></tr>
<tr class="memdesc:a5cae97067de121b03f7738b9b9401f59"><td class="mdescLeft">&#160;</td><td class="mdescRight">The rectangle created by the <a class="el" href="class_otter_1_1_texture.html" title="Class representing a texture. Can perform pixel operations on the CPU, but those will be pretty slow ...">Texture</a>'s width and height. <a href="#a5cae97067de121b03f7738b9b9401f59">More...</a><br/></td></tr>
<tr class="separator:a5cae97067de121b03f7738b9b9401f59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a465c3714640c5ea79ca0dc7dcc0fcd17"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a465c3714640c5ea79ca0dc7dcc0fcd17">Smooth</a><code> [get, set]</code></td></tr>
<tr class="memdesc:a465c3714640c5ea79ca0dc7dcc0fcd17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the source texture is smoothed when transformed. <a href="#a465c3714640c5ea79ca0dc7dcc0fcd17">More...</a><br/></td></tr>
<tr class="separator:a465c3714640c5ea79ca0dc7dcc0fcd17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22825380a47a2fb1349fe3262e32d110"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#a22825380a47a2fb1349fe3262e32d110">Source</a><code> [get, set]</code></td></tr>
<tr class="memdesc:a22825380a47a2fb1349fe3262e32d110"><td class="mdescLeft">&#160;</td><td class="mdescRight">The file path source if the texture was loaded from a file. <a href="#a22825380a47a2fb1349fe3262e32d110">More...</a><br/></td></tr>
<tr class="separator:a22825380a47a2fb1349fe3262e32d110"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb0df64daa12cb81fde51c9569ee2645"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_otter_1_1_texture.html#acb0df64daa12cb81fde51c9569ee2645">Width</a><code> [get]</code></td></tr>
<tr class="memdesc:acb0df64daa12cb81fde51c9569ee2645"><td class="mdescLeft">&#160;</td><td class="mdescRight">The width of the <a class="el" href="class_otter_1_1_texture.html" title="Class representing a texture. Can perform pixel operations on the CPU, but those will be pretty slow ...">Texture</a>. <a href="#acb0df64daa12cb81fde51c9569ee2645">More...</a><br/></td></tr>
<tr class="separator:acb0df64daa12cb81fde51c9569ee2645"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Class representing a texture. Can perform pixel operations on the CPU, but those will be pretty slow and shouldn't be used that much. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ae02f5d30b223b8e3166cc2c2d1e756f6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Otter.Texture.Texture </td>
<td>(</td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>source</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>useCache</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Load a texture from a file path. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">source</td><td>The file path to load from.</td></tr>
<tr><td class="paramname">useCache</td><td>Determines if the cache should be checked first.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a4d2f020e91ffcc9449733a1a1a4dfe09"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Otter.Texture.Texture </td>
<td>(</td>
<td class="paramtype">Stream&#160;</td>
<td class="paramname"><em>stream</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>useCache</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a texture from a stream of bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">stream</td><td>The stream to load from.</td></tr>
<tr><td class="paramname">useCache</td><td>Determines if the cache should be checked first.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6204dbe89d7a6141763f6cc2986c369c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Otter.Texture.Texture </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_otter_1_1_texture.html">Texture</a>&#160;</td>
<td class="paramname"><em>copy</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new texture from a copy of another texture. No cache option for this. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">copy</td><td>The texture to copy from.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a505bb66d4456c290d15cb1d9d00c2fad"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Otter.Texture.Texture </td>
<td>(</td>
<td class="paramtype">byte[]&#160;</td>
<td class="paramname"><em>bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>useCache</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a texture from a byte array. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bytes</td><td>The byte array to load from.</td></tr>
<tr><td class="paramname">useCache</td><td>Determines if the cache should be checked first.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8853912e9a385d37bba6fca6423a2c06"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Otter.Texture.Texture </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>height</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates an empty texture of width and height. This does not use the cache. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">width</td><td>The width of the texture.</td></tr>
<tr><td class="paramname">height</td><td>The height of the texture.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a9265516887ced52c8cf1008c9305202d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.CopyPixels </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_otter_1_1_texture.html">Texture</a>&#160;</td>
<td class="paramname"><em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>fromX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>fromY</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>toX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>toY</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy pixels from one texture to another using blitting. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">from</td><td></td></tr>
<tr><td class="paramname">fromX</td><td></td></tr>
<tr><td class="paramname">fromY</td><td></td></tr>
<tr><td class="paramname">toX</td><td></td></tr>
<tr><td class="paramname">toY</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa6fdf4f66704c52664b529ae7abd3f72"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.CreateImage </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>forceNewImage</em> = <code>false</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Loads the image internally in the texture for image manipulation. This is handled automatically, but it's exposed so that it can be manually controlled. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">forceNewImage</td><td>If set to true a new image will always be created instead of only when there is no image.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab6a9821b6e5fd33dad1e52cd881a6d93"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_otter_1_1_color.html">Color</a> Otter.Texture.GetPixel </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>y</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the <a class="el" href="class_otter_1_1_color.html" title="Class that represents a color with red, green, blue, and alpha channels. ">Color</a> from a specific pixel on the texture. Warning: This is slow! </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>The x coordinate of the pixel to get.</td></tr>
<tr><td class="paramname">y</td><td>The y coordinate of the pixel to get.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="class_otter_1_1_color.html" title="Class that represents a color with red, green, blue, and alpha channels. ">Color</a> of the pixel.</dd></dl>
</div>
</div>
<a class="anchor" id="a7ad721262d446d6bc110558ccab7c1bd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.SaveToFile </td>
<td>(</td>
<td class="paramtype">string&#160;</td>
<td class="paramname"><em>path</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Save the texture to a file. The supported image formats are bmp, png, tga and jpg. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">path</td><td>The file path to save to. The type of image is deduced from the extension.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a01c6abecda0ca0576f53109ccfed2b27"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.SetBytes </td>
<td>(</td>
<td class="paramtype">byte[]&#160;</td>
<td class="paramname"><em>bytes</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the texture with a byte array. Note: Updates immediately. Probably not the fastest. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bytes</td><td>The byte array containing our pixels.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aba6aaab13a72a66d3fb3cc065a29e3e8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.SetBytes </td>
<td>(</td>
<td class="paramtype">byte[]&#160;</td>
<td class="paramname"><em>bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>height</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>x</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>y</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the texture with a byte array, at the given position and size. Note: Updates immediately. Probably not the fastest. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bytes</td><td>The byte array containing our pixels.</td></tr>
<tr><td class="paramname">width</td><td>The width of the section we are updating.</td></tr>
<tr><td class="paramname">height</td><td>The height of the section we are updating.</td></tr>
<tr><td class="paramname">x</td><td>The X coordinate of the section we are updating.</td></tr>
<tr><td class="paramname">y</td><td>The Y coordinate of the section we are updating.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a78cbc1cb9cf1188732f7510cb6d099f8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.SetPixel </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_otter_1_1_color.html">Color</a>&#160;</td>
<td class="paramname"><em>color</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the color of a specific pixel on the texture. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>The x coordinate of the pixel.</td></tr>
<tr><td class="paramname">y</td><td>The y coordinate of the pixel.</td></tr>
<tr><td class="paramname">color</td><td>The <a class="el" href="class_otter_1_1_color.html" title="Class that represents a color with red, green, blue, and alpha channels. ">Color</a> to set the pixel to.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a07fe60305c9e435d553e34cfe3d3398c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.SetRect </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>height</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_otter_1_1_color.html">Color</a>&#160;</td>
<td class="paramname"><em>color</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the color of a rectangle of pixels on the texture. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>The x coordinate of the rectangle.</td></tr>
<tr><td class="paramname">y</td><td>The y coordinate of the rectangle.</td></tr>
<tr><td class="paramname">width</td><td>The width of the rectangle.</td></tr>
<tr><td class="paramname">height</td><td>The height of the rectangle.</td></tr>
<tr><td class="paramname">color</td><td>The color of the rectangle.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ac154c072a7da449877011335399fb1bf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Otter.Texture.Update </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the texture to reflect changes made from SetPixel. </p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a42efff351f63707d57f7c479683487e8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool Otter.Texture.DefaultSmooth = false</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The default setting to use for smoothing textures. Much easier to set this at the start of a program rather than adjust the settings for every single texture you use. </p>
</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a class="anchor" id="a763e2294f5819441d5008a0e342c6898"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int Otter.Texture.Height</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The height of the texture. </p>
</div>
</div>
<a class="anchor" id="a02930cf4acf79faa2c9a07be621dd05a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">byte [] Otter.Texture.Pixels</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The array of pixels in the texture in bytes. </p>
</div>
</div>
<a class="anchor" id="a5cae97067de121b03f7738b9b9401f59"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_otter_1_1_rectangle.html">Rectangle</a> Otter.Texture.Region</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The rectangle created by the <a class="el" href="class_otter_1_1_texture.html" title="Class representing a texture. Can perform pixel operations on the CPU, but those will be pretty slow ...">Texture</a>'s width and height. </p>
</div>
</div>
<a class="anchor" id="a465c3714640c5ea79ca0dc7dcc0fcd17"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool Otter.Texture.Smooth</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines if the source texture is smoothed when transformed. </p>
</div>
</div>
<a class="anchor" id="a22825380a47a2fb1349fe3262e32d110"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">string Otter.Texture.Source</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The file path source if the texture was loaded from a file. </p>
</div>
</div>
<a class="anchor" id="acb0df64daa12cb81fde51c9569ee2645"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int Otter.Texture.Width</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The width of the <a class="el" href="class_otter_1_1_texture.html" title="Class representing a texture. Can perform pixel operations on the CPU, but those will be pretty slow ...">Texture</a>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Otter/Graphics/Texture.cs</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespace_otter.html">Otter</a></li><li class="navelem"><a class="el" href="class_otter_1_1_texture.html">Texture</a></li>
<li class="footer">Generated on Thu May 12 2016 18:16:53 for Otter by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
</ul>
</div>
</body>
</html>