Image.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**
  2. * Copyright (c) 2006-2013 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #include "Image.h"
  21. #include "ImageData.h"
  22. #include "CompressedData.h"
  23. #include "DevilHandler.h"
  24. namespace love
  25. {
  26. namespace image
  27. {
  28. namespace magpie
  29. {
  30. Image::Image()
  31. {
  32. DevilHandler::init();
  33. }
  34. Image::~Image()
  35. {
  36. DevilHandler::quit();
  37. }
  38. const char *Image::getName() const
  39. {
  40. return "love.image.magpie";
  41. }
  42. love::image::ImageData *Image::newImageData(love::filesystem::FileData *data)
  43. {
  44. return new ImageData(data);
  45. }
  46. love::image::ImageData *Image::newImageData(int width, int height)
  47. {
  48. return new ImageData(width, height);
  49. }
  50. love::image::ImageData *Image::newImageData(int width, int height, void *data, bool own)
  51. {
  52. return new ImageData(width, height, data, own);
  53. }
  54. love::image::CompressedData *Image::newCompressedData(love::filesystem::FileData *data)
  55. {
  56. return new CompressedData(data);
  57. }
  58. bool Image::isCompressed(love::filesystem::FileData *data)
  59. {
  60. return CompressedData::isCompressed(data);
  61. }
  62. } // magpie
  63. } // image
  64. } // love