svgtopt/nvgdecoder/inc/nvgfittoviewbox.inl
changeset 0 d46562c3d99d
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     1 /*
       
     2 * Copyright (c) 2009 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 // Setter function for viewBox
       
    20 // ---------------------------------------------------------------------------
       
    21 inline void CNvgFitToViewBoxImpl::SetViewBox(TReal avbX, TReal avbY, TReal avbW, TReal avbH)
       
    22     {
       
    23     ivbX = avbX;
       
    24     ivbY = avbY;
       
    25     ivbW = avbW;
       
    26     ivbH = avbH;
       
    27     iViewBoxDefined = ETrue;
       
    28     }
       
    29 
       
    30 
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // Setter function for Alignment
       
    34 // ---------------------------------------------------------------------------
       
    35 inline void CNvgFitToViewBoxImpl::SetAlign(TNvgAlignStatusType aAlignStatus)    
       
    36     {
       
    37     iAlign = aAlignStatus;
       
    38     }
       
    39 
       
    40 
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // Setter function for Scaling of viewport to viewbox
       
    44 // ---------------------------------------------------------------------------
       
    45 inline void CNvgFitToViewBoxImpl::SetScaling(TNvgMeetOrSliceType aMeetSlice)    
       
    46     {
       
    47     iMeetSlice = aMeetSlice;
       
    48     }
       
    49 
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // Setter function for setting current transformation matrix
       
    53 // ---------------------------------------------------------------------------
       
    54 inline void CNvgFitToViewBoxImpl::SetTransform(TReal aM00, TReal aM01, TReal aM02, TReal aM10, TReal aM11, TReal aM12)
       
    55     {
       
    56     iM00 = aM00;    
       
    57     iM01 = aM01;
       
    58     iM02 = aM02;
       
    59     iM10 = aM10;
       
    60     iM11 = aM11;
       
    61     iM12 = aM12;
       
    62     }
       
    63 
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Setter function for translation factors
       
    68 // ---------------------------------------------------------------------------
       
    69 inline void CNvgFitToViewBoxImpl::Translate(TReal aTx, TReal aTy)
       
    70     {
       
    71     TReal lTranslateMatrix[6] =  { 1, 0, aTx, 0, 1, aTy};
       
    72     Concatenate(lTranslateMatrix);
       
    73     }
       
    74 
       
    75 
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // Setter function for Scaling factors
       
    79 // ---------------------------------------------------------------------------
       
    80 inline void CNvgFitToViewBoxImpl::Scale(TReal aSx, TReal aSy)
       
    81     {
       
    82     TReal lScaleMatrix[6] = { aSx, 0, 0, 0, aSy, 0};
       
    83     Concatenate(lScaleMatrix);
       
    84     }
       
    85 
       
    86 
       
    87 inline void CNvgFitToViewBoxImpl::Concatenate(TReal aMatrix[6])
       
    88     {
       
    89     Concatenate(aMatrix[0], aMatrix[1], aMatrix[2], aMatrix[3], aMatrix[4], aMatrix[5]);
       
    90     }
       
    91 //===========================End Of File=================================================
       
    92