uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitextureautosizeparams.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c)  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:   Declares huitextureautosizeparams texture class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_HUITEXTUREAUTOSIZEPARAMS_H
       
    21 #define C_HUITEXTUREAUTOSIZEPARAMS_H
       
    22 
       
    23 #include <e32std.h>
       
    24 
       
    25 /**
       
    26  * Texture auto size parameters. These can be used to control texture 
       
    27  * resizing when automatic size calculation is enabled. Actual behaviour
       
    28  * of parameters may depend also on the used renderer, e.g. texture
       
    29  * resizing algorithm may be more aggressive in BitGdi than in 
       
    30  * OpenGLES renderer.
       
    31  * 
       
    32  * Example of use 
       
    33  * @code
       
    34  * texture->EnableAutoSizeCalculation();
       
    35  * THuiTextureAutoSizeParams newparams = texture->AutoSizeParams();
       
    36  * newparams.SetSizeLowerThreshold(THuiTextureAutoSizeParams::EHigh);
       
    37  * newparams.SetSizeUpperThreshold(THuiTextureAutoSizeParams::ELow);
       
    38  * texture->SetAutoSizeParams(newparams);
       
    39  * @endcode
       
    40  *
       
    41  */
       
    42 NONSHARABLE_CLASS( THuiTextureAutoSizeParams )
       
    43     {
       
    44 
       
    45 public:
       
    46     
       
    47     enum
       
    48         {
       
    49         EVeryLow = -20,
       
    50         ELow = -10,
       
    51         EMedium = 0,
       
    52         EHigh = 10,
       
    53         EVeryHigh = 20
       
    54         };
       
    55     
       
    56     /**
       
    57      * Constructor.
       
    58      */
       
    59     IMPORT_C THuiTextureAutoSizeParams();
       
    60     
       
    61     /** 
       
    62      * Gets a size threshold which defines how much required size may
       
    63      * decrease before it is considered to be small enough to 
       
    64      * cause texture resizing.
       
    65      *
       
    66      * @return Texture downsize threshold
       
    67      */  
       
    68     IMPORT_C TInt SizeLowerThreshold() const;
       
    69 
       
    70     /** 
       
    71      * Sets a size threshold which defines how much required size may
       
    72      * decrease before it is considered to be small enough to 
       
    73      * cause texture resizing.
       
    74      * 
       
    75      * Exmple: Setting value to EVeryLow causes texture to be 
       
    76      * very easily resized to a smaller size if needed. 
       
    77      * 
       
    78      * @param aSizeLowerThreshold Texture downscale threshold
       
    79      */  
       
    80     IMPORT_C void SetSizeLowerThreshold(TInt aSizeLowerThreshold);
       
    81 
       
    82     /** 
       
    83      * Gets a size threshold which defines how much required size may
       
    84      * increase before it is considered to be big enough to 
       
    85      * cause texture resizing.
       
    86      *
       
    87      * @return Texture upscale threshold
       
    88      */  
       
    89     IMPORT_C TInt SizeUpperThreshold() const;
       
    90 
       
    91     /** 
       
    92      * Sets a size threshold which defines how much required size may
       
    93      * increase before it is considered to be big enough to 
       
    94      * cause texture resizing.
       
    95      *
       
    96      * Exmple: Setting value to EVeryLow causes texture to be 
       
    97      * very easily resized to a larger size if needed. 
       
    98      *
       
    99      * @param aSizeUpperThreshold Texture upscale threshold
       
   100      */  
       
   101     IMPORT_C void SetSizeUpperThreshold(TInt aSizeUpperThreshold);
       
   102 
       
   103     /**
       
   104      * Gets the minumum amount of resize. If height or width difference 
       
   105      * between current size and required size is smaller than threshold
       
   106      * specified by this value, resizing is not done 
       
   107      * (except if the current texture size is zero).
       
   108      * @return aMinSizeChange 
       
   109      */
       
   110      IMPORT_C TInt MinSizeChange() const;   
       
   111 
       
   112     /**
       
   113      * Sets the minumum amount of resize. If height or width difference 
       
   114      * between current size and required size is smaller than threshold
       
   115      * specified by this value, resizing is not done 
       
   116      * (except if the current texture size is zero).
       
   117      *
       
   118      * Exmple: Setting value to EHigh can be used to prevent unnecessary
       
   119      * size changes if the required size varies often but changes are small.
       
   120      *
       
   121      * @param aMinSizeChange 
       
   122      */
       
   123      IMPORT_C void SetMinSizeChange(TInt aMinSizeChange);   
       
   124 
       
   125     /**
       
   126      * Gets size threshold under which relative resizing calculations are
       
   127      * settled to be less aggressive than specified. This is used to avoid unnecessary
       
   128      * resizing when texture size is very small (small pixel changes may be large
       
   129      * relative changes)
       
   130      *
       
   131      * @return Size threshold.
       
   132      */
       
   133     IMPORT_C TInt DownsizeSettleThreshold() const;
       
   134 
       
   135     /**
       
   136      * Sets size threshold under which relative resizing calculations are
       
   137      * settled to be less aggressive than specified. This is used to avoid unnecessary
       
   138      * resizing when texture size is very small (small pixel changes may be large
       
   139      * relative changes)
       
   140      *
       
   141      * @param aDownsizeSettlethreshold Size threshold.
       
   142      */
       
   143     IMPORT_C void SetDownsizeSettleThreshold(TInt aDownsizeSettleThreshold);
       
   144      
       
   145 
       
   146 private:
       
   147     
       
   148     /** Lower size threshold */
       
   149     TInt iSizeLowerThreshold;
       
   150     /** Higher size threshold */
       
   151     TInt iSizeUpperThreshold;
       
   152     /** Min resize amount that makes sense to do */
       
   153     TInt iMinSizeChange;            
       
   154     /** Size when texture is so small that relative lower/upper thresholds are no more followed strictly */
       
   155     TInt iDownsizeSettleThreshold;
       
   156     /** Reserved for future use */
       
   157     TInt iSpare[10];
       
   158     };
       
   159 #endif