This is the interface for the LEAD Video Resize filter.
typedef enum
{
RESIZE_1OVER8 = 0,
RESIZE_1OVER4 = 1,
RESIZE_1OVER2 = 2,
RESIZE_NORMAL = 3,
RESIZE_X2 = 4,
RESIZE_X4 = 5,
RESIZE_X8 = 6
} QUICKRESIZE;
Holds the predefined resizing constants.
Constant |
Description |
RESIZE_1OVER8 |
The output width and height are 1/8 of the source width and height. |
RESIZE_1OVER4 |
The output width and height are 1/4 of the source width and height. |
RESIZE_1OVER2 |
The output width and height are 1/2 of the source width and height. |
RESIZE_NORMAL |
The output width and height are same as the source width and height. |
RESIZE_X2 |
The output width and height are 2X of the source width and height. |
RESIZE_X4 |
The output width and height are 4X of the source width and height. |
RESIZE_X8 |
The output width and height are 8X of the source width and height. |
typedef enum
{
RESIZE_NORMAL = 0x0000,
RESIZE_BRESENHAM = 0x0001,
RESIZE_RESAMPLE = 0x0002,
RESIZE_BICUBIC = 0x0004,
} SIZETYPES;
Holds the resizing algorithms constants.
Constant |
Description |
RESIZE_NORMAL |
Use the normal resizing method. |
RESIZE_BRESENHAM |
Use Bresenham resizing. |
RESIZE_RESAMPLE |
Use resampling. |
RESIZE_BICUBIC |
Use bicubic resizing. |
typedef enum
{
INPUTASPECTRATIO_SQUAREPIXELS = 0,
INPUTASPECTRATIO_USEINPUT = 1,
INPUTASPECTRATIO_CUSTOM = 2,
INPUTASPECTRATIO_4_3 = 10,
INPUTASPECTRATIO_16_9 = 11,
} InputAspectRatioModeConstants;
Constant |
Description |
INPUTASPECTRATIO_SQUAREPIXELS |
Ignore the any input aspect ratio and consider the input to be square pixels. |
INPUTASPECTRATIO_USEINPUT |
Use the input aspect ratio (if present). Otherwise, consider the input to be square pixels. |
INPUTASPECTRATIO_CUSTOM |
Ignore any input aspect ratio and consider it to be given by the CustomInputAspectRatioWidth and CustomInputAspectRatioHeight properties. |
INPUTASPECTRATIO_4_3 |
Ignore the input aspect ratio and consider it to be 4:3. |
INPUTASPECTRATIO_16_9 |
Ignore the input aspect ratio and consider it to be 16:9. |
typedef enum
{
OUTPUTASPECTRATIO_SQUAREPIXELS = 0,
OUTPUTASPECTRATIO_USEINPUT = 1,
OUTPUTASPECTRATIO_CUSTOM = 2,
OUTPUTASPECTRATIO_4_3 = 10,
OUTPUTASPECTRATIO_16_9 = 11,
} OutputAspectRatioModeConstants;
Constant |
Description |
OUTPUTASPECTRATIO_SQUAREPIXELS |
Make the output aspect ratio square pixels. |
OUTPUTASPECTRATIO_USEINPUT |
Make the output aspect ratio be the same as the input aspect ratio. |
OUTPUTASPECTRATIO_CUSTOM |
Use the output aspect ratio given by the CustomOutputAspectRatioWidth and CustomOutputAspectRatioHeight properties. |
OUTPUTASPECTRATIO_4_3 |
Make the output have a 4:3 aspect ratio. |
OUTPUTASPECTRATIO_16_9 |
Make the output have a 4:3 aspect ratio. |
typedef enum
{
STRETCHMODE_STRETCH,
STRETCHMODE_FITWIDTH,
STRETCHMODE_FITHEIGHT,
STRETCHMODE_FIT,
STRETCHMODE_ENLARGEDFIT,
} StretchModeConstants;
Constant |
Description |
STRETCHMODE_STRETCH |
Ignore any input aspect ratio and stretch the video to the output width and height. Ignore the WidthControlMode and HeightControlMode properties (consider them both as Fixed). |
STRETCHMODE_FITWIDTH |
Resize the video by preserving the aspect ratio and fit to width. This might cause colored bars on top and bottom of the video or it can cause the top and bottom of the video to be truncated. |
STRETCHMODE_FITHEIGHT |
Resize the video by preserving the aspect ratio and fit to height. This might cause colored bars on left and rigth side of the video or it can cause the left and right side of the video to be truncated. |
STRETCHMODE_FIT |
Resize the video by preserving the aspect ratio and fit both width and height inside the output rectangle. This might add colored bars on the edges. |
STRETCHMODE_ENLARGEDFIT |
Resize the video by preserving the aspect ratio and enlarging the width or height so the output rectangle fits inside the resulting output. (This is the default resize mode performed by the DirectShow® renderers). This might cause video edges to be cropped. |
typedef enum
{
SIZECONTROL_FIXED,
SIZECONTROL_ADJUSTABLE,
} SizeControlModeConstants;
Constant |
Description |
SIZECONTROL_FIXED |
Keep the output size (width or height) fixed. |
SIZECONTROL_ADJUSTABLE |
You can adjust the output size (width or height) to preserve the input aspect ratio. |
typedef enum
{
SQUAREPIXELOUTPUT_SAMESIZE,
SQUAREPIXELOUTPUT_FITWIDTH,
SQUAREPIXELOUTPUT_FITHEIGHT,
SQUAREPIXELOUTPUT_INCREASESIZE,
SQUAREPIXELOUTPUT_DECREASESIZE,
} SquarePixelOutputModeConstants;
Constant |
Description |
SQUAREPIXELOUTPUT_SAMESIZE |
Keep the output size unchanged. This might distort the output. |
SQUAREPIXELOUTPUT_FITWIDTH |
Keep the output width the same and modify the output height to preserve the visual output ratio. |
SQUAREPIXELOUTPUT_FITHEIGHT |
Keep the output height the same and modify the output width to preserve the visual output ratio. |
SQUAREPIXELOUTPUT_INCREASESIZE |
Increase the video size (width or height) so the requested output size fits inside the new output size. (This is the default resizing performed by the DirectShow video renderers). |
SQUAREPIXELOUTPUT_DECREASESIZE |
Decrease the video size (width or height) so the new output size fits inside the requested output size. |
typedef enum
{
LMVResize_APILEVEL_1 = 0,
LMVResize_APILEVEL_2 = 1,
} LMVResize_APILEVEL;
Constant |
Description |
LMVResize_APILEVEL_1 |
Use the defaults from the previous versions of the resize filter. |
LMVResize_APILEVEL_2 |
Use the defaults from the current version of the resize filter. |
typedef enum
{
AUTORESIZEMODE_INCREASE = 0x00,
AUTORESIZEMODE_FITWIDTH = 0x00,
AUTORESIZEMODE_DECREASE = 0x01
AUTORESIZEMODE_FITHEIGHT = 0x01
} AutoResizeModeConstants;
Holds auto resizing mode constants
Constant |
Description |
AUTORESIZEMODE_INCREASE |
Obsolete |
AUTORESIZEMODE_DECREASE |
Obsolete |
AUTORESIZEMODE_FITWIDTH |
The height will be changed according to the width. |
AUTORESIZEMODE_FITHEIGHT |
The width will be changed according to the height. |
Type |
Name | Description |
VARIANT_BOOL |
Enabled |
VARIANT_TRUE to enable resizing. |
VARIANT_BOOL |
EnableQuickResize |
VARIANT_TRUE to enable predefined ratios selection. |
VARIANT_BOOL |
AspectRatio |
Obsolete property, use StretchMode instead. VARIANT_TRUE to preserve the size aspect ratio, if the filter input is not connected, no aspect ratio is used. |
VARIANT_BOOL |
AutoStop |
If VARIANT_TRUE, allows the graph to be stopped automatically. This is necessary when the dimensions change while the graph is running. The graph needs to be re-run after the change is applied. |
long |
Width |
New width to use. |
long |
Height |
New height to use. |
QUICKRESIZE |
QuickResize |
If EnableQuickResize is VARIANT_TRUE, this property must be set to one of the QUICKRESIZE constants. When using the QUICKRESIZE constants the Width and Height properties are ignored. |
SIZETYPES |
Flags |
One of the SIZETYPES constants, which specify the algorithm used for resizing. |
VARIANT_BOOL |
IsLEADInputPinConnected |
Read only. Returns VARIANT_TRUE if the filters input pin is connected. |
VARIANT_BOOL |
IsLEADOutputPinConnected |
Read only; returns VARIANT_TRUE if the filters output pin is connected. |
long |
InWidth |
Read only; the input stream width. |
long |
InHeight |
Read only; the input stream height. |
long |
OutWidth |
Read only; the output stream width. |
long |
OutHeight |
Read only; the output stream height. |
long |
InBits |
Read only; the input stream bits per pixel. |
long |
OutBits |
Read only; the output stream bits per pixel. |
VARIANT_BOOL |
AutoSize |
Obsolete property, use WidthControlMode and HeightControlMode instead. If selected, preserves the actual video size aspect ratio. If the width changes then the height will be changed as well. |
long |
FillColor |
The color that will be used to fill the different size. |
AutoResizeModeConstants |
AutoResizeMode |
Obsolete property, use StretchMode instead. A value that represents the auto resize mode. It must be one of AutoResizeModeConstants values. |
InputAspectRatioMode |
InputAspectRatioModeConstants |
Use this property to specify whether to use the video input aspect ratio or override it. |
CustomInputAspectRatioWidth |
long |
Width component for custom aspect ratio. Used only if InputAspectRatioMode is set to INPUTASPECTRATIO_CUSTOM. |
CustomInputAspectRatioHeight |
long |
Height component for custom aspect ratio. Used only if InputAspectRatioMode is set to INPUTASPECTRATIO_CUSTOM. |
OutputAspectRatioMode |
OutputAspectRatioModeConstants |
Use this property to specify the desired output aspect ratio. |
CustomOutputAspectRatioWidth |
long |
Width component for custom aspect ratio. Used only if OutputAspectRatioMode is set to OUTPUTASPECTRATIO_CUSTOM. |
CustomOutputAspectRatioHeight |
long |
Height component for custom aspect ratio. Used only if OutputAspectRatioMode is set to OUTPUTASPECTRATIO_CUSTOM. |
StretchMode |
StretchModeConstants |
Allows you to specify whether the input should be stretched to the output or whether the aspect ratio should be preserved. |
WidthControlMode |
SizeControlModeConstants |
Specifies whether the filter can modify the output width if necessary to preserve the input aspect ratio. This property is ignored if StretchMode is set to STRETCHMODE_STRETCH. |
HeightControlMode |
SizeControlModeConstants |
Specifies whether the filter can modify the output height if necessary to preserve the input aspect ratio. This property is ignored if StretchMode is set to STRETCHMODE_STRETCH. |
SquarePixelOutputMode |
SquarePixelOutputModeConstants |
Specifies what to do if the output does not have square pixels and the downstream filter does not preserve the aspect ratio. This setting allows you to specify how to modify the output width and height if the downstream filter insists on a square pixel output. This option overrides the WidthControlMode and HeightControlMode properties. (In other words, this indicates what should be down if the output media type is not VIDEOINFO2). |
ForceSquarePixelOutput |
VARIANT_BOOL |
Force the output to be square pixels (VIDEOINFO). In this case, the output might be resized as specified by the SquarePixelOutputMode property. |
None.
Call this method when you are about to change the resize attributes. The changes take effect when StopChangingAttributes is called with bCancelChanges set to VARIANT_FALSE.
S_OK if connected, S_FALSE otherwise.
bCancelChanges
Sets the resize attributes. Set to VARIANT_FALSE to set the resize attributes. Use VARIANT_TRUE to reset the resize attributes to the old one.
S_OK if connected, S_FALSE otherwise.
None.
This method is now obsolete. Call ResetToDefaultsEx(LMVResize_APILEVEL_1) instead.
Resets resizing to default values from the previous version of the filter.
S_OK if connected, S_FALSE otherwise.
LMVResize_APILEVEL ApiLevel.
Resets resizing to default values. The ApiLevel determines which default values to use. Current applications should set ApiLevel to LMVResize_APILEVEL_2 = 1.
The resize filter might change in the future and have different properties or default behaviour. Calling this method ensure the filter will have the same default values as they were at the time you developed your application.
It is recommended you call ResetToDefaultsEx(LMVResize_APILEVEL_2) before you start setting properties and start calling other methods for this interface.
S_OK if connected, S_FALSE otherwise.
For more information on how the filter's properties are used during the resizing process, please see the Notes and Comments section of the LEAD Video Resize Filter User Interface (2.0) topic.