javauis/lcdui_akn/lcdgd/inc/calctransform.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALCTRANSFORM_H
       
    20 #define CALCTRANSFORM_H
       
    21 
       
    22 #include <gdi.h>
       
    23 #include <lcdgdrv.h>
       
    24 #include "lcdgdrvif.h"
       
    25 #include "lcdtransform.h"
       
    26 
       
    27 
       
    28 /**
       
    29  * Compute the TLcdTransform mapping between aSrcRect and aDstRect with transform type
       
    30  * aSrcTransform.
       
    31  */
       
    32 IMPORT_C TLcdTransform CalcTransform
       
    33 (
       
    34     const TRect&   aDstRect,            // unclipped
       
    35     const TRect&   aSrcRect,            // unclipped
       
    36     TTransformType aSrcTransform
       
    37 );
       
    38 
       
    39 /**
       
    40  * Calculate clipped source and destination rectangles for
       
    41  * src to dst transform aSrcTransform. This function calculates
       
    42  * the largest corresponding subrectangles of aDstRect and aSrcRect
       
    43  * that also lie within aDstClipRect and aSrcClipRect respectively.
       
    44  */
       
    45 IMPORT_C void ClipTransformRect
       
    46 (
       
    47     TRect& aDstRect,                    // in/out
       
    48     TRect& aSrcRect,                    // in/out
       
    49     const TRect& aDstClipRect,          // input
       
    50     const TRect& aSrcClipRect,          // input
       
    51     TLcdTransform& aSrcTransform        // src to target transform
       
    52 );
       
    53 
       
    54 /**
       
    55  * Clip source and dst rects against source and dst clip rects, maintaining mapping (i.e. no stretch)
       
    56  */
       
    57 IMPORT_C void ClipRects(TRect& aDstRect, const TRect& aDstClip, TRect& aSrcRect, const TRect& aSrcClip);
       
    58 
       
    59 /**
       
    60  *@return ETrue if aSrcRect and aDstRect correspond under transformation aTransform
       
    61  */
       
    62 IMPORT_C TBool CheckTransform(const TRect& aDstRect, const TRect& aSrcRect, const TLcdTransform aTransform);
       
    63 
       
    64 /**
       
    65  *@return ETrue if aDstRect is completely contained within rectangle of size aDstSize, and
       
    66  * aDstRect transformed by aTransform is completely contained within rectangle of size aSrcSize.
       
    67  */
       
    68 IMPORT_C TBool CheckBounds(const TSize& aDstSize, const TSize& aSrcSize, const TRect& aDstRect, const TLcdTransform& aTransform);
       
    69 
       
    70 #endif // CALCTRANSFORM_H