/apps/desktop/libvncserver/zrlepalettehelper.h

http://ftk.googlecode.com/ · C++ Header · 46 lines · 16 code · 7 blank · 23 comment · 0 complexity · 23bb10a9f824b52e81ae90d4a87d9551 MD5 · raw file

  1. /*
  2. * Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
  3. * Copyright (C) 2003 Sun Microsystems, Inc.
  4. *
  5. * This is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This software is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this software; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  18. * USA.
  19. */
  20. /*
  21. * The PaletteHelper class helps us build up the palette from pixel data by
  22. * storing a reverse index using a simple hash-table
  23. */
  24. #ifndef __ZRLE_PALETTE_HELPER_H__
  25. #define __ZRLE_PALETTE_HELPER_H__
  26. #include "zrletypes.h"
  27. #define ZRLE_PALETTE_MAX_SIZE 127
  28. typedef struct {
  29. zrle_U32 palette[ZRLE_PALETTE_MAX_SIZE];
  30. zrle_U8 index[ZRLE_PALETTE_MAX_SIZE + 4096];
  31. zrle_U32 key[ZRLE_PALETTE_MAX_SIZE + 4096];
  32. int size;
  33. } zrlePaletteHelper;
  34. void zrlePaletteHelperInit (zrlePaletteHelper *helper);
  35. void zrlePaletteHelperInsert(zrlePaletteHelper *helper,
  36. zrle_U32 pix);
  37. int zrlePaletteHelperLookup(zrlePaletteHelper *helper,
  38. zrle_U32 pix);
  39. #endif /* __ZRLE_PALETTE_HELPER_H__ */