diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2019-06-02 20:50:28 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2019-06-02 20:50:28 -0400 |
commit | b421d4e7e06f977436b6e6195b95ca44d884e0c0 (patch) | |
tree | cd6e040b7d0fea82b5f766d1508c7278ff50fac0 /manuals/guile-sdl2/Surfaces.html | |
parent | 179da31b16bcf711c14020ec85472c145fc4be51 (diff) |
Add guile-sdl2 manual.
Diffstat (limited to 'manuals/guile-sdl2/Surfaces.html')
-rw-r--r-- | manuals/guile-sdl2/Surfaces.html | 316 |
1 files changed, 316 insertions, 0 deletions
diff --git a/manuals/guile-sdl2/Surfaces.html b/manuals/guile-sdl2/Surfaces.html new file mode 100644 index 0000000..7a094fe --- /dev/null +++ b/manuals/guile-sdl2/Surfaces.html @@ -0,0 +1,316 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<!-- Copyright (C) 2016 David Thompson davet@gnu.org + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled "GNU +Free Documentation License". + +A copy of the license is also available from the Free Software +Foundation Web site at http://www.gnu.org/licenses/fdl.html. + + +The document was typeset with +http://www.texinfo.org/ (GNU Texinfo). + --> +<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>Surfaces (Guile-SDL2)</title> + +<meta name="description" content="Surfaces (Guile-SDL2)"> +<meta name="keywords" content="Surfaces (Guile-SDL2)"> +<meta name="resource-type" content="document"> +<meta name="distribution" content="global"> +<meta name="Generator" content="makeinfo"> +<link href="index.html#Top" rel="start" title="Top"> +<link href="Index.html#Index" rel="index" title="Index"> +<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> +<link href="API-Reference.html#API-Reference" rel="up" title="API Reference"> +<link href="Rendering.html#Rendering" rel="next" title="Rendering"> +<link href="Rects.html#Rects" rel="prev" title="Rects"> +<style type="text/css"> +<!-- +a.summary-letter {text-decoration: none} +blockquote.indentedblock {margin-right: 0em} +blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} +blockquote.smallquotation {font-size: smaller} +div.display {margin-left: 3.2em} +div.example {margin-left: 3.2em} +div.lisp {margin-left: 3.2em} +div.smalldisplay {margin-left: 3.2em} +div.smallexample {margin-left: 3.2em} +div.smalllisp {margin-left: 3.2em} +kbd {font-style: oblique} +pre.display {font-family: inherit} +pre.format {font-family: inherit} +pre.menu-comment {font-family: serif} +pre.menu-preformatted {font-family: serif} +pre.smalldisplay {font-family: inherit; font-size: smaller} +pre.smallexample {font-size: smaller} +pre.smallformat {font-family: inherit; font-size: smaller} +pre.smalllisp {font-size: smaller} +span.nolinebreak {white-space: nowrap} +span.roman {font-family: initial; font-weight: normal} +span.sansserif {font-family: sans-serif; font-weight: normal} +ul.no-bullet {list-style: none} +@media (min-width: 1140px) { + body { + margin-left: 14rem; + margin-right: 4rem; + max-width: 52rem; + } +} + +@media (min-width: 800px) and (max-width: 1140px) { + body { + margin-left: 6rem; + margin-right: 4rem; + max-width: 52rem; + } +} + +@media (max-width: 800px) { + body { + margin: 1rem; + } +} + +--> +</style> +<link rel="stylesheet" type="text/css" href="https://dthompson.us/css/dthompson.css"> + + +</head> + +<body lang="en"> +<a name="Surfaces"></a> +<div class="header"> +<p> +Next: <a href="Rendering.html#Rendering" accesskey="n" rel="next">Rendering</a>, Previous: <a href="Rects.html#Rects" accesskey="p" rel="prev">Rects</a>, Up: <a href="API-Reference.html#API-Reference" accesskey="u" rel="up">API Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p> +</div> +<hr> +<a name="Surfaces-1"></a> +<h3 class="section">3.6 Surfaces</h3> + +<div class="example"> +<pre class="example">(use-modules (sdl2 surface)) +</pre></div> + +<dl> +<dt><a name="index-color_003f"></a>Procedure: <strong>color?</strong> <em>c</em></dt> +<dd><p>Return <code>#t</code> if <var>c</var> is a color. +</p></dd></dl> + +<dl> +<dt><a name="index-color_002dr"></a>Procedure: <strong>color-r</strong> <em>c</em></dt> +</dl> + +<dl> +<dt><a name="index-color_002dg"></a>Procedure: <strong>color-g</strong> <em>c</em></dt> +</dl> + +<dl> +<dt><a name="index-color_002db"></a>Procedure: <strong>color-b</strong> <em>c</em></dt> +</dl> + +<dl> +<dt><a name="index-color_002da"></a>Procedure: <strong>color-a</strong> <em>c</em></dt> +</dl> + +<dl> +<dt><a name="index-palette_003f"></a>Procedure: <strong>palette?</strong> <em>p</em></dt> +<dd><p>Return <code>#t</code> if <var>p</var> is a palette. +</p></dd></dl> + +<dl> +<dt><a name="index-palette_002dlength"></a>Procedure: <strong>palette-length</strong> <em>palette</em></dt> +<dd><p>Return the number of colors in <var>palette</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-palette_002dcolors"></a>Procedure: <strong>palette-colors</strong> <em>palette</em></dt> +<dd><p>Return the colors in <var>palette</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_003f"></a>Procedure: <strong>pixel-format?</strong> <em>pf</em></dt> +<dd><p>Return <code>#t</code> if <var>pf</var> is a pixel format. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dname"></a>Procedure: <strong>pixel-format-name</strong> <em>pf</em></dt> +<dd><p>Return the symbolic name of the pixel format <var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dpalette"></a>Procedure: <strong>pixel-format-palette</strong> <em>pf</em></dt> +<dd><p>Return the palette for the pixel format <var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dbits_002dper_002dpixel"></a>Procedure: <strong>pixel-format-bits-per-pixel</strong> <em>pf</em></dt> +<dd><p>Return the number of bits per pixel for the pixel format <var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dbytes_002dper_002dpixel"></a>Procedure: <strong>pixel-format-bytes-per-pixel</strong> <em>pf</em></dt> +<dd><p>Return the number of bytes per pixel for the pixel format <var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dred_002dmask"></a>Procedure: <strong>pixel-format-red-mask</strong> <em>pf</em></dt> +<dd><p>Return the bitmask for the red component of a pixel in the pixel format +<var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dgreen_002dmask"></a>Procedure: <strong>pixel-format-green-mask</strong> <em>pf</em></dt> +<dd><p>Return the bitmask for the green component of a pixel in the pixel format +<var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dblue_002dmask"></a>Procedure: <strong>pixel-format-blue-mask</strong> <em>pf</em></dt> +<dd><p>Return the bitmask for the blue component of a pixel in the pixel format +<var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-pixel_002dformat_002dalpha_002dmask"></a>Procedure: <strong>pixel-format-alpha-mask</strong> <em>pf</em></dt> +<dd><p>Return the bitmask for the alpha component of a pixel in the pixel format +<var>pf</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-make_002drgb_002dsurface"></a>Procedure: <strong>make-rgb-surface</strong> <em>width height depth</em></dt> +<dd><p>Create a new SDL surface with the dimensions <var>width</var> and <var>height</var> and +<var>depth</var> bits per pixel. +</p></dd></dl> + +<dl> +<dt><a name="index-bytevector_002d_003esurface"></a>Procedure: <strong>bytevector->surface</strong> <em>bv width height depth pitch</em></dt> +<dd><p>Convert <var>bv</var>, a bytevector of pixel data with dimensions +<var>width</var>x<var>height</var>, to an SDL surface. Each pixel is <var>depth</var> bits in +size, and each row of pixels is <var>pitch</var> bytes in size. +</p></dd></dl> + +<dl> +<dt><a name="index-delete_002dsurface_0021"></a>Procedure: <strong>delete-surface!</strong> <em>surface</em></dt> +<dd><p>Free the memory used by <var>surface</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-call_002dwith_002dsurface"></a>Procedure: <strong>call-with-surface</strong> <em>surface proc</em></dt> +<dd><p>Call <var>proc</var>, passing it <var>surface</var> and deleting <var>surface</var> upon exit +of <var>proc</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-load_002dbmp"></a>Procedure: <strong>load-bmp</strong> <em>file</em></dt> +<dd><p>Create a new surface from the bitmap data in <var>file</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-surface_002dwidth"></a>Procedure: <strong>surface-width</strong> <em>surface</em></dt> +<dd><p>Return the width of <var>surface</var> in pixels. +</p></dd></dl> + +<dl> +<dt><a name="index-surface_002dheight"></a>Procedure: <strong>surface-height</strong> <em>surface</em></dt> +<dd><p>Return the height of <var>surface</var> in pixels. +</p></dd></dl> + +<dl> +<dt><a name="index-surface_002dpitch"></a>Procedure: <strong>surface-pitch</strong> <em>surface</em></dt> +<dd><p>Return the length of a row of pixels in <var>surface</var> in bytes. +</p></dd></dl> + +<dl> +<dt><a name="index-surface_002dpixels"></a>Procedure: <strong>surface-pixels</strong> <em>surface</em></dt> +<dd><p>Return a bytevector containing the raw pixel data in <var>surface</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-surface_002dpixel_002dformat"></a>Procedure: <strong>surface-pixel-format</strong> <em>surface</em></dt> +<dd><p>Return the pixel format for <var>surface</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-convert_002dsurface_002dformat"></a>Procedure: <strong>convert-surface-format</strong> <em>surface format</em></dt> +<dd><p>Convert the pixels in <var>surface</var> to <var>format</var>, a symbol representing a +specific pixel format, and return a new surface object. +</p> +<p>Valid format types are: +</p> +<ul> +<li> <code>index1lsb</code> +</li><li> <code>index1msb</code> +</li><li> <code>index4lsb</code> +</li><li> <code>index4msb</code> +</li><li> <code>index8</code> +</li><li> <code>rgb332</code> +</li><li> <code>rgb444</code> +</li><li> <code>rgb555</code> +</li><li> <code>bgr555</code> +</li><li> <code>argb4444</code> +</li><li> <code>rgba4444</code> +</li><li> <code>abgr4444</code> +</li><li> <code>bgra4444</code> +</li><li> <code>argb1555</code> +</li><li> <code>rgba5551</code> +</li><li> <code>abgr1555</code> +</li><li> <code>bgra5551</code> +</li><li> <code>rgb565</code> +</li><li> <code>bgr565</code> +</li><li> <code>rgb24</code> +</li><li> <code>bgr24</code> +</li><li> <code>rgb888</code> +</li><li> <code>rgbx8888</code> +</li><li> <code>bgr888</code> +</li><li> <code>bgrx8888</code> +</li><li> <code>argb8888</code> +</li><li> <code>rgba8888</code> +</li><li> <code>abgr8888</code> +</li><li> <code>bgra8888</code> +</li><li> <code>argb2101010</code> +</li><li> <code>yv12</code> +</li><li> <code>iyuv</code> +</li><li> <code>yuy2</code> +</li><li> <code>uyvy</code> +</li><li> <code>yvyu</code> +</li></ul> +</dd></dl> + +<dl> +<dt><a name="index-blit_002dsurface"></a>Procedure: <strong>blit-surface</strong> <em><var>src</var> <var>src-rect</var> <var>dst</var> <var>dst-rect</var></em></dt> +<dd><p>Blit the rectangle <var>src-rect</var> from the surface <var>src</var> to +<var>dst-rect</var> of the surface <var>dst</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-blit_002dscaled"></a>Procedure: <strong>blit-scaled</strong> <em><var>src</var> <var>src-rect</var> <var>dst</var> <var>dst-rect</var></em></dt> +<dd><p>Blit the rectangle <var>src-rect</var> from the surface <var>src</var> to +<var>dst-rect</var> of the surface <var>dst</var>, scaling the source to fit the +destination. +</p></dd></dl> + +<dl> +<dt><a name="index-fill_002drect"></a>Procedure: <strong>fill-rect</strong> <em><var>dst</var> <var>rect</var> <var>color</var></em></dt> +<dd><p>Fill <var>rect</var> with <var>color</var>, a 32-bit color encoded as an integer +value, in the surface <var>dst</var>. +</p></dd></dl> + +<hr> +<div class="header"> +<p> +Next: <a href="Rendering.html#Rendering" accesskey="n" rel="next">Rendering</a>, Previous: <a href="Rects.html#Rects" accesskey="p" rel="prev">Rects</a>, Up: <a href="API-Reference.html#API-Reference" accesskey="u" rel="up">API Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p> +</div> + + + +</body> +</html> |