Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > media > contrib-release > by-pkgid > 8079d983ecf371717db799dd75bd56c2 > files > 45

libopenrm1-1.5.2-2mdv2007.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head><title>OpenRM - RM Library (rmutil.c)</title></head>
<body bgcolor=white fgcolor=black>
<table width="100%" border=2 cellspacing=0 cellpadding=0 bgcolor="khaki" valign="center">
<th><img src="./images/ormsg.gif">
</th>
</table>
<spacer type=vertical size=15>
<h2>Index of OpenRM - RM Library</h2>
<spacer type=vertical size=15>
<a name="rmNearestPowerOfTwo"> 
<pre><b>
 int rmNearestPowerOfTwo (int n)
</b></pre>
<pre>
 int n - an integer value.
</pre>
<menu><P>
 This routine computes the integer that is the closest power of two to
 the input integer "n". The algorithm works only for non-negative
 input.
</P>
<P>
 This routine will come in handy if you have to scale an image so it's
 size is an even power of two.
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
<a name="rmIntMagnitude"> 
<pre><b>
 int rmIntMagnitude (int m)
</b></pre>
<pre>
 int m - an integer value.
</pre>
<menu><P>
 This routine computes log2(m) for some integer m, and returns an
 integer. It is not an exact log2() replacement. It is useful for
 determining the position of the uppermost "on" bit in an integer.
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
<a name="rmHSVtoRGB"> 
<pre><b>
 void rmHSVtoRGB (float hue,
	          float saturation,
		  float value,
		  float *redReturn,
		  float *greenReturn,
		  float *blueReturn)
</b></pre>
<pre>

 float hue, saturation, value - floating point values in the range
    [0..1] (input).

 float *redReturn, *greenReturn, *blueReturn - handles to floats. will
    contain floats in the range [0..1] (return). 
</pre>
<menu><P>
 Convert a three-component pixel from HSV space to RGB space. Input
 hue is in the range 0..1, with 0 corresponding to 0 degrees on the
 HSV circle, and 1.0 corresponding to 360 degrees on the HSV
 circle. Saturation is in the range 0..1, where 0 is fully desaturated
 and 1 is fully saturated.  Value, or brightness, is in the range
 0..1. A brightness value of 0 is black (not very bright), and a value
 of 1.0 is full brightness.
</P>
<P>
 The results of the conversion are placed into caller-supplied memory.
 The return RGB values are also in the range 0..1, with 0 representing
 "full off" and 1 representing "full on."
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
<a name="rmRGBtoHSV"> 
<pre><b>
 void rmRGBtoHSV (float red,
	          float green,
		  float blue,
		  float *hueReturn,
		  float *saturationReturn,
		  float *valueReturn)
</b></pre>
<pre>
 float red, green, blue - floating point values in the range 0..1 that
    represent a 3-component RGB pixel.

 float *hueReturn, *saturationReturn, *valueReturn - handles to floats
    that will contain the HSV representation of the input RGB pixel
    upon return. The return values are in the range 0..1 (result).
</pre>
<menu><P>
 Converts an RGB 3-tuple into HSV space.
</P>
<P>
 Output hue is in the range 0..1, with 0 corresponding to 0 degrees on
 the HSV circle, and 1.0 corresponding to 360 degrees on the HSV
 circle. Saturation is in the range 0..1, where 0 is fully desaturated
 and 1 is fully saturated.  Value, or brightness, is in the range
 0..1. A brightness value of 0 is black (not very bright), and a value
 of 1.0 is full brightness.
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
<a name="rmUnionBoundingBoxes"> 
<pre><b>
 RMenum rmUnionBoundingBoxes (const RMvertex3D *s1min,
		              const RMvertex3D *s1max,
			      const RMvertex3D *s2min,
			      const RMvertex3D *s2max,
			      RMvertex3D *dmin,
			      RMvertex3D *dmax)
</b></pre>
<pre>
 const RMvertex3D *s1min, *s1max, *s2min, *s2max - handles to
    RMvertex3D objects (input).

 RMvertex3D *dmin, *dmax - handles to RMvertex3D objects (modified).
</pre>
<menu><P>
 This routine performs a "union" operation of two, 3D boxes, returning
 the minimum and maximum coordinates of the resulting box into
 caller-supplied memory. Returns RM_CHILL upon success, or RM_WHACKED
 upon failure.
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
<a name="rmGLGetError"> 
<pre><b>
 int rmGLGetError (const char *string)
</b></pre>
<pre>
 const char *string - a handle to a string (input).
</pre>
<menu><P>
 This routine is a wrapper for the routine glGetError(), and is used
 to obtain OpenGL error codes. If there are no errors, a value of zero
 is returned by rmGLGetError(). Otherwise, the error code is returned
 to the caller, and the error code, along with the message contained
 in the parameter "string" is reported via rmWarning().  Refer to gl.h
 in your OpenGL distribution for definitions of the OpenGL error
 codes, as well as the man page for glGetError().
</P>
<P>
 This routine was used extensively for debugging during the
 development of RM Scene Graph.
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
<a name="rmImageBuildMipmaps"> 
<pre><b>
 int rmImageBuildMipmaps (const RMimage *src,
		          RMimage ***mapsReturn,
			  RMenum hardwareEnum,
			  RMpipe *hwPipe)
</b></pre>
<pre>
 const RMimage *src - a handle to an RMimage object (input).

 RMimage ***mapsReturn - a pointer to an array of RMimage pointer (return).

 RMenum hardwareEnum - an RMenum value, may be either RM_HARDWARE or
    RM_SOFTWARE (input).

 RMpipe *hwPipe - a handle to an RMpipe (input). A valid RMpipe handle
    is required when RM_HARDWARE is requested via hardwareEnum. When
    RM_SOFTWARE image resizing for mipmap generation is requested,
    callers should specify NULL for the hwPipe parameter.
</pre>
<menu><P>
 This convenience routine will generate a full set of mipmaps given an
 input image. The number of mipmaps generated is returned to the
 caller. This value will be positive and non-zero upon success,
 otherwise zero is returned.
</P>
<P>
 When RM_SOFTWARE is selected, RM will repeatedly call gluScaleImage
 to produce the mipmaps, a software operation. When RM_HARDWARE is
 set, the framebuffer itself is used to scale the image data. In some
 cases, RM_HARDWARE will run faster by an order of magnitude than
 RM_SOFTWARE.
</P>
<P>
 Inside this routine, an array of RMimage pointer is allocated. The
 number of entries in this array is log2(max(width,height)) of the
 input image, and is the number of mipmaps that will be
 generated. Then, each of these N images is created using
 RM_COPY_DATA, including the first image (which is a duplicate of the
 input image). The second image will be 1/4 the size of the first, and
 so forth down to a 1x1 image.
</P>
<P>
 At this time (January 2000), RM_HARDWARE occasionally has problems
 with the pixel reads on some framebuffers (esp. nVidia cards under
 Linux).
</P>
<P>
 At this time (January 2000), rmImageBuildMipmaps works ONLY on
 RMimage objects containing a two-dimensional image. There is no
 support at present for generating 3D mipmaps.
</P>
<P>
 At this time (January 2000), the scaled images are drawn to the
 framebuffer for debugging purposes, regardless of whether or not
 RM_SOFTWARE or RM_HARDWARE is specified by the caller.
</P>
<P>
 It is assumed that the input image is an even power of two in size.
</P>
<P>
 The following code snippet shows how to free the images returned by
 rmImageBuildMipmaps.
</P>
<P>
 <pre>
 RMimage  *source;
 RMimage **dstMipmaps;
 int       nMipmaps, i;
</P>
<P>
 ... stuff is assigned to source here (omitted) ...
</P>
<P>
 nMipmaps = rmImageBuildMipmaps(source, &dstMipmaps, RM_HARDWARE);
</P>
<P>
 .... do some stuff with the mipmaps (omitted) ...
</P>
<P>
 // delete the images
 for (i = 0; i < nMipmaps; i++)
     rmImageDelete(dstMipmaps[i]);
 free((void *)dstMipmaps);
 </pre>
</P></menu>
<i>librm library source file: rmutil.c </i><hr width="75%">
</body></html>