mmplugins/imagingplugins/codecs/JPEGCodec/JPEGProxy.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <ecom/ecom.h>
       
    17 #include <ecom/implementationproxy.h>
       
    18 #include <icl/icl_uids.hrh>
       
    19 #include "JPEGConvert.h"
       
    20 #include "ExifJpegTransform.h"
       
    21 #include <iclexifimageframe.h>
       
    22 
       
    23 #include <icl/imageconstruct.h>
       
    24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    25 #include <icl/icl_uids_const.hrh>
       
    26 #include <icl/icl_uids_def.hrh>
       
    27 #endif
       
    28 
       
    29 //
       
    30 // this file doesn't contain any performance-critical code so use thumb
       
    31 // instruction set to save on some ROM footprint
       
    32 #if defined(__ARMCC__)
       
    33 #pragma thumb
       
    34 #endif
       
    35 
       
    36 class CJpegDecodeConstruct : public CImageDecodeConstruct
       
    37 	{
       
    38 public:
       
    39 	static CJpegDecodeConstruct* NewL();
       
    40 
       
    41 	// from CImageDecodeConstruct
       
    42 	CImageDecoderPlugin* NewPluginL() const;
       
    43 	CImageDecoder* NewDecoderL() const;
       
    44 	};
       
    45 
       
    46 CJpegDecodeConstruct* CJpegDecodeConstruct::NewL()
       
    47 	{
       
    48 	CJpegDecodeConstruct* self = new (ELeave) CJpegDecodeConstruct;
       
    49 	CleanupStack::PushL(self);
       
    50 	self->ConstructL();
       
    51 	CleanupStack::Pop(self);
       
    52 	return self;
       
    53 	}
       
    54 
       
    55 CImageDecoderPlugin* CJpegDecodeConstruct::NewPluginL() const
       
    56 	{
       
    57 	return CJpegDecoder::NewL();
       
    58 	}
       
    59 
       
    60 CImageDecoder* CJpegDecodeConstruct::NewDecoderL() const
       
    61 	{
       
    62 	return CJPEGImageFrameDecoder::NewL();
       
    63 	}
       
    64 
       
    65 
       
    66 class CJpegEncodeConstruct : public CImageEncodeConstruct
       
    67 	{
       
    68 public:
       
    69 	static CJpegEncodeConstruct* NewL();
       
    70 
       
    71 	// from CImageEncodeConstruct
       
    72 	CImageEncoderPlugin* NewPluginL() const;
       
    73 	CImageEncoder* NewEncoderL() const;
       
    74 	};
       
    75 
       
    76 CJpegEncodeConstruct* CJpegEncodeConstruct::NewL()
       
    77 	{
       
    78 	CJpegEncodeConstruct* self = new (ELeave) CJpegEncodeConstruct;
       
    79 	CleanupStack::PushL(self);
       
    80 	self->ConstructL();
       
    81 	CleanupStack::Pop(self);
       
    82 	return self;
       
    83 	}
       
    84 
       
    85 CImageEncoderPlugin* CJpegEncodeConstruct::NewPluginL() const
       
    86 	{
       
    87 	return CJpegEncoder::NewL();
       
    88 	}
       
    89 
       
    90 CImageEncoder* CJpegEncodeConstruct::NewEncoderL() const
       
    91 	{
       
    92 	return CJPEGImageFrameEncoder::NewL();
       
    93 	}
       
    94 
       
    95 
       
    96 
       
    97 // Exported proxy for instantiation method resolution
       
    98 
       
    99 // Define the Implementation UIDs for JPEG decoder
       
   100 const TImplementationProxy ImplementationTable[] =
       
   101 	{
       
   102 		IMPLEMENTATION_PROXY_ENTRY(KJPGDecoderImplementationUidValue, CJpegDecodeConstruct::NewL),
       
   103 		IMPLEMENTATION_PROXY_ENTRY(KJPGEncoderImplementationUidValue, CJpegEncodeConstruct::NewL),
       
   104 		IMPLEMENTATION_PROXY_ENTRY(KUidTransformJpegPluginUidValue, CExifJpegTransform::NewL),
       
   105 		IMPLEMENTATION_PROXY_ENTRY(KJPGDecoderImplementation2UidValue, CJpegDecodeConstruct::NewL),
       
   106 		IMPLEMENTATION_PROXY_ENTRY(KJPGEncoderImplementation2UidValue, CJpegEncodeConstruct::NewL)
       
   107 	};
       
   108 
       
   109 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   110 	{
       
   111 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   112 	return ImplementationTable;
       
   113 	}