LBitmap::Tunnel

#include "ltwrappr.h"

virtual L_INT LBitmap::Tunnel( ptCenterPoint, uZValue, nDistance, nRad, nRepeat, nRotationOffset, uStretch, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

POINT ptCenterPoint;

/* point at which the viewer is looking */

L_UINT uZValue;

/* viewing screen offset on the Z-axis */

L_INT nDistance;

/* camera distance from the viewing screen */

L_UINT nRad;

/* tunnel radius */

L_INT nRepeat;

/* number of times the bitmaps are repeated */

L_INT nRotationOffset;

/* rotation offset */

L_UINT uStretch;

/* compression factor */

L_UINT uStartBright;

/* brightness of an external light source on the first bitmap displayed */

L_UINT uEndBright;

/* brightness of an external light source on the last bitmap displayed */

L_UINT uBrightLength;

/* changes in brightness along the Z axis */

COLORREF crBright;

/* color of an external light source that is shined on the bitmaps */

COLORREF crFill;

/* background color */

L_UINT uFlags;

/* flags */

Places the bitmap inside a tunnel along the Z-axis.

Parameter

Description

ptCenterPoint

POINT structure that contains the point at which the camera or viewer is looking. It may be outside the bitmap borders.

uZValue

Viewing screen offset on the Z-axis, in pixels.

nDistance

Camera distance from the viewing screen, in pixels.

nRad

Tunnel radius.

nRepeat

Number of times the bitmap repeats along the Z-axis. If nRepeat equals 1 the bitmap will be infinitely repeated. Its range starts from 1.

nRotationOffset

Rotates tunnel around the Z-axis in pixel steps. If TUN_AXIS_WIDTH option is selected then the bitmap width is along the Z-axis and nRotationOffset set to the bitmap height is equivalent to a complete cycle. If TUN_AXIS_HEIGHT option is set, then the bitmap height is along the Z-axis and nRotationOffset set to the bitmap width is equivalent to a complete cycle.

uStretch

Value that indicates whether to expand or compress the bitmap, and by how much. If uStretch < 100 bitmap will be expanded. If uStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.

uStartBright

Value that indicates the brightness of an external light source at the beginning of the tunnel. Possible values range from 0 to 100. A value of 0 indicates no external light is displayed at the beginning of the tunnel. A value of 100 indicates an external light source with full brightness is displayed.

uEndBright

Value that indicates the brightness of an external light source at the end of the tunnel. Possible values range from 0 to 100. A value of 0 indicates no external light displayed at the end of the tunnel. A value of 100 indicates an external light source with full brightness is displayed on the bitmap.

uBrightLength

Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.

crBright

The COLORREF value that specifies the color of an external light source that shines in the tunnel.

crFill

The COLORREF value that specifies the background color.

uFlags

Flags that indicate the background color and which bitmap dimension extends along the Z-axis. You can use a bit wise OR (|) to specify one flag from each group.

 

The following are the flags that indicate the background color:

 

Value

Meaning

 

PLANE_FILL_CLR

[0x0001] Use the crFill as a background color.

 

PLANE_NO_CHG

[0x0002] Use the image itself as a background.

 

The following are the flags that indicate which bitmap dimension is along the Z-axis:

 

Value

Meaning

 

TUN_AXIS_WIDTH

[0x0010] Bitmap width will be along the Z-axis.

 

TUN_AXIS_HEIGHT

[0x0010] Bitmap height will be along the Z-axis.

 

The following are the flags that indicate how to handle exposed areas:

 

Value

Meaning

 

TUN_FILL_CLR

[0x0001] Fill any exposed areas with crFill.

 

TUN_NO_CHG

[0x0002] Leave the exposed area as is, without changing it.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function shows the effect of placing a bitmap inside a tunnel along the Z-axis. An external light source of the specified color and brightness may be shined on the bitmaps. The brightness may vary along the z-axis according to the uBrightLength value.

Changing the camera center point, the rotation angle and the viewing screen Z-offset will simulate moving along the axis.

If the bitmap has a region, the effect will be applied on the region dimensions only.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

For an example, see the following figure:

image\Tunnel_before.gif

The following figure shows the same bitmap, after the effect has been applied:

image\Tunnel_after.gif

To obtain this effect, the following settings were used with the function:

CenterPoint(x,y) = (200,200)

uZValue= 0

nDistance= 200

nRad= 200

nRepeat= -1

nRotationOffset= 75

uStretch= 25

uStartBright= 0

uEndBright= 100

uBrightLength= 45

crBright= RGB(255,255,255)

crFill= RGB(255,255,255)

uFlags= PLANE_FILL_CLR|TUN_AXIS_WIDTH

This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.

This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.

Required DLLs and Libraries

LTIMGSFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Doing Geometric Transformations

 

Raster Image Functions: Artistic Effects

 

Applying Artistic Effects

 

Using Color Values in LEADTOOLS

 

Raster Image Functions: Correcting Colors

Example

L_INT LBitmap__TunnelExample(LAnimationWindow *BitmapWindow) 
{
   
   POINT  CenterPt; 
   CenterPt.x  =  BitmapWindow->GetWidth()/2; 
   CenterPt.y  =  BitmapWindow->GetHeight()/2; 
   return BitmapWindow->Tunnel(CenterPt, 0, BitmapWindow->GetHeight(), BitmapWindow->GetWidth()/2, -1,0, 25,100,0, 2000, RGB(255,0,0), RGB(0,0,0),TUN_AXIS_WIDTH | PLANE_FILL_CLR); 
}