QPx_FilterPicture

QPx_FilterPicture(pictVar; pictVar):error
pictVar Picture Picture variable
filterSettings BLOB Filter settings
error Longint Error result

Apply a filter to a picture

The source picture is passed in the pictVar parameter. The source picture may be compressed or uncompressed. The filtered picture is also returned in the pictVar parameter and it is always uncompressed. If an error occurs, pictVar is set to an empty picture.

The filterSettings parameter specifies the filter to be applied and its associated settings. To let the user select a filter and retrieve the selected filter and settings, call the QPx_DoFilterSettingsDialog command.

To get all available QuickTime filters, call the QPx_GetFilterList command.

NOTE The BLOB parameter must contain filter settings that has previously been obtained using QPx_DoFilterSettingsDialog. The structure of this BLOB is private to QuickTime and cannot be constructed or altered with 4D BLOB commands. To fiddle with the settings BLOB at your own risk, use the plug-in QTAtoms.bundle that is included in the QPix distribution package.

Example

   // Displays the filter settings dialog and applies 
   // the selected filter to a picture

C_LONGINT($error)
C_PICTURE($picture)
C_TEXT($filterType)
C_BLOB($settings)

$picture:=[Images]Picture

$error:=QPx_DoFilterSettingsDialog ($settings;$filterType)

If ($error=qpx_noErr)
   
   $error:=QPx_FilterPicture ($picture;$settings)
   
   If ($error#qpx_noErr)
      
         // Handle the error
      
   End if 
   
End if 

Related commands

QPx_DoFilterSettingsDialog Display the standard QuickTime filter dialog
QPx_GetFilterList Get a list of available QuickTime filters
QPx_BrightnessContrastPicture Apply the "Escape Brightness and Contrast" filter to a picture
QPx_SharpenPicture Apply the "Sharpen" filter to a picture
QPx_BlurPicture Apply the "Blur" filter to a picture
QPx_RGBBalancePicture Apply the "RGB Balance" filter to a picture
QPx_HSLBalancePicture Apply the "HSL Balance" filter to a picture