Opera 12.15 Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

imageloadernopremultiply.h 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
  2. **
  3. ** Copyright (C) 2010 Opera Software AS. All rights reserved.
  4. **
  5. ** This file is part of the Opera web browser. It may not be distributed
  6. ** under any circumstances.
  7. **
  8. */
  9. #ifdef IMGLOADER_NO_PREMULTIPLY
  10. #ifndef IMGLOADER_NO_PREMULTIPLY_H
  11. #define IMGLOADER_NO_PREMULTIPLY_H
  12. #include "modules/img/src/imagemanagerimp.h"
  13. // Forward declarations.
  14. class VEGASWBuffer;
  15. /**
  16. * This class takes an ImageContentProvider and decodes the image data into a VEGASWBuffer without
  17. * doing any alpha premultiplication and optionally also ignoring the color space conversions in the
  18. * image decoders.
  19. */
  20. class ImageLoaderNoPremultiply : public ImageDecoderListener
  21. {
  22. public:
  23. /** Load (decode) a complete image. Will not yeild until the entire first
  24. * frame of the image is decoded and will return an error if not enough of
  25. * the images data has been loaded to decode the first frame. */
  26. static OP_STATUS Load(ImageContentProvider* content_provider, VEGASWBuffer **swBuffer, BOOL ignoreColorSpaceConversion);
  27. private:
  28. // Private constructor and destructor as we only want this to be used via Load().
  29. ImageLoaderNoPremultiply();
  30. ~ImageLoaderNoPremultiply();
  31. OP_STATUS DoLoad();
  32. // Overloaded methods from ImageDecoderListener.
  33. virtual void OnLineDecoded(void* data, INT32 line, INT32 lineHeight);
  34. virtual BOOL OnInitMainFrame(INT32 width, INT32 height);
  35. virtual void OnNewFrame(const ImageFrameData& image_frame_data);
  36. virtual void OnAnimationInfo(INT32 nrOfRepeats);
  37. virtual void OnDecodingFinished();
  38. #ifdef IMAGE_METADATA_SUPPORT
  39. virtual void OnMetaData(ImageMetaData id, const char* data);
  40. #endif // IMAGE_METADATA_SUPPORT
  41. #ifdef EMBEDDED_ICC_SUPPORT
  42. void OnICCProfileData(const UINT8* data, unsigned datalen);
  43. #endif // EMBEDDED_ICC_SUPPORT
  44. virtual BOOL IgnoreColorSpaceConversions() const;
  45. ImageContentProvider *m_contentProvider;
  46. ImageDecoder *m_imageDecoder;
  47. VEGASWBuffer **m_swBuffer;
  48. UINT8 *m_palette;
  49. unsigned int m_scanlinesAdded;
  50. BOOL m_ignoreColorSpaceConversion;
  51. BOOL m_firstFrameLoaded;
  52. unsigned int m_framesAdded;
  53. #ifdef EMBEDDED_ICC_SUPPORT
  54. ImageColorTransform *m_color_transform;
  55. #endif // EMBEDDED_ICC_SUPPORT
  56. };
  57. #endif //IMGLOADER_NO_PREMULTIPLY_H
  58. #endif //IMGLOADER_NO_PREMULTIPLY