<html> <head><title>ClanLib Reference: CL_SurfaceProvider</title></head> <body text=black link=blue vlink=#800080 bgcolor=white topmargin=0 leftmargin=0> <table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img border=0 src="../images/eyeheader-main-purple-a.gif" alt="ClanSoft logo" width=525 height=96></td></tr> <tr bgcolor=#dadada><td align=left valign=top><img border=0 src="../images/eyeheader-main-purple-b.gif" alt="ClanSoft logo" width=190 height=14></td><td align=right valign=top><img border=0 src="../images/clanlib_light.gif" width=42 height=14></td></tr></table> <table align=center border=0 cellspacing=10> <tr> <td><a href="entire_class_index.html">Entire Class Index</a></td> <td><a href="class_index.html">Main Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="global_index.html">Global Index</a></td> </table><h1 align=center>Class CL_SurfaceProvider</h1><p> <b> The image source interface.</b><br> Contained in: <a href="global_index.html">global</a><br> Derived from: <a href="CL_Target.html">CL_Target</a> <br> Derived by: <a href="CL_Canvas.html">CL_Canvas</a> <a href="CL_JPEGProvider.html">CL_JPEGProvider</a> <a href="CL_JPGDProvider.html">CL_JPGDProvider</a> <a href="CL_SurfaceProvider_32bpp.html">CL_SurfaceProvider_32bpp</a> <a href="CL_SurfaceProvider_Generic.html">CL_SurfaceProvider_Generic</a> <br>Group: Display (Display 2D) <p> #include <ClanLib/display.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=left><h3>Construction:</h3></td> <tr valign=top><td align=right><tt><tt>static</tt> <a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>*</tt> </td><td align=right><a href="CL_SurfaceProvider.html#2593"><tt><font color=blue><b>load</b></font></tt></a></td><td><tt>(<tt>const</tt> <tt><font color=navy>std::string</font></tt>& <tt><font color=blue>resource_id</font></tt>, <a href="CL_ResourceManager.html"><tt><font color=navy><b>CL_ResourceManager</b></font></tt></a>* <tt><font color=blue>manager</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="CL_SurfaceProvider.html#2594"><tt><font color=blue><b>~CL_SurfaceProvider</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=left><h3>Attributes:</h3></td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_SurfaceProvider.html#2595"><tt><font color=blue><b>get_translate_x</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_SurfaceProvider.html#2596"><tt><font color=blue><b>get_translate_y</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="CL_SurfaceProvider.html#2597"><tt><font color=blue><b>uses_src_colorkey</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_SurfaceProvider.html#2598"><tt><font color=blue><b>get_src_colorkey</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="CL_SurfaceProvider.html#2599"><tt><font color=blue><b>get_pixel</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>a</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> <tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_SurfaceProvider.html#2600"><tt><font color=blue><b>get_pixel</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>)</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> This is the interface used by a <a href="CL_Surface.html">CL_Surface</a> surface to load an image. For more information about the relationship between a surface and its provider, please the <a href="CL_Surface.html">CL_Surface</a> class description.<br><br> The surface provider interface extends the <a href="CL_Target.html">CL_Target</a> renderer target interface with some blitting related functions. Currently, this is translation of the image and colorkey transparency.<br><br> ClanLib includes a large range of surface providers that can load an image from various sources: PCX, TGA, PNG and so on.<br><br> If you want to be able to load your (newly created) surface provider as a resource, you have to implement the <a href="CL_ResourceSource_Surface.html">CL_ResourceSource_Surface</a> as well.<br><p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="2599"><font size=+1><b>CL_SurfaceProvider::get_pixel</b></font></a> - Get Pixel<br><tt><tt>virtual</tt> <tt><font color=purple>void</font></tt></tt> <a href="CL_SurfaceProvider.html#2599"><tt><font color=blue><b>get_pixel</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>r</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>g</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>b</font></tt>, <tt><font color=purple>float</font></tt>* <tt><font color=blue>a</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2600"><font size=+1><b>CL_SurfaceProvider::get_pixel</b></font></a> - Get Pixel<br><tt><tt>virtual</tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_SurfaceProvider.html#2600"><tt><font color=blue><b>get_pixel</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2598"><font size=+1><b>CL_SurfaceProvider::get_src_colorkey</b></font></a> - Returns the source color key.<br><tt><tt>virtual</tt> <tt><font color=navy>unsigned</font></tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_SurfaceProvider.html#2598"><tt><font color=blue><b>get_src_colorkey</b></font></tt></a><tt>() <tt>const</tt></tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2595"><font size=+1><b>CL_SurfaceProvider::get_translate_x</b></font></a> - Returns the offset of the surface_data returned by get_data(). This translation will be applied to every putscreen using a given surfaceproviders data as input.<br><tt><tt>virtual</tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_SurfaceProvider.html#2595"><tt><font color=blue><b>get_translate_x</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> Returns - The x-offset of the surface data.</blockquote> <hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2596"><font size=+1><b>CL_SurfaceProvider::get_translate_y</b></font></a> - Returns the offset of the surface_data returned by get_data(). This translation will be applied to every putscreen using a given surfaceproviders data as input.<br><tt><tt>virtual</tt> <tt><font color=purple>int</font></tt></tt> <a href="CL_SurfaceProvider.html#2596"><tt><font color=blue><b>get_translate_y</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> Returns - The y-offset of the surface data.</blockquote> <hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2593"><font size=+1><b>CL_SurfaceProvider::load</b></font></a> - This function loads a surface provider from a resource file (usually a datafile).<br><tt><tt>static</tt> <a href="CL_SurfaceProvider.html"><tt><font color=navy><b>CL_SurfaceProvider</b></font></tt></a>*</tt> <a href="CL_SurfaceProvider.html#2593"><tt><font color=blue><b>load</b></font></tt></a><tt>(<tt>const</tt> <tt><font color=navy>std::string</font></tt>& <tt><font color=blue>resource_id</font></tt>, <a href="CL_ResourceManager.html"><tt><font color=navy><b>CL_ResourceManager</b></font></tt></a>* <tt><font color=blue>manager</font></tt>)</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2597"><font size=+1><b>CL_SurfaceProvider::uses_src_colorkey</b></font></a> - Returns true if the surface provider uses a source color key.<br><tt><tt>virtual</tt> <tt><font color=purple>bool</font></tt></tt> <a href="CL_SurfaceProvider.html#2597"><tt><font color=blue><b>uses_src_colorkey</b></font></tt></a><tt>() <tt>const</tt></tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br> <a name="2594"><font size=+1><b>CL_SurfaceProvider::~CL_SurfaceProvider</b></font></a> - Surface Provider Destructor<br><tt><tt>virtual</tt> </tt> <a href="CL_SurfaceProvider.html#2594"><tt><font color=blue><b>~CL_SurfaceProvider</b></font></tt></a><tt>()</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br> <hr noshade> </body> </html>