/src/canvas/dummy/ftk_bitmap_dummy.c

http://ftk.googlecode.com/ · C · 98 lines · 51 code · 19 blank · 28 comment · 5 complexity · 403c6b774f609976bf22db97427cc958 MD5 · raw file

  1. /*
  2. * File: ftk_bitmap_dummy.c
  3. * Author: Li XianJing <xianjimli@hotmail.com>
  4. * Brief: dummy bitmap implemntation.
  5. *
  6. * Copyright (c) 2009 - 2011 Li XianJing <xianjimli@hotmail.com>
  7. *
  8. * Licensed under the Academic Free License version 2.1
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. */
  24. /*
  25. * History:
  26. * ================================================================
  27. * 2011-10-03 Li XianJing <xianjimli@hotmail.com> created
  28. */
  29. #include "ftk_bitmap.h"
  30. #include "ftk_globals.h"
  31. FtkBitmap* ftk_bitmap_create(int w, int h, FtkColor color)
  32. {
  33. FtkBitmap* thiz = (FtkBitmap*)FTK_ALLOC(sizeof(FtkBitmap));
  34. return thiz;
  35. }
  36. FtkBitmap* ftk_bitmap_create_with_native(void* bitmap)
  37. {
  38. FtkBitmap* thiz = (FtkBitmap*)FTK_ALLOC(sizeof(FtkBitmap));
  39. if(thiz != NULL)
  40. {
  41. thiz->ref = 1;
  42. thiz->data = bitmap;
  43. }
  44. return thiz;
  45. }
  46. void* ftk_bitmap_get_native(FtkBitmap* thiz)
  47. {
  48. return_val_if_fail(thiz != NULL, NULL);
  49. return thiz->data;
  50. }
  51. int ftk_bitmap_width(FtkBitmap* thiz)
  52. {
  53. return 0;
  54. }
  55. int ftk_bitmap_height(FtkBitmap* thiz)
  56. {
  57. return 0;
  58. }
  59. FtkColor* ftk_bitmap_lock(FtkBitmap* thiz)
  60. {
  61. return NULL;
  62. }
  63. void ftk_bitmap_unlock(FtkBitmap* thiz)
  64. {
  65. return;
  66. }
  67. FtkColor ftk_bitmap_get_pixel(FtkBitmap* thiz, int x, int y)
  68. {
  69. FtkColor c = {0, 0, 0, 0};
  70. return c;
  71. }
  72. void ftk_bitmap_destroy(FtkBitmap* thiz)
  73. {
  74. if(thiz != NULL)
  75. {
  76. FTK_ZFREE(thiz, sizeof(FtkBitmap));
  77. }
  78. return;
  79. }