svgtopt/gfx2d/inc/GfxCurveFlattenerP.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:20:46 +0100
branchRCL_3
changeset 18 1902ade171ab
parent 0 d46562c3d99d
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201026 Kit: 201035

/*
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Graphics Extension Library header file
*
*/


#ifndef GFXCURVEFLATTENERP_H
#define GFXCURVEFLATTENERP_H

#include <e32base.h>
#include <e32std.h>

#include "GfxFloatFixPt.h"

class TGfxAffineTransform;


/**
 * This class provides the methods to smooth a curve defined by control points.
 *
 *  @lib Gfx2D.lib
 *  @since 1.0
 */
class TGfxCurveFlattener
    {
    public:

        /**
         * Construct a TGfxCurveFlattener with a transform matrix.
         *
         * @since 1.0
         * @param aTransform : Transformation matrix.
         * @return
         */
                                TGfxCurveFlattener( TGfxAffineTransform* aTransform );

        /**
         * Add a quadratic curve to this object.
         *
         * @since 1.0
         * @param aRenderer : edge point list
         * @param aCtrlPoints : control points.
         * @param aLimit : number of points to flatten curve with.
         * @return
         */
        void                    AddSubCurveQuadL( CGfxEdgeListP* aRenderer,
                                                  TFloatFixPt * aCtrlPoints,
                                                  TInt32 aLimit );

        /**
         * Add a cubic curve to this object.
         *
         * @since 1.0
         * @param aRenderer : edge point list
         * @param aCtrlPoints : control points.
         * @param aLimit : number of points to flatten curve with.
         * @return
         */
        void                    AddSubCurveCubicL( CGfxEdgeListP* aRenderer,
                                                   TFloatFixPt * aCtrlPoints,
                                                   TInt32 aLimit );
    private:

        TGfxAffineTransform*    iTransform;
    };

#endif      // GFXCURVEFLATTENERP_H