gosu 0.15.2 → 1.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/dependencies/SDL/include/SDL.h +138 -0
  3. data/dependencies/SDL/include/SDL_assert.h +293 -0
  4. data/dependencies/SDL/include/SDL_atomic.h +295 -0
  5. data/dependencies/SDL/include/SDL_audio.h +859 -0
  6. data/dependencies/SDL/include/SDL_bits.h +121 -0
  7. data/dependencies/SDL/include/SDL_blendmode.h +123 -0
  8. data/dependencies/SDL/include/SDL_clipboard.h +71 -0
  9. data/dependencies/SDL/include/SDL_config.h +55 -0
  10. data/dependencies/SDL/include/SDL_config_android.h +182 -0
  11. data/dependencies/SDL/include/SDL_config_iphoneos.h +207 -0
  12. data/dependencies/SDL/include/SDL_config_macosx.h +266 -0
  13. data/dependencies/SDL/include/SDL_config_minimal.h +85 -0
  14. data/dependencies/SDL/include/SDL_config_os2.h +188 -0
  15. data/dependencies/SDL/include/SDL_config_pandora.h +135 -0
  16. data/dependencies/SDL/include/SDL_config_psp.h +165 -0
  17. data/dependencies/SDL/include/SDL_config_windows.h +288 -0
  18. data/dependencies/SDL/include/SDL_config_winrt.h +243 -0
  19. data/dependencies/SDL/include/SDL_config_wiz.h +149 -0
  20. data/dependencies/SDL/include/SDL_copying.h +20 -0
  21. data/dependencies/SDL/include/SDL_cpuinfo.h +299 -0
  22. data/dependencies/SDL/include/SDL_egl.h +1676 -0
  23. data/dependencies/SDL/include/SDL_endian.h +263 -0
  24. data/dependencies/SDL/include/SDL_error.h +112 -0
  25. data/dependencies/SDL/include/SDL_events.h +827 -0
  26. data/dependencies/SDL/include/SDL_filesystem.h +136 -0
  27. data/dependencies/SDL/include/SDL_gamecontroller.h +541 -0
  28. data/dependencies/SDL/include/SDL_gesture.h +87 -0
  29. data/dependencies/SDL/include/SDL_haptic.h +1247 -0
  30. data/dependencies/SDL/include/SDL_hints.h +1578 -0
  31. data/dependencies/SDL/include/SDL_joystick.h +499 -0
  32. data/dependencies/SDL/include/SDL_keyboard.h +217 -0
  33. data/dependencies/SDL/include/SDL_keycode.h +351 -0
  34. data/dependencies/SDL/include/SDL_loadso.h +81 -0
  35. data/dependencies/SDL/include/SDL_locale.h +101 -0
  36. data/dependencies/SDL/include/SDL_log.h +211 -0
  37. data/dependencies/SDL/include/SDL_main.h +180 -0
  38. data/dependencies/SDL/include/SDL_messagebox.h +146 -0
  39. data/dependencies/SDL/include/SDL_metal.h +117 -0
  40. data/dependencies/SDL/include/SDL_misc.h +75 -0
  41. data/dependencies/SDL/include/SDL_mouse.h +302 -0
  42. data/dependencies/SDL/include/SDL_mutex.h +251 -0
  43. data/dependencies/SDL/include/SDL_name.h +33 -0
  44. data/dependencies/SDL/include/SDL_opengl.h +2183 -0
  45. data/dependencies/SDL/include/SDL_opengl_glext.h +11180 -0
  46. data/dependencies/SDL/include/SDL_opengles.h +39 -0
  47. data/dependencies/SDL/include/SDL_opengles2.h +52 -0
  48. data/dependencies/SDL/include/SDL_opengles2_gl2.h +621 -0
  49. data/dependencies/SDL/include/SDL_opengles2_gl2ext.h +2050 -0
  50. data/dependencies/SDL/include/SDL_opengles2_gl2platform.h +30 -0
  51. data/dependencies/SDL/include/SDL_opengles2_khrplatform.h +282 -0
  52. data/dependencies/SDL/include/SDL_pixels.h +479 -0
  53. data/dependencies/SDL/include/SDL_platform.h +198 -0
  54. data/dependencies/SDL/include/SDL_power.h +75 -0
  55. data/dependencies/SDL/include/SDL_quit.h +58 -0
  56. data/dependencies/SDL/include/SDL_rect.h +174 -0
  57. data/dependencies/SDL/include/SDL_render.h +1158 -0
  58. data/dependencies/SDL/include/SDL_revision.h +2 -0
  59. data/dependencies/SDL/include/SDL_rwops.h +283 -0
  60. data/dependencies/SDL/include/SDL_scancode.h +413 -0
  61. data/dependencies/SDL/include/SDL_sensor.h +267 -0
  62. data/dependencies/SDL/include/SDL_shape.h +144 -0
  63. data/dependencies/SDL/include/SDL_stdinc.h +647 -0
  64. data/dependencies/SDL/include/SDL_surface.h +563 -0
  65. data/dependencies/SDL/include/SDL_system.h +325 -0
  66. data/dependencies/SDL/include/SDL_syswm.h +354 -0
  67. data/dependencies/SDL/include/SDL_test.h +69 -0
  68. data/dependencies/SDL/include/SDL_test_assert.h +105 -0
  69. data/dependencies/SDL/include/SDL_test_common.h +218 -0
  70. data/dependencies/SDL/include/SDL_test_compare.h +69 -0
  71. data/dependencies/SDL/include/SDL_test_crc32.h +124 -0
  72. data/dependencies/SDL/include/SDL_test_font.h +81 -0
  73. data/dependencies/SDL/include/SDL_test_fuzzer.h +384 -0
  74. data/dependencies/SDL/include/SDL_test_harness.h +134 -0
  75. data/dependencies/SDL/include/SDL_test_images.h +78 -0
  76. data/dependencies/SDL/include/SDL_test_log.h +67 -0
  77. data/dependencies/SDL/include/SDL_test_md5.h +129 -0
  78. data/dependencies/SDL/include/SDL_test_memory.h +63 -0
  79. data/dependencies/SDL/include/SDL_test_random.h +115 -0
  80. data/dependencies/SDL/include/SDL_thread.h +366 -0
  81. data/dependencies/SDL/include/SDL_timer.h +115 -0
  82. data/dependencies/SDL/include/SDL_touch.h +102 -0
  83. data/dependencies/SDL/include/SDL_types.h +29 -0
  84. data/dependencies/SDL/include/SDL_version.h +162 -0
  85. data/dependencies/SDL/include/SDL_video.h +1282 -0
  86. data/dependencies/SDL/include/SDL_vulkan.h +276 -0
  87. data/dependencies/SDL/include/begin_code.h +166 -0
  88. data/dependencies/SDL/include/close_code.h +40 -0
  89. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  90. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  91. data/dependencies/SDL_sound/SDL_sound.c +795 -0
  92. data/dependencies/SDL_sound/SDL_sound.h +725 -0
  93. data/dependencies/SDL_sound/SDL_sound_aiff.c +537 -0
  94. data/dependencies/SDL_sound/SDL_sound_au.c +352 -0
  95. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +747 -0
  96. data/dependencies/SDL_sound/SDL_sound_flac.c +182 -0
  97. data/dependencies/SDL_sound/SDL_sound_internal.h +304 -0
  98. data/dependencies/SDL_sound/SDL_sound_modplug.c +228 -0
  99. data/dependencies/SDL_sound/SDL_sound_mp3.c +184 -0
  100. data/dependencies/SDL_sound/SDL_sound_raw.c +164 -0
  101. data/dependencies/SDL_sound/SDL_sound_shn.c +1309 -0
  102. data/dependencies/SDL_sound/SDL_sound_voc.c +550 -0
  103. data/dependencies/SDL_sound/SDL_sound_vorbis.c +223 -0
  104. data/dependencies/SDL_sound/SDL_sound_wav.c +783 -0
  105. data/dependencies/SDL_sound/dr_flac.h +5906 -0
  106. data/dependencies/SDL_sound/dr_mp3.h +2832 -0
  107. data/dependencies/SDL_sound/libmodplug/fastmix.c +1748 -0
  108. data/dependencies/SDL_sound/libmodplug/libmodplug.h +1001 -0
  109. data/dependencies/SDL_sound/libmodplug/load_669.c +188 -0
  110. data/dependencies/SDL_sound/libmodplug/load_abc.c +4725 -0
  111. data/dependencies/SDL_sound/libmodplug/load_amf.c +403 -0
  112. data/dependencies/SDL_sound/libmodplug/load_ams.c +587 -0
  113. data/dependencies/SDL_sound/libmodplug/load_dbm.c +357 -0
  114. data/dependencies/SDL_sound/libmodplug/load_dmf.c +531 -0
  115. data/dependencies/SDL_sound/libmodplug/load_dsm.c +232 -0
  116. data/dependencies/SDL_sound/libmodplug/load_far.c +253 -0
  117. data/dependencies/SDL_sound/libmodplug/load_it.c +796 -0
  118. data/dependencies/SDL_sound/libmodplug/load_mdl.c +488 -0
  119. data/dependencies/SDL_sound/libmodplug/load_med.c +757 -0
  120. data/dependencies/SDL_sound/libmodplug/load_mid.c +1405 -0
  121. data/dependencies/SDL_sound/libmodplug/load_mod.c +269 -0
  122. data/dependencies/SDL_sound/libmodplug/load_mt2.c +546 -0
  123. data/dependencies/SDL_sound/libmodplug/load_mtm.c +142 -0
  124. data/dependencies/SDL_sound/libmodplug/load_okt.c +192 -0
  125. data/dependencies/SDL_sound/libmodplug/load_pat.c +1143 -0
  126. data/dependencies/SDL_sound/libmodplug/load_pat.h +25 -0
  127. data/dependencies/SDL_sound/libmodplug/load_psm.c +350 -0
  128. data/dependencies/SDL_sound/libmodplug/load_ptm.c +204 -0
  129. data/dependencies/SDL_sound/libmodplug/load_s3m.c +325 -0
  130. data/dependencies/SDL_sound/libmodplug/load_stm.c +180 -0
  131. data/dependencies/SDL_sound/libmodplug/load_ult.c +206 -0
  132. data/dependencies/SDL_sound/libmodplug/load_umx.c +51 -0
  133. data/dependencies/SDL_sound/libmodplug/load_xm.c +554 -0
  134. data/dependencies/SDL_sound/libmodplug/mmcmp.c +382 -0
  135. data/dependencies/SDL_sound/libmodplug/modplug.c +170 -0
  136. data/dependencies/SDL_sound/libmodplug/modplug.h +90 -0
  137. data/dependencies/SDL_sound/libmodplug/snd_dsp.c +301 -0
  138. data/dependencies/SDL_sound/libmodplug/snd_flt.c +63 -0
  139. data/dependencies/SDL_sound/libmodplug/snd_fx.c +2350 -0
  140. data/dependencies/SDL_sound/libmodplug/sndfile.c +1169 -0
  141. data/dependencies/SDL_sound/libmodplug/sndmix.c +1034 -0
  142. data/dependencies/SDL_sound/libmodplug/tables.h +371 -0
  143. data/{src/stb_vorbis.c → dependencies/SDL_sound/stb_vorbis.h} +143 -78
  144. data/dependencies/al_soft/AL/al.h +655 -0
  145. data/dependencies/al_soft/AL/alc.h +270 -0
  146. data/dependencies/al_soft/AL/alext.h +585 -0
  147. data/dependencies/al_soft/AL/efx-creative.h +3 -0
  148. data/dependencies/al_soft/AL/efx-presets.h +402 -0
  149. data/dependencies/al_soft/AL/efx.h +762 -0
  150. data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
  151. data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
  152. data/{src → dependencies/stb}/stb_image.h +330 -127
  153. data/{src → dependencies/stb}/stb_image_write.h +156 -85
  154. data/{src → dependencies/stb}/stb_truetype.h +192 -69
  155. data/{src → dependencies/utf8proc}/utf8proc.c +0 -0
  156. data/{src → dependencies/utf8proc}/utf8proc.h +0 -0
  157. data/{src → dependencies/utf8proc}/utf8proc_data.h +0 -0
  158. data/ext/gosu/extconf.rb +56 -22
  159. data/{Gosu → include/Gosu}/Audio.hpp +6 -8
  160. data/{Gosu → include/Gosu}/AutoLink.hpp +0 -0
  161. data/include/Gosu/Bitmap.hpp +100 -0
  162. data/{Gosu → include/Gosu}/Buttons.hpp +94 -35
  163. data/{Gosu → include/Gosu}/Channel.h +0 -0
  164. data/{Gosu → include/Gosu}/Color.h +0 -0
  165. data/{Gosu → include/Gosu}/Color.hpp +0 -0
  166. data/{Gosu → include/Gosu}/Directories.hpp +0 -0
  167. data/{Gosu → include/Gosu}/Font.h +0 -0
  168. data/{Gosu → include/Gosu}/Font.hpp +0 -0
  169. data/{Gosu → include/Gosu}/Fwd.hpp +0 -0
  170. data/{Gosu → include/Gosu}/Gosu.h +3 -0
  171. data/{Gosu → include/Gosu}/Gosu.hpp +0 -0
  172. data/{Gosu → include/Gosu}/Graphics.hpp +0 -0
  173. data/{Gosu → include/Gosu}/GraphicsBase.hpp +0 -0
  174. data/{Gosu → include/Gosu}/IO.hpp +0 -0
  175. data/{Gosu → include/Gosu}/Image.h +0 -0
  176. data/{Gosu → include/Gosu}/Image.hpp +7 -6
  177. data/{Gosu → include/Gosu}/ImageData.hpp +0 -0
  178. data/{Gosu → include/Gosu}/Input.hpp +30 -15
  179. data/{Gosu → include/Gosu}/Inspection.hpp +0 -0
  180. data/{Gosu → include/Gosu}/Math.hpp +0 -0
  181. data/{Gosu → include/Gosu}/Platform.hpp +0 -0
  182. data/{Gosu → include/Gosu}/Sample.h +0 -0
  183. data/{Gosu → include/Gosu}/Song.h +0 -0
  184. data/{Gosu → include/Gosu}/Text.hpp +0 -0
  185. data/{Gosu → include/Gosu}/TextInput.h +0 -0
  186. data/{Gosu → include/Gosu}/TextInput.hpp +0 -0
  187. data/{Gosu → include/Gosu}/Timing.hpp +0 -0
  188. data/{Gosu → include/Gosu}/Utility.hpp +1 -1
  189. data/{Gosu → include/Gosu}/Version.hpp +0 -0
  190. data/{Gosu → include/Gosu}/Window.h +2 -0
  191. data/{Gosu → include/Gosu}/Window.hpp +21 -13
  192. data/lib/OpenAL32.dll +0 -0
  193. data/lib/SDL2.dll +0 -0
  194. data/lib/gosu.rb +0 -3
  195. data/lib/gosu/patches.rb +0 -9
  196. data/lib/gosu/swig_patches.rb +3 -2
  197. data/lib/libmpg123.dll +0 -0
  198. data/lib/libsndfile.dll +0 -0
  199. data/lib64/OpenAL32.dll +0 -0
  200. data/lib64/SDL2.dll +0 -0
  201. data/lib64/libmpg123.dll +0 -0
  202. data/lib64/libsndfile.dll +0 -0
  203. data/rdoc/gosu.rb +95 -20
  204. data/src/Audio.cpp +50 -224
  205. data/src/AudioFile.hpp +17 -37
  206. data/src/AudioFileAudioToolbox.cpp +237 -0
  207. data/src/AudioFileSDLSound.cpp +147 -0
  208. data/src/AudioImpl.cpp +3 -12
  209. data/src/AudioImpl.hpp +3 -1
  210. data/src/Bitmap.cpp +85 -83
  211. data/src/BitmapIO.cpp +52 -58
  212. data/src/Constants.cpp +80 -33
  213. data/src/Font.cpp +3 -1
  214. data/src/GosuWrapper.cpp +19 -0
  215. data/src/Graphics.cpp +7 -4
  216. data/src/Image.cpp +13 -16
  217. data/src/Input.cpp +408 -159
  218. data/src/LargeImageData.cpp +1 -1
  219. data/src/MarkupParser.cpp +2 -1
  220. data/src/RubyGosu.cxx +349 -83
  221. data/src/RubyGosu.h +4 -2
  222. data/src/TexChunk.cpp +1 -1
  223. data/src/TextBuilder.cpp +3 -1
  224. data/src/Texture.cpp +1 -1
  225. data/src/TrueTypeFont.cpp +1 -1
  226. data/src/Utility.cpp +11 -7
  227. data/src/Window.cpp +30 -39
  228. data/src/WindowWrapper.cpp +28 -0
  229. metadata +207 -52
  230. data/Gosu/Bitmap.hpp +0 -113
  231. data/src/AudioToolboxFile.hpp +0 -210
  232. data/src/OggFile.hpp +0 -92
  233. data/src/SndFile.hpp +0 -174
  234. data/src/WinMain.cpp +0 -64
@@ -1,4 +1,4 @@
1
- /* stb_image_write - v1.13 - public domain - http://nothings.org/stb
1
+ /* stb_image_write - v1.15 - public domain - http://nothings.org/stb
2
2
  writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015
3
3
  no warranty implied; use at your own risk
4
4
 
@@ -105,7 +105,7 @@ USAGE:
105
105
 
106
106
  TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed
107
107
  data, set the global variable 'stbi_write_tga_with_rle' to 0.
108
-
108
+
109
109
  JPEG does ignore alpha channels in input data; quality is between 1 and 100.
110
110
  Higher quality looks better but results in a bigger image.
111
111
  JPEG baseline (no JPEG progressive).
@@ -113,7 +113,7 @@ USAGE:
113
113
  CREDITS:
114
114
 
115
115
 
116
- Sean Barrett - PNG/BMP/TGA
116
+ Sean Barrett - PNG/BMP/TGA
117
117
  Baldur Karlsson - HDR
118
118
  Jean-Sebastien Guay - TGA monochrome
119
119
  Tim Kelsey - misc enhancements
@@ -247,17 +247,17 @@ STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean);
247
247
  #define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
248
248
 
249
249
  #ifdef STB_IMAGE_WRITE_STATIC
250
- static int stbi__flip_vertically_on_write=0;
251
250
  static int stbi_write_png_compression_level = 8;
252
251
  static int stbi_write_tga_with_rle = 1;
253
252
  static int stbi_write_force_png_filter = -1;
254
253
  #else
255
254
  int stbi_write_png_compression_level = 8;
256
- int stbi__flip_vertically_on_write=0;
257
255
  int stbi_write_tga_with_rle = 1;
258
256
  int stbi_write_force_png_filter = -1;
259
257
  #endif
260
258
 
259
+ static int stbi__flip_vertically_on_write = 0;
260
+
261
261
  STBIWDEF void stbi_flip_vertically_on_write(int flag)
262
262
  {
263
263
  stbi__flip_vertically_on_write = flag;
@@ -267,6 +267,8 @@ typedef struct
267
267
  {
268
268
  stbi_write_func *func;
269
269
  void *context;
270
+ unsigned char buffer[64];
271
+ int buf_used;
270
272
  } stbi__write_context;
271
273
 
272
274
  // initialize a callback-based context
@@ -306,7 +308,7 @@ static FILE *stbiw__fopen(char const *filename, char const *mode)
306
308
  wchar_t wFilename[1024];
307
309
  if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)))
308
310
  return 0;
309
-
311
+
310
312
  if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)))
311
313
  return 0;
312
314
 
@@ -380,16 +382,36 @@ static void stbiw__writef(stbi__write_context *s, const char *fmt, ...)
380
382
  va_end(v);
381
383
  }
382
384
 
385
+ static void stbiw__write_flush(stbi__write_context *s)
386
+ {
387
+ if (s->buf_used) {
388
+ s->func(s->context, &s->buffer, s->buf_used);
389
+ s->buf_used = 0;
390
+ }
391
+ }
392
+
383
393
  static void stbiw__putc(stbi__write_context *s, unsigned char c)
384
394
  {
385
395
  s->func(s->context, &c, 1);
386
396
  }
387
397
 
398
+ static void stbiw__write1(stbi__write_context *s, unsigned char a)
399
+ {
400
+ if (s->buf_used + 1 > sizeof(s->buffer))
401
+ stbiw__write_flush(s);
402
+ s->buffer[s->buf_used++] = a;
403
+ }
404
+
388
405
  static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c)
389
406
  {
390
- unsigned char arr[3];
391
- arr[0] = a; arr[1] = b; arr[2] = c;
392
- s->func(s->context, arr, 3);
407
+ int n;
408
+ if (s->buf_used + 3 > sizeof(s->buffer))
409
+ stbiw__write_flush(s);
410
+ n = s->buf_used;
411
+ s->buf_used = n+3;
412
+ s->buffer[n+0] = a;
413
+ s->buffer[n+1] = b;
414
+ s->buffer[n+2] = c;
393
415
  }
394
416
 
395
417
  static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d)
@@ -398,7 +420,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in
398
420
  int k;
399
421
 
400
422
  if (write_alpha < 0)
401
- s->func(s->context, &d[comp - 1], 1);
423
+ stbiw__write1(s, d[comp - 1]);
402
424
 
403
425
  switch (comp) {
404
426
  case 2: // 2 pixels = mono + alpha, alpha is written separately, so same as 1-channel case
@@ -406,7 +428,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in
406
428
  if (expand_mono)
407
429
  stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp
408
430
  else
409
- s->func(s->context, d, 1); // monochrome TGA
431
+ stbiw__write1(s, d[0]); // monochrome TGA
410
432
  break;
411
433
  case 4:
412
434
  if (!write_alpha) {
@@ -422,7 +444,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in
422
444
  break;
423
445
  }
424
446
  if (write_alpha > 0)
425
- s->func(s->context, &d[comp - 1], 1);
447
+ stbiw__write1(s, d[comp - 1]);
426
448
  }
427
449
 
428
450
  static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono)
@@ -447,6 +469,7 @@ static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, i
447
469
  unsigned char *d = (unsigned char *) data + (j*x+i)*comp;
448
470
  stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d);
449
471
  }
472
+ stbiw__write_flush(s);
450
473
  s->func(s->context, &zero, scanline_pad);
451
474
  }
452
475
  }
@@ -476,7 +499,7 @@ static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, c
476
499
 
477
500
  STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
478
501
  {
479
- stbi__write_context s;
502
+ stbi__write_context s = { 0 };
480
503
  stbi__start_write_callbacks(&s, func, context);
481
504
  return stbi_write_bmp_core(&s, x, y, comp, data);
482
505
  }
@@ -484,7 +507,7 @@ STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x,
484
507
  #ifndef STBI_WRITE_NO_STDIO
485
508
  STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
486
509
  {
487
- stbi__write_context s;
510
+ stbi__write_context s = { 0 };
488
511
  if (stbi__start_write_file(&s,filename)) {
489
512
  int r = stbi_write_bmp_core(&s, x, y, comp, data);
490
513
  stbi__end_write_file(&s);
@@ -557,24 +580,25 @@ static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, v
557
580
 
558
581
  if (diff) {
559
582
  unsigned char header = STBIW_UCHAR(len - 1);
560
- s->func(s->context, &header, 1);
583
+ stbiw__write1(s, header);
561
584
  for (k = 0; k < len; ++k) {
562
585
  stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp);
563
586
  }
564
587
  } else {
565
588
  unsigned char header = STBIW_UCHAR(len - 129);
566
- s->func(s->context, &header, 1);
589
+ stbiw__write1(s, header);
567
590
  stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin);
568
591
  }
569
592
  }
570
593
  }
594
+ stbiw__write_flush(s);
571
595
  }
572
596
  return 1;
573
597
  }
574
598
 
575
599
  STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
576
600
  {
577
- stbi__write_context s;
601
+ stbi__write_context s = { 0 };
578
602
  stbi__start_write_callbacks(&s, func, context);
579
603
  return stbi_write_tga_core(&s, x, y, comp, (void *) data);
580
604
  }
@@ -582,7 +606,7 @@ STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x,
582
606
  #ifndef STBI_WRITE_NO_STDIO
583
607
  STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
584
608
  {
585
- stbi__write_context s;
609
+ stbi__write_context s = { 0 };
586
610
  if (stbi__start_write_file(&s,filename)) {
587
611
  int r = stbi_write_tga_core(&s, x, y, comp, (void *) data);
588
612
  stbi__end_write_file(&s);
@@ -748,7 +772,7 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
748
772
 
749
773
  STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data)
750
774
  {
751
- stbi__write_context s;
775
+ stbi__write_context s = { 0 };
752
776
  stbi__start_write_callbacks(&s, func, context);
753
777
  return stbi_write_hdr_core(&s, x, y, comp, (float *) data);
754
778
  }
@@ -756,7 +780,7 @@ STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x,
756
780
  #ifndef STBI_WRITE_NO_STDIO
757
781
  STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
758
782
  {
759
- stbi__write_context s;
783
+ stbi__write_context s = { 0 };
760
784
  if (stbi__start_write_file(&s,filename)) {
761
785
  int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data);
762
786
  stbi__end_write_file(&s);
@@ -774,7 +798,7 @@ STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const
774
798
 
775
799
  #ifndef STBIW_ZLIB_COMPRESS
776
800
  // stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size()
777
- #define stbiw__sbraw(a) ((int *) (a) - 2)
801
+ #define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
778
802
  #define stbiw__sbm(a) stbiw__sbraw(a)[0]
779
803
  #define stbiw__sbn(a) stbiw__sbraw(a)[1]
780
804
 
@@ -1044,13 +1068,13 @@ static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int
1044
1068
  int type = mymap[filter_type];
1045
1069
  unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y);
1046
1070
  int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes;
1047
-
1071
+
1048
1072
  if (type==0) {
1049
1073
  memcpy(line_buffer, z, width*n);
1050
1074
  return;
1051
1075
  }
1052
1076
 
1053
- // first loop isn't optimized since it's just one pixel
1077
+ // first loop isn't optimized since it's just one pixel
1054
1078
  for (i = 0; i < n; ++i) {
1055
1079
  switch (type) {
1056
1080
  case 1: line_buffer[i] = z[i]; break;
@@ -1271,26 +1295,31 @@ static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) {
1271
1295
  bits[0] = val & ((1<<bits[1])-1);
1272
1296
  }
1273
1297
 
1274
- static int stbiw__jpg_processDU(stbi__write_context *s, int *bitBuf, int *bitCnt, float *CDU, float *fdtbl, int DC, const unsigned short HTDC[256][2], const unsigned short HTAC[256][2]) {
1298
+ static int stbiw__jpg_processDU(stbi__write_context *s, int *bitBuf, int *bitCnt, float *CDU, int du_stride, float *fdtbl, int DC, const unsigned short HTDC[256][2], const unsigned short HTAC[256][2]) {
1275
1299
  const unsigned short EOB[2] = { HTAC[0x00][0], HTAC[0x00][1] };
1276
1300
  const unsigned short M16zeroes[2] = { HTAC[0xF0][0], HTAC[0xF0][1] };
1277
- int dataOff, i, diff, end0pos;
1301
+ int dataOff, i, j, n, diff, end0pos, x, y;
1278
1302
  int DU[64];
1279
1303
 
1280
1304
  // DCT rows
1281
- for(dataOff=0; dataOff<64; dataOff+=8) {
1305
+ for(dataOff=0, n=du_stride*8; dataOff<n; dataOff+=du_stride) {
1282
1306
  stbiw__jpg_DCT(&CDU[dataOff], &CDU[dataOff+1], &CDU[dataOff+2], &CDU[dataOff+3], &CDU[dataOff+4], &CDU[dataOff+5], &CDU[dataOff+6], &CDU[dataOff+7]);
1283
1307
  }
1284
1308
  // DCT columns
1285
1309
  for(dataOff=0; dataOff<8; ++dataOff) {
1286
- stbiw__jpg_DCT(&CDU[dataOff], &CDU[dataOff+8], &CDU[dataOff+16], &CDU[dataOff+24], &CDU[dataOff+32], &CDU[dataOff+40], &CDU[dataOff+48], &CDU[dataOff+56]);
1310
+ stbiw__jpg_DCT(&CDU[dataOff], &CDU[dataOff+du_stride], &CDU[dataOff+du_stride*2], &CDU[dataOff+du_stride*3], &CDU[dataOff+du_stride*4],
1311
+ &CDU[dataOff+du_stride*5], &CDU[dataOff+du_stride*6], &CDU[dataOff+du_stride*7]);
1287
1312
  }
1288
1313
  // Quantize/descale/zigzag the coefficients
1289
- for(i=0; i<64; ++i) {
1290
- float v = CDU[i]*fdtbl[i];
1291
- // DU[stbiw__jpg_ZigZag[i]] = (int)(v < 0 ? ceilf(v - 0.5f) : floorf(v + 0.5f));
1292
- // ceilf() and floorf() are C99, not C89, but I /think/ they're not needed here anyway?
1293
- DU[stbiw__jpg_ZigZag[i]] = (int)(v < 0 ? v - 0.5f : v + 0.5f);
1314
+ for(y = 0, j=0; y < 8; ++y) {
1315
+ for(x = 0; x < 8; ++x,++j) {
1316
+ float v;
1317
+ i = y*du_stride+x;
1318
+ v = CDU[i]*fdtbl[j];
1319
+ // DU[stbiw__jpg_ZigZag[j]] = (int)(v < 0 ? ceilf(v - 0.5f) : floorf(v + 0.5f));
1320
+ // ceilf() and floorf() are C99, not C89, but I /think/ they're not needed here anyway?
1321
+ DU[stbiw__jpg_ZigZag[j]] = (int)(v < 0 ? v - 0.5f : v + 0.5f);
1322
+ }
1294
1323
  }
1295
1324
 
1296
1325
  // Encode DC
@@ -1405,10 +1434,10 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
1405
1434
  37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99};
1406
1435
  static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,
1407
1436
  99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
1408
- static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
1437
+ static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
1409
1438
  1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f };
1410
1439
 
1411
- int row, col, i, k;
1440
+ int row, col, i, k, subsample;
1412
1441
  float fdtbl_Y[64], fdtbl_UV[64];
1413
1442
  unsigned char YTable[64], UVTable[64];
1414
1443
 
@@ -1417,6 +1446,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
1417
1446
  }
1418
1447
 
1419
1448
  quality = quality ? quality : 90;
1449
+ subsample = quality <= 90 ? 1 : 0;
1420
1450
  quality = quality < 1 ? 1 : quality > 100 ? 100 : quality;
1421
1451
  quality = quality < 50 ? 5000 / quality : 200 - quality * 2;
1422
1452
 
@@ -1439,7 +1469,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
1439
1469
  static const unsigned char head0[] = { 0xFF,0xD8,0xFF,0xE0,0,0x10,'J','F','I','F',0,1,1,0,0,1,0,1,0,0,0xFF,0xDB,0,0x84,0 };
1440
1470
  static const unsigned char head2[] = { 0xFF,0xDA,0,0xC,3,1,0,2,0x11,3,0x11,0,0x3F,0 };
1441
1471
  const unsigned char head1[] = { 0xFF,0xC0,0,0x11,8,(unsigned char)(height>>8),STBIW_UCHAR(height),(unsigned char)(width>>8),STBIW_UCHAR(width),
1442
- 3,1,0x11,0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 };
1472
+ 3,1,(unsigned char)(subsample?0x22:0x11),0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 };
1443
1473
  s->func(s->context, (void*)head0, sizeof(head0));
1444
1474
  s->func(s->context, (void*)YTable, sizeof(YTable));
1445
1475
  stbiw__putc(s, 1);
@@ -1462,36 +1492,74 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
1462
1492
  // Encode 8x8 macroblocks
1463
1493
  {
1464
1494
  static const unsigned short fillBits[] = {0x7F, 7};
1465
- const unsigned char *imageData = (const unsigned char *)data;
1466
1495
  int DCY=0, DCU=0, DCV=0;
1467
1496
  int bitBuf=0, bitCnt=0;
1468
1497
  // comp == 2 is grey+alpha (alpha is ignored)
1469
1498
  int ofsG = comp > 2 ? 1 : 0, ofsB = comp > 2 ? 2 : 0;
1499
+ const unsigned char *dataR = (const unsigned char *)data;
1500
+ const unsigned char *dataG = dataR + ofsG;
1501
+ const unsigned char *dataB = dataR + ofsB;
1470
1502
  int x, y, pos;
1471
- for(y = 0; y < height; y += 8) {
1472
- for(x = 0; x < width; x += 8) {
1473
- float YDU[64], UDU[64], VDU[64];
1474
- for(row = y, pos = 0; row < y+8; ++row) {
1475
- // row >= height => use last input row
1476
- int clamped_row = (row < height) ? row : height - 1;
1477
- int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
1478
- for(col = x; col < x+8; ++col, ++pos) {
1479
- float r, g, b;
1480
- // if col >= width => use pixel from last input column
1481
- int p = base_p + ((col < width) ? col : (width-1))*comp;
1482
-
1483
- r = imageData[p+0];
1484
- g = imageData[p+ofsG];
1485
- b = imageData[p+ofsB];
1486
- YDU[pos]=+0.29900f*r+0.58700f*g+0.11400f*b-128;
1487
- UDU[pos]=-0.16874f*r-0.33126f*g+0.50000f*b;
1488
- VDU[pos]=+0.50000f*r-0.41869f*g-0.08131f*b;
1503
+ if(subsample) {
1504
+ for(y = 0; y < height; y += 16) {
1505
+ for(x = 0; x < width; x += 16) {
1506
+ float Y[256], U[256], V[256];
1507
+ for(row = y, pos = 0; row < y+16; ++row) {
1508
+ // row >= height => use last input row
1509
+ int clamped_row = (row < height) ? row : height - 1;
1510
+ int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
1511
+ for(col = x; col < x+16; ++col, ++pos) {
1512
+ // if col >= width => use pixel from last input column
1513
+ int p = base_p + ((col < width) ? col : (width-1))*comp;
1514
+ float r = dataR[p], g = dataG[p], b = dataB[p];
1515
+ Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128;
1516
+ U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b;
1517
+ V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b;
1518
+ }
1519
+ }
1520
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+0, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
1521
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+8, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
1522
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+128, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
1523
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+136, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
1524
+
1525
+ // subsample U,V
1526
+ {
1527
+ float subU[64], subV[64];
1528
+ int yy, xx;
1529
+ for(yy = 0, pos = 0; yy < 8; ++yy) {
1530
+ for(xx = 0; xx < 8; ++xx, ++pos) {
1531
+ int j = yy*32+xx*2;
1532
+ subU[pos] = (U[j+0] + U[j+1] + U[j+16] + U[j+17]) * 0.25f;
1533
+ subV[pos] = (V[j+0] + V[j+1] + V[j+16] + V[j+17]) * 0.25f;
1534
+ }
1535
+ }
1536
+ DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subU, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
1537
+ DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subV, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
1489
1538
  }
1490
1539
  }
1540
+ }
1541
+ } else {
1542
+ for(y = 0; y < height; y += 8) {
1543
+ for(x = 0; x < width; x += 8) {
1544
+ float Y[64], U[64], V[64];
1545
+ for(row = y, pos = 0; row < y+8; ++row) {
1546
+ // row >= height => use last input row
1547
+ int clamped_row = (row < height) ? row : height - 1;
1548
+ int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
1549
+ for(col = x; col < x+8; ++col, ++pos) {
1550
+ // if col >= width => use pixel from last input column
1551
+ int p = base_p + ((col < width) ? col : (width-1))*comp;
1552
+ float r = dataR[p], g = dataG[p], b = dataB[p];
1553
+ Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128;
1554
+ U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b;
1555
+ V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b;
1556
+ }
1557
+ }
1491
1558
 
1492
- DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);
1493
- DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
1494
- DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
1559
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y, 8, fdtbl_Y, DCY, YDC_HT, YAC_HT);
1560
+ DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, U, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
1561
+ DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, V, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
1562
+ }
1495
1563
  }
1496
1564
  }
1497
1565
 
@@ -1508,7 +1576,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in
1508
1576
 
1509
1577
  STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality)
1510
1578
  {
1511
- stbi__write_context s;
1579
+ stbi__write_context s = { 0 };
1512
1580
  stbi__start_write_callbacks(&s, func, context);
1513
1581
  return stbi_write_jpg_core(&s, x, y, comp, (void *) data, quality);
1514
1582
  }
@@ -1517,7 +1585,7 @@ STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x,
1517
1585
  #ifndef STBI_WRITE_NO_STDIO
1518
1586
  STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality)
1519
1587
  {
1520
- stbi__write_context s;
1588
+ stbi__write_context s = { 0 };
1521
1589
  if (stbi__start_write_file(&s,filename)) {
1522
1590
  int r = stbi_write_jpg_core(&s, x, y, comp, data, quality);
1523
1591
  stbi__end_write_file(&s);
@@ -1530,10 +1598,13 @@ STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const
1530
1598
  #endif // STB_IMAGE_WRITE_IMPLEMENTATION
1531
1599
 
1532
1600
  /* Revision history
1601
+ 1.14 (2020-02-02) updated JPEG writer to downsample chroma channels
1602
+ 1.13
1603
+ 1.12
1533
1604
  1.11 (2019-08-11)
1534
-
1605
+
1535
1606
  1.10 (2019-02-07)
1536
- support utf8 filenames in Windows; fix warnings and platform ifdefs
1607
+ support utf8 filenames in Windows; fix warnings and platform ifdefs
1537
1608
  1.09 (2018-02-11)
1538
1609
  fix typo in zlib quality API, improve STB_I_W_STATIC in C++
1539
1610
  1.08 (2018-01-29)
@@ -1582,38 +1653,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
1582
1653
  ------------------------------------------------------------------------------
1583
1654
  ALTERNATIVE A - MIT License
1584
1655
  Copyright (c) 2017 Sean Barrett
1585
- Permission is hereby granted, free of charge, to any person obtaining a copy of
1586
- this software and associated documentation files (the "Software"), to deal in
1587
- the Software without restriction, including without limitation the rights to
1588
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1589
- of the Software, and to permit persons to whom the Software is furnished to do
1656
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
1657
+ this software and associated documentation files (the "Software"), to deal in
1658
+ the Software without restriction, including without limitation the rights to
1659
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1660
+ of the Software, and to permit persons to whom the Software is furnished to do
1590
1661
  so, subject to the following conditions:
1591
- The above copyright notice and this permission notice shall be included in all
1662
+ The above copyright notice and this permission notice shall be included in all
1592
1663
  copies or substantial portions of the Software.
1593
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1594
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1595
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1596
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1597
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1598
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1664
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1665
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1666
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1667
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1668
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1669
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1599
1670
  SOFTWARE.
1600
1671
  ------------------------------------------------------------------------------
1601
1672
  ALTERNATIVE B - Public Domain (www.unlicense.org)
1602
1673
  This is free and unencumbered software released into the public domain.
1603
- Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
1604
- software, either in source code form or as a compiled binary, for any purpose,
1674
+ Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
1675
+ software, either in source code form or as a compiled binary, for any purpose,
1605
1676
  commercial or non-commercial, and by any means.
1606
- In jurisdictions that recognize copyright laws, the author or authors of this
1607
- software dedicate any and all copyright interest in the software to the public
1608
- domain. We make this dedication for the benefit of the public at large and to
1609
- the detriment of our heirs and successors. We intend this dedication to be an
1610
- overt act of relinquishment in perpetuity of all present and future rights to
1677
+ In jurisdictions that recognize copyright laws, the author or authors of this
1678
+ software dedicate any and all copyright interest in the software to the public
1679
+ domain. We make this dedication for the benefit of the public at large and to
1680
+ the detriment of our heirs and successors. We intend this dedication to be an
1681
+ overt act of relinquishment in perpetuity of all present and future rights to
1611
1682
  this software under copyright law.
1612
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1613
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1614
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1615
- AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1616
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1683
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1684
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1685
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1686
+ AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1687
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1617
1688
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1618
1689
  ------------------------------------------------------------------------------
1619
1690
  */