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.

decoderfactorypng.h 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
  2. **
  3. ** Copyright (C) 1995-2003 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. #ifndef DECODERFACTORYPNG_H
  10. #define DECODERFACTORYPNG_H
  11. #include "modules/img/imagedecoderfactory.h"
  12. #ifdef SELFTEST
  13. class OpBitmap;
  14. #endif
  15. class DecoderFactoryPng : public ImageDecoderFactory
  16. {
  17. public:
  18. #if defined(INTERNAL_PNG_SUPPORT) || defined(ASYNC_IMAGE_DECODERS_EMULATION)
  19. ImageDecoder* CreateImageDecoder(ImageDecoderListener* listener);
  20. #endif // INTERNAL_PNG_SUPPORT
  21. BOOL3 CheckSize(const UCHAR* data, INT32 len, INT32& width, INT32& height);
  22. BOOL3 CheckType(const UCHAR* data, INT32 len);
  23. #ifdef SELFTEST
  24. /** Vertify a bitmap against a tga file.
  25. * @param refFile the reference file to compare the bitmap to.
  26. * @param bitmap the data to check
  27. * @param maxPSNR maximum peek signal to noise ratio (http://en.wikipedia.org/wiki/PSNR). The maxPSNR should be 10^(psnr/10) to avoid log10 in the function.
  28. * @param maxComponentDiff the maximum difference in a single component of the image.
  29. * @param regenerate write the outdata to the file before checking. Should only be true when creating new selftest or updating it.
  30. * @returns OpStatus::OK if the images match, OpStatus::ERR it they don't and OpStatus::ERR_NO_MEMory if there was not enough memory to test. */
  31. static OP_STATUS verify(const char* refFile, const OpBitmap* bitmap, unsigned int linesToTest, unsigned int maxComponentDiff = 1, unsigned int maxPSNR = 0, BOOL regenerate = FALSE);
  32. static OP_STATUS selftest_verify(const char* refFile, const OpBitmap* bitmap, unsigned int linesToTest, unsigned int maxComponentDiff = 1, unsigned int maxPSNR = 0, BOOL regenerate = FALSE) { return verify(refFile, bitmap, linesToTest, maxComponentDiff, maxPSNR, regenerate); }
  33. static OP_STATUS verify(const char* refFile, unsigned int width, unsigned int height, unsigned int stride, UINT32* pixels, unsigned int linesToTest, unsigned int maxComponentDiff = 1, unsigned int maxPSNR = 0, BOOL regenerate = FALSE);
  34. static OP_STATUS selftest_verify(const char* refFile, unsigned int width, unsigned int height, unsigned int stride, UINT32* pixels, unsigned int linesToTest, unsigned int maxComponentDiff = 1, unsigned int maxPSNR = 0, BOOL regenerate = FALSE) { return verify(refFile, width, height, stride, pixels, linesToTest, maxComponentDiff, maxPSNR, regenerate); }
  35. #endif // SELFTEST
  36. };
  37. #endif // !DECODERFACTORYPNG_H