iljpg.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: iljpg.h /main/3 1995/10/23 15:54:01 rswiston $ */
  24. /**---------------------------------------------------------------------
  25. ***
  26. *** (c)Copyright 1992 Hewlett-Packard Co.
  27. ***
  28. *** RESTRICTED RIGHTS LEGEND
  29. *** Use, duplication, or disclosure by the U.S. Government is subject to
  30. *** restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
  31. *** Technical Data and Computer Software clause in DFARS 252.227-7013.
  32. *** Hewlett-Packard Company
  33. *** 3000 Hanover Street
  34. *** Palo Alto, CA 94304 U.S.A.
  35. *** Rights for non-DOD U.S. Government Departments and Agencies are as set
  36. *** forth in FAR 52.227-19(c)(1,2).
  37. ***
  38. ***-------------------------------------------------------------------*/
  39. #ifndef ILJPG_H
  40. #define ILJPG_H
  41. #define ILJPG_MAX_COMPS 4 /* max # of components (IL "samples") */
  42. /* JPEG marker codes */
  43. #define ILJPGM_FIRST_BYTE 0xFF /* first byte of all JPEG markers */
  44. #define ILJPGM_TEM 0x01 /* TEMporary */
  45. #define ILJPGM_SOF0 0xC0 /* Start Of Image, 0 = baseline JPEG */
  46. #define ILJPGM_DHT 0xC4 /* Define Huffman Table */
  47. #define ILJPGM_SOI 0xD8 /* Start Of Image */
  48. #define ILJPGM_RST0 0xD0 /* ReSeT markers 0..7 */
  49. #define ILJPGM_RST1 0xD1
  50. #define ILJPGM_RST2 0xD2
  51. #define ILJPGM_RST3 0xD3
  52. #define ILJPGM_RST4 0xD4
  53. #define ILJPGM_RST5 0xD5
  54. #define ILJPGM_RST6 0xD6
  55. #define ILJPGM_RST7 0xD7
  56. #define ILJPGM_EOI 0xD9 /* End Of Image */
  57. #define ILJPGM_SOS 0xDA /* Start Of Scan */
  58. #define ILJPGM_DQT 0xDB /* Define Quantization Table */
  59. #define ILJPGM_DRI 0xDD /* Define Restart Interval */
  60. #define ILJPGM_APP0 0xE0 /* APPlication marker "0" */
  61. typedef int iljpgError;
  62. typedef unsigned char iljpgByte;
  63. typedef iljpgByte *iljpgPtr;
  64. typedef struct {
  65. int horiFactor;
  66. int vertFactor;
  67. int QTableIndex;
  68. int DCTableIndex;
  69. int ACTableIndex;
  70. } iljpgCompDataRec, *iljpgCompDataPtr;
  71. typedef struct {
  72. iljpgPtr QTables[4];
  73. iljpgPtr DCTables[4];
  74. iljpgPtr ACTables[4];
  75. int restartInterval;
  76. int width;
  77. int height;
  78. int maxHoriFactor;
  79. int maxVertFactor;
  80. int nComps;
  81. iljpgCompDataRec comp[ILJPG_MAX_COMPS];
  82. } iljpgDataRec, *iljpgDataPtr;
  83. /* Declarations to enable symbol hiding if single compiled */
  84. #ifndef ILJPG_PUBLIC_EXTERN
  85. #define ILJPG_PUBLIC_EXTERN extern
  86. #endif
  87. #ifndef ILJPG_PUBLIC
  88. #define ILJPG_PUBLIC
  89. #endif
  90. #ifndef ILJPG_PRIVATE_EXTERN
  91. #define ILJPG_PRIVATE_EXTERN extern
  92. #endif
  93. #ifndef ILJPG_PRIVATE
  94. #define ILJPG_PRIVATE
  95. #endif
  96. #endif