Filters and Transitions
This topic documents a feature of Visual Filters and Transitions, which is deprecated as of Windows Internet Explorer 9.
With Microsoft Internet Explorer 4.0 and later, you can apply various multimedia-style visual effects to your Web page. You can implement these effects in Web pages using Cascading Style Sheets (CSS) properties. By combining filters and transitions with basic scripting, you have a powerful tool for creating visually engaging and interactive documents. Internet Explorer 5.5 and later supports the richest variety of optimized filters. This documentation covers the basics of filters and transitions as well as all of the reference components.
Overviews/Tutorials
About Procedural SurfacesThe Microsoft DirectX Transform architecture enables you to write procedural surfaces. These DXSurfaces are not stored as an array of samples, but instead as a set of instructions that specify how to render a surface of arbitrary size and resolution. Procedural surfaces take up a fraction of the memory used to store bitmap images, and they can produce realistic marble and wood textures. The resulting surfaces can be used as background images.
About Transforms and DXSurfacesDirectX Transform objects apply space and time effects to Microsoft DirectDraw objects. DirectX Transform objects read data from a source, modify it, and write it to a destination object. In certain cases the source and destination data objects can be the same if the transform is capable of executing in place. DirectX Transform exposes a number of Component Object Model (COM) interfaces and data types that enable you to create your own unique effects and plug them into the existing architecture.
ArchitectureIn order to properly use DirectX Transform objects and interfaces, it is important to know what they are and how they all relate to one another.
Author's Guide to TransformsThis article should be considered required reading for transform authors. It contains important information that you need in order for your transform to function correctly under DirectX Transform containers. It also includes conventions and tips that are useful for writing transforms.
Building DirectX Transform Samples and ApplicationsThis overview explains the download and installation procedures necessary to prepare your build environment to build the samples and applications described in the DirectX Transform documentation.
CDXMMXInfo ConstructorThis constructor is used to to determine whether MMX instructions are present.
Copyright InformationDirectX Transform provides a way for you to secure the transforms you write so that only registered users can legally use your copyrighted transforms with their content. You can easily implement this, and it provides you with legal recourse for copyright violations.
DirectX Transform C++ SamplesSeveral sample applications are provided to demonstrate the various features of transforms.
DXETool for Transform UsersThe DirectX Transform documentation includes an application called DXETool.exe, which helps you verify that your transforms work properly within the DirectX Transform architecture. You can also use this application to view transform output and determine settings for the custom properties.
DXETool for Transform WritersThe DXETool application is a useful tool in the transform writing process. This overview provides instructions for setting-up and using DXETool.
Example: The Wipe TransformThis topic walks you through the Wipe transform sample code. This transform uses custom helper functions and elements common to all DLL files that use DirectX Transform routines.
Example: The WipeDlg ApplicationDirectX Transform provides you with powerful tools for manipulating 2-D image data. With DirectX Transform, you can perform operations on a single image—for example, the MotionBlur or BasicImage transform—or combine two images to form a single output image—for example, the Iris or Wheel transform.
Getting StartedThis overview provides a starting point for readers new to DirectX Transform.
How to Apply a Transition on an ImageThis article demonstrates how to implement a simple transition on an image.
How to Implement Procedural SurfacesThis tutorial describes the process of implementing procedural surfaces with Microsoft Visual Studio.
How Transforms WorkIn a general sense, each transform is a set of rules for how to produce one graphic output.
Implementation GuideThis overview provides a procedure for building an image transform DLL using Microsoft Visual C++ and the DirectX Transform interfaces.
Introduction to Filters and TransitionsWith Internet Explorer 4.0 and above, you can apply various multimedia-style visual effects to your Web page. You can implement these effects in Web pages using CSS properties. By combining filters and transitions with basic scripting, you have a powerful tool for creating visually engaging and interactive documents. Internet Explorer 5.5 and above supports the richest variety of optimized filters. Most examples in this article require that you have Internet Explorer 5.5 installed.
Security Considerations: Filters and TransitionsThis topic provides a list of topics that contain security information. These topics do not provide all you need to know about security issues—instead, use them as a starting point and reference for this technology area.
Supported Pixel FormatsOne of the most useful capabilities of DirectX Transform is that it enables you to import and export graphics data in a number of standard pixel formats.
Understanding DXSurfacesA DirectX surface object, DXSurface, is an abstract image whose pixel data is obtainable in 32-bit ARGB color format, regardless of the underlying pixel representation. DirectX Transform uses this data object for both input and output images. The DXSurface enables you to concentrate on the logical aspects of designing the transform, while letting the supporting software take care of numerous details, such as alpha blending, dithering, and converting among different pixel formats.
Using the CDXBaseNTo1 Base ClassCDXBaseNTo1 is a base class that you can use to implement transforms that take multiple images as inputs and produce a single image. If you choose not to use this base class, you can create a transform by directly implementing the IDXTransform interface, the IObjectWithSite COM interface, and, if you are using an image transform, the IDXSurfacePick interface. However, you will find it easier to use this base class because it performs parameter validation, preprocesses data, and implements the full IDXTransform interface. This simplifies development by only requiring implementation of the code specific to the transform.
Using TransformsThis overview suggests further reading regarding how to use a DirectX Transform in a Windows application.
Using Transforms in C++To use a transform in a C++ application, you must be familiar with a few key interfaces, methods, and objects. This section describes how to use an existing transform in a C++ application.
What is DirectX Transform?DirectX Transform is a DirectX media API you can use to create, animate, and edit digital images. DirectX Transform works with 2-D images, which can be used to create stand-alone Windows applications or dynamic plug-ins for Web graphics.
Writing TransformsDirectX Transform enables you to produce effects on images. The API provides sophisticated graphics tools for modifying and combining images. These tools include scaling, dithering, compositing, alpha blending, image filtering, and many others. You can use transforms in your own image-based applications.
Attributes/Properties
Brightness
Sets and retrieves the settings for the lookup table brightness curve.
BuildOrder
Sets and retrieves the order of operations used to build the lookup table.
CapabilitiesRetrieves a value that indicates specific capabilities of a transition.
ColorBalance
Sets and retrieves the tint curves for color balance operations on the selected color.
Contrast
Sets and retrieves the settings for the lookup table contrast curve.
DurationSets or retrieves the length of time the transition takes to complete.
DurationRetrieves the recommended length of time for performing a transition. Sets the suggested duration for the transition.
EnabledSets or retrieves a value that indicates whether the filter is enabled.
filterGets or sets the filter or collection of filters that are applied to the object.
Gamma
Sets and retrieves the value used for gamma correction.
Invert
Sets and retrieves the threshold value for color inversion, which represents a fraction of a one-byte color channel.
LevelsPerChannel
Sets and retrieves the number of color levels to use for the posterizing operation.
NumBuildSteps
Retrieves the number of lookup table operations to perform.
Opacity
Sets and retrieves the opacity adjustment for the lookup table.
PercentSets or retrieves the point in a transition at which to capture the display for a static filter output.
ProgressRetrieves the setting of the transform's Progress property. Sets the requested progress made on the transform.
StepResolutionRetrieves the step size that corresponds to the smallest meaningful change for the Progress property.
Threshold
Sets and retrieves the value for threshold filtering operations.
Methods
ApplyCaptures the initial display of an object's content for a transition.
ApplyTablesTranslates a set of samples in place.
BitBltCopies samples from one DXSurface to another.
BottomRetrieves the minimum y-axis value.
BoundsAreEmptyTests whether the bounds are empty.
BoundsAreNullTests whether the bounds are null.
CDXTWorkInfoNTo1Constructs a CDXTWorkInfoNTo1 and initializes the data members.
ClearDirtyIndicates to the transform that it is properly set up and ready to produce output.
CopyAndMoveBothCopies the specified number of samples from the current position of the source surface to the current position of the output surface.
CopyRectCopies the specified number of samples from the specified rectangle in the source surface to the current position on the output surface.
CopySurfaceToNewFormatCopies one surface to another and changes its pixel format.
CreateARGBPointerAllocates an ARGB read pointer object.
CreateD3DRMTextureNot supported.
CreateFromDDSurfaceCreates a DXSurface that contains a specified DirectDrawSurface object.
CreateSurfaceCreates a DXSurface object of the specified size and format.
CreateTransformCreates and initializes a transform.
DeleteARGBPointerFrees an ARGB read pointer object.
DepthRetrieves the depth of the z-axis dimension.
DetermineBndsCalled by the base class to determine the output bounds of 2-D transforms.
DetermineBndsNot supported.
DoDitherDetermines whether the transform output should be dithered.
DoOverDetermines whether the transform output should be alpha blended over the output surface.
DurationRetrieves the size of the t-axis dimension.
DXBASESAMPLEConstructs an uninitialized DXBASESAMPLE object.
DXBASESAMPLEConstructs a DXBASESAMPLE object with members initialized to the specified values.
DXBASESAMPLEConstructs a DXBASESAMPLE object with members initialized to the values specified in a Integer.
DXPMSAMPLEConstructs an uninitialized DXPMSAMPLE object.
DXPMSAMPLEConstructs a DXPMSAMPLE object with members initialized to the specified values.
DXPMSAMPLEConstructs a DXPMSAMPLE object with members initialized to the values specified in a Integer.
DXSAMPLEConstructs an uninitialized DXSAMPLE object.
DXSAMPLEConstructs a DXSAMPLE object with members initialized to the specified values.
DXSAMPLEConstructs a DXSAMPLE object with members initialized to the values specified in a Integer.
ExecuteExecutes the transform operation given the specified portion bounds and places the result in the destination data object.
ExpandAdds to the object's dimensions about its center by the specified amount.
ExpandAdds to the object's dimensions about its center by the specified amount.
FillAndMoveFills the output surface with the specified sample value, starting at the current position and advancing the current position.
FillRectFills a rectangle with the sample value, optionally doing an alpha-blend with the destination.
FillSamplesA method called by the base class to generate a row of output samples.
GetAppDataRetrieves an application-specific Integer of data.
GetBackgroundRetrieves a pointer to the DXSurface used as a background.
GetBehaviorSiteNot implemented.
GetBiasRetrieves the bias value used for the convolution.
GetBoundsRetrieves a structure that contains the surface's boundary region.
GetBrightnessRetrieves the settings for the lookup table brightness curve.
GetBuildOrderRetrieves the order of operations used to build the lookup table.
GetColorBalanceRetrieves the tint curves used for color balance operations on the selected color.
GetColorKeyRetrieves the surface's color key value.
GetCompositeOperationRetrieves the method used for image compositing.
GetConcurrencyLimitRetrieves the number of threads allowed to execute on a single processor at a given time.
GetContrastRetrieves the settings for the lookup table contrast curve.
GetConvertToGrayRetrieves a value that indicates whether the filter output color is converted to grayscale.
GetDCRetrieves the current device context (DC).
GetDirectDrawSurfaceRetrieves an interface on the underlying GetDirectDrawSurface object if the DXSurface object is aggregated onto a GetDirectDrawSurface.
GetEffectProgressRetrieves a value indicating the current progress of the transform effect.
GetExcludeAlphaRetrieves a value that indicates whether the alpha channel should be filtered along with the color data.
GetFillColorRetrieves the surface fill color.
GetFilterTypeRetrieves the selected filter type for the convolution.
GetForegroundRetrieves a pointer to the DXSurface used as a foreground.
GetGammaRetrieves the value used for gamma correction.
GetGenerationIdRetrieves the current generation ID for the object.
GetIndexValuesRetrieves the component values for a specific index in the table.
GetInOutInfoRetrieves input or output information about the specified data object, and an optional pointer to it.
GetInvertRetrieves the threshold value used for color inversion.
GetLevelsPerChannelRetrieves the number of color levels to use for the posterizing operation.
GetLookupRetrieves the interface to the selected color lookup table.
GetMaxVectorStores the maximum values for each dimension into the specified vector.
GetMinVectorStores the minimum values for each dimension into the specified vector.
GetMiscFlagsRetrieves flags that describe the behavior of the transform.
GetNativeTypeRetrieves the native underlying pixel format of a DXSurface.
GetNumBuildStepsRetrieves the number of lookup table operations to perform.
GetNumInputsRetrieves the number of inputs used during the transform setup.
GetObjectSizeRetrieves the size, in bytes, of the data object (for example, a surface or buffer).
GetOpacityRetrieves the opacity adjustment for the lookup table.
GetOpacityRetrieves the opacity of the foreground surface.
GetOutputSizeRetrieves the size of the output surface.
GetPixelFormatRetrieves the pixel format of the surface.
GetQualityRetrieves the quality level used to render the transform result.
GetSafeArrayGets the value of the data object to the bounds in the specified array data type.
GetScaleGets the scale for an alpha sample as a floating point value.
GetScaleAlphaValueGets the scale for an alpha sample as a byte integer value.
GetScalesRetrieves the x-axis and y-axis scale factors.
GetSizeRetrieves the bounds translated so that the minimum values are positioned at zero.
GetStatusFlagsRetrieves the status flags of the DXSurface object.
GetSurfaceRetrieves a pointer to the parent DXSurface.
GetSurfaceInfoRetrieves information about the attributes and structure of the raw surface object's pixel data.
GetTablesRetrieves a copy of the lookup tables.
GetThreadPoolSizeRetrieves the number of threads in the thread pool.
GetThresholdRetrieves the value used for threshold filtering operations.
GetXYRectStores the x-axis and y-axis bounds into the specified rectangle.
GetXYSizeStores the x and y size of the bounds into the specified SIZE structure.
HaveInputTests whether an input data object is associated with the specified input index.
HaveOutputTests whether an output data object is associated with the transform.
HeightRetrieves the height of the y-axis dimension.
IncrementGenerationIdManually increments the object generation ID.
InitFromDDSurfaceInitializes a DXSurface from an existing DirectDrawSurface.
InitFromRawSurfaceInitializes a DXSurface object from a client-created object that supports the IDXRawSurface interface.
InitFromSafeArraySets the value of the data object to the bounds in the specified array.
InitializeTransformInitializes a transform that has been created by the caller.
InitSurfaceInitializes a DXSurface object with the specified volume boundary and format from a DirectDraw object.
InputMeshBuilderNot supported.
InputSampleFormatRetrieves the pixel format type for the selected input surface.
InputSurfaceRetrieves a pointer to the selected input surface.
IntersectBoundsDetermines whether the two specified bounds intersect.
IntersectBoundsDetermines whether the two specified bounds intersect.
IsChannelIdentityDetermines whether the application of a channel's table will have any effect.
IsInputDirtyDetermines whether a transform input has changed since the last time this method was called.
IsOutputDirtyDetermines whether an output has changed since the last time this method was called.
IsTransformDirtyDetermines whether the transform parameters or inputs have changed since the last time this method was called.
LeftRetrieves the minimum x-axis value.
LoadImageBinds the specified file name or URL and returns a DXSurface containing the image data.
LoadImageFromStreamLoads an image from a stream and returns a DXSurface.
LockSurfaceLocks a region of the surface and returns a pointer through which you can access samples on DXSurfaces.
LockSurfaceDCLocks a region of the surface and returns an IDXDCLock interface.
MapBoundsIn2OutMaps the input coordinate space to the output coordinate space.
MapBoundsOut2InMaps the output coordinate space to the input coordinate space.
MinMMXOverCountReturns a value that indicates whether MMX instructions are present.
MoveMoves the sample pointer along the x-axis relative to its current position.
MoveAndGetRunInfoMoves the sample pointer to a specified row and retrieves a pointer to the run information associated with that row.
MoveToRowMoves the sample pointer to an absolute row along the y-axis and resets the x-axis position to zero.
MoveToXYMoves the sample pointer to an absolute position.
NeedDestPMBuffDetermines whether a temporary buffer is needed when calling a sample for surface read/write methods.
NeedSrcPMBuffDetermines whether a temporary buffer is needed when calling sample input methods on the IDXARGBReadPtr interface.
NormalizeBoundsMakes all of the minimum bounds less than or equal to the maximum bounds.
OffsetAdds the specified vector to the minimum and maximum for each dimension.
OffsetAdds the specified values to the minimum and maximum for each dimension.
OnExecuteCalled by the base class to cause a transform to produce its output.
OnFreeInstDataFrees resources allocated by the OnInitInstData method.
OnGetObjectSizeCalled by the base class to determine the amount of data space currently occupied by the transform.
OnGetObjectSizeCalled by the base class to determine the object's size, in bytes.
OnGetSurfacePickOrderProvides the base class with the necessary information to perform surface picking for the transform.
OnInitInstDataEnables the transform to allocate resources or compute any data that is to be shared across threads.
OnReleaseObjectsCalled to release resources when the transform is being set up with null inputs or outputs.
OnSetSizeSets the width and height of the surface.
OnSetupCalled after the base class has completed its setup.
OnSurfacePickCalled by the base class to enable the derived transform to fully implement surface picking.
OnSurfacePickDetermines whether any part of the surface is located at the specified point.
OnUpdateGenerationIdCalled by the base class to check the input and output data object generation IDs and increment the transform generation ID.
operator DWORDCasts the sample as a Integer.
operator DWORDCasts the sample as a Integer.
operator DWORDCasts the sample as a Integer.
operator DXPMSAMPLECasts the sample as a DXPMSAMPLE.
operator DXSAMPLECasts the sample as a DXSAMPLE.
operator=Assigns the color values of the sample.
operator=Assigns the color values of the sample.
operator=Assigns the color values of the sample.
OutputMeshBuilderNot supported.
OutputSampleFormatRetrieves the pixel format type of the output surface.
OutputSurfaceRetrieves a pointer to the output surface.
OverArrayAndMoveAlpha-blends an array of samples over the output surface and moves the pointer a specified number of samples.
OverSampleAlpha-blends the sample value over the sample at the specified position.
PackAndMovePlaces a buffer of ARGB32 samples into the output surface and moves the sample pointer.
PackPremultAndMovePlaces a buffer of ARGB32 samples into the output surfaces and moves the sample pointer.
PackRectAccepts a buffer of either PMARGB32 or ARGB32 samples and writes them to a subsection of the output surface defined by a DXPACKEDRECTDESC structure.
PlayPlays the transition.
PointPickPerforms a surface pick at the specified output point.
QueryNumProcessorsRetrieves the number of processors installed in the system.
RightRetrieves the maximum x-axis value.
SampleFormatEnumRetrieves the native pixel format of the surface.
ScaleScales the object about its center by the specified scaling factors.
ScaleScales the object about its center by the specified scaling factors.
ScaleArrayApplies a lookup table to an array of DXSAMPLE structures.
ScaleArrayAlphaOnlyApplies alpha portion of a lookup table to an array of DXSAMPLE structures.
ScaleBaseArrayApplies a lookup table to an array of DXBASESAMPLE structures.
ScaleFitToSizeSets the scale factors used to fit a portion of the input to match a specified size.
ScalePremultArrayApplies a lookup table to an array of DXPMSAMPLE structures.
ScaleSampleApplies a lookup table to a single DXBASESAMPLE structure.
ScaleTypeReturns a value that indicates the scale type.
ScaleType (const)Returns a value that indicates the scale type.
ScheduleTasksDefines a set of tasks to execute.
SetAppDataSets the surface's application-specified Integer of data.
SetBackgroundSets the surface modifier background surface.
SetBehaviorSiteSets the behavior site.
SetBiasSets the bias value used for the convolution.
SetBindHostSpecifies the bind host that the transform should use.
SetBoundsSets all the values of the data object with the specified bounds.
SetBoundsSets the surface's volume boundary structure.
SetBrightnessSets the values for the lookup table brightness curve.
SetBuildOrderSets the order of operations used to build the lookup table.
SetColorBalanceSets the tint curves for color balance operations on the selected color.
SetColorKeySets the surface's color_key value.
SetCompositeOperationSelects the method used for image compositing.
SetConcurrencyLimitDefines the number of threads that can execute from a thread pool at a given time.
SetContrastSets the values for the lookup table contrast curve.
SetConvertToGraySets a value that indicates whether the filter output color is converted to grayscale.
SetCustomFilterSets the convolution to use a custom filter.
SetDirtyIncrements the transform generation ID.
SetEmptySets all minimum and maximum bound values to zero.
SetExcludeAlphaSets a value that indicates whether the alpha channel should be filtered with the color data.
SetFillColorSets the surface fill color.
SetFilterTypeSets the selected filter type for the convolution.
SetForegroundSelects the DXSurface to use as a foreground.
SetGammaSets the value used for gamma correction.
SetGradientSets the parameters used to produce the gradient surface.
SetHostUrlSets the host URL.
SetInvertSets the threshold value for color inversion.
SetLevelsPerChannelSets the number of color levels to use for the posterizing operation.
SetLookupSets the interface to use for color lookup table operations on the foreground surface.
SetMiscFlagsSets transform flags that specify how to generate the output.
SetOpacitySets the opacity adjustment for the lookup table.
SetOpacitySets the opacity of the foreground surface.
SetOutputSizeSets the size of the scaled transform output.
SetPlacementTranslates the bounds to the absolute position specified by the vector.
SetQualitySets the quality level used to render the transform result.
SetScaleSets the scale using a float value.
SetScaleAlphaValueSets the scale for an alpha sample using a byte integer value.
SetScalesSets the x-axis and y-axis scale factors.
SetServiceAdds a service provider to the Transform Factory.
SetStatusFlagsSets the status flags of the DXSurface object.
SetThreadPoolSizeSpecifies the number of threads to create and make available to execute tasks.
SetThresholdSets the value for threshold filtering operations.
SetToMeshBoundsNot supported.
SetToSizeTranslates the bounds to the absolute position specified by the vector.
SetToSurfaceBoundsSets the value of the data object to the bounds of the specified surface.
SetupDefines the input and output data objects used in the transform.
SetXYPointSets the x-axis and y-axis bounds of the object to one pixel width at the specified point.
SetXYRectSets the x-axis and y-axis bounds of the object to the specified rectangle.
SetXYSizeSets the x-axis and y-axis bounds of the object to the specified size.
SetXYSizeSets the x-axis and y-axis bounds of the object to the specified size.
SizeRetrieves the bounds translated so that the minimum values are positioned at zero.
StopStops the transition playback.
SurfaceCLSIDRetrieves the class identifier (CLSID) of the surface.
TerminateRequestTerminates a task based on its request ID value that was used when the task was scheduled.
TerminateTasksTerminates a set of tasks previously scheduled by the task manager.
TestIntersectTests whether the specified bounds intersect the data object.
TopRetrieves the maximum y-axis value.
UnionBoundsCreates a union of the two specified bounds and assigns the result to the data object.
UnpackUnpacks the specified number of samples into the supplied buffer in ARGB32 pixel format. This method can only unpack a single row. Use UnpackRect to unpack multiple rows.
UnpackPremultUnpacks the specified number of samples into the supplied buffer in alpha-premultiplied PMARGB32 pixel format. This method only unpacks a single row. Use UnpackRect to unpack multiple rows.
UnpackRectUnpacks a subsection of source samples defined by a rectangle structure and advances the horizontal position of the read pointer. Use to unpack multiple rows.
WidthRetrieves the width of the x-axis dimension.
WidthRetrieves the width of the specified dimension.
WorkProcCalled in a response to the Execute method to render a portion of the output space to the current output surface.
WorkProcCalled by the transform base class to enable the surface to function as a transform.
Events
onfilterchangeFires when a visual filter changes state or completes a transition.
Collections
filtersRetrieves the collection of filters that have been applied to the object.