This method uses spline function to modifiy the YCrCb values of a raster image.

[C++Builder]   [ bool = ]imagekitcontrolname->Effect->YCCSpline(const TPoint * Points, const int Points_Size, const TPoint * spPoints, const int spPoints_Size, bool Yb, bool Cr, bool Cb)
[C++Builder]   [ bool = ]imagekitcontrolname->Effect->YCCSpline(const TPoint * spPoints, const int spPoints_Size, bool Yb, bool Cr, bool Cb)
[Delphi]   [ Boolean = ]imagekitcontrolname.Effect.YCCSpline(const Points: array of TPoint; const spPoints: array of TPoint; Yb, Cr, Cb: Boolean)
[Delphi]   [ Boolean = ]imagekitcontrolname.Effect.YCCSpline(const spPoints: array of TPoint; Yb, Cr, Cb: Boolean)

Parameters

Name Explanation
Points An array of x and y coordinate values defining points of a polygonal area on the image. (in pixels)
In C++Builder, the size of the Points array is given by Points_Size - 1
spPoints An array of YCrCb values values assigned to various points along the YCCSpline curve. (from 0 to 255)
In C++Builder, the size of the spPoints array is given by spPoints_Size - 1
Yb Affects the Y component (luminance) of the YCrCb value (False(0): does not affect the Y component, True( nonzero): affects the Y component)
Cr Affects the Cr component (chrominance) of the YCrCb value (False(0): does not affect the Cr component, True( nonzero): affects the Cr component)
Cb Affects the Cb component (chrominance) of the YCrCb value (False(0): does not affect the Cb component, True( nonzero): affects the Cb component)

Return Value

Returns True if successful, otherwise returns False.

Explanation

The YCCSpline method uses a spline function to modify the YCrCb values of a raster image. A spline function is a method of interpolating values that lay in between data points. In other words it produces a smooth curve from a limited set of points.

The YCCSpline method allows you to define the relationship between the input YCrCb values in the original image and output YCrCb values in the newly created image. You do this by specifying a set of coordinate points where the input YCrCb values are the x coordinates and the output YCrCb values are the y coordinates. These coordinate points are stored in arrays and passed to the YCCSpline method through the spx and spy parameters. The YCCSpline method then interpolates a "smooth" curve from these coordinate points. The graphic representation of this relationship between input YCrCb and output YCrCb values is known as the YCCSpline curve. A sample YCCSpline curve is shown in the diagram below:

In the above diagram, the Cr default YCCSpline curve represents no change between input YCrCb values and output YCrCb values. In this case, the newly created image is exactly the same as the orginal image. The red YCCSpline curve represents an increase in contrast between the original image and the newly created image. It was generated from the following points:

          Point     (spx values,spy values)
          -----------------------------------------------------
          Point A     (0,0)
          Point B     (64,32)
          Point C     (128,128)
          Point D     (192,160)
          Point E     (255,255)

At the midpoint of the Yb YCCSpline curve, the input YCrCb value of 128 equals the output YCrCb value of 128. At points below the midpoint, however, the output YCrCb values are lower than the input YCrCb values. This means that dark colors become darker. Conversely, at points above the midpoint, output YCrCb values are higher than input YCrCb values. This means that light colors become lighter. This particular YCCSpline curve therefore increases the contrast of the image.

An YCCSpline curve that decreases contrast could be defined with the following points:

          Point     (spx values,spy values)
          ----------------------------------------------------
          Point A     (0,0)
          Point B     (64, 96)
          Point C     (128,128)
          Point D     (225, 192)
          Point E     (255,255)

To execute the YCCSpline method, set the image handle of the image in the ImageHandle property or the Layer(LayerNo).ImageHandle property. The YCCSpline method supports 1, 4, 8, 16, 24, and 32 bit images.

Before executing the YCCSpline method, you must set the area on the image that will be affected. There are 4 ways to do this.

  1. To use a mask image, set the SelectMode property to vikEffectMask. Set the mask image handle in the MaskImageHandle property
  2. To process the total image, set the SelectMode property to vikEffectAll.
  3. To process the polygonal area on the image, set the SelectMode property to vikEffectPolygon. Select the polygon by setting the appropriate coordinate values for the points of the polygon in the Points array. The number of points defining the polygon must be 3 or more.
  4. To process an elliptical area on the image, set the SelectMode property to vikEffectEllipse. Select the ellipse by setting the appropriate values for the bounding rectangle in the RectLeft, RectTop, RectRight, and RectBottom properties

When the SelectMode property is set to vikEffectPolygon or vikEffectEllipse, the InOut property should be set. When the SelectMode property is set to values other than vikEffectPolygon, please set the Points parameter to a dummy array or to NULL.

If successful the resulting raster image data is set in the LayerNo property (the ImageHandle property or the Layer(LayerNo).ImageHandle property. If unsuccessful, 0 is returned.

When the Caption, Message, and ButtonName properties are blank, the progress dialog box will not be displayed. When the progress dialog box is displayed, the percentage that the processing has completed will be shown in the dialog box.

Differences from the ImageKit 7/8/9/10 ActiveX

The parameters x, y have been changed to type TPoint
In Delphi, it is not necessary to pass the size of the array of x, y points.

The ImageKit10 VCL is a product created by Newtone Corporation