KSquirrel – powerful image viewer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
6.4KB

  1. * fmt_filters is a regular C++ namespace.
  2. * it is a set of image filters, written on pure C++.
  3. * it is intended to create platform-independed filters, which can be used anywhere -
  4. in KDE, GNOME, ... apps.
  5. * these source files are distributed with ksquirrel from http://ksquirrel.sf.net.
  6. * you can find the latest version of fmt_filters at http://ksquirrel.sf.net/subprojects.php.
  7. * fmt_filters work with 32-bit image data.
  8. * to use it in your project, simply add fmt_filters sources to your project.
  9. * fmt_filters is distributed under the terms of LGPL. See COPYING for details.
  10. * at this time fmt_filters supports the following filters:
  11. - colorize
  12. - brightness
  13. - contrast
  14. - gamma
  15. - negative
  16. - swap RGB values
  17. - blend
  18. - fade
  19. - togray
  20. - desaturate
  21. - threshold
  22. - solarize
  23. - spread
  24. - swirl
  25. - noise
  26. - flatten
  27. - wave
  28. - shade
  29. - equalize
  30. - blur
  31. - despeckle
  32. - implode
  33. - edge
  34. - emboss
  35. - sharpen
  36. - oil
  37. - redeye
  38. -------------------------------------------------------------------
  39. Copyrights:
  40. * redeye
  41. --------
  42. Red-eye removal was taken from "redeye" plugin for GIMP
  43. /* redeye.c: redeye remover plugin code
  44. *
  45. * Copyright (C) 2004 Robert Merkel <robert.merkel@benambra.org> (the "Author").
  46. * All Rights Reserved.
  47. *
  48. * Permission is hereby granted, free of charge, to any person obtaining a
  49. * copy of this software and associated documentation files (the "Software"),
  50. * to deal in the Software without restriction, including without limitation
  51. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  52. * and/or sell copies of the Software, and to permit persons to whom the
  53. * Software is furnished to do so, subject to the following conditions:
  54. *
  55. * The above copyright notice and this permission notice shall be included
  56. * in all copies or substantial portions of the Software.
  57. *
  58. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  59. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  60. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  61. * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  62. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  63. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  64. *
  65. * Except as contained in this notice, the name of the Author of the
  66. * Software shall not be used in advertising or otherwise to promote the
  67. * sale, use or other dealings in this Software without prior written
  68. * authorization from the Author.
  69. 1;3B */
  70. * most image processing filters ported from KImageEffect (KDE project, http://kde.org)
  71. --------------------------------------------------------------------------------------
  72. /* This file is part of the KDE libraries
  73. Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley <mosfet@kde.org>
  74. (C) 1998, 1999 Christian Tibirna <ctibirna@total.net>
  75. (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org>
  76. (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl>
  77. (C) 2000 Josef Weidendorfer <weidendo@in.tum.de>
  78. Redistribution and use in source and binary forms, with or without
  79. modification, are permitted provided that the following conditions
  80. are met:
  81. 1. Redistributions of source code must retain the above copyright
  82. notice, this list of conditions and the following disclaimer.
  83. 2. Redistributions in binary form must reproduce the above copyright
  84. notice, this list of conditions and the following disclaimer in the
  85. documentation and/or other materials provided with the distribution.
  86. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  87. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  88. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  89. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  90. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  91. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  92. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  93. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  94. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  95. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  96. */
  97. //
  98. // ===================================================================
  99. // Effects originally ported from ImageMagick for PixiePlus, plus a few
  100. // new ones. (mosfet 05/26/2003)
  101. // ===================================================================
  102. //
  103. /*
  104. Portions of this software are based on ImageMagick. Such portions are clearly
  105. marked as being ported from ImageMagick. ImageMagick is copyrighted under the
  106. following conditions:
  107. Copyright (C) 2003 ImageMagick Studio, a non-profit organization dedicated to
  108. making software imaging solutions freely available.
  109. Permission is hereby granted, free of charge, to any person obtaining a copy
  110. of this software and associated documentation files ("ImageMagick"), to deal
  111. in ImageMagick without restriction, including without limitation the rights
  112. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  113. copies of ImageMagick, and to permit persons to whom the ImageMagick is
  114. furnished to do so, subject to the following conditions:
  115. The above copyright notice and this permission notice shall be included in all
  116. copies or substantial portions of ImageMagick.
  117. The software is provided "as is", without warranty of any kind, express or
  118. implied, including but not limited to the warranties of merchantability,
  119. fitness for a particular purpose and noninfringement. In no event shall
  120. ImageMagick Studio be liable for any claim, damages or other liability,
  121. whether in an action of contract, tort or otherwise, arising from, out of or
  122. in connection with ImageMagick or the use or other dealings in ImageMagick.
  123. Except as contained in this notice, the name of the ImageMagick Studio shall
  124. not be used in advertising or otherwise to promote the sale, use or other
  125. dealings in ImageMagick without prior written authorization from the
  126. ImageMagick Studio.
  127. */
  128. -------------------------------------------------------------------
  129. Qt example:
  130. -----------
  131. QImage im;
  132. im.load("sample.png");
  133. im = im.convertDepth(32);
  134. fmt_filters::image img(sample.bits(), sample.width(), sample.height());
  135. fmt_filters::implode(img, 50, fmt_filters::white);
  136. QPixmap p;
  137. p.convertFromImage(im);
  138. pixmapLabel->setPixmap(p);