imagingmodules/jp2kcodec/Src/JP2KProxy.cpp
changeset 0 469c91dae73b
equal deleted inserted replaced
-1:000000000000 0:469c91dae73b
       
     1 /*
       
     2 * Copyright (c) 2003-2006 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:  JPEG2000 image encoder/decoder plugin entry point.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <ecom/ecom.h>
       
    21 #include <ecom/implementationproxy.h>
       
    22 #include <icl/imageconstruct.h>
       
    23 #include <icl/icl_uids.hrh>
       
    24 #include <JP2KUids.hrh>
       
    25 #include "JP2KFormat.h"
       
    26 #include "JP2KConvert.h"
       
    27 
       
    28 // EXTERNAL DATA STRUCTURES
       
    29 
       
    30 // EXTERNAL FUNCTION PROTOTYPES  
       
    31 
       
    32 // CONSTANTS
       
    33 
       
    34 // MACROS
       
    35 #ifdef __EABI__
       
    36 #ifndef IMPLEMENTATION_PROXY_ENTRY
       
    37 typedef TAny* TProxyNewLPtr;
       
    38 #define IMPLEMENTATION_PROXY_ENTRY(aUid, aFuncPtr) {{aUid},(TProxyNewLPtr)(aFuncPtr)}
       
    39 #endif
       
    40 #endif
       
    41 
       
    42 // LOCAL CONSTANTS AND MACROS
       
    43 
       
    44 // MODULE DATA STRUCTURES
       
    45 
       
    46 // LOCAL FUNCTION PROTOTYPES
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 
       
    50 /**
       
    51 *  CJp2kDecodeConstruct class.
       
    52 *  Implement the entry point for creating JPEG2000 decoder.
       
    53 *
       
    54 *  @lib ?library
       
    55 *  @since 2.6
       
    56 */
       
    57 class CJp2kDecodeConstruct : public CImageDecodeConstruct
       
    58 {
       
    59     public:
       
    60 
       
    61         /**
       
    62         * Two-phased constructor.
       
    63         */
       
    64         static CJp2kDecodeConstruct* NewL();
       
    65 
       
    66     public:
       
    67         
       
    68         /**
       
    69         * Instantiates JPEG 2000 plug-in.
       
    70         * @since 2.6
       
    71         * @param None.
       
    72         * @return Pointer to instantiated plug-in.
       
    73         */
       
    74         CImageDecoderPlugin* NewPluginL() const;
       
    75 };
       
    76 
       
    77 // ============================ MEMBER FUNCTIONS ===============================
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CJp2kDecodeConstruct::NewL
       
    81 // Two-phased constructor.
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 CJp2kDecodeConstruct* CJp2kDecodeConstruct::NewL()
       
    85     {
       
    86     CJp2kDecodeConstruct* self = new ( ELeave ) CJp2kDecodeConstruct;
       
    87 
       
    88     CleanupStack::PushL( self );
       
    89     self->ConstructL();
       
    90     CleanupStack::Pop( self );
       
    91 
       
    92     return self;
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CJp2kDecodeConstruct::NewPluginL
       
    97 // Creating a new CJp2kDecodeConstruct object.
       
    98 // (other items were commented in a header).
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 CImageDecoderPlugin* CJp2kDecodeConstruct::NewPluginL() const
       
   102     {
       
   103     return CJp2kDecoder::NewL();
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // Global implementation uid array
       
   108 // Define the Implementation UIDs for JP2K decoder.
       
   109 // (other items were commented in a header).
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 const TImplementationProxy ImplementationTable[] =
       
   113 {
       
   114     // Decoder recognize two different formats
       
   115     // JP2 file format and JP2 codestream 
       
   116     IMPLEMENTATION_PROXY_ENTRY( KJ2KDecoderImplementationUidValueFileFormat, 
       
   117     CJp2kDecodeConstruct::NewL ),
       
   118     IMPLEMENTATION_PROXY_ENTRY( KJ2KDecoderImplementationUidValueCodeStream, 
       
   119     CJp2kDecodeConstruct::NewL ),
       
   120     IMPLEMENTATION_PROXY_ENTRY( KJ2KDecoderImplementationUid, 
       
   121     CJp2kDecodeConstruct::NewL )
       
   122 };
       
   123 
       
   124 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // ImplementationGroupProxy Implements proxy interface for ECom
       
   128 // Exported proxy for instantiation method resolution.
       
   129 // -----------------------------------------------------------------------------
       
   130 //
       
   131 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(  //lint !e714 Used by ECom
       
   132     TInt& aTableCount ) // Number of tables 
       
   133     {
       
   134     aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
       
   135     return ImplementationTable;
       
   136     }