j2k.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Text;
  30. namespace OpenSim.Framework.OpenJpeg
  31. {
  32. public static class j2k
  33. {
  34. }
  35. public enum J2K_STATUS
  36. {
  37. J2K_STATE_MHSOC = 0x0001, /**< a SOC marker is expected */
  38. J2K_STATE_MHSIZ = 0x0002, /**< a SIZ marker is expected */
  39. J2K_STATE_MH = 0x0004, /**< the decoding process is in the main header */
  40. J2K_STATE_TPHSOT = 0x0008, /**< the decoding process is in a tile part header and expects a SOT marker */
  41. J2K_STATE_TPH = 0x0010, /**< the decoding process is in a tile part header */
  42. J2K_STATE_MT = 0x0020, /**< the EOC marker has just been read */
  43. J2K_STATE_NEOC = 0x0040, /**< the decoding process must not expect a EOC marker because the codestream is truncated */
  44. J2K_STATE_ERR = 0x0080 /**< the decoding process has encountered an error */
  45. }
  46. public enum J2K_T2_MODE
  47. {
  48. THRESH_CALC = 0, /** Function called in Rate allocation process*/
  49. FINAL_PASS = 1 /** Function called in Tier 2 process*/
  50. }
  51. public struct opj_stepsize
  52. {
  53. public int expn;
  54. public int mant;
  55. }
  56. public struct opj_tccp
  57. {
  58. public int csty;
  59. public int numresolutions;
  60. public int cblkw;
  61. public int cblkh;
  62. public int cblksty;
  63. public int qmfbid;
  64. public int qntsty;
  65. /// <summary>
  66. /// don't forget to initialize 97 elements
  67. /// </summary>
  68. public opj_stepsize[] stepsizes;
  69. public int numgbits;
  70. public int roishift;
  71. /// <summary>
  72. /// Don't forget to initialize 33 elements
  73. /// </summary>
  74. public int[] prcw;
  75. }
  76. public struct opj_tcp
  77. {
  78. public int first;
  79. public int csty;
  80. public PROG_ORDER prg;
  81. public int numlayers;
  82. public int mct;
  83. /// <summary>
  84. /// don't forget to initialize to 100
  85. /// </summary>
  86. public float[] rates;
  87. public int numpocs;
  88. public int POC;
  89. /// <summary>
  90. /// Don't forget to initialize to 32
  91. /// </summary>
  92. public opj_poc[] pocs;
  93. public byte ppt_data;
  94. public byte ppt_data_first;
  95. public int ppt;
  96. public int ppt_store;
  97. public int ppt_len;
  98. /// <summary>
  99. /// Don't forget to initialize 100 elements
  100. /// </summary>
  101. public float[] distoratio;
  102. public opj_tccp tccps;
  103. }
  104. public struct opj_cp
  105. {
  106. public CINEMA_MODE cinema;
  107. public int max_comp_size;
  108. public int img_size;
  109. public RSIZ_CAPABILITIES rsiz;
  110. public sbyte tp_on;
  111. public sbyte tp_flag;
  112. public int tp_pos;
  113. public int distro_alloc;
  114. public int fixed_alloc;
  115. public int fixed_quality;
  116. public int reduce;
  117. public int layer;
  118. public LIMIT_DECODING limit_decoding;
  119. public int tx0;
  120. public int ty0;
  121. public int tdx;
  122. public int tdy;
  123. public sbyte? comment;
  124. public int tw;
  125. public int th;
  126. public int? tileno;
  127. public byte ppm_data;
  128. public byte ppm_data_first;
  129. public int ppm;
  130. public int ppm_store;
  131. public int ppm_previous;
  132. public int ppm_len;
  133. public opj_tcp tcps;
  134. public int matrice;
  135. }
  136. public static class j2kdefines
  137. {
  138. public const uint J2K_CP_CSTY_PRT = 0x01;
  139. public const uint J2K_CP_CSTY_SOP = 0x02;
  140. public const uint J2K_CP_CSTY_EPH = 0x04;
  141. public const uint J2K_CCP_CSTY_PRT = 0x01;
  142. public const uint J2K_CCP_CBLKSTY_LAZY = 0x01;
  143. public const uint J2K_CCP_CBLKSTY_RESET = 0x02;
  144. public const uint J2K_CCP_CBLKSTY_TERMALL = 0x04;
  145. public const uint J2K_CCP_CBLKSTY_VSC = 0x08;
  146. public const uint J2K_CCP_CBLKSTY_PTERM =0x10;
  147. public const uint J2K_CCP_CBLKSTY_SEGSYM = 0x20;
  148. public const uint J2K_CCP_QNTSTY_NOQNT = 0;
  149. public const uint J2K_CCP_QNTSTY_SIQNT = 1;
  150. public const uint J2K_CCP_QNTSTY_SEQNT = 2;
  151. public const uint J2K_MS_SOC = 0xff4f; /**< SOC marker value */
  152. public const uint J2K_MS_SOT = 0xff90; /**< SOT marker value */
  153. public const uint J2K_MS_SOD = 0xff93; /**< SOD marker value */
  154. public const uint J2K_MS_EOC = 0xffd9; /**< EOC marker value */
  155. public const uint J2K_MS_SIZ = 0xff51; /**< SIZ marker value */
  156. public const uint J2K_MS_COD = 0xff52; /**< COD marker value */
  157. public const uint J2K_MS_COC = 0xff53; /**< COC marker value */
  158. public const uint J2K_MS_RGN = 0xff5e; /**< RGN marker value */
  159. public const uint J2K_MS_QCD = 0xff5c; /**< QCD marker value */
  160. public const uint J2K_MS_QCC = 0xff5d; /**< QCC marker value */
  161. public const uint J2K_MS_POC = 0xff5f; /**< POC marker value */
  162. public const uint J2K_MS_TLM = 0xff55; /**< TLM marker value */
  163. public const uint J2K_MS_PLM = 0xff57; /**< PLM marker value */
  164. public const uint J2K_MS_PLT = 0xff58; /**< PLT marker value */
  165. public const uint J2K_MS_PPM = 0xff60; /**< PPM marker value */
  166. public const uint J2K_MS_PPT = 0xff61; /**< PPT marker value */
  167. public const uint J2K_MS_SOP = 0xff91; /**< SOP marker value */
  168. public const uint J2K_MS_EPH = 0xff92; /**< EPH marker value */
  169. public const uint J2K_MS_CRG = 0xff63; /**< CRG marker value */
  170. public const uint J2K_MS_COM = 0xff64; /**< COM marker value */
  171. }
  172. }