diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d25c1519..44446e412 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,12 @@ set(MANYMOUSE_SOURCE ) +set(SDL2_GFX_SOURCE + thirdparty/SDL2_gfx/SDL2_rotozoom.h + thirdparty/SDL2_gfx/SDL2_rotozoom.c +) + + add_executable(${CMAKE_PROJECT_NAME} ${SINGE_SOURCE} ${ARG_PARSER_SOURCE} @@ -247,6 +253,7 @@ add_executable(${CMAKE_PROJECT_NAME} ${LUA_RS232_SOURCE} ${UTHASH_SOURCE} ${MANYMOUSE_SOURCE} + ${SDL2_GFX_SOURCE} ) @@ -280,6 +287,7 @@ target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${BUILD_DIR} ${BUILD_DIR}/include + ${BUILD_DIR}/include/SDL2 thirdparty/lua/src thirdparty/luasec/src thirdparty/librs232/include diff --git a/assets/Framework.singe b/assets/Framework.singe index e09e98964..896aeca4f 100644 --- a/assets/Framework.singe +++ b/assets/Framework.singe @@ -422,6 +422,9 @@ SWITCH_GRAB = 23 MOUSE_SINGLE = 100 MOUSE_MANY = 200 +SPRITE_SMOOTH = 1 +SPRITE_PIXELATED = 0 + -- Singe 1.xx Features ------------------------------------------------------- diff --git a/src/singe.c b/src/singe.c index 89d6a2620..1004c4466 100644 --- a/src/singe.c +++ b/src/singe.c @@ -31,6 +31,7 @@ #include "../thirdparty/lua/src/lauxlib.h" #include "../thirdparty/uthash/src/uthash.h" #include "../thirdparty/manymouse/manymouse.h" +#include "../thirdparty/SDL2_gfx/SDL2_rotozoom.h" #include "../thirdparty/luafilesystem/src/lfs.h" #include "../thirdparty/luasec/src/context.h" #include "../thirdparty/luasec/src/ssl.h" @@ -100,12 +101,17 @@ typedef struct MouseS { } MouseT; typedef struct SpriteS { - int32_t id; + int32_t id; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpadded" - SDL_Surface *surface; + SDL_Surface *originalSurface; + SDL_Surface *surface; #pragma GCC diagnostic pop - UT_hash_handle hh; + double angle; + double scaleX; + double scaleY; + int smooth; + UT_hash_handle hh; } SpriteT; typedef struct SoundS { @@ -376,6 +382,9 @@ int32_t apiSpriteDraw(lua_State *L); int32_t apiSpriteGetHeight(lua_State *L); int32_t apiSpriteGetWidth(lua_State *L); int32_t apiSpriteLoad(lua_State *L); +int32_t apiSpriteRotate(lua_State *L); +int32_t apiSpriteScale(lua_State *L); +int32_t apiSpriteSmooth(lua_State *L); int32_t apiSpriteUnload(lua_State *L); int32_t apiVideoDraw(lua_State *L); @@ -1091,6 +1100,9 @@ int32_t apiFontToSprite(lua_State *L) { luaDie(L, "fontToSprite", "Font surface is null!"); } else { SDL_SetColorKey(sprite->surface, true, 0); + SDL_BlitSurface(sprite->surface, NULL, sprite->originalSurface, NULL); + sprite->scaleX = 1.0; + sprite->scaleY = 1.0; sprite->id = _global.nextSpriteId; result = _global.nextSpriteId++; HASH_ADD_INT(_global.spriteList, id, sprite); @@ -1830,38 +1842,70 @@ int32_t apiSpriteDraw(lua_State *L) { int32_t n = lua_gettop(L); int32_t id = -1; double d = 0; + bool center = false; SpriteT *sprite = NULL; SDL_Rect dest; + int ox; + int oy; - if ((n == 3) || (n == 5)) { + // spriteDraw(x, y, id) - Simple draw + // spriteDraw(x, y, c, id) - Centered draw + // spriteDraw(x, y, x2, y2, id) - Scaled draw + // spriteDraw(x, y, x2, y2, c, id) - Centered scaled draw + + if ((n >= 3) && (n <= 6)) { if (lua_isnumber(L, 1)) { if (lua_isnumber(L, 2)) { if (lua_isnumber(L, 3)) { d = lua_tonumber(L, 1); dest.x = (int32_t)d; d = lua_tonumber(L, 2); dest.y = (int32_t)d; - if (n == 5) { + // Centered? + if ((n == 3) || (n == 4)) { + if (n == 4) { + if (lua_isnumber(L, 4)) { + d = lua_tonumber(L, 3); center = (int32_t)d != 0; + d = lua_tonumber(L, 4); id = (int32_t)d; + } + } else { + d = lua_tonumber(L, 3); id = (int32_t)d; + } + } + if ((n == 5) || (n == 6)) { // Target is scaled if (lua_isnumber(L, 4)) { if (lua_isnumber(L, 5)) { d = lua_tonumber(L, 3); dest.w = (int32_t)d - dest.x + 1; d = lua_tonumber(L, 4); dest.h = (int32_t)d - dest.y + 1; - d = lua_tonumber(L, 5); id = (int32_t)d; + // Centered? + if (n == 6) { + if (lua_isnumber(L, 6)) { + d = lua_tonumber(L, 5); center = (int32_t)d != 0; + d = lua_tonumber(L, 6); id = (int32_t)d; + } + } else { + d = lua_tonumber(L, 5); id = (int32_t)d; + } } } - } else { - // Target is same size as sprite - d = lua_tonumber(L, 3); id = (int32_t)d; } HASH_FIND_INT(_global.spriteList, &id, sprite); if (!sprite) luaDie(L, "spriteDraw", "No sprite at index %d in apiSpriteDraw.", id); - if (n == 5) { - // Target is scaled - SDL_BlitScaled(sprite->surface, NULL, _global.overlay, &dest); - } else { - // Target is same size as sprite + if ((n == 3) || (n == 4)) { + // No scaling, find width dest.w = sprite->surface->w; dest.h = sprite->surface->h; + } + if (center) { + // Move sprite so the drawing coordinate is the center of the sprite + dest.x -= dest.w * 0.5; + dest.y -= dest.w * 0.5; + } + if ((n == 3) || (n == 4)) { + // No scaling SDL_BlitSurface(sprite->surface, NULL, _global.overlay, &dest); + } else { + // Scaled + SDL_BlitScaled(sprite->surface, NULL, _global.overlay, &dest); } } } @@ -1869,7 +1913,7 @@ int32_t apiSpriteDraw(lua_State *L) { } if (id >= 0) { - luaTrace(L, "spriteDraw", "%d %d %d %d %d", id, dest.x, dest.y, dest.w, dest.h); + luaTrace(L, "spriteDraw", "%d %d %d %d %d %d", id, dest.x, dest.y, dest.w, dest.h, center); } else { luaDie(L, "spriteDraw", "Failed!"); } @@ -1948,6 +1992,9 @@ int32_t apiSpriteLoad(lua_State *L) { sprite->surface = IMG_Load(name); if (!sprite->surface) luaDie(L, "spriteLoad", "%s", IMG_GetError()); SDL_SetColorKey(sprite->surface, true, 0); + SDL_BlitSurface(sprite->surface, NULL, sprite->originalSurface, NULL); + sprite->scaleX = 1.0; + sprite->scaleY = 1.0; sprite->id = _global.nextSpriteId; result = _global.nextSpriteId++; HASH_ADD_INT(_global.spriteList, id, sprite); @@ -1965,6 +2012,107 @@ int32_t apiSpriteLoad(lua_State *L) { } +int32_t apiSpriteRotate(lua_State *L) { + int32_t n = lua_gettop(L); + int32_t id = -1; + double d; + double a; + SpriteT *sprite = NULL; + + if (n == 2) { + if (lua_isnumber(L, 1)) { + if (lua_isnumber(L, 2)) { + d = lua_tonumber(L, 1); a = fmod(d, 360.0); + d = lua_tonumber(L, 2); id = (int32_t)d; + HASH_FIND_INT(_global.spriteList, &id, sprite); + if (!sprite) luaDie(L, "spriteRotate", "No sprite at index %d in apiSpriteRotate.", id); + sprite->angle = a; + SDL_FreeSurface(sprite->surface); + sprite->surface = rotozoomSurfaceXY(sprite->originalSurface, sprite->angle, sprite->scaleX, sprite->scaleY, sprite->smooth); + } + } + } + + if (id >= 0) { + luaTrace(L, "spriteRotate", "%d %f", id, sprite->angle); + } else { + luaDie(L, "spriteRotate", "Failed!"); + } + + return 0; +} + + +int32_t apiSpriteScale(lua_State *L) { + int32_t n = lua_gettop(L); + int32_t id = -1; + double d; + double x; + double y; + SpriteT *sprite = NULL; + + if ((n == 2) || (n == 3)) { + if (lua_isnumber(L, 1)) { + if (lua_isnumber(L, 2)) { + d = lua_tonumber(L, 1); x = d; + if (n == 2) { + y = x; + d = lua_tonumber(L, 2); id = (int32_t)d; + } else { + d = lua_tonumber(L, 2); y = d; + d = lua_tonumber(L, 3); id = (int32_t)d; + } + HASH_FIND_INT(_global.spriteList, &id, sprite); + if (!sprite) luaDie(L, "spriteScale", "No sprite at index %d in apiSpriteScale.", id); + sprite->scaleX = x; + sprite->scaleY = y; + SDL_FreeSurface(sprite->surface); + sprite->surface = rotozoomSurfaceXY(sprite->originalSurface, sprite->angle, sprite->scaleX, sprite->scaleY, sprite->smooth); + } + } + } + + if (id >= 0) { + luaTrace(L, "spriteScale", "%d %f %f", id, sprite->scaleX, sprite->scaleY); + } else { + luaDie(L, "spriteScale", "Failed!"); + } + + return 0; +} + + +int32_t apiSpriteSmooth(lua_State *L) { + int32_t n = lua_gettop(L); + int32_t id = -1; + int32_t s; + double d; + SpriteT *sprite = NULL; + + if (n == 2) { + if (lua_isnumber(L, 1)) { + if (lua_isnumber(L, 2)) { + d = lua_tonumber(L, 1); s = (int32_t)d; + d = lua_tonumber(L, 2); id = (int32_t)d; + HASH_FIND_INT(_global.spriteList, &id, sprite); + if (!sprite) luaDie(L, "spriteSmooth", "No sprite at index %d in apiSpriteSmooth.", id); + sprite->smooth = s; + SDL_FreeSurface(sprite->surface); + sprite->surface = rotozoomSurfaceXY(sprite->originalSurface, sprite->angle, sprite->scaleX, sprite->scaleY, sprite->smooth); + } + } + } + + if (id >= 0) { + luaTrace(L, "spriteSmooth", "%d %d", id, sprite->smooth); + } else { + luaDie(L, "spriteSmooth", "Failed!"); + } + + return 0; +} + + int32_t apiSpriteUnload(lua_State *L) { int32_t n = lua_gettop(L); bool result = false; @@ -1980,6 +2128,7 @@ int32_t apiSpriteUnload(lua_State *L) { if (!sprite) luaDie(L, "spriteUnload", "No sprite at index %d in apiSpriteUnload.", id); HASH_DEL(_global.spriteList, sprite); SDL_FreeSurface(sprite->surface); + SDL_FreeSurface(sprite->originalSurface); free(sprite); result = true; } @@ -4394,12 +4543,13 @@ void singe(SDL_Window *window, SDL_Renderer *renderer, ConfigT *conf) { HASH_ITER(hh, _global.spriteList, sprite, spriteTemp) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" - HASH_DEL(_global.spriteList, sprite); + HASH_DEL(_global.spriteList, sprite); #pragma GCC diagnostic pop - progTrace("Unloading sprite handle %d", sprite->id); - SDL_FreeSurface(sprite->surface); - free(sprite); - } + progTrace("Unloading sprite handle %d", sprite->id); + SDL_FreeSurface(sprite->surface); + SDL_FreeSurface(sprite->originalSurface); + free(sprite); + } // Unload videos HASH_ITER(hh, _global.videoList, video, videoTemp) { diff --git a/thirdparty/SDL2_gfx/AUTHORS b/thirdparty/SDL2_gfx/AUTHORS new file mode 100755 index 000000000..040bd79d9 --- /dev/null +++ b/thirdparty/SDL2_gfx/AUTHORS @@ -0,0 +1 @@ +aschiffler at ferzkopp dot net diff --git a/thirdparty/SDL2_gfx/COPYING b/thirdparty/SDL2_gfx/COPYING new file mode 100755 index 000000000..2d5488373 --- /dev/null +++ b/thirdparty/SDL2_gfx/COPYING @@ -0,0 +1,5 @@ +SDL2_gfx COPYING + +Library is governed under the ZLib license. + +http://www.zlib.net/zlib_license.html diff --git a/thirdparty/SDL2_gfx/ChangeLog b/thirdparty/SDL2_gfx/ChangeLog new file mode 100755 index 000000000..f8f245fa2 --- /dev/null +++ b/thirdparty/SDL2_gfx/ChangeLog @@ -0,0 +1,68 @@ +SDL2_gfx ChangeLog + +Sun, Feb 11, 2018 16:55:00 PM +- version rev to 1.0.4 +- fix int overflow in ellipseRGBA for large radii (thanks for reporting David) +- fix aaline wrong direction hline bug (thanks Andre) +- fix off-by-1 error in rotateSurface90Degrees (thanks Austin) + +Mon, Feb 20, 2017 9:04:29 PM +- version rev to 1.0.3 +- updates to VS solution +- update README for VS2015 +- fix to rotozoomSurfaceSizeTrig (thanks hydren) +- fix for special case of roundedBoxRGBA (thanks LukeMS) + +Thu, Dec 10, 2015 8:11:26 AM +- added XCode.zip (thanks Matthias for contributing) + +Sun, Jul 13, 2014 9:21:00 AM +- added TestFramerate + +Fri, Jul 11, 2014 7:33:12 PM +- rewrote thick line algorithm using polygon drawing (much less + code and faster than original Murphy-Bresenham algorithm) +- update TestThickLine accuracy test in TestGfx +- update file headers + +Fri, Jul 04, 2014 4:00:21 PM +- rewrote ellipse algorithm used by non-AA line/filled circle/ellipse functions: + integer midpoint algorithm with 4x overscan for visual accuracy +- fix bugs in TestGfx +- add screenshot image + +Sun, Jun 15, 2014 3:12:31 PM +- fixed roundedBox by rewriting algorithm and base it on filledCircle +- fixed textured polygon algorithm +- updated testgfx extensively (visual accuracy tests, updated tests for textured polygon) +- updated README + +Mon, Jun 09, 2014 8:48:50 AM +- removed VS2010 solution files; updated VS2012 solution files for SDL2 updates + +Mon, Jun 02, 2014 7:36:24 AM +- add patch for pkg-config support (thanks Sylvain) +- update tests to use SDLTest library +- fix commandline parsing in testgfx + +Mon, May 12, 2014 7:29:24 AM +- fixed BoxRGBA size-off-by-1 error (thanks Stefan for reporting) + +Sun, Feb 02, 2014 12:00:00 PM +- fixed and optimized rotateSurface90Degrees +- updated testrotozoom to allow specification of test range + +Sun, Nov 03, 2013 10:11:16 AM +- updated testgfx program for benchmarking primitive rendering performance +- updated test programs based on VS warnings +- fixed VS2012 solution for Release build + +Mon, Oct 28, 2013 8:00:05 AM +- bugfix to _aaline special cases +- added image filter functions +- added to documentation +- updated readme and changelog +- updated solutions for VS2010 and VS2012 + +Tue, Sep 04, 2012 8:27:44 AM +- initial release of development version (partially finished) diff --git a/thirdparty/SDL2_gfx/Docs/html.doxyfile b/thirdparty/SDL2_gfx/Docs/html.doxyfile new file mode 100755 index 000000000..eacb94d98 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html.doxyfile @@ -0,0 +1,1832 @@ +# Doxyfile 1.8.0 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = SDL2_gfx + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 1.0.2 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = Graphics primitives and surface functions for SDL2 + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = .. + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl \ + README + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = .. + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# style sheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/thirdparty/SDL2_gfx/Docs/html/_r_e_a_d_m_e.html b/thirdparty/SDL2_gfx/Docs/html/_r_e_a_d_m_e.html new file mode 100755 index 000000000..ff300b790 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_r_e_a_d_m_e.html @@ -0,0 +1,60 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/README File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/README File Reference
+
+ + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_r_e_a_d_m_e_source.html b/thirdparty/SDL2_gfx/Docs/html/_r_e_a_d_m_e_source.html new file mode 100755 index 000000000..9793f0c05 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_r_e_a_d_m_e_source.html @@ -0,0 +1,152 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/README Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/README
+
+
+Go to the documentation of this file.
1 /*!
+
2 
+
3 \mainpage SDL2_gfx - Graphics primitives and surface functions for SDL2
+
4 
+
5 \section contact_sec Contact and License
+
6 
+
7 Email aschiffler at ferzkopp dot net to contact the author
+
8 or better check author's homepage at http://www.ferzkopp.net
+
9 for the most up-to-date contact information.
+
10 
+
11 This library is licenced under the zlib License, see the file LICENSE for details.
+
12 
+
13 
+
14 \section intro_sec Introduction
+
15 
+
16 The SDL2_gfx library provides the basic drawing functions such as lines,
+
17 circles or polygons provided by SDL_gfx on SDL2 against renderers of SDL2.
+
18 
+
19 The current components of the SDL2_gfx library are:
+
20 - Graphic Primitives (SDL2_gfxPrimitives.h, SDL2_gfxPrimitives.c)
+
21 - Surface Rotozoomer (SDL2_rotozoom.h, SDL2_rotozoom.c)
+
22 - Framerate control (SDL2_framerate.h, SDL2_framerate.c)
+
23 - MMX image filters (SDL2_imageFilter.h, SDL2_imageFilter.c)
+
24 - Build-in 8x8 Font (SDL2_gfxPrimitives_font.h)
+
25 
+
26 Note that SDL2_gfx is compatible with SDL version 2.0 (not SDL 1.2).
+
27 
+
28 \section install_sec Installation
+
29 
+
30 \subsection unix Unix/Linux
+
31 
+
32 Use the standard autoconf/automake sequence to compile and install the library.
+
33 \verbatim
+
34  ./autogen.sh # (optional, recommended)
+
35  ./configure
+
36  make
+
37  make install
+
38 \endverbatim
+
39 
+
40 \\subsubsection nommx Linker Configuration
+
41 
+
42 The default location for the installation is /usr/local/lib and /usr/local/include.
+
43 This libary path may need to be added to the file the linker configuration file:
+
44 \verbatim
+
45  vi /etc/ld.so.conf
+
46  ldconfig
+
47 \endverbatim
+
48 
+
49 \\subsubsection nommx Non-MMX Platforms
+
50 
+
51 To build without MMX code enabled (i.e. ARM, PPC, AMD64 architectures):
+
52 \verbatim
+
53  ./configure --disable-mmx
+
54  make
+
55  make install
+
56 \endverbatim
+
57 
+
58 \subsection visualstudio Windows (VS2012, VS2013)
+
59 
+
60 Open the SDL2_gfx.sln solution file, right click on the solution and choose 'Rebuild'.
+
61 
+
62 The SDL2 Visual Studio solution must be placed in a directory alongside SDL2_gfx and build in the same configuration, i.e. Debug or Release, beforehand so the referenced SDL2.lib file can be found.
+
63 
+
64 \subsection platformosx Mac OSX
+
65 
+
66 The usual autotools build chain should be used. MacPorts or fink may be required.
+
67 
+
68 Xcode is supported via templates. See Xcode.zip - this template only supports SDL2_gfx
+
69 and not the tests. For this template, the Deployment Target (the lowest version to run on)
+
70 is set to 10.11 and expects the SDL2.framework preinstalled in the default location: /Library/Frameworks.
+
71 
+
72 \section test_sec Test Programs
+
73 
+
74 Change to the ./test directory and run
+
75 \verbatim
+
76  ./autogen.sh
+
77  ./configure
+
78  make
+
79 \endverbatim
+
80 to create several test programs for the libraries functions. This requires
+
81 the SDL2_gfx library to be previously compiled and installed.
+
82 
+
83 See the source in the test/*.c files for some sample code and implementation hints.
+
84 
+
85 \section documentation_sec Documentation
+
86 
+
87 Please refer to the Doxygen-generated API documentation found in the
+
88 Docs/html folder as well as the test programs in the test folder.
+
89 
+
90 \section changelog_sec Change Log
+
91 
+
92 \verbinclude ChangeLog
+
93 
+
94 */
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8c.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8c.html new file mode 100755 index 000000000..c956b897f --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8c.html @@ -0,0 +1,256 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_framerate.c File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_framerate.c File Reference
+
+
+
#include "SDL2_framerate.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + +

+Functions

Uint32 _getTicks ()
 Internal wrapper to SDL_GetTicks that ensures a non-zero return value. More...
 
void SDL_initFramerate (FPSmanager *manager)
 Initialize the framerate manager. More...
 
int SDL_setFramerate (FPSmanager *manager, Uint32 rate)
 Set the framerate in Hz. More...
 
int SDL_getFramerate (FPSmanager *manager)
 Return the current target framerate in Hz. More...
 
int SDL_getFramecount (FPSmanager *manager)
 Return the current framecount. More...
 
Uint32 SDL_framerateDelay (FPSmanager *manager)
 Delay execution to maintain a constant framerate and calculate fps. More...
 
+

Function Documentation

+ +
+
+ + + + + + + +
Uint32 _getTicks ()
+
+ +

Internal wrapper to SDL_GetTicks that ensures a non-zero return value.

+
Returns
The tick count.
+ +

Definition at line 37 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
Uint32 SDL_framerateDelay (FPSmanagermanager)
+
+ +

Delay execution to maintain a constant framerate and calculate fps.

+

Generate a delay to accomodate currently set framerate. Call once in the graphics/rendering loop. If the computer cannot keep up with the rate (i.e. drawing too slow), the delay is zero and the delay interpolation is reset.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+
Returns
The time that passed since the last call to the function in ms. May return 0.
+ +

Definition at line 146 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
int SDL_getFramecount (FPSmanagermanager)
+
+ +

Return the current framecount.

+

Get the current framecount from the framerate manager. A frame is counted each time SDL_framerateDelay is called.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+
Returns
Current frame count or -1 for error.
+ +

Definition at line 126 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
int SDL_getFramerate (FPSmanagermanager)
+
+ +

Return the current target framerate in Hz.

+

Get the currently set framerate of the manager.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+
Returns
Current framerate in Hz or -1 for error.
+ +

Definition at line 107 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
void SDL_initFramerate (FPSmanagermanager)
+
+ +

Initialize the framerate manager.

+

Initialize the framerate manager, set default framerate of 30Hz and reset delay interpolation.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+ +

Definition at line 62 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int SDL_setFramerate (FPSmanagermanager,
Uint32 rate 
)
+
+ +

Set the framerate in Hz.

+

Sets a new framerate for the manager and reset delay interpolation. Rate values must be between FPS_LOWER_LIMIT and FPS_UPPER_LIMIT inclusive to be accepted.

+
Parameters
+ + + +
managerPointer to the framerate manager.
rateThe new framerate in Hz (frames per second).
+
+
+
Returns
0 for sucess and -1 for error.
+ +

Definition at line 86 of file SDL2_framerate.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8c_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8c_source.html new file mode 100755 index 000000000..50bc265a6 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8c_source.html @@ -0,0 +1,209 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_framerate.c Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_framerate.c
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_framerate.c: framerate manager
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #include "SDL2_framerate.h"
+
31 
+
37 Uint32 _getTicks()
+
38 {
+
39  Uint32 ticks = SDL_GetTicks();
+
40 
+
41  /*
+
42  * Since baseticks!=0 is used to track initialization
+
43  * we need to ensure that the tick count is always >0
+
44  * since SDL_GetTicks may not have incremented yet and
+
45  * return 0 depending on the timing of the calls.
+
46  */
+
47  if (ticks == 0) {
+
48  return 1;
+
49  } else {
+
50  return ticks;
+
51  }
+
52 }
+
53 
+ +
63 {
+
64  /*
+
65  * Store some sane values
+
66  */
+
67  manager->framecount = 0;
+
68  manager->rate = FPS_DEFAULT;
+
69  manager->rateticks = (1000.0f / (float) FPS_DEFAULT);
+
70  manager->baseticks = _getTicks();
+
71  manager->lastticks = manager->baseticks;
+
72 
+
73 }
+
74 
+
86 int SDL_setFramerate(FPSmanager * manager, Uint32 rate)
+
87 {
+
88  if ((rate >= FPS_LOWER_LIMIT) && (rate <= FPS_UPPER_LIMIT)) {
+
89  manager->framecount = 0;
+
90  manager->rate = rate;
+
91  manager->rateticks = (1000.0f / (float) rate);
+
92  return (0);
+
93  } else {
+
94  return (-1);
+
95  }
+
96 }
+
97 
+ +
108 {
+
109  if (manager == NULL) {
+
110  return (-1);
+
111  } else {
+
112  return ((int)manager->rate);
+
113  }
+
114 }
+
115 
+ +
127 {
+
128  if (manager == NULL) {
+
129  return (-1);
+
130  } else {
+
131  return ((int)manager->framecount);
+
132  }
+
133 }
+
134 
+ +
147 {
+
148  Uint32 current_ticks;
+
149  Uint32 target_ticks;
+
150  Uint32 the_delay;
+
151  Uint32 time_passed = 0;
+
152 
+
153  /*
+
154  * No manager, no delay
+
155  */
+
156  if (manager == NULL) {
+
157  return 0;
+
158  }
+
159 
+
160  /*
+
161  * Initialize uninitialized manager
+
162  */
+
163  if (manager->baseticks == 0) {
+
164  SDL_initFramerate(manager);
+
165  }
+
166 
+
167  /*
+
168  * Next frame
+
169  */
+
170  manager->framecount++;
+
171 
+
172  /*
+
173  * Get/calc ticks
+
174  */
+
175  current_ticks = _getTicks();
+
176  time_passed = current_ticks - manager->lastticks;
+
177  manager->lastticks = current_ticks;
+
178  target_ticks = manager->baseticks + (Uint32) ((float) manager->framecount * manager->rateticks);
+
179 
+
180  if (current_ticks <= target_ticks) {
+
181  the_delay = target_ticks - current_ticks;
+
182  SDL_Delay(the_delay);
+
183  } else {
+
184  manager->framecount = 0;
+
185  manager->baseticks = _getTicks();
+
186  }
+
187 
+
188  return time_passed;
+
189 }
+
Uint32 framecount
+
Uint32 lastticks
+
Structure holding the state and timing information of the framerate controller.
+
Uint32 SDL_framerateDelay(FPSmanager *manager)
Delay execution to maintain a constant framerate and calculate fps.
+
#define FPS_UPPER_LIMIT
Highest possible rate supported by framerate controller in Hz (1/s).
+ +
Uint32 _getTicks()
Internal wrapper to SDL_GetTicks that ensures a non-zero return value.
+
#define FPS_DEFAULT
Default rate of framerate controller in Hz (1/s).
+
float rateticks
+
void SDL_initFramerate(FPSmanager *manager)
Initialize the framerate manager.
+
int SDL_getFramerate(FPSmanager *manager)
Return the current target framerate in Hz.
+
Uint32 baseticks
+
int SDL_setFramerate(FPSmanager *manager, Uint32 rate)
Set the framerate in Hz.
+ +
int SDL_getFramecount(FPSmanager *manager)
Return the current framecount.
+
#define FPS_LOWER_LIMIT
Lowest possible rate supported by framerate controller in Hz (1/s).
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h.html new file mode 100755 index 000000000..beb38ea20 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h.html @@ -0,0 +1,318 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_framerate.h File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_framerate.h File Reference
+
+
+
#include "SDL.h"
+
+

Go to the source code of this file.

+ + + + + +

+Data Structures

struct  FPSmanager
 Structure holding the state and timing information of the framerate controller. More...
 
+ + + + + + + + + + + + +

+Macros

#define FPS_UPPER_LIMIT   200
 Highest possible rate supported by framerate controller in Hz (1/s). More...
 
#define FPS_LOWER_LIMIT   1
 Lowest possible rate supported by framerate controller in Hz (1/s). More...
 
#define FPS_DEFAULT   30
 Default rate of framerate controller in Hz (1/s). More...
 
#define SDL2_FRAMERATE_SCOPE   extern
 
+ + + + + + + + + + + + + + + + +

+Functions

SDL2_FRAMERATE_SCOPE void SDL_initFramerate (FPSmanager *manager)
 Initialize the framerate manager. More...
 
SDL2_FRAMERATE_SCOPE int SDL_setFramerate (FPSmanager *manager, Uint32 rate)
 Set the framerate in Hz. More...
 
SDL2_FRAMERATE_SCOPE int SDL_getFramerate (FPSmanager *manager)
 Return the current target framerate in Hz. More...
 
SDL2_FRAMERATE_SCOPE int SDL_getFramecount (FPSmanager *manager)
 Return the current framecount. More...
 
SDL2_FRAMERATE_SCOPE Uint32 SDL_framerateDelay (FPSmanager *manager)
 Delay execution to maintain a constant framerate and calculate fps. More...
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define FPS_DEFAULT   30
+
+ +

Default rate of framerate controller in Hz (1/s).

+ +

Definition at line 57 of file SDL2_framerate.h.

+ +
+
+ +
+
+ + + + +
#define FPS_LOWER_LIMIT   1
+
+ +

Lowest possible rate supported by framerate controller in Hz (1/s).

+ +

Definition at line 52 of file SDL2_framerate.h.

+ +
+
+ +
+
+ + + + +
#define FPS_UPPER_LIMIT   200
+
+ +

Highest possible rate supported by framerate controller in Hz (1/s).

+ +

Definition at line 47 of file SDL2_framerate.h.

+ +
+
+ +
+
+ + + + +
#define SDL2_FRAMERATE_SCOPE   extern
+
+ +

Definition at line 82 of file SDL2_framerate.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
SDL2_FRAMERATE_SCOPE Uint32 SDL_framerateDelay (FPSmanagermanager)
+
+ +

Delay execution to maintain a constant framerate and calculate fps.

+

Generate a delay to accomodate currently set framerate. Call once in the graphics/rendering loop. If the computer cannot keep up with the rate (i.e. drawing too slow), the delay is zero and the delay interpolation is reset.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+
Returns
The time that passed since the last call to the function in ms. May return 0.
+ +

Definition at line 146 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_FRAMERATE_SCOPE int SDL_getFramecount (FPSmanagermanager)
+
+ +

Return the current framecount.

+

Get the current framecount from the framerate manager. A frame is counted each time SDL_framerateDelay is called.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+
Returns
Current frame count or -1 for error.
+ +

Definition at line 126 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_FRAMERATE_SCOPE int SDL_getFramerate (FPSmanagermanager)
+
+ +

Return the current target framerate in Hz.

+

Get the currently set framerate of the manager.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+
Returns
Current framerate in Hz or -1 for error.
+ +

Definition at line 107 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_FRAMERATE_SCOPE void SDL_initFramerate (FPSmanagermanager)
+
+ +

Initialize the framerate manager.

+

Initialize the framerate manager, set default framerate of 30Hz and reset delay interpolation.

+
Parameters
+ + +
managerPointer to the framerate manager.
+
+
+ +

Definition at line 62 of file SDL2_framerate.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
SDL2_FRAMERATE_SCOPE int SDL_setFramerate (FPSmanagermanager,
Uint32 rate 
)
+
+ +

Set the framerate in Hz.

+

Sets a new framerate for the manager and reset delay interpolation. Rate values must be between FPS_LOWER_LIMIT and FPS_UPPER_LIMIT inclusive to be accepted.

+
Parameters
+ + + +
managerPointer to the framerate manager.
rateThe new framerate in Hz (frames per second).
+
+
+
Returns
0 for sucess and -1 for error.
+ +

Definition at line 86 of file SDL2_framerate.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h_source.html new file mode 100755 index 000000000..bb3ac9f38 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h_source.html @@ -0,0 +1,158 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_framerate.h Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_framerate.h
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_framerate.h: framerate manager
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #ifndef _SDL2_framerate_h
+
31 #define _SDL2_framerate_h
+
32 
+
33 /* Set up for C function definitions, even when using C++ */
+
34 #ifdef __cplusplus
+
35 extern "C" {
+
36 #endif
+
37 
+
38  /* --- */
+
39 
+
40 #include "SDL.h"
+
41 
+
42  /* --------- Definitions */
+
43 
+
47 #define FPS_UPPER_LIMIT 200
+
48 
+
52 #define FPS_LOWER_LIMIT 1
+
53 
+
57 #define FPS_DEFAULT 30
+
58 
+
62  typedef struct {
+
63  Uint32 framecount;
+
64  float rateticks;
+
65  Uint32 baseticks;
+
66  Uint32 lastticks;
+
67  Uint32 rate;
+
68  } FPSmanager;
+
69 
+
70  /* ---- Function Prototypes */
+
71 
+
72 #ifdef _MSC_VER
+
73 # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT)
+
74 # define SDL2_FRAMERATE_SCOPE __declspec(dllexport)
+
75 # else
+
76 # ifdef LIBSDL2_GFX_DLL_IMPORT
+
77 # define SDL2_FRAMERATE_SCOPE __declspec(dllimport)
+
78 # endif
+
79 # endif
+
80 #endif
+
81 #ifndef SDL2_FRAMERATE_SCOPE
+
82 # define SDL2_FRAMERATE_SCOPE extern
+
83 #endif
+
84 
+
85  /* Functions return 0 or value for sucess and -1 for error */
+
86 
+ +
88  SDL2_FRAMERATE_SCOPE int SDL_setFramerate(FPSmanager * manager, Uint32 rate);
+ + + +
92 
+
93  /* --- */
+
94 
+
95  /* Ends C function definitions when using C++ */
+
96 #ifdef __cplusplus
+
97 }
+
98 #endif
+
99 
+
100 #endif /* _SDL2_framerate_h */
+
SDL2_FRAMERATE_SCOPE void SDL_initFramerate(FPSmanager *manager)
Initialize the framerate manager.
+
SDL2_FRAMERATE_SCOPE int SDL_getFramerate(FPSmanager *manager)
Return the current target framerate in Hz.
+
SDL2_FRAMERATE_SCOPE int SDL_setFramerate(FPSmanager *manager, Uint32 rate)
Set the framerate in Hz.
+
Uint32 framecount
+
Uint32 lastticks
+
Structure holding the state and timing information of the framerate controller.
+
float rateticks
+
SDL2_FRAMERATE_SCOPE int SDL_getFramecount(FPSmanager *manager)
Return the current framecount.
+
SDL2_FRAMERATE_SCOPE Uint32 SDL_framerateDelay(FPSmanager *manager)
Delay execution to maintain a constant framerate and calculate fps.
+
#define SDL2_FRAMERATE_SCOPE
+
Uint32 baseticks
+ +
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8c.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8c.html new file mode 100755 index 000000000..3adc30ac1 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8c.html @@ -0,0 +1,5843 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.c File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.c File Reference
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include "SDL2_gfxPrimitives.h"
+#include "SDL2_rotozoom.h"
+#include "SDL2_gfxPrimitives_font.h"
+
+

Go to the source code of this file.

+ + + + + + + + +

+Data Structures

struct  SDL2_gfxBresenhamIterator
 The structure passed to the internal Bresenham iterator. More...
 
struct  SDL2_gfxMurphyIterator
 The structure passed to the internal Murphy iterator. More...
 
+ + + + + + + + +

+Macros

#define AAlevels   256
 
#define AAbits   8
 
#define ELLIPSE_OVERSCAN   4
 Internal function to draw ellipse or filled ellipse with blending. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

int pixel (SDL_Renderer *renderer, Sint16 x, Sint16 y)
 Draw pixel in currently set color. More...
 
int pixelColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint32 color)
 Draw pixel with blending enabled if a<255. More...
 
int pixelRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw pixel with blending enabled if a<255. More...
 
int pixelRGBAWeight (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint32 weight)
 Draw pixel with blending enabled and using alpha weight on color. More...
 
int hline (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y)
 Draw horizontal line in currently set color. More...
 
int hlineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
 Draw horizontal line with blending. More...
 
int hlineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw horizontal line with blending. More...
 
int vline (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2)
 Draw vertical line in currently set color. More...
 
int vlineColor (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
 Draw vertical line with blending. More...
 
int vlineRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw vertical line with blending. More...
 
int rectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw rectangle with blending. More...
 
int rectangleRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rectangle with blending. More...
 
int roundedRectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
 Draw rounded-corner rectangle with blending. More...
 
int roundedRectangleRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rounded-corner rectangle with blending. More...
 
int roundedBoxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
 Draw rounded-corner box (filled rectangle) with blending. More...
 
int roundedBoxRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rounded-corner box (filled rectangle) with blending. More...
 
int boxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw box (filled rectangle) with blending. More...
 
int boxRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw box (filled rectangle) with blending. More...
 
int line (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2)
 Draw line with alpha blending using the currently set color. More...
 
int lineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw line with alpha blending. More...
 
int lineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw line with alpha blending. More...
 
int _aalineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int draw_endpoint)
 Internal function to draw anti-aliased line with alpha blending and endpoint control. More...
 
int aalineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw anti-aliased line with alpha blending. More...
 
int aalineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased line with alpha blending. More...
 
int circleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw circle with blending. More...
 
int circleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw circle with blending. More...
 
int arcColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Arc with blending. More...
 
int arcRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Arc with blending. More...
 
int aacircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw anti-aliased circle with blending. More...
 
int aacircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased circle with blending. More...
 
int _drawQuadrants (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 dx, Sint16 dy, Sint32 f)
 Internal function to draw pixels or lines in 4 quadrants. More...
 
int _ellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Sint32 f)
 
int ellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw ellipse with blending. More...
 
int ellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw ellipse with blending. More...
 
int filledCircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw filled circle with blending. More...
 
int filledCircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled circle with blending. More...
 
int aaellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw anti-aliased ellipse with blending. More...
 
int aaellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased ellipse with blending. More...
 
int filledEllipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw filled ellipse with blending. More...
 
int filledEllipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled ellipse with blending. More...
 
int _pieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint8 filled)
 Internal float (low-speed) pie-calc implementation by drawing polygons. More...
 
int pieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Draw pie (outline) with alpha blending. More...
 
int pieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw pie (outline) with alpha blending. More...
 
int filledPieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Draw filled pie with alpha blending. More...
 
int filledPieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled pie with alpha blending. More...
 
int trigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw trigon (triangle outline) with alpha blending. More...
 
int trigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw trigon (triangle outline) with alpha blending. More...
 
int aatrigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw anti-aliased trigon (triangle outline) with alpha blending. More...
 
int aatrigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased trigon (triangle outline) with alpha blending. More...
 
int filledTrigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw filled trigon (triangle) with alpha blending. More...
 
int filledTrigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled trigon (triangle) with alpha blending. More...
 
int polygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw polygon with alpha blending. More...
 
int polygon (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n)
 Draw polygon with the currently set color and blend mode. More...
 
int polygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw polygon with alpha blending. More...
 
int aapolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw anti-aliased polygon with alpha blending. More...
 
int aapolygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased polygon with alpha blending. More...
 
int _gfxPrimitivesCompareInt (const void *a, const void *b)
 Internal helper qsort callback functions used in filled polygon drawing. More...
 
int filledPolygonRGBAMT (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated)
 Draw filled polygon with alpha blending (multi-threaded capable). More...
 
int filledPolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw filled polygon with alpha blending. More...
 
int filledPolygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled polygon with alpha blending. More...
 
int _HLineTextured (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, SDL_Texture *texture, int texture_w, int texture_h, int texture_dx, int texture_dy)
 Internal function to draw a textured horizontal line. More...
 
int texturedPolygonMT (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy, int **polyInts, int *polyAllocated)
 Draws a polygon filled with the given texture (Multi-Threading Capable). More...
 
int texturedPolygon (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy)
 Draws a polygon filled with the given texture. More...
 
void gfxPrimitivesSetFont (const void *fontdata, Uint32 cw, Uint32 ch)
 Sets or resets the current global font data. More...
 
void gfxPrimitivesSetFontRotation (Uint32 rotation)
 Sets current global font character rotation steps. More...
 
int characterRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a character of the currently set font. More...
 
int characterColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint32 color)
 Draw a character of the currently set font. More...
 
int stringColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
 Draw a string in the currently set font. More...
 
int stringRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a string in the currently set font. More...
 
double _evaluateBezier (double *data, int ndata, double t)
 Internal function to calculate bezier interpolator of data array with ndata values at position 't'. More...
 
int bezierColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color)
 Draw a bezier curve with alpha blending. More...
 
int bezierRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a bezier curve with alpha blending. More...
 
int thickLineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
 Draw a thick line with alpha blending. More...
 
int thickLineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a thick line with alpha blending. More...
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define AAbits   8
+
+ +

Definition at line 857 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + +
#define AAlevels   256
+
+ +

Definition at line 856 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + +
#define ELLIPSE_OVERSCAN   4
+
+ +

Internal function to draw ellipse or filled ellipse with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
rThe red value of the ellipse to draw.
gThe green value of the ellipse to draw.
bThe blue value of the ellipse to draw.
aThe alpha value of the ellipse to draw.
fFlag indicating if the ellipse should be filled (1) or not (0).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1529 of file SDL2_gfxPrimitives.c.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _aalineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a,
int draw_endpoint 
)
+
+ +

Internal function to draw anti-aliased line with alpha blending and endpoint control.

+

This implementation of the Wu antialiasing code is based on Mike Abrash's DDJ article which was reprinted as Chapter 42 of his Graphics Programming Black Book, but has been optimized to work with SDL and utilizes 32-bit fixed-point arithmetic by A. Schiffler. The endpoint control allows the supression to draw the last pixel useful for rendering continous aa-lines with alpha<255.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
rThe red value of the aa-line to draw.
gThe green value of the aa-line to draw.
bThe blue value of the aa-line to draw.
aThe alpha value of the aa-line to draw.
draw_endpointFlag indicating if the endpoint should be drawn; draw if non-zero.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 882 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _drawQuadrants (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 dx,
Sint16 dy,
Sint32 f 
)
+
+ +

Internal function to draw pixels or lines in 4 quadrants.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the quadrant.
yY coordinate of the center of the quadrant.
dxX offset in pixels of the corners of the quadrant.
dyY offset in pixels of the corners of the quadrant.
fFlag indicating if the quadrant should be filled (1) or not (0).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1475 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _ellipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a,
Sint32 f 
)
+
+ +

Definition at line 1530 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
double _evaluateBezier (double * data,
int ndata,
double t 
)
+
+ +

Internal function to calculate bezier interpolator of data array with ndata values at position 't'.

+
Parameters
+ + + + +
dataArray of values.
ndataSize of array.
tPosition for which to calculate interpolated value. t should be between [0, ndata].
+
+
+
Returns
Interpolated value at position t, value[0] when t<0, value[n-1] when t>n.
+ +

Definition at line 3556 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int _gfxPrimitivesCompareInt (const void * a,
const void * b 
)
+
+ +

Internal helper qsort callback functions used in filled polygon drawing.

+
Parameters
+ + + +
aThe surface to draw on.
bVertex array containing X coordinates of the points of the polygon.
+
+
+
Returns
Returns 0 if a==b, a negative number if a<b or a positive number if a>b.
+ +

Definition at line 2674 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _HLineTextured (SDL_Renderer * renderer,
Sint16 x1,
Sint16 x2,
Sint16 y,
SDL_Texture * texture,
int texture_w,
int texture_h,
int texture_dx,
int texture_dy 
)
+
+ +

Internal function to draw a textured horizontal line.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
textureThe texture to retrieve color information from.
texture_wThe width of the texture.
texture_hThe height of the texture.
texture_dxThe X offset for the texture lookup.
texture_dyThe Y offset for the textured lookup.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2921 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _pieRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a,
Uint8 filled 
)
+
+ +

Internal float (low-speed) pie-calc implementation by drawing polygons.

+

Note: Determines vertex array and uses polygon or filledPolygon drawing routines to render.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
rThe red value of the pie to draw.
gThe green value of the pie to draw.
bThe blue value of the pie to draw.
aThe alpha value of the pie to draw.
filledFlag indicating if the pie should be filled (=1) or not (=0).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2055 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aacircleColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw anti-aliased circle with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-circle.
yY coordinate of the center of the aa-circle.
radRadius in pixels of the aa-circle.
colorThe color value of the aa-circle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1433 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aacircleRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased circle with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-circle.
yY coordinate of the center of the aa-circle.
radRadius in pixels of the aa-circle.
rThe red value of the aa-circle to draw.
gThe green value of the aa-circle to draw.
bThe blue value of the aa-circle to draw.
aThe alpha value of the aa-circle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1453 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aaellipseColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint32 color 
)
+
+ +

Draw anti-aliased ellipse with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-ellipse.
yY coordinate of the center of the aa-ellipse.
rxHorizontal radius in pixels of the aa-ellipse.
ryVertical radius in pixels of the aa-ellipse.
colorThe color value of the aa-ellipse to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1791 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aaellipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased ellipse with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-ellipse.
yY coordinate of the center of the aa-ellipse.
rxHorizontal radius in pixels of the aa-ellipse.
ryVertical radius in pixels of the aa-ellipse.
rThe red value of the aa-ellipse to draw.
gThe green value of the aa-ellipse to draw.
bThe blue value of the aa-ellipse to draw.
aThe alpha value of the aa-ellipse to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1812 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aalineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw anti-aliased line with alpha blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
colorThe color value of the aa-line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1096 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aalineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased line with alpha blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
rThe red value of the aa-line to draw.
gThe green value of the aa-line to draw.
bThe blue value of the aa-line to draw.
aThe alpha value of the aa-line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1117 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aapolygonColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint32 color 
)
+
+ +

Draw anti-aliased polygon with alpha blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the aa-polygon.
vyVertex array containing Y coordinates of the points of the aa-polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the aa-polygon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2596 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aapolygonRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased polygon with alpha blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the aa-polygon.
vyVertex array containing Y coordinates of the points of the aa-polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the aa-polygon to draw.
gThe green value of the aa-polygon to draw.
bThe blue value of the aa-polygon to draw.
aThe alpha value of the aa-polygon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2616 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aatrigonColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint32 color 
)
+
+ +

Draw anti-aliased trigon (triangle outline) with alpha blending.

+

Note: Creates vertex array and uses aapolygon routine to render.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-trigon.
y1Y coordinate of the first point of the aa-trigon.
x2X coordinate of the second point of the aa-trigon.
y2Y coordinate of the second point of the aa-trigon.
x3X coordinate of the third point of the aa-trigon.
y3Y coordinate of the third point of the aa-trigon.
colorThe color value of the aa-trigon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2324 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int aatrigonRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased trigon (triangle outline) with alpha blending.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-trigon.
y1Y coordinate of the first point of the aa-trigon.
x2X coordinate of the second point of the aa-trigon.
y2Y coordinate of the second point of the aa-trigon.
x3X coordinate of the third point of the aa-trigon.
y3Y coordinate of the third point of the aa-trigon.
rThe red value of the aa-trigon to draw.
gThe green value of the aa-trigon to draw.
bThe blue value of the aa-trigon to draw.
aThe alpha value of the aa-trigon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2356 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int arcColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint32 color 
)
+
+ +

Arc with blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the arc.
yY coordinate of the center of the arc.
radRadius in pixels of the arc.
startStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
endEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
colorThe color value of the arc to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1175 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int arcRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Arc with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the arc.
yY coordinate of the center of the arc.
radRadius in pixels of the arc.
startStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
endEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
rThe red value of the arc to draw.
gThe green value of the arc to draw.
bThe blue value of the arc to draw.
aThe alpha value of the arc to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1198 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int bezierColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
int s,
Uint32 color 
)
+
+ +

Draw a bezier curve with alpha blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the bezier curve.
vyVertex array containing Y coordinates of the points of the bezier curve.
nNumber of points in the vertex array. Minimum number is 3.
sNumber of steps for the interpolation. Minimum number is 2.
colorThe color value of the bezier curve to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3615 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int bezierRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
int s,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a bezier curve with alpha blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the bezier curve.
vyVertex array containing Y coordinates of the points of the bezier curve.
nNumber of points in the vertex array. Minimum number is 3.
sNumber of steps for the interpolation. Minimum number is 2.
rThe red value of the bezier curve to draw.
gThe green value of the bezier curve to draw.
bThe blue value of the bezier curve to draw.
aThe alpha value of the bezier curve to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3636 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int boxColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw box (filled rectangle) with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
colorThe color value of the box to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 710 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int boxRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw box (filled rectangle) with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
rThe red value of the box to draw.
gThe green value of the box to draw.
bThe blue value of the box to draw.
aThe alpha value of the box to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 731 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int characterColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
char c,
Uint32 color 
)
+
+ +

Draw a character of the currently set font.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the character.
yY (vertical) coordinate of the upper left corner of the character.
cThe character to draw.
colorThe color value of the character to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3474 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int characterRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
char c,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a character of the currently set font.

+
Parameters
+ + + + + + + + + +
rendererThe Renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the character.
yY (vertical) coordinate of the upper left corner of the character.
cThe character to draw.
rThe red value of the character to draw.
gThe green value of the character to draw.
bThe blue value of the character to draw.
aThe alpha value of the character to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3352 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int circleColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw circle with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the circle.
yY coordinate of the center of the circle.
radRadius in pixels of the circle.
colorThe color value of the circle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1135 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int circleRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw circle with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the circle.
yY coordinate of the center of the circle.
radRadius in pixels of the circle.
rThe red value of the circle to draw.
gThe green value of the circle to draw.
bThe blue value of the circle to draw.
aThe alpha value of the circle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1155 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int ellipseColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint32 color 
)
+
+ +

Draw ellipse with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
colorThe color value of the ellipse to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1672 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int ellipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw ellipse with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
rThe red value of the ellipse to draw.
gThe green value of the ellipse to draw.
bThe blue value of the ellipse to draw.
aThe alpha value of the ellipse to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1693 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledCircleColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw filled circle with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled circle.
yY coordinate of the center of the filled circle.
radRadius in pixels of the filled circle.
colorThe color value of the filled circle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1711 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledCircleRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled circle with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled circle.
yY coordinate of the center of the filled circle.
radRadius in pixels of the filled circle.
rThe red value of the filled circle to draw.
gThe green value of the filled circle to draw.
bThe blue value of the filled circle to draw.
aThe alpha value of the filled circle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1731 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledEllipseColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint32 color 
)
+
+ +

Draw filled ellipse with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled ellipse.
yY coordinate of the center of the filled ellipse.
rxHorizontal radius in pixels of the filled ellipse.
ryVertical radius in pixels of the filled ellipse.
colorThe color value of the filled ellipse to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2007 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledEllipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled ellipse with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled ellipse.
yY coordinate of the center of the filled ellipse.
rxHorizontal radius in pixels of the filled ellipse.
ryVertical radius in pixels of the filled ellipse.
rThe red value of the filled ellipse to draw.
gThe green value of the filled ellipse to draw.
bThe blue value of the filled ellipse to draw.
aThe alpha value of the filled ellipse to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2028 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledPieColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint32 color 
)
+
+ +

Draw filled pie with alpha blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled pie.
yY coordinate of the center of the filled pie.
radRadius in pixels of the filled pie.
startStarting radius in degrees of the filled pie.
endEnding radius in degrees of the filled pie.
colorThe color value of the filled pie to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2212 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledPieRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled pie with alpha blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled pie.
yY coordinate of the center of the filled pie.
radRadius in pixels of the filled pie.
startStarting radius in degrees of the filled pie.
endEnding radius in degrees of the filled pie.
rThe red value of the filled pie to draw.
gThe green value of the filled pie to draw.
bThe blue value of the filled pie to draw.
aThe alpha value of the filled pie to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2234 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledPolygonColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint32 color 
)
+
+ +

Draw filled polygon with alpha blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the filled polygon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2879 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledPolygonRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled polygon with alpha blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the filled polygon to draw.
gThe green value of the filled polygon to draw.
bThe blue value of the filed polygon to draw.
aThe alpha value of the filled polygon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2899 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledPolygonRGBAMT (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a,
int ** polyInts,
int * polyAllocated 
)
+
+ +

Draw filled polygon with alpha blending (multi-threaded capable).

+

Note: The last two parameters are optional; but are required for multithreaded operation.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the filled polygon to draw.
gThe green value of the filled polygon to draw.
bThe blue value of the filled polygon to draw.
aThe alpha value of the filled polygon to draw.
polyIntsPreallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise.
polyAllocatedFlag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2711 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledTrigonColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint32 color 
)
+
+ +

Draw filled trigon (triangle) with alpha blending.

+

Note: Creates vertex array and uses aapolygon routine to render.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the filled trigon.
y1Y coordinate of the first point of the filled trigon.
x2X coordinate of the second point of the filled trigon.
y2Y coordinate of the second point of the filled trigon.
x3X coordinate of the third point of the filled trigon.
y3Y coordinate of the third point of the filled trigon.
colorThe color value of the filled trigon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2390 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int filledTrigonRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled trigon (triangle) with alpha blending.

+

Note: Creates vertex array and uses aapolygon routine to render.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the filled trigon.
y1Y coordinate of the first point of the filled trigon.
x2X coordinate of the second point of the filled trigon.
y2Y coordinate of the second point of the filled trigon.
x3X coordinate of the third point of the filled trigon.
y3Y coordinate of the third point of the filled trigon.
rThe red value of the filled trigon to draw.
gThe green value of the filled trigon to draw.
bThe blue value of the filled trigon to draw.
aThe alpha value of the filled trigon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2424 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void gfxPrimitivesSetFont (const void * fontdata,
Uint32 cw,
Uint32 ch 
)
+
+ +

Sets or resets the current global font data.

+

The font data array is organized in follows: [fontdata] = [character 0][character 1]...[character 255] where [character n] = [byte 1 row 1][byte 2 row 1]...[byte {pitch} row 1][byte 1 row 2] ...[byte {pitch} row height] where [byte n] = [bit 0]...[bit 7] where [bit n] = [0 for transparent pixel|1 for colored pixel]

+
Parameters
+ + + + +
fontdataPointer to array of font data. Set to NULL, to reset global font to the default 8x8 font.
cwWidth of character in bytes. Ignored if fontdata==NULL.
chHeight of character in bytes. Ignored if fontdata==NULL.
+
+
+ +

Definition at line 3260 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + +
void gfxPrimitivesSetFontRotation (Uint32 rotation)
+
+ +

Sets current global font character rotation steps.

+

Default is 0 (no rotation). 1 = 90deg clockwise. 2 = 180deg clockwise. 3 = 270deg clockwise. Changing the rotation, will reset the character cache.

+
Parameters
+ + +
rotationNumber of 90deg clockwise steps to rotate
+
+
+ +

Definition at line 3306 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hline (SDL_Renderer * renderer,
Sint16 x1,
Sint16 x2,
Sint16 y 
)
+
+ +

Draw horizontal line in currently set color.

+
Parameters
+ + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 158 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hlineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 x2,
Sint16 y,
Uint32 color 
)
+
+ +

Draw horizontal line with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 175 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int hlineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 x2,
Sint16 y,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw horizontal line with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 195 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int line (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2 
)
+
+ +

Draw line with alpha blending using the currently set color.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 801 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int lineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw line with alpha blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the seond point of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 821 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int lineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw line with alpha blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 842 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pieColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint32 color 
)
+
+ +

Draw pie (outline) with alpha blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
colorThe color value of the pie to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2170 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pieRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw pie (outline) with alpha blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
rThe red value of the pie to draw.
gThe green value of the pie to draw.
bThe blue value of the pie to draw.
aThe alpha value of the pie to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2193 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pixel (SDL_Renderer * renderer,
Sint16 x,
Sint16 y 
)
+
+ +

Draw pixel in currently set color.

+
Parameters
+ + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 73 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pixelColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Uint32 color 
)
+
+ +

Draw pixel with blending enabled if a<255.

+
Parameters
+ + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
colorThe color value of the pixel to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 88 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pixelRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw pixel with blending enabled if a<255.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
rThe red color value of the pixel to draw.
gThe green color value of the pixel to draw.
bThe blue color value of the pixel to draw.
aThe alpha value of the pixel to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 107 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pixelRGBAWeight (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a,
Uint32 weight 
)
+
+ +

Draw pixel with blending enabled and using alpha weight on color.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xThe horizontal coordinate of the pixel.
yThe vertical position of the pixel.
rThe red color value of the pixel to draw.
gThe green color value of the pixel to draw.
bThe blue color value of the pixel to draw.
aThe alpha value of the pixel to draw.
weightThe weight multiplied into the alpha value of the pixel.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 130 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int polygon (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n 
)
+
+ +

Draw polygon with the currently set color and blend mode.

+
Parameters
+ + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2469 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int polygonColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint32 color 
)
+
+ +

Draw polygon with alpha blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the polygon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2453 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int polygonRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw polygon with alpha blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the polygon to draw.
gThe green value of the polygon to draw.
bThe blue value of the polygon to draw.
aThe alpha value of the polygon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2535 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int rectangleColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw rectangle with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
colorThe color value of the rectangle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 275 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int rectangleRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw rectangle with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
rThe red value of the rectangle to draw.
gThe green value of the rectangle to draw.
bThe blue value of the rectangle to draw.
aThe alpha value of the rectangle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 296 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int roundedBoxColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw rounded-corner box (filled rectangle) with blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
radThe radius of the corner arcs of the box.
colorThe color value of the box to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 513 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int roundedBoxRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw rounded-corner box (filled rectangle) with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
radThe radius of the corner arcs of the box.
rThe red value of the box to draw.
gThe green value of the box to draw.
bThe blue value of the box to draw.
aThe alpha value of the box to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 535 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int roundedRectangleColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw rounded-corner rectangle with blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
radThe radius of the corner arc.
colorThe color value of the rectangle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 368 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int roundedRectangleRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw rounded-corner rectangle with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
radThe radius of the corner arc.
rThe red value of the rectangle to draw.
gThe green value of the rectangle to draw.
bThe blue value of the rectangle to draw.
aThe alpha value of the rectangle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 390 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int stringColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
const char * s,
Uint32 color 
)
+
+ +

Draw a string in the currently set font.

+

The spacing between consequtive characters in the string is the fixed number of pixels of the character width of the current global font.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the string.
yY (vertical) coordinate of the upper left corner of the string.
sThe string to draw.
colorThe color value of the string to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3495 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int stringRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
const char * s,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a string in the currently set font.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the string.
yY (vertical) coordinate of the upper left corner of the string.
sThe string to draw.
rThe red value of the string to draw.
gThe green value of the string to draw.
bThe blue value of the string to draw.
aThe alpha value of the string to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3515 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int texturedPolygon (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
SDL_Surface * texture,
int texture_dx,
int texture_dy 
)
+
+ +

Draws a polygon filled with the given texture.

+

This standard version is calling multithreaded versions with NULL cache parameters.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
vxarray of x vector components
vyarray of x vector components
nthe amount of vectors in the vx and vy array
texturethe sdl surface to use to fill the polygon
texture_dxthe offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value
texture_dysee texture_dx
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3192 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int texturedPolygonMT (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
SDL_Surface * texture,
int texture_dx,
int texture_dy,
int ** polyInts,
int * polyAllocated 
)
+
+ +

Draws a polygon filled with the given texture (Multi-Threading Capable).

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
vxarray of x vector components
vyarray of x vector components
nthe amount of vectors in the vx and vy array
texturethe sdl surface to use to fill the polygon
texture_dxthe offset of the texture relative to the screeen. If you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value
texture_dysee texture_dx
polyIntsPreallocated temp array storage for vertex sorting (used for multi-threaded operation)
polyAllocatedFlag indicating oif the temp array was allocated (used for multi-threaded operation)
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3020 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int thickLineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 width,
Uint32 color 
)
+
+ +

Draw a thick line with alpha blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
widthWidth of the line in pixels. Must be >0.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3716 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int thickLineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 width,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a thick line with alpha blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
widthWidth of the line in pixels. Must be >0.
rThe red value of the character to draw.
gThe green value of the character to draw.
bThe blue value of the character to draw.
aThe alpha value of the character to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3738 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trigonColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint32 color 
)
+
+ +

Draw trigon (triangle outline) with alpha blending.

+

Note: Creates vertex array and uses polygon routine to render.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the trigon.
y1Y coordinate of the first point of the trigon.
x2X coordinate of the second point of the trigon.
y2Y coordinate of the second point of the trigon.
x3X coordinate of the third point of the trigon.
y3Y coordinate of the third point of the trigon.
colorThe color value of the trigon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2258 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int trigonRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw trigon (triangle outline) with alpha blending.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the trigon.
y1Y coordinate of the first point of the trigon.
x2X coordinate of the second point of the trigon.
y2Y coordinate of the second point of the trigon.
x3X coordinate of the third point of the trigon.
y3Y coordinate of the third point of the trigon.
rThe red value of the trigon to draw.
gThe green value of the trigon to draw.
bThe blue value of the trigon to draw.
aThe alpha value of the trigon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2290 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int vline (SDL_Renderer * renderer,
Sint16 x,
Sint16 y1,
Sint16 y2 
)
+
+ +

Draw vertical line in currently set color.

+
Parameters
+ + + + + +
rendererThe renderer to draw on.
xX coordinate of points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 216 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int vlineColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y1,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw vertical line with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 232 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int vlineRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y1,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw vertical line with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 252 of file SDL2_gfxPrimitives.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8c_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8c_source.html new file mode 100755 index 000000000..52b24ac29 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8c_source.html @@ -0,0 +1,2894 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.c Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.c
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_gfxPrimitives.c: graphics primitives for SDL2 renderers
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #include <stdio.h>
+
31 #include <stdlib.h>
+
32 #include <math.h>
+
33 #include <string.h>
+
34 
+
35 #include "SDL2_gfxPrimitives.h"
+
36 #include "SDL2_rotozoom.h"
+ +
38 
+
39 /* ---- Structures */
+
40 
+
44 typedef struct {
+
45  Sint16 x, y;
+
46  int dx, dy, s1, s2, swapdir, error;
+
47  Uint32 count;
+ +
49 
+
53 typedef struct {
+
54  SDL_Renderer *renderer;
+
55  int u, v; /* delta x , delta y */
+
56  int ku, kt, kv, kd; /* loop constants */
+
57  int oct2;
+
58  int quad4;
+
59  Sint16 last1x, last1y, last2x, last2y, first1x, first1y, first2x, first2y, tempx, tempy;
+ +
61 
+
62 /* ---- Pixel */
+
63 
+
73 int pixel(SDL_Renderer *renderer, Sint16 x, Sint16 y)
+
74 {
+
75  return SDL_RenderDrawPoint(renderer, x, y);
+
76 }
+
77 
+
88 int pixelColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint32 color)
+
89 {
+
90  Uint8 *c = (Uint8 *)&color;
+
91  return pixelRGBA(renderer, x, y, c[0], c[1], c[2], c[3]);
+
92 }
+
93 
+
107 int pixelRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
108 {
+
109  int result = 0;
+
110  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
111  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
112  result |= SDL_RenderDrawPoint(renderer, x, y);
+
113  return result;
+
114 }
+
115 
+
130 int pixelRGBAWeight(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint32 weight)
+
131 {
+
132  /*
+
133  * Modify Alpha by weight
+
134  */
+
135  Uint32 ax = a;
+
136  ax = ((ax * weight) >> 8);
+
137  if (ax > 255) {
+
138  a = 255;
+
139  } else {
+
140  a = (Uint8)(ax & 0x000000ff);
+
141  }
+
142 
+
143  return pixelRGBA(renderer, x, y, r, g, b, a);
+
144 }
+
145 
+
146 /* ---- Hline */
+
147 
+
158 int hline(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y)
+
159 {
+
160  return SDL_RenderDrawLine(renderer, x1, y, x2, y);;
+
161 }
+
162 
+
163 
+
175 int hlineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
+
176 {
+
177  Uint8 *c = (Uint8 *)&color;
+
178  return hlineRGBA(renderer, x1, x2, y, c[0], c[1], c[2], c[3]);
+
179 }
+
180 
+
195 int hlineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
196 {
+
197  int result = 0;
+
198  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
199  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
200  result |= SDL_RenderDrawLine(renderer, x1, y, x2, y);
+
201  return result;
+
202 }
+
203 
+
204 /* ---- Vline */
+
205 
+
216 int vline(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2)
+
217 {
+
218  return SDL_RenderDrawLine(renderer, x, y1, x, y2);;
+
219 }
+
220 
+
232 int vlineColor(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
+
233 {
+
234  Uint8 *c = (Uint8 *)&color;
+
235  return vlineRGBA(renderer, x, y1, y2, c[0], c[1], c[2], c[3]);
+
236 }
+
237 
+
252 int vlineRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
253 {
+
254  int result = 0;
+
255  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
256  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
257  result |= SDL_RenderDrawLine(renderer, x, y1, x, y2);
+
258  return result;
+
259 }
+
260 
+
261 /* ---- Rectangle */
+
262 
+
275 int rectangleColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
+
276 {
+
277  Uint8 *c = (Uint8 *)&color;
+
278  return rectangleRGBA(renderer, x1, y1, x2, y2, c[0], c[1], c[2], c[3]);
+
279 }
+
280 
+
296 int rectangleRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
297 {
+
298  int result;
+
299  Sint16 tmp;
+
300  SDL_Rect rect;
+
301 
+
302  /*
+
303  * Test for special cases of straight lines or single point
+
304  */
+
305  if (x1 == x2) {
+
306  if (y1 == y2) {
+
307  return (pixelRGBA(renderer, x1, y1, r, g, b, a));
+
308  } else {
+
309  return (vlineRGBA(renderer, x1, y1, y2, r, g, b, a));
+
310  }
+
311  } else {
+
312  if (y1 == y2) {
+
313  return (hlineRGBA(renderer, x1, x2, y1, r, g, b, a));
+
314  }
+
315  }
+
316 
+
317  /*
+
318  * Swap x1, x2 if required
+
319  */
+
320  if (x1 > x2) {
+
321  tmp = x1;
+
322  x1 = x2;
+
323  x2 = tmp;
+
324  }
+
325 
+
326  /*
+
327  * Swap y1, y2 if required
+
328  */
+
329  if (y1 > y2) {
+
330  tmp = y1;
+
331  y1 = y2;
+
332  y2 = tmp;
+
333  }
+
334 
+
335  /*
+
336  * Create destination rect
+
337  */
+
338  rect.x = x1;
+
339  rect.y = y1;
+
340  rect.w = x2 - x1;
+
341  rect.h = y2 - y1;
+
342 
+
343  /*
+
344  * Draw
+
345  */
+
346  result = 0;
+
347  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
348  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
349  result |= SDL_RenderDrawRect(renderer, &rect);
+
350  return result;
+
351 }
+
352 
+
353 /* ---- Rounded Rectangle */
+
354 
+
368 int roundedRectangleColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
+
369 {
+
370  Uint8 *c = (Uint8 *)&color;
+
371  return roundedRectangleRGBA(renderer, x1, y1, x2, y2, rad, c[0], c[1], c[2], c[3]);
+
372 }
+
373 
+
390 int roundedRectangleRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
391 {
+
392  int result = 0;
+
393  Sint16 tmp;
+
394  Sint16 w, h;
+
395  Sint16 xx1, xx2;
+
396  Sint16 yy1, yy2;
+
397 
+
398  /*
+
399  * Check renderer
+
400  */
+
401  if (renderer == NULL)
+
402  {
+
403  return -1;
+
404  }
+
405 
+
406  /*
+
407  * Check radius vor valid range
+
408  */
+
409  if (rad < 0) {
+
410  return -1;
+
411  }
+
412 
+
413  /*
+
414  * Special case - no rounding
+
415  */
+
416  if (rad <= 1) {
+
417  return rectangleRGBA(renderer, x1, y1, x2, y2, r, g, b, a);
+
418  }
+
419 
+
420  /*
+
421  * Test for special cases of straight lines or single point
+
422  */
+
423  if (x1 == x2) {
+
424  if (y1 == y2) {
+
425  return (pixelRGBA(renderer, x1, y1, r, g, b, a));
+
426  } else {
+
427  return (vlineRGBA(renderer, x1, y1, y2, r, g, b, a));
+
428  }
+
429  } else {
+
430  if (y1 == y2) {
+
431  return (hlineRGBA(renderer, x1, x2, y1, r, g, b, a));
+
432  }
+
433  }
+
434 
+
435  /*
+
436  * Swap x1, x2 if required
+
437  */
+
438  if (x1 > x2) {
+
439  tmp = x1;
+
440  x1 = x2;
+
441  x2 = tmp;
+
442  }
+
443 
+
444  /*
+
445  * Swap y1, y2 if required
+
446  */
+
447  if (y1 > y2) {
+
448  tmp = y1;
+
449  y1 = y2;
+
450  y2 = tmp;
+
451  }
+
452 
+
453  /*
+
454  * Calculate width&height
+
455  */
+
456  w = x2 - x1;
+
457  h = y2 - y1;
+
458 
+
459  /*
+
460  * Maybe adjust radius
+
461  */
+
462  if ((rad * 2) > w)
+
463  {
+
464  rad = w / 2;
+
465  }
+
466  if ((rad * 2) > h)
+
467  {
+
468  rad = h / 2;
+
469  }
+
470 
+
471  /*
+
472  * Draw corners
+
473  */
+
474  xx1 = x1 + rad;
+
475  xx2 = x2 - rad;
+
476  yy1 = y1 + rad;
+
477  yy2 = y2 - rad;
+
478  result |= arcRGBA(renderer, xx1, yy1, rad, 180, 270, r, g, b, a);
+
479  result |= arcRGBA(renderer, xx2, yy1, rad, 270, 360, r, g, b, a);
+
480  result |= arcRGBA(renderer, xx1, yy2, rad, 90, 180, r, g, b, a);
+
481  result |= arcRGBA(renderer, xx2, yy2, rad, 0, 90, r, g, b, a);
+
482 
+
483  /*
+
484  * Draw lines
+
485  */
+
486  if (xx1 <= xx2) {
+
487  result |= hlineRGBA(renderer, xx1, xx2, y1, r, g, b, a);
+
488  result |= hlineRGBA(renderer, xx1, xx2, y2, r, g, b, a);
+
489  }
+
490  if (yy1 <= yy2) {
+
491  result |= vlineRGBA(renderer, x1, yy1, yy2, r, g, b, a);
+
492  result |= vlineRGBA(renderer, x2, yy1, yy2, r, g, b, a);
+
493  }
+
494 
+
495  return result;
+
496 }
+
497 
+
498 /* ---- Rounded Box */
+
499 
+
513 int roundedBoxColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
+
514 {
+
515  Uint8 *c = (Uint8 *)&color;
+
516  return roundedBoxRGBA(renderer, x1, y1, x2, y2, rad, c[0], c[1], c[2], c[3]);
+
517 }
+
518 
+
535 int roundedBoxRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2,
+
536  Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
537 {
+
538  int result;
+
539  Sint16 w, h, r2, tmp;
+
540  Sint16 cx = 0;
+
541  Sint16 cy = rad;
+
542  Sint16 ocx = (Sint16) 0xffff;
+
543  Sint16 ocy = (Sint16) 0xffff;
+
544  Sint16 df = 1 - rad;
+
545  Sint16 d_e = 3;
+
546  Sint16 d_se = -2 * rad + 5;
+
547  Sint16 xpcx, xmcx, xpcy, xmcy;
+
548  Sint16 ypcy, ymcy, ypcx, ymcx;
+
549  Sint16 x, y, dx, dy;
+
550 
+
551  /*
+
552  * Check destination renderer
+
553  */
+
554  if (renderer == NULL)
+
555  {
+
556  return -1;
+
557  }
+
558 
+
559  /*
+
560  * Check radius vor valid range
+
561  */
+
562  if (rad < 0) {
+
563  return -1;
+
564  }
+
565 
+
566  /*
+
567  * Special case - no rounding
+
568  */
+
569  if (rad <= 1) {
+
570  return rectangleRGBA(renderer, x1, y1, x2, y2, r, g, b, a);
+
571  }
+
572 
+
573  /*
+
574  * Test for special cases of straight lines or single point
+
575  */
+
576  if (x1 == x2) {
+
577  if (y1 == y2) {
+
578  return (pixelRGBA(renderer, x1, y1, r, g, b, a));
+
579  } else {
+
580  return (vlineRGBA(renderer, x1, y1, y2, r, g, b, a));
+
581  }
+
582  } else {
+
583  if (y1 == y2) {
+
584  return (hlineRGBA(renderer, x1, x2, y1, r, g, b, a));
+
585  }
+
586  }
+
587 
+
588  /*
+
589  * Swap x1, x2 if required
+
590  */
+
591  if (x1 > x2) {
+
592  tmp = x1;
+
593  x1 = x2;
+
594  x2 = tmp;
+
595  }
+
596 
+
597  /*
+
598  * Swap y1, y2 if required
+
599  */
+
600  if (y1 > y2) {
+
601  tmp = y1;
+
602  y1 = y2;
+
603  y2 = tmp;
+
604  }
+
605 
+
606  /*
+
607  * Calculate width&height
+
608  */
+
609  w = x2 - x1 + 1;
+
610  h = y2 - y1 + 1;
+
611 
+
612  /*
+
613  * Maybe adjust radius
+
614  */
+
615  r2 = rad + rad;
+
616  if (r2 > w)
+
617  {
+
618  rad = w / 2;
+
619  r2 = rad + rad;
+
620  }
+
621  if (r2 > h)
+
622  {
+
623  rad = h / 2;
+
624  }
+
625 
+
626  /* Setup filled circle drawing for corners */
+
627  x = x1 + rad;
+
628  y = y1 + rad;
+
629  dx = x2 - x1 - rad - rad;
+
630  dy = y2 - y1 - rad - rad;
+
631 
+
632  /*
+
633  * Set color
+
634  */
+
635  result = 0;
+
636  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
637  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
638 
+
639  /*
+
640  * Draw corners
+
641  */
+
642  do {
+
643  xpcx = x + cx;
+
644  xmcx = x - cx;
+
645  xpcy = x + cy;
+
646  xmcy = x - cy;
+
647  if (ocy != cy) {
+
648  if (cy > 0) {
+
649  ypcy = y + cy;
+
650  ymcy = y - cy;
+
651  result |= hline(renderer, xmcx, xpcx + dx, ypcy + dy);
+
652  result |= hline(renderer, xmcx, xpcx + dx, ymcy);
+
653  } else {
+
654  result |= hline(renderer, xmcx, xpcx + dx, y);
+
655  }
+
656  ocy = cy;
+
657  }
+
658  if (ocx != cx) {
+
659  if (cx != cy) {
+
660  if (cx > 0) {
+
661  ypcx = y + cx;
+
662  ymcx = y - cx;
+
663  result |= hline(renderer, xmcy, xpcy + dx, ymcx);
+
664  result |= hline(renderer, xmcy, xpcy + dx, ypcx + dy);
+
665  } else {
+
666  result |= hline(renderer, xmcy, xpcy + dx, y);
+
667  }
+
668  }
+
669  ocx = cx;
+
670  }
+
671 
+
672  /*
+
673  * Update
+
674  */
+
675  if (df < 0) {
+
676  df += d_e;
+
677  d_e += 2;
+
678  d_se += 2;
+
679  } else {
+
680  df += d_se;
+
681  d_e += 2;
+
682  d_se += 4;
+
683  cy--;
+
684  }
+
685  cx++;
+
686  } while (cx <= cy);
+
687 
+
688  /* Inside */
+
689  if (dx > 0 && dy > 0) {
+
690  result |= boxRGBA(renderer, x1, y1 + rad + 1, x2, y2 - rad, r, g, b, a);
+
691  }
+
692 
+
693  return (result);
+
694 }
+
695 
+
696 /* ---- Box */
+
697 
+
710 int boxColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
+
711 {
+
712  Uint8 *c = (Uint8 *)&color;
+
713  return boxRGBA(renderer, x1, y1, x2, y2, c[0], c[1], c[2], c[3]);
+
714 }
+
715 
+
731 int boxRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
732 {
+
733  int result;
+
734  Sint16 tmp;
+
735  SDL_Rect rect;
+
736 
+
737  /*
+
738  * Test for special cases of straight lines or single point
+
739  */
+
740  if (x1 == x2) {
+
741  if (y1 == y2) {
+
742  return (pixelRGBA(renderer, x1, y1, r, g, b, a));
+
743  } else {
+
744  return (vlineRGBA(renderer, x1, y1, y2, r, g, b, a));
+
745  }
+
746  } else {
+
747  if (y1 == y2) {
+
748  return (hlineRGBA(renderer, x1, x2, y1, r, g, b, a));
+
749  }
+
750  }
+
751 
+
752  /*
+
753  * Swap x1, x2 if required
+
754  */
+
755  if (x1 > x2) {
+
756  tmp = x1;
+
757  x1 = x2;
+
758  x2 = tmp;
+
759  }
+
760 
+
761  /*
+
762  * Swap y1, y2 if required
+
763  */
+
764  if (y1 > y2) {
+
765  tmp = y1;
+
766  y1 = y2;
+
767  y2 = tmp;
+
768  }
+
769 
+
770  /*
+
771  * Create destination rect
+
772  */
+
773  rect.x = x1;
+
774  rect.y = y1;
+
775  rect.w = x2 - x1 + 1;
+
776  rect.h = y2 - y1 + 1;
+
777 
+
778  /*
+
779  * Draw
+
780  */
+
781  result = 0;
+
782  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
783  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
784  result |= SDL_RenderFillRect(renderer, &rect);
+
785  return result;
+
786 }
+
787 
+
788 /* ----- Line */
+
789 
+
801 int line(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2)
+
802 {
+
803  /*
+
804  * Draw
+
805  */
+
806  return SDL_RenderDrawLine(renderer, x1, y1, x2, y2);
+
807 }
+
808 
+
821 int lineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
+
822 {
+
823  Uint8 *c = (Uint8 *)&color;
+
824  return lineRGBA(renderer, x1, y1, x2, y2, c[0], c[1], c[2], c[3]);
+
825 }
+
826 
+
842 int lineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
843 {
+
844  /*
+
845  * Draw
+
846  */
+
847  int result = 0;
+
848  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
849  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
850  result |= SDL_RenderDrawLine(renderer, x1, y1, x2, y2);
+
851  return result;
+
852 }
+
853 
+
854 /* ---- AA Line */
+
855 
+
856 #define AAlevels 256
+
857 #define AAbits 8
+
858 
+
882 int _aalineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int draw_endpoint)
+
883 {
+
884  Sint32 xx0, yy0, xx1, yy1;
+
885  int result;
+
886  Uint32 intshift, erracc, erradj;
+
887  Uint32 erracctmp, wgt, wgtcompmask;
+
888  int dx, dy, tmp, xdir, y0p1, x0pxdir;
+
889 
+
890  /*
+
891  * Keep on working with 32bit numbers
+
892  */
+
893  xx0 = x1;
+
894  yy0 = y1;
+
895  xx1 = x2;
+
896  yy1 = y2;
+
897 
+
898  /*
+
899  * Reorder points to make dy positive
+
900  */
+
901  if (yy0 > yy1) {
+
902  tmp = yy0;
+
903  yy0 = yy1;
+
904  yy1 = tmp;
+
905  tmp = xx0;
+
906  xx0 = xx1;
+
907  xx1 = tmp;
+
908  }
+
909 
+
910  /*
+
911  * Calculate distance
+
912  */
+
913  dx = xx1 - xx0;
+
914  dy = yy1 - yy0;
+
915 
+
916  /*
+
917  * Adjust for negative dx and set xdir
+
918  */
+
919  if (dx >= 0) {
+
920  xdir = 1;
+
921  } else {
+
922  xdir = -1;
+
923  dx = (-dx);
+
924  }
+
925 
+
926  /*
+
927  * Check for special cases
+
928  */
+
929  if (dx == 0) {
+
930  /*
+
931  * Vertical line
+
932  */
+
933  if (draw_endpoint)
+
934  {
+
935  return (vlineRGBA(renderer, x1, y1, y2, r, g, b, a));
+
936  } else {
+
937  if (dy > 0) {
+
938  return (vlineRGBA(renderer, x1, yy0, yy0+dy, r, g, b, a));
+
939  } else {
+
940  return (pixelRGBA(renderer, x1, y1, r, g, b, a));
+
941  }
+
942  }
+
943  } else if (dy == 0) {
+
944  /*
+
945  * Horizontal line
+
946  */
+
947  if (draw_endpoint)
+
948  {
+
949  return (hlineRGBA(renderer, x1, x2, y1, r, g, b, a));
+
950  } else {
+
951  if (dx > 0) {
+
952  return (hlineRGBA(renderer, xx0, xx0+dx, y1, r, g, b, a));
+
953  } else {
+
954  return (pixelRGBA(renderer, x1, y1, r, g, b, a));
+
955  }
+
956  }
+
957  } else if ((dx == dy) && (draw_endpoint)) {
+
958  /*
+
959  * Diagonal line (with endpoint)
+
960  */
+
961  return (lineRGBA(renderer, x1, y1, x2, y2, r, g, b, a));
+
962  }
+
963 
+
964 
+
965  /*
+
966  * Line is not horizontal, vertical or diagonal (with endpoint)
+
967  */
+
968  result = 0;
+
969 
+
970  /*
+
971  * Zero accumulator
+
972  */
+
973  erracc = 0;
+
974 
+
975  /*
+
976  * # of bits by which to shift erracc to get intensity level
+
977  */
+
978  intshift = 32 - AAbits;
+
979 
+
980  /*
+
981  * Mask used to flip all bits in an intensity weighting
+
982  */
+
983  wgtcompmask = AAlevels - 1;
+
984 
+
985  /*
+
986  * Draw the initial pixel in the foreground color
+
987  */
+
988  result |= pixelRGBA(renderer, x1, y1, r, g, b, a);
+
989 
+
990  /*
+
991  * x-major or y-major?
+
992  */
+
993  if (dy > dx) {
+
994 
+
995  /*
+
996  * y-major. Calculate 16-bit fixed point fractional part of a pixel that
+
997  * X advances every time Y advances 1 pixel, truncating the result so that
+
998  * we won't overrun the endpoint along the X axis
+
999  */
+
1000  /*
+
1001  * Not-so-portable version: erradj = ((Uint64)dx << 32) / (Uint64)dy;
+
1002  */
+
1003  erradj = ((dx << 16) / dy) << 16;
+
1004 
+
1005  /*
+
1006  * draw all pixels other than the first and last
+
1007  */
+
1008  x0pxdir = xx0 + xdir;
+
1009  while (--dy) {
+
1010  erracctmp = erracc;
+
1011  erracc += erradj;
+
1012  if (erracc <= erracctmp) {
+
1013  /*
+
1014  * rollover in error accumulator, x coord advances
+
1015  */
+
1016  xx0 = x0pxdir;
+
1017  x0pxdir += xdir;
+
1018  }
+
1019  yy0++; /* y-major so always advance Y */
+
1020 
+
1021  /*
+
1022  * the AAbits most significant bits of erracc give us the intensity
+
1023  * weighting for this pixel, and the complement of the weighting for
+
1024  * the paired pixel.
+
1025  */
+
1026  wgt = (erracc >> intshift) & 255;
+
1027  result |= pixelRGBAWeight (renderer, xx0, yy0, r, g, b, a, 255 - wgt);
+
1028  result |= pixelRGBAWeight (renderer, x0pxdir, yy0, r, g, b, a, wgt);
+
1029  }
+
1030 
+
1031  } else {
+
1032 
+
1033  /*
+
1034  * x-major line. Calculate 16-bit fixed-point fractional part of a pixel
+
1035  * that Y advances each time X advances 1 pixel, truncating the result so
+
1036  * that we won't overrun the endpoint along the X axis.
+
1037  */
+
1038  /*
+
1039  * Not-so-portable version: erradj = ((Uint64)dy << 32) / (Uint64)dx;
+
1040  */
+
1041  erradj = ((dy << 16) / dx) << 16;
+
1042 
+
1043  /*
+
1044  * draw all pixels other than the first and last
+
1045  */
+
1046  y0p1 = yy0 + 1;
+
1047  while (--dx) {
+
1048 
+
1049  erracctmp = erracc;
+
1050  erracc += erradj;
+
1051  if (erracc <= erracctmp) {
+
1052  /*
+
1053  * Accumulator turned over, advance y
+
1054  */
+
1055  yy0 = y0p1;
+
1056  y0p1++;
+
1057  }
+
1058  xx0 += xdir; /* x-major so always advance X */
+
1059  /*
+
1060  * the AAbits most significant bits of erracc give us the intensity
+
1061  * weighting for this pixel, and the complement of the weighting for
+
1062  * the paired pixel.
+
1063  */
+
1064  wgt = (erracc >> intshift) & 255;
+
1065  result |= pixelRGBAWeight (renderer, xx0, yy0, r, g, b, a, 255 - wgt);
+
1066  result |= pixelRGBAWeight (renderer, xx0, y0p1, r, g, b, a, wgt);
+
1067  }
+
1068  }
+
1069 
+
1070  /*
+
1071  * Do we have to draw the endpoint
+
1072  */
+
1073  if (draw_endpoint) {
+
1074  /*
+
1075  * Draw final pixel, always exactly intersected by the line and doesn't
+
1076  * need to be weighted.
+
1077  */
+
1078  result |= pixelRGBA (renderer, x2, y2, r, g, b, a);
+
1079  }
+
1080 
+
1081  return (result);
+
1082 }
+
1083 
+
1096 int aalineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
+
1097 {
+
1098  Uint8 *c = (Uint8 *)&color;
+
1099  return _aalineRGBA(renderer, x1, y1, x2, y2, c[0], c[1], c[2], c[3], 1);
+
1100 }
+
1101 
+
1117 int aalineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1118 {
+
1119  return _aalineRGBA(renderer, x1, y1, x2, y2, r, g, b, a, 1);
+
1120 }
+
1121 
+
1122 /* ----- Circle */
+
1123 
+
1135 int circleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
+
1136 {
+
1137  Uint8 *c = (Uint8 *)&color;
+
1138  return ellipseRGBA(renderer, x, y, rad, rad, c[0], c[1], c[2], c[3]);
+
1139 }
+
1140 
+
1155 int circleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1156 {
+
1157  return ellipseRGBA(renderer, x, y, rad, rad, r, g, b, a);
+
1158 }
+
1159 
+
1160 /* ----- Arc */
+
1161 
+
1175 int arcColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
+
1176 {
+
1177  Uint8 *c = (Uint8 *)&color;
+
1178  return arcRGBA(renderer, x, y, rad, start, end, c[0], c[1], c[2], c[3]);
+
1179 }
+
1180 
+
1197 /* TODO: rewrite algorithm; arc endpoints are not always drawn */
+
1198 int arcRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1199 {
+
1200  int result;
+
1201  Sint16 cx = 0;
+
1202  Sint16 cy = rad;
+
1203  Sint16 df = 1 - rad;
+
1204  Sint16 d_e = 3;
+
1205  Sint16 d_se = -2 * rad + 5;
+
1206  Sint16 xpcx, xmcx, xpcy, xmcy;
+
1207  Sint16 ypcy, ymcy, ypcx, ymcx;
+
1208  Uint8 drawoct;
+
1209  int startoct, endoct, oct, stopval_start = 0, stopval_end = 0;
+
1210  double dstart, dend, temp = 0.;
+
1211 
+
1212  /*
+
1213  * Sanity check radius
+
1214  */
+
1215  if (rad < 0) {
+
1216  return (-1);
+
1217  }
+
1218 
+
1219  /*
+
1220  * Special case for rad=0 - draw a point
+
1221  */
+
1222  if (rad == 0) {
+
1223  return (pixelRGBA(renderer, x, y, r, g, b, a));
+
1224  }
+
1225 
+
1226  /*
+
1227  Octant labeling
+
1228 
+
1229  \ 5 | 6 /
+
1230  \ | /
+
1231  4 \ | / 7
+
1232  \|/
+
1233  ------+------ +x
+
1234  /|\
+
1235  3 / | \ 0
+
1236  / | \
+
1237  / 2 | 1 \
+
1238  +y
+
1239 
+
1240  Initially reset bitmask to 0x00000000
+
1241  the set whether or not to keep drawing a given octant.
+
1242  For example: 0x00111100 means we're drawing in octants 2-5
+
1243  */
+
1244  drawoct = 0;
+
1245 
+
1246  /*
+
1247  * Fixup angles
+
1248  */
+
1249  start %= 360;
+
1250  end %= 360;
+
1251  /* 0 <= start & end < 360; note that sometimes start > end - if so, arc goes back through 0. */
+
1252  while (start < 0) start += 360;
+
1253  while (end < 0) end += 360;
+
1254  start %= 360;
+
1255  end %= 360;
+
1256 
+
1257  /* now, we find which octants we're drawing in. */
+
1258  startoct = start / 45;
+
1259  endoct = end / 45;
+
1260  oct = startoct - 1;
+
1261 
+
1262  /* stopval_start, stopval_end; what values of cx to stop at. */
+
1263  do {
+
1264  oct = (oct + 1) % 8;
+
1265 
+
1266  if (oct == startoct) {
+
1267  /* need to compute stopval_start for this octant. Look at picture above if this is unclear */
+
1268  dstart = (double)start;
+
1269  switch (oct)
+
1270  {
+
1271  case 0:
+
1272  case 3:
+
1273  temp = sin(dstart * M_PI / 180.);
+
1274  break;
+
1275  case 1:
+
1276  case 6:
+
1277  temp = cos(dstart * M_PI / 180.);
+
1278  break;
+
1279  case 2:
+
1280  case 5:
+
1281  temp = -cos(dstart * M_PI / 180.);
+
1282  break;
+
1283  case 4:
+
1284  case 7:
+
1285  temp = -sin(dstart * M_PI / 180.);
+
1286  break;
+
1287  }
+
1288  temp *= rad;
+
1289  stopval_start = (int)temp;
+
1290 
+
1291  /*
+
1292  This isn't arbitrary, but requires graph paper to explain well.
+
1293  The basic idea is that we're always changing drawoct after we draw, so we
+
1294  stop immediately after we render the last sensible pixel at x = ((int)temp).
+
1295  and whether to draw in this octant initially
+
1296  */
+
1297  if (oct % 2) drawoct |= (1 << oct); /* this is basically like saying drawoct[oct] = true, if drawoct were a bool array */
+
1298  else drawoct &= 255 - (1 << oct); /* this is basically like saying drawoct[oct] = false */
+
1299  }
+
1300  if (oct == endoct) {
+
1301  /* need to compute stopval_end for this octant */
+
1302  dend = (double)end;
+
1303  switch (oct)
+
1304  {
+
1305  case 0:
+
1306  case 3:
+
1307  temp = sin(dend * M_PI / 180);
+
1308  break;
+
1309  case 1:
+
1310  case 6:
+
1311  temp = cos(dend * M_PI / 180);
+
1312  break;
+
1313  case 2:
+
1314  case 5:
+
1315  temp = -cos(dend * M_PI / 180);
+
1316  break;
+
1317  case 4:
+
1318  case 7:
+
1319  temp = -sin(dend * M_PI / 180);
+
1320  break;
+
1321  }
+
1322  temp *= rad;
+
1323  stopval_end = (int)temp;
+
1324 
+
1325  /* and whether to draw in this octant initially */
+
1326  if (startoct == endoct) {
+
1327  /* note: we start drawing, stop, then start again in this case */
+
1328  /* otherwise: we only draw in this octant, so initialize it to false, it will get set back to true */
+
1329  if (start > end) {
+
1330  /* unfortunately, if we're in the same octant and need to draw over the whole circle, */
+
1331  /* we need to set the rest to true, because the while loop will end at the bottom. */
+
1332  drawoct = 255;
+
1333  } else {
+
1334  drawoct &= 255 - (1 << oct);
+
1335  }
+
1336  }
+
1337  else if (oct % 2) drawoct &= 255 - (1 << oct);
+
1338  else drawoct |= (1 << oct);
+
1339  } else if (oct != startoct) { /* already verified that it's != endoct */
+
1340  drawoct |= (1 << oct); /* draw this entire segment */
+
1341  }
+
1342  } while (oct != endoct);
+
1343 
+
1344  /* so now we have what octants to draw and when to draw them. all that's left is the actual raster code. */
+
1345 
+
1346  /*
+
1347  * Set color
+
1348  */
+
1349  result = 0;
+
1350  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
1351  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
1352 
+
1353  /*
+
1354  * Draw arc
+
1355  */
+
1356  do {
+
1357  ypcy = y + cy;
+
1358  ymcy = y - cy;
+
1359  if (cx > 0) {
+
1360  xpcx = x + cx;
+
1361  xmcx = x - cx;
+
1362 
+
1363  /* always check if we're drawing a certain octant before adding a pixel to that octant. */
+
1364  if (drawoct & 4) result |= pixel(renderer, xmcx, ypcy);
+
1365  if (drawoct & 2) result |= pixel(renderer, xpcx, ypcy);
+
1366  if (drawoct & 32) result |= pixel(renderer, xmcx, ymcy);
+
1367  if (drawoct & 64) result |= pixel(renderer, xpcx, ymcy);
+
1368  } else {
+
1369  if (drawoct & 96) result |= pixel(renderer, x, ymcy);
+
1370  if (drawoct & 6) result |= pixel(renderer, x, ypcy);
+
1371  }
+
1372 
+
1373  xpcy = x + cy;
+
1374  xmcy = x - cy;
+
1375  if (cx > 0 && cx != cy) {
+
1376  ypcx = y + cx;
+
1377  ymcx = y - cx;
+
1378  if (drawoct & 8) result |= pixel(renderer, xmcy, ypcx);
+
1379  if (drawoct & 1) result |= pixel(renderer, xpcy, ypcx);
+
1380  if (drawoct & 16) result |= pixel(renderer, xmcy, ymcx);
+
1381  if (drawoct & 128) result |= pixel(renderer, xpcy, ymcx);
+
1382  } else if (cx == 0) {
+
1383  if (drawoct & 24) result |= pixel(renderer, xmcy, y);
+
1384  if (drawoct & 129) result |= pixel(renderer, xpcy, y);
+
1385  }
+
1386 
+
1387  /*
+
1388  * Update whether we're drawing an octant
+
1389  */
+
1390  if (stopval_start == cx) {
+
1391  /* works like an on-off switch. */
+
1392  /* This is just in case start & end are in the same octant. */
+
1393  if (drawoct & (1 << startoct)) drawoct &= 255 - (1 << startoct);
+
1394  else drawoct |= (1 << startoct);
+
1395  }
+
1396  if (stopval_end == cx) {
+
1397  if (drawoct & (1 << endoct)) drawoct &= 255 - (1 << endoct);
+
1398  else drawoct |= (1 << endoct);
+
1399  }
+
1400 
+
1401  /*
+
1402  * Update pixels
+
1403  */
+
1404  if (df < 0) {
+
1405  df += d_e;
+
1406  d_e += 2;
+
1407  d_se += 2;
+
1408  } else {
+
1409  df += d_se;
+
1410  d_e += 2;
+
1411  d_se += 4;
+
1412  cy--;
+
1413  }
+
1414  cx++;
+
1415  } while (cx <= cy);
+
1416 
+
1417  return (result);
+
1418 }
+
1419 
+
1420 /* ----- AA Circle */
+
1421 
+
1433 int aacircleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
+
1434 {
+
1435  Uint8 *c = (Uint8 *)&color;
+
1436  return aaellipseRGBA(renderer, x, y, rad, rad, c[0], c[1], c[2], c[3]);
+
1437 }
+
1438 
+
1453 int aacircleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1454 {
+
1455  /*
+
1456  * Draw
+
1457  */
+
1458  return aaellipseRGBA(renderer, x, y, rad, rad, r, g, b, a);
+
1459 }
+
1460 
+
1461 /* ----- Ellipse */
+
1462 
+
1475 int _drawQuadrants(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 dx, Sint16 dy, Sint32 f)
+
1476 {
+
1477  int result = 0;
+
1478  Sint16 xpdx, xmdx;
+
1479  Sint16 ypdy, ymdy;
+
1480 
+
1481  if (dx == 0) {
+
1482  if (dy == 0) {
+
1483  result |= pixel(renderer, x, y);
+
1484  } else {
+
1485  ypdy = y + dy;
+
1486  ymdy = y - dy;
+
1487  if (f) {
+
1488  result |= vline(renderer, x, ymdy, ypdy);
+
1489  } else {
+
1490  result |= pixel(renderer, x, ypdy);
+
1491  result |= pixel(renderer, x, ymdy);
+
1492  }
+
1493  }
+
1494  } else {
+
1495  xpdx = x + dx;
+
1496  xmdx = x - dx;
+
1497  ypdy = y + dy;
+
1498  ymdy = y - dy;
+
1499  if (f) {
+
1500  result |= vline(renderer, xpdx, ymdy, ypdy);
+
1501  result |= vline(renderer, xmdx, ymdy, ypdy);
+
1502  } else {
+
1503  result |= pixel(renderer, xpdx, ypdy);
+
1504  result |= pixel(renderer, xmdx, ypdy);
+
1505  result |= pixel(renderer, xpdx, ymdy);
+
1506  result |= pixel(renderer, xmdx, ymdy);
+
1507  }
+
1508  }
+
1509 
+
1510  return result;
+
1511 }
+
1512 
+
1529 #define ELLIPSE_OVERSCAN 4
+
1530 int _ellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Sint32 f)
+
1531 {
+
1532  int result;
+
1533  Sint32 rx2, ry2, rx22, ry22;
+
1534  Sint32 error;
+
1535  Sint32 curX, curY, curXp1, curYm1;
+
1536  Sint32 scrX, scrY, oldX, oldY;
+
1537  Sint32 deltaX, deltaY;
+
1538 
+
1539  /*
+
1540  * Sanity check radii
+
1541  */
+
1542  if ((rx < 0) || (ry < 0)) {
+
1543  return (-1);
+
1544  }
+
1545 
+
1546  /*
+
1547  * Set color
+
1548  */
+
1549  result = 0;
+
1550  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
1551  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
1552 
+
1553  /*
+
1554  * Special cases for rx=0 and/or ry=0: draw a hline/vline/pixel
+
1555  */
+
1556  if (rx == 0) {
+
1557  if (ry == 0) {
+
1558  return (pixel(renderer, x, y));
+
1559  } else {
+
1560  return (vline(renderer, x, y - ry, y + ry));
+
1561  }
+
1562  } else {
+
1563  if (ry == 0) {
+
1564  return (hline(renderer, x - rx, x + rx, y));
+
1565  }
+
1566  }
+
1567 
+
1568  /*
+
1569  * Top/bottom center points.
+
1570  */
+
1571  oldX = scrX = 0;
+
1572  oldY = scrY = ry;
+
1573  result |= _drawQuadrants(renderer, x, y, 0, ry, f);
+
1574 
+
1575  /* Midpoint ellipse algorithm with overdraw */
+
1576  rx *= ELLIPSE_OVERSCAN;
+
1577  ry *= ELLIPSE_OVERSCAN;
+
1578  rx2 = rx * rx;
+
1579  rx22 = rx2 + rx2;
+
1580  ry2 = ry * ry;
+
1581  ry22 = ry2 + ry2;
+
1582  curX = 0;
+
1583  curY = ry;
+
1584  deltaX = 0;
+
1585  deltaY = rx22 * curY;
+
1586 
+
1587  /* Points in segment 1 */
+
1588  error = ry2 - rx2 * ry + rx2 / 4;
+
1589  while (deltaX <= deltaY)
+
1590  {
+
1591  curX++;
+
1592  deltaX += ry22;
+
1593 
+
1594  error += deltaX + ry2;
+
1595  if (error >= 0)
+
1596  {
+
1597  curY--;
+
1598  deltaY -= rx22;
+
1599  error -= deltaY;
+
1600  }
+
1601 
+
1602  scrX = curX/ELLIPSE_OVERSCAN;
+
1603  scrY = curY/ELLIPSE_OVERSCAN;
+
1604  if ((scrX != oldX && scrY == oldY) || (scrX != oldX && scrY != oldY)) {
+
1605  result |= _drawQuadrants(renderer, x, y, scrX, scrY, f);
+
1606  oldX = scrX;
+
1607  oldY = scrY;
+
1608  }
+
1609  }
+
1610 
+
1611  /* Points in segment 2 */
+
1612  if (curY > 0)
+
1613  {
+
1614  curXp1 = curX + 1;
+
1615  curYm1 = curY - 1;
+
1616  error = ry2 * curX * curXp1 + ((ry2 + 3) / 4) + rx2 * curYm1 * curYm1 - rx2 * ry2;
+
1617  while (curY > 0)
+
1618  {
+
1619  curY--;
+
1620  deltaY -= rx22;
+
1621 
+
1622  error += rx2;
+
1623  error -= deltaY;
+
1624 
+
1625  if (error <= 0)
+
1626  {
+
1627  curX++;
+
1628  deltaX += ry22;
+
1629  error += deltaX;
+
1630  }
+
1631 
+
1632  scrX = curX/ELLIPSE_OVERSCAN;
+
1633  scrY = curY/ELLIPSE_OVERSCAN;
+
1634  if ((scrX != oldX && scrY == oldY) || (scrX != oldX && scrY != oldY)) {
+
1635  oldY--;
+
1636  for (;oldY >= scrY; oldY--) {
+
1637  result |= _drawQuadrants(renderer, x, y, scrX, oldY, f);
+
1638  /* prevent overdraw */
+
1639  if (f) {
+
1640  oldY = scrY - 1;
+
1641  }
+
1642  }
+
1643  oldX = scrX;
+
1644  oldY = scrY;
+
1645  }
+
1646  }
+
1647 
+
1648  /* Remaining points in vertical */
+
1649  if (!f) {
+
1650  oldY--;
+
1651  for (;oldY >= 0; oldY--) {
+
1652  result |= _drawQuadrants(renderer, x, y, scrX, oldY, f);
+
1653  }
+
1654  }
+
1655  }
+
1656 
+
1657  return (result);
+
1658 }
+
1659 
+
1672 int ellipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
+
1673 {
+
1674  Uint8 *c = (Uint8 *)&color;
+
1675  return _ellipseRGBA(renderer, x, y, rx, ry, c[0], c[1], c[2], c[3], 0);
+
1676 }
+
1677 
+
1693 int ellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1694 {
+
1695  return _ellipseRGBA(renderer, x, y, rx, ry, r, g, b, a, 0);
+
1696 }
+
1697 
+
1698 /* ----- Filled Circle */
+
1699 
+
1711 int filledCircleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
+
1712 {
+
1713  Uint8 *c = (Uint8 *)&color;
+
1714  return filledEllipseRGBA(renderer, x, y, rad, rad, c[0], c[1], c[2], c[3]);
+
1715 }
+
1716 
+
1731 int filledCircleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1732 {
+
1733  return _ellipseRGBA(renderer, x, y, rad, rad, r, g ,b, a, 1);
+
1734 }
+
1735 
+
1736 
+
1737 /* ----- AA Ellipse */
+
1738 
+
1739 /* Windows targets do not have lrint, so provide a local inline version */
+
1740 #if defined(_MSC_VER)
+
1741 /* Detect 64bit and use intrinsic version */
+
1742 #ifdef _M_X64
+
1743 #include <emmintrin.h>
+
1744 static __inline long
+
1745  lrint(float f)
+
1746 {
+
1747  return _mm_cvtss_si32(_mm_load_ss(&f));
+
1748 }
+
1749 #elif defined(_M_IX86)
+
1750 __inline long int
+
1751  lrint (double flt)
+
1752 {
+
1753  int intgr;
+
1754  _asm
+
1755  {
+
1756  fld flt
+
1757  fistp intgr
+
1758  };
+
1759  return intgr;
+
1760 }
+
1761 #elif defined(_M_ARM)
+
1762 #include <armintr.h>
+
1763 #pragma warning(push)
+
1764 #pragma warning(disable: 4716)
+
1765 __declspec(naked) long int
+
1766  lrint (double flt)
+
1767 {
+
1768  __emit(0xEC410B10); // fmdrr d0, r0, r1
+
1769  __emit(0xEEBD0B40); // ftosid s0, d0
+
1770  __emit(0xEE100A10); // fmrs r0, s0
+
1771  __emit(0xE12FFF1E); // bx lr
+
1772 }
+
1773 #pragma warning(pop)
+
1774 #else
+
1775 #error lrint needed for MSVC on non X86/AMD64/ARM targets.
+
1776 #endif
+
1777 #endif
+
1778 
+
1791 int aaellipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
+
1792 {
+
1793  Uint8 *c = (Uint8 *)&color;
+
1794  return aaellipseRGBA(renderer, x, y, rx, ry, c[0], c[1], c[2], c[3]);
+
1795 }
+
1796 
+
1812 int aaellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
1813 {
+
1814  int result;
+
1815  int i;
+
1816  int a2, b2, ds, dt, dxt, t, s, d;
+
1817  Sint16 xp, yp, xs, ys, dyt, od, xx, yy, xc2, yc2;
+
1818  float cp;
+
1819  double sab;
+
1820  Uint8 weight, iweight;
+
1821 
+
1822  /*
+
1823  * Sanity check radii
+
1824  */
+
1825  if ((rx < 0) || (ry < 0)) {
+
1826  return (-1);
+
1827  }
+
1828 
+
1829  /*
+
1830  * Special cases for rx=0 and/or ry=0: draw a hline/vline/pixel
+
1831  */
+
1832  if (rx == 0) {
+
1833  if (ry == 0) {
+
1834  return (pixelRGBA(renderer, x, y, r, g, b, a));
+
1835  } else {
+
1836  return (vlineRGBA(renderer, x, y - ry, y + ry, r, g, b, a));
+
1837  }
+
1838  } else {
+
1839  if (ry == 0) {
+
1840  return (hlineRGBA(renderer, x - rx, x + rx, y, r, g, b, a));
+
1841  }
+
1842  }
+
1843 
+
1844  /* Variable setup */
+
1845  a2 = rx * rx;
+
1846  b2 = ry * ry;
+
1847 
+
1848  ds = 2 * a2;
+
1849  dt = 2 * b2;
+
1850 
+
1851  xc2 = 2 * x;
+
1852  yc2 = 2 * y;
+
1853 
+
1854  sab = sqrt((double)(a2 + b2));
+
1855  od = (Sint16)lrint(sab*0.01) + 1; /* introduce some overdraw */
+
1856  dxt = (Sint16)lrint((double)a2 / sab) + od;
+
1857 
+
1858  t = 0;
+
1859  s = -2 * a2 * ry;
+
1860  d = 0;
+
1861 
+
1862  xp = x;
+
1863  yp = y - ry;
+
1864 
+
1865  /* Draw */
+
1866  result = 0;
+
1867  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
1868 
+
1869  /* "End points" */
+
1870  result |= pixelRGBA(renderer, xp, yp, r, g, b, a);
+
1871  result |= pixelRGBA(renderer, xc2 - xp, yp, r, g, b, a);
+
1872  result |= pixelRGBA(renderer, xp, yc2 - yp, r, g, b, a);
+
1873  result |= pixelRGBA(renderer, xc2 - xp, yc2 - yp, r, g, b, a);
+
1874 
+
1875  for (i = 1; i <= dxt; i++) {
+
1876  xp--;
+
1877  d += t - b2;
+
1878 
+
1879  if (d >= 0)
+
1880  ys = yp - 1;
+
1881  else if ((d - s - a2) > 0) {
+
1882  if ((2 * d - s - a2) >= 0)
+
1883  ys = yp + 1;
+
1884  else {
+
1885  ys = yp;
+
1886  yp++;
+
1887  d -= s + a2;
+
1888  s += ds;
+
1889  }
+
1890  } else {
+
1891  yp++;
+
1892  ys = yp + 1;
+
1893  d -= s + a2;
+
1894  s += ds;
+
1895  }
+
1896 
+
1897  t -= dt;
+
1898 
+
1899  /* Calculate alpha */
+
1900  if (s != 0) {
+
1901  cp = (float) abs(d) / (float) abs(s);
+
1902  if (cp > 1.0) {
+
1903  cp = 1.0;
+
1904  }
+
1905  } else {
+
1906  cp = 1.0;
+
1907  }
+
1908 
+
1909  /* Calculate weights */
+
1910  weight = (Uint8) (cp * 255);
+
1911  iweight = 255 - weight;
+
1912 
+
1913  /* Upper half */
+
1914  xx = xc2 - xp;
+
1915  result |= pixelRGBAWeight(renderer, xp, yp, r, g, b, a, iweight);
+
1916  result |= pixelRGBAWeight(renderer, xx, yp, r, g, b, a, iweight);
+
1917 
+
1918  result |= pixelRGBAWeight(renderer, xp, ys, r, g, b, a, weight);
+
1919  result |= pixelRGBAWeight(renderer, xx, ys, r, g, b, a, weight);
+
1920 
+
1921  /* Lower half */
+
1922  yy = yc2 - yp;
+
1923  result |= pixelRGBAWeight(renderer, xp, yy, r, g, b, a, iweight);
+
1924  result |= pixelRGBAWeight(renderer, xx, yy, r, g, b, a, iweight);
+
1925 
+
1926  yy = yc2 - ys;
+
1927  result |= pixelRGBAWeight(renderer, xp, yy, r, g, b, a, weight);
+
1928  result |= pixelRGBAWeight(renderer, xx, yy, r, g, b, a, weight);
+
1929  }
+
1930 
+
1931  /* Replaces original approximation code dyt = abs(yp - yc); */
+
1932  dyt = (Sint16)lrint((double)b2 / sab ) + od;
+
1933 
+
1934  for (i = 1; i <= dyt; i++) {
+
1935  yp++;
+
1936  d -= s + a2;
+
1937 
+
1938  if (d <= 0)
+
1939  xs = xp + 1;
+
1940  else if ((d + t - b2) < 0) {
+
1941  if ((2 * d + t - b2) <= 0)
+
1942  xs = xp - 1;
+
1943  else {
+
1944  xs = xp;
+
1945  xp--;
+
1946  d += t - b2;
+
1947  t -= dt;
+
1948  }
+
1949  } else {
+
1950  xp--;
+
1951  xs = xp - 1;
+
1952  d += t - b2;
+
1953  t -= dt;
+
1954  }
+
1955 
+
1956  s += ds;
+
1957 
+
1958  /* Calculate alpha */
+
1959  if (t != 0) {
+
1960  cp = (float) abs(d) / (float) abs(t);
+
1961  if (cp > 1.0) {
+
1962  cp = 1.0;
+
1963  }
+
1964  } else {
+
1965  cp = 1.0;
+
1966  }
+
1967 
+
1968  /* Calculate weight */
+
1969  weight = (Uint8) (cp * 255);
+
1970  iweight = 255 - weight;
+
1971 
+
1972  /* Left half */
+
1973  xx = xc2 - xp;
+
1974  yy = yc2 - yp;
+
1975  result |= pixelRGBAWeight(renderer, xp, yp, r, g, b, a, iweight);
+
1976  result |= pixelRGBAWeight(renderer, xx, yp, r, g, b, a, iweight);
+
1977 
+
1978  result |= pixelRGBAWeight(renderer, xp, yy, r, g, b, a, iweight);
+
1979  result |= pixelRGBAWeight(renderer, xx, yy, r, g, b, a, iweight);
+
1980 
+
1981  /* Right half */
+
1982  xx = xc2 - xs;
+
1983  result |= pixelRGBAWeight(renderer, xs, yp, r, g, b, a, weight);
+
1984  result |= pixelRGBAWeight(renderer, xx, yp, r, g, b, a, weight);
+
1985 
+
1986  result |= pixelRGBAWeight(renderer, xs, yy, r, g, b, a, weight);
+
1987  result |= pixelRGBAWeight(renderer, xx, yy, r, g, b, a, weight);
+
1988  }
+
1989 
+
1990  return (result);
+
1991 }
+
1992 
+
1993 /* ---- Filled Ellipse */
+
1994 
+
2007 int filledEllipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
+
2008 {
+
2009  Uint8 *c = (Uint8 *)&color;
+
2010  return _ellipseRGBA(renderer, x, y, rx, ry, c[0], c[1], c[2], c[3], 1);
+
2011 }
+
2012 
+
2028 int filledEllipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2029 {
+
2030  return _ellipseRGBA(renderer, x, y, rx, ry, r, g, b, a, 1);
+
2031 }
+
2032 
+
2033 /* ----- Pie */
+
2034 
+
2054 /* TODO: rewrite algorithm; pie is not always accurate */
+
2055 int _pieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint8 filled)
+
2056 {
+
2057  int result;
+
2058  double angle, start_angle, end_angle;
+
2059  double deltaAngle;
+
2060  double dr;
+
2061  int numpoints, i;
+
2062  Sint16 *vx, *vy;
+
2063 
+
2064  /*
+
2065  * Sanity check radii
+
2066  */
+
2067  if (rad < 0) {
+
2068  return (-1);
+
2069  }
+
2070 
+
2071  /*
+
2072  * Fixup angles
+
2073  */
+
2074  start = start % 360;
+
2075  end = end % 360;
+
2076 
+
2077  /*
+
2078  * Special case for rad=0 - draw a point
+
2079  */
+
2080  if (rad == 0) {
+
2081  return (pixelRGBA(renderer, x, y, r, g, b, a));
+
2082  }
+
2083 
+
2084  /*
+
2085  * Variable setup
+
2086  */
+
2087  dr = (double) rad;
+
2088  deltaAngle = 3.0 / dr;
+
2089  start_angle = (double) start *(2.0 * M_PI / 360.0);
+
2090  end_angle = (double) end *(2.0 * M_PI / 360.0);
+
2091  if (start > end) {
+
2092  end_angle += (2.0 * M_PI);
+
2093  }
+
2094 
+
2095  /* We will always have at least 2 points */
+
2096  numpoints = 2;
+
2097 
+
2098  /* Count points (rather than calculating it) */
+
2099  angle = start_angle;
+
2100  while (angle < end_angle) {
+
2101  angle += deltaAngle;
+
2102  numpoints++;
+
2103  }
+
2104 
+
2105  /* Allocate combined vertex array */
+
2106  vx = vy = (Sint16 *) malloc(2 * sizeof(Uint16) * numpoints);
+
2107  if (vx == NULL) {
+
2108  return (-1);
+
2109  }
+
2110 
+
2111  /* Update point to start of vy */
+
2112  vy += numpoints;
+
2113 
+
2114  /* Center */
+
2115  vx[0] = x;
+
2116  vy[0] = y;
+
2117 
+
2118  /* First vertex */
+
2119  angle = start_angle;
+
2120  vx[1] = x + (int) (dr * cos(angle));
+
2121  vy[1] = y + (int) (dr * sin(angle));
+
2122 
+
2123  if (numpoints<3)
+
2124  {
+
2125  result = lineRGBA(renderer, vx[0], vy[0], vx[1], vy[1], r, g, b, a);
+
2126  }
+
2127  else
+
2128  {
+
2129  /* Calculate other vertices */
+
2130  i = 2;
+
2131  angle = start_angle;
+
2132  while (angle < end_angle) {
+
2133  angle += deltaAngle;
+
2134  if (angle>end_angle)
+
2135  {
+
2136  angle = end_angle;
+
2137  }
+
2138  vx[i] = x + (int) (dr * cos(angle));
+
2139  vy[i] = y + (int) (dr * sin(angle));
+
2140  i++;
+
2141  }
+
2142 
+
2143  /* Draw */
+
2144  if (filled) {
+
2145  result = filledPolygonRGBA(renderer, vx, vy, numpoints, r, g, b, a);
+
2146  } else {
+
2147  result = polygonRGBA(renderer, vx, vy, numpoints, r, g, b, a);
+
2148  }
+
2149  }
+
2150 
+
2151  /* Free combined vertex array */
+
2152  free(vx);
+
2153 
+
2154  return (result);
+
2155 }
+
2156 
+
2170 int pieColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
2171  Sint16 start, Sint16 end, Uint32 color)
+
2172 {
+
2173  Uint8 *c = (Uint8 *)&color;
+
2174  return _pieRGBA(renderer, x, y, rad, start, end, c[0], c[1], c[2], c[3], 0);
+
2175 }
+
2176 
+
2193 int pieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
2194  Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2195 {
+
2196  return _pieRGBA(renderer, x, y, rad, start, end, r, g, b, a, 0);
+
2197 }
+
2198 
+
2212 int filledPieColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
+
2213 {
+
2214  Uint8 *c = (Uint8 *)&color;
+
2215  return _pieRGBA(renderer, x, y, rad, start, end, c[0], c[1], c[2], c[3], 1);
+
2216 }
+
2217 
+
2234 int filledPieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
2235  Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2236 {
+
2237  return _pieRGBA(renderer, x, y, rad, start, end, r, g, b, a, 1);
+
2238 }
+
2239 
+
2240 /* ------ Trigon */
+
2241 
+
2258 int trigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
+
2259 {
+
2260  Sint16 vx[3];
+
2261  Sint16 vy[3];
+
2262 
+
2263  vx[0]=x1;
+
2264  vx[1]=x2;
+
2265  vx[2]=x3;
+
2266  vy[0]=y1;
+
2267  vy[1]=y2;
+
2268  vy[2]=y3;
+
2269 
+
2270  return(polygonColor(renderer,vx,vy,3,color));
+
2271 }
+
2272 
+
2290 int trigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
+
2291  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2292 {
+
2293  Sint16 vx[3];
+
2294  Sint16 vy[3];
+
2295 
+
2296  vx[0]=x1;
+
2297  vx[1]=x2;
+
2298  vx[2]=x3;
+
2299  vy[0]=y1;
+
2300  vy[1]=y2;
+
2301  vy[2]=y3;
+
2302 
+
2303  return(polygonRGBA(renderer,vx,vy,3,r,g,b,a));
+
2304 }
+
2305 
+
2306 /* ------ AA-Trigon */
+
2307 
+
2324 int aatrigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
+
2325 {
+
2326  Sint16 vx[3];
+
2327  Sint16 vy[3];
+
2328 
+
2329  vx[0]=x1;
+
2330  vx[1]=x2;
+
2331  vx[2]=x3;
+
2332  vy[0]=y1;
+
2333  vy[1]=y2;
+
2334  vy[2]=y3;
+
2335 
+
2336  return(aapolygonColor(renderer,vx,vy,3,color));
+
2337 }
+
2338 
+
2356 int aatrigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
+
2357  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2358 {
+
2359  Sint16 vx[3];
+
2360  Sint16 vy[3];
+
2361 
+
2362  vx[0]=x1;
+
2363  vx[1]=x2;
+
2364  vx[2]=x3;
+
2365  vy[0]=y1;
+
2366  vy[1]=y2;
+
2367  vy[2]=y3;
+
2368 
+
2369  return(aapolygonRGBA(renderer,vx,vy,3,r,g,b,a));
+
2370 }
+
2371 
+
2372 /* ------ Filled Trigon */
+
2373 
+
2390 int filledTrigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
+
2391 {
+
2392  Sint16 vx[3];
+
2393  Sint16 vy[3];
+
2394 
+
2395  vx[0]=x1;
+
2396  vx[1]=x2;
+
2397  vx[2]=x3;
+
2398  vy[0]=y1;
+
2399  vy[1]=y2;
+
2400  vy[2]=y3;
+
2401 
+
2402  return(filledPolygonColor(renderer,vx,vy,3,color));
+
2403 }
+
2404 
+
2424 int filledTrigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
+
2425  Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2426 {
+
2427  Sint16 vx[3];
+
2428  Sint16 vy[3];
+
2429 
+
2430  vx[0]=x1;
+
2431  vx[1]=x2;
+
2432  vx[2]=x3;
+
2433  vy[0]=y1;
+
2434  vy[1]=y2;
+
2435  vy[2]=y3;
+
2436 
+
2437  return(filledPolygonRGBA(renderer,vx,vy,3,r,g,b,a));
+
2438 }
+
2439 
+
2440 /* ---- Polygon */
+
2441 
+
2453 int polygonColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color)
+
2454 {
+
2455  Uint8 *c = (Uint8 *)&color;
+
2456  return polygonRGBA(renderer, vx, vy, n, c[0], c[1], c[2], c[3]);
+
2457 }
+
2458 
+
2469 int polygon(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n)
+
2470 {
+
2471  /*
+
2472  * Draw
+
2473  */
+
2474  int result = 0;
+
2475  int i, nn;
+
2476  SDL_Point* points;
+
2477 
+
2478  /*
+
2479  * Vertex array NULL check
+
2480  */
+
2481  if (vx == NULL) {
+
2482  return (-1);
+
2483  }
+
2484  if (vy == NULL) {
+
2485  return (-1);
+
2486  }
+
2487 
+
2488  /*
+
2489  * Sanity check
+
2490  */
+
2491  if (n < 3) {
+
2492  return (-1);
+
2493  }
+
2494 
+
2495  /*
+
2496  * Create array of points
+
2497  */
+
2498  nn = n + 1;
+
2499  points = (SDL_Point*)malloc(sizeof(SDL_Point) * nn);
+
2500  if (points == NULL)
+
2501  {
+
2502  return -1;
+
2503  }
+
2504  for (i=0; i<n; i++)
+
2505  {
+
2506  points[i].x = vx[i];
+
2507  points[i].y = vy[i];
+
2508  }
+
2509  points[n].x = vx[0];
+
2510  points[n].y = vy[0];
+
2511 
+
2512  /*
+
2513  * Draw
+
2514  */
+
2515  result |= SDL_RenderDrawLines(renderer, points, nn);
+
2516  free(points);
+
2517 
+
2518  return (result);
+
2519 }
+
2520 
+
2535 int polygonRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2536 {
+
2537  /*
+
2538  * Draw
+
2539  */
+
2540  int result;
+
2541  const Sint16 *x1, *y1, *x2, *y2;
+
2542 
+
2543  /*
+
2544  * Vertex array NULL check
+
2545  */
+
2546  if (vx == NULL) {
+
2547  return (-1);
+
2548  }
+
2549  if (vy == NULL) {
+
2550  return (-1);
+
2551  }
+
2552 
+
2553  /*
+
2554  * Sanity check
+
2555  */
+
2556  if (n < 3) {
+
2557  return (-1);
+
2558  }
+
2559 
+
2560  /*
+
2561  * Pointer setup
+
2562  */
+
2563  x1 = x2 = vx;
+
2564  y1 = y2 = vy;
+
2565  x2++;
+
2566  y2++;
+
2567 
+
2568  /*
+
2569  * Set color
+
2570  */
+
2571  result = 0;
+
2572  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
2573  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
2574 
+
2575  /*
+
2576  * Draw
+
2577  */
+
2578  result |= polygon(renderer, vx, vy, n);
+
2579 
+
2580  return (result);
+
2581 }
+
2582 
+
2583 /* ---- AA-Polygon */
+
2584 
+
2596 int aapolygonColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color)
+
2597 {
+
2598  Uint8 *c = (Uint8 *)&color;
+
2599  return aapolygonRGBA(renderer, vx, vy, n, c[0], c[1], c[2], c[3]);
+
2600 }
+
2601 
+
2616 int aapolygonRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2617 {
+
2618  int result;
+
2619  int i;
+
2620  const Sint16 *x1, *y1, *x2, *y2;
+
2621 
+
2622  /*
+
2623  * Vertex array NULL check
+
2624  */
+
2625  if (vx == NULL) {
+
2626  return (-1);
+
2627  }
+
2628  if (vy == NULL) {
+
2629  return (-1);
+
2630  }
+
2631 
+
2632  /*
+
2633  * Sanity check
+
2634  */
+
2635  if (n < 3) {
+
2636  return (-1);
+
2637  }
+
2638 
+
2639  /*
+
2640  * Pointer setup
+
2641  */
+
2642  x1 = x2 = vx;
+
2643  y1 = y2 = vy;
+
2644  x2++;
+
2645  y2++;
+
2646 
+
2647  /*
+
2648  * Draw
+
2649  */
+
2650  result = 0;
+
2651  for (i = 1; i < n; i++) {
+
2652  result |= _aalineRGBA(renderer, *x1, *y1, *x2, *y2, r, g, b, a, 0);
+
2653  x1 = x2;
+
2654  y1 = y2;
+
2655  x2++;
+
2656  y2++;
+
2657  }
+
2658 
+
2659  result |= _aalineRGBA(renderer, *x1, *y1, *vx, *vy, r, g, b, a, 0);
+
2660 
+
2661  return (result);
+
2662 }
+
2663 
+
2664 /* ---- Filled Polygon */
+
2665 
+
2674 int _gfxPrimitivesCompareInt(const void *a, const void *b)
+
2675 {
+
2676  return (*(const int *) a) - (*(const int *) b);
+
2677 }
+
2678 
+
2684 static int *gfxPrimitivesPolyIntsGlobal = NULL;
+
2685 
+
2691 static int gfxPrimitivesPolyAllocatedGlobal = 0;
+
2692 
+
2711 int filledPolygonRGBAMT(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated)
+
2712 {
+
2713  int result;
+
2714  int i;
+
2715  int y, xa, xb;
+
2716  int miny, maxy;
+
2717  int x1, y1;
+
2718  int x2, y2;
+
2719  int ind1, ind2;
+
2720  int ints;
+
2721  int *gfxPrimitivesPolyInts = NULL;
+
2722  int *gfxPrimitivesPolyIntsNew = NULL;
+
2723  int gfxPrimitivesPolyAllocated = 0;
+
2724 
+
2725  /*
+
2726  * Vertex array NULL check
+
2727  */
+
2728  if (vx == NULL) {
+
2729  return (-1);
+
2730  }
+
2731  if (vy == NULL) {
+
2732  return (-1);
+
2733  }
+
2734 
+
2735  /*
+
2736  * Sanity check number of edges
+
2737  */
+
2738  if (n < 3) {
+
2739  return -1;
+
2740  }
+
2741 
+
2742  /*
+
2743  * Map polygon cache
+
2744  */
+
2745  if ((polyInts==NULL) || (polyAllocated==NULL)) {
+
2746  /* Use global cache */
+
2747  gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsGlobal;
+
2748  gfxPrimitivesPolyAllocated = gfxPrimitivesPolyAllocatedGlobal;
+
2749  } else {
+
2750  /* Use local cache */
+
2751  gfxPrimitivesPolyInts = *polyInts;
+
2752  gfxPrimitivesPolyAllocated = *polyAllocated;
+
2753  }
+
2754 
+
2755  /*
+
2756  * Allocate temp array, only grow array
+
2757  */
+
2758  if (!gfxPrimitivesPolyAllocated) {
+
2759  gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n);
+
2760  gfxPrimitivesPolyAllocated = n;
+
2761  } else {
+
2762  if (gfxPrimitivesPolyAllocated < n) {
+
2763  gfxPrimitivesPolyIntsNew = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n);
+
2764  if (!gfxPrimitivesPolyIntsNew) {
+
2765  if (!gfxPrimitivesPolyInts) {
+
2766  free(gfxPrimitivesPolyInts);
+
2767  gfxPrimitivesPolyInts = NULL;
+
2768  }
+
2769  gfxPrimitivesPolyAllocated = 0;
+
2770  } else {
+
2771  gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsNew;
+
2772  gfxPrimitivesPolyAllocated = n;
+
2773  }
+
2774  }
+
2775  }
+
2776 
+
2777  /*
+
2778  * Check temp array
+
2779  */
+
2780  if (gfxPrimitivesPolyInts==NULL) {
+
2781  gfxPrimitivesPolyAllocated = 0;
+
2782  }
+
2783 
+
2784  /*
+
2785  * Update cache variables
+
2786  */
+
2787  if ((polyInts==NULL) || (polyAllocated==NULL)) {
+
2788  gfxPrimitivesPolyIntsGlobal = gfxPrimitivesPolyInts;
+
2789  gfxPrimitivesPolyAllocatedGlobal = gfxPrimitivesPolyAllocated;
+
2790  } else {
+
2791  *polyInts = gfxPrimitivesPolyInts;
+
2792  *polyAllocated = gfxPrimitivesPolyAllocated;
+
2793  }
+
2794 
+
2795  /*
+
2796  * Check temp array again
+
2797  */
+
2798  if (gfxPrimitivesPolyInts==NULL) {
+
2799  return(-1);
+
2800  }
+
2801 
+
2802  /*
+
2803  * Determine Y maxima
+
2804  */
+
2805  miny = vy[0];
+
2806  maxy = vy[0];
+
2807  for (i = 1; (i < n); i++) {
+
2808  if (vy[i] < miny) {
+
2809  miny = vy[i];
+
2810  } else if (vy[i] > maxy) {
+
2811  maxy = vy[i];
+
2812  }
+
2813  }
+
2814 
+
2815  /*
+
2816  * Draw, scanning y
+
2817  */
+
2818  result = 0;
+
2819  for (y = miny; (y <= maxy); y++) {
+
2820  ints = 0;
+
2821  for (i = 0; (i < n); i++) {
+
2822  if (!i) {
+
2823  ind1 = n - 1;
+
2824  ind2 = 0;
+
2825  } else {
+
2826  ind1 = i - 1;
+
2827  ind2 = i;
+
2828  }
+
2829  y1 = vy[ind1];
+
2830  y2 = vy[ind2];
+
2831  if (y1 < y2) {
+
2832  x1 = vx[ind1];
+
2833  x2 = vx[ind2];
+
2834  } else if (y1 > y2) {
+
2835  y2 = vy[ind1];
+
2836  y1 = vy[ind2];
+
2837  x2 = vx[ind1];
+
2838  x1 = vx[ind2];
+
2839  } else {
+
2840  continue;
+
2841  }
+
2842  if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) {
+
2843  gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1);
+
2844  }
+
2845  }
+
2846 
+
2847  qsort(gfxPrimitivesPolyInts, ints, sizeof(int), _gfxPrimitivesCompareInt);
+
2848 
+
2849  /*
+
2850  * Set color
+
2851  */
+
2852  result = 0;
+
2853  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
2854  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
2855 
+
2856  for (i = 0; (i < ints); i += 2) {
+
2857  xa = gfxPrimitivesPolyInts[i] + 1;
+
2858  xa = (xa >> 16) + ((xa & 32768) >> 15);
+
2859  xb = gfxPrimitivesPolyInts[i+1] - 1;
+
2860  xb = (xb >> 16) + ((xb & 32768) >> 15);
+
2861  result |= hline(renderer, xa, xb, y);
+
2862  }
+
2863  }
+
2864 
+
2865  return (result);
+
2866 }
+
2867 
+
2879 int filledPolygonColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color)
+
2880 {
+
2881  Uint8 *c = (Uint8 *)&color;
+
2882  return filledPolygonRGBAMT(renderer, vx, vy, n, c[0], c[1], c[2], c[3], NULL, NULL);
+
2883 }
+
2884 
+
2899 int filledPolygonRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
2900 {
+
2901  return filledPolygonRGBAMT(renderer, vx, vy, n, r, g, b, a, NULL, NULL);
+
2902 }
+
2903 
+
2904 /* ---- Textured Polygon */
+
2905 
+
2921 int _HLineTextured(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, SDL_Texture *texture, int texture_w, int texture_h, int texture_dx, int texture_dy)
+
2922 {
+
2923  Sint16 w;
+
2924  Sint16 xtmp;
+
2925  int result = 0;
+
2926  int texture_x_walker;
+
2927  int texture_y_start;
+
2928  SDL_Rect source_rect,dst_rect;
+
2929  int pixels_written,write_width;
+
2930 
+
2931  /*
+
2932  * Swap x1, x2 if required to ensure x1<=x2
+
2933  */
+
2934  if (x1 > x2) {
+
2935  xtmp = x1;
+
2936  x1 = x2;
+
2937  x2 = xtmp;
+
2938  }
+
2939 
+
2940  /*
+
2941  * Calculate width to draw
+
2942  */
+
2943  w = x2 - x1 + 1;
+
2944 
+
2945  /*
+
2946  * Determine where in the texture we start drawing
+
2947  */
+
2948  texture_x_walker = (x1 - texture_dx) % texture_w;
+
2949  if (texture_x_walker < 0){
+
2950  texture_x_walker = texture_w + texture_x_walker ;
+
2951  }
+
2952 
+
2953  texture_y_start = (y + texture_dy) % texture_h;
+
2954  if (texture_y_start < 0){
+
2955  texture_y_start = texture_h + texture_y_start;
+
2956  }
+
2957 
+
2958  /* setup the source rectangle; we are only drawing one horizontal line */
+
2959  source_rect.y = texture_y_start;
+
2960  source_rect.x = texture_x_walker;
+
2961  source_rect.h = 1;
+
2962 
+
2963  /* we will draw to the current y */
+
2964  dst_rect.y = y;
+
2965  dst_rect.h = 1;
+
2966 
+
2967  /* if there are enough pixels left in the current row of the texture */
+
2968  /* draw it all at once */
+
2969  if (w <= texture_w -texture_x_walker){
+
2970  source_rect.w = w;
+
2971  source_rect.x = texture_x_walker;
+
2972  dst_rect.x= x1;
+
2973  dst_rect.w = source_rect.w;
+
2974  result = (SDL_RenderCopy(renderer, texture, &source_rect, &dst_rect) == 0);
+
2975  } else {
+
2976  /* we need to draw multiple times */
+
2977  /* draw the first segment */
+
2978  pixels_written = texture_w - texture_x_walker;
+
2979  source_rect.w = pixels_written;
+
2980  source_rect.x = texture_x_walker;
+
2981  dst_rect.x= x1;
+
2982  dst_rect.w = source_rect.w;
+
2983  result |= (SDL_RenderCopy(renderer, texture, &source_rect, &dst_rect) == 0);
+
2984  write_width = texture_w;
+
2985 
+
2986  /* now draw the rest */
+
2987  /* set the source x to 0 */
+
2988  source_rect.x = 0;
+
2989  while (pixels_written < w){
+
2990  if (write_width >= w - pixels_written) {
+
2991  write_width = w - pixels_written;
+
2992  }
+
2993  source_rect.w = write_width;
+
2994  dst_rect.x = x1 + pixels_written;
+
2995  dst_rect.w = source_rect.w;
+
2996  result |= (SDL_RenderCopy(renderer, texture, &source_rect, &dst_rect) == 0);
+
2997  pixels_written += write_width;
+
2998  }
+
2999  }
+
3000 
+
3001  return result;
+
3002 }
+
3003 
+
3020 int texturedPolygonMT(SDL_Renderer *renderer, const Sint16 * vx, const Sint16 * vy, int n,
+
3021  SDL_Surface * texture, int texture_dx, int texture_dy, int **polyInts, int *polyAllocated)
+
3022 {
+
3023  int result;
+
3024  int i;
+
3025  int y, xa, xb;
+
3026  int minx,maxx,miny, maxy;
+
3027  int x1, y1;
+
3028  int x2, y2;
+
3029  int ind1, ind2;
+
3030  int ints;
+
3031  int *gfxPrimitivesPolyInts = NULL;
+
3032  int *gfxPrimitivesPolyIntsTemp = NULL;
+
3033  int gfxPrimitivesPolyAllocated = 0;
+
3034  SDL_Texture *textureAsTexture = NULL;
+
3035 
+
3036  /*
+
3037  * Sanity check number of edges
+
3038  */
+
3039  if (n < 3) {
+
3040  return -1;
+
3041  }
+
3042 
+
3043  /*
+
3044  * Map polygon cache
+
3045  */
+
3046  if ((polyInts==NULL) || (polyAllocated==NULL)) {
+
3047  /* Use global cache */
+
3048  gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsGlobal;
+
3049  gfxPrimitivesPolyAllocated = gfxPrimitivesPolyAllocatedGlobal;
+
3050  } else {
+
3051  /* Use local cache */
+
3052  gfxPrimitivesPolyInts = *polyInts;
+
3053  gfxPrimitivesPolyAllocated = *polyAllocated;
+
3054  }
+
3055 
+
3056  /*
+
3057  * Allocate temp array, only grow array
+
3058  */
+
3059  if (!gfxPrimitivesPolyAllocated) {
+
3060  gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n);
+
3061  gfxPrimitivesPolyAllocated = n;
+
3062  } else {
+
3063  if (gfxPrimitivesPolyAllocated < n) {
+
3064  gfxPrimitivesPolyIntsTemp = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n);
+
3065  if (gfxPrimitivesPolyIntsTemp == NULL) {
+
3066  /* Realloc failed - keeps original memory block, but fails this operation */
+
3067  return(-1);
+
3068  }
+
3069  gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsTemp;
+
3070  gfxPrimitivesPolyAllocated = n;
+
3071  }
+
3072  }
+
3073 
+
3074  /*
+
3075  * Check temp array
+
3076  */
+
3077  if (gfxPrimitivesPolyInts==NULL) {
+
3078  gfxPrimitivesPolyAllocated = 0;
+
3079  }
+
3080 
+
3081  /*
+
3082  * Update cache variables
+
3083  */
+
3084  if ((polyInts==NULL) || (polyAllocated==NULL)) {
+
3085  gfxPrimitivesPolyIntsGlobal = gfxPrimitivesPolyInts;
+
3086  gfxPrimitivesPolyAllocatedGlobal = gfxPrimitivesPolyAllocated;
+
3087  } else {
+
3088  *polyInts = gfxPrimitivesPolyInts;
+
3089  *polyAllocated = gfxPrimitivesPolyAllocated;
+
3090  }
+
3091 
+
3092  /*
+
3093  * Check temp array again
+
3094  */
+
3095  if (gfxPrimitivesPolyInts==NULL) {
+
3096  return(-1);
+
3097  }
+
3098 
+
3099  /*
+
3100  * Determine X,Y minima,maxima
+
3101  */
+
3102  miny = vy[0];
+
3103  maxy = vy[0];
+
3104  minx = vx[0];
+
3105  maxx = vx[0];
+
3106  for (i = 1; (i < n); i++) {
+
3107  if (vy[i] < miny) {
+
3108  miny = vy[i];
+
3109  } else if (vy[i] > maxy) {
+
3110  maxy = vy[i];
+
3111  }
+
3112  if (vx[i] < minx) {
+
3113  minx = vx[i];
+
3114  } else if (vx[i] > maxx) {
+
3115  maxx = vx[i];
+
3116  }
+
3117  }
+
3118 
+
3119  /* Create texture for drawing */
+
3120  textureAsTexture = SDL_CreateTextureFromSurface(renderer, texture);
+
3121  if (textureAsTexture == NULL)
+
3122  {
+
3123  return -1;
+
3124  }
+
3125  SDL_SetTextureBlendMode(textureAsTexture, SDL_BLENDMODE_BLEND);
+
3126 
+
3127  /*
+
3128  * Draw, scanning y
+
3129  */
+
3130  result = 0;
+
3131  for (y = miny; (y <= maxy); y++) {
+
3132  ints = 0;
+
3133  for (i = 0; (i < n); i++) {
+
3134  if (!i) {
+
3135  ind1 = n - 1;
+
3136  ind2 = 0;
+
3137  } else {
+
3138  ind1 = i - 1;
+
3139  ind2 = i;
+
3140  }
+
3141  y1 = vy[ind1];
+
3142  y2 = vy[ind2];
+
3143  if (y1 < y2) {
+
3144  x1 = vx[ind1];
+
3145  x2 = vx[ind2];
+
3146  } else if (y1 > y2) {
+
3147  y2 = vy[ind1];
+
3148  y1 = vy[ind2];
+
3149  x2 = vx[ind1];
+
3150  x1 = vx[ind2];
+
3151  } else {
+
3152  continue;
+
3153  }
+
3154  if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) {
+
3155  gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1);
+
3156  }
+
3157  }
+
3158 
+
3159  qsort(gfxPrimitivesPolyInts, ints, sizeof(int), _gfxPrimitivesCompareInt);
+
3160 
+
3161  for (i = 0; (i < ints); i += 2) {
+
3162  xa = gfxPrimitivesPolyInts[i] + 1;
+
3163  xa = (xa >> 16) + ((xa & 32768) >> 15);
+
3164  xb = gfxPrimitivesPolyInts[i+1] - 1;
+
3165  xb = (xb >> 16) + ((xb & 32768) >> 15);
+
3166  result |= _HLineTextured(renderer, xa, xb, y, textureAsTexture, texture->w, texture->h, texture_dx, texture_dy);
+
3167  }
+
3168  }
+
3169 
+
3170  SDL_RenderPresent(renderer);
+
3171  SDL_DestroyTexture(textureAsTexture);
+
3172 
+
3173  return (result);
+
3174 }
+
3175 
+
3192 int texturedPolygon(SDL_Renderer *renderer, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy)
+
3193 {
+
3194  /*
+
3195  * Draw
+
3196  */
+
3197  return (texturedPolygonMT(renderer, vx, vy, n, texture, texture_dx, texture_dy, NULL, NULL));
+
3198 }
+
3199 
+
3200 /* ---- Character */
+
3201 
+
3205 static SDL_Texture *gfxPrimitivesFont[256];
+
3206 
+
3210 static const unsigned char *currentFontdata = gfxPrimitivesFontdata;
+
3211 
+
3215 static Uint32 charWidth = 8;
+
3216 
+
3220 static Uint32 charHeight = 8;
+
3221 
+
3225 static Uint32 charWidthLocal = 8;
+
3226 
+
3230 static Uint32 charHeightLocal = 8;
+
3231 
+
3235 static Uint32 charPitch = 1;
+
3236 
+
3240 static Uint32 charRotation = 0;
+
3241 
+
3245 static Uint32 charSize = 8;
+
3246 
+
3260 void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch)
+
3261 {
+
3262  int i;
+
3263 
+
3264  if ((fontdata) && (cw) && (ch)) {
+
3265  currentFontdata = (unsigned char *)fontdata;
+
3266  charWidth = cw;
+
3267  charHeight = ch;
+
3268  } else {
+
3269  currentFontdata = gfxPrimitivesFontdata;
+
3270  charWidth = 8;
+
3271  charHeight = 8;
+
3272  }
+
3273 
+
3274  charPitch = (charWidth+7)/8;
+
3275  charSize = charPitch * charHeight;
+
3276 
+
3277  /* Maybe flip width/height for rendering */
+
3278  if ((charRotation==1) || (charRotation==3))
+
3279  {
+
3280  charWidthLocal = charHeight;
+
3281  charHeightLocal = charWidth;
+
3282  }
+
3283  else
+
3284  {
+
3285  charWidthLocal = charWidth;
+
3286  charHeightLocal = charHeight;
+
3287  }
+
3288 
+
3289  /* Clear character cache */
+
3290  for (i = 0; i < 256; i++) {
+
3291  if (gfxPrimitivesFont[i]) {
+
3292  SDL_DestroyTexture(gfxPrimitivesFont[i]);
+
3293  gfxPrimitivesFont[i] = NULL;
+
3294  }
+
3295  }
+
3296 }
+
3297 
+
3306 void gfxPrimitivesSetFontRotation(Uint32 rotation)
+
3307 {
+
3308  int i;
+
3309 
+
3310  rotation = rotation & 3;
+
3311  if (charRotation != rotation)
+
3312  {
+
3313  /* Store rotation */
+
3314  charRotation = rotation;
+
3315 
+
3316  /* Maybe flip width/height for rendering */
+
3317  if ((charRotation==1) || (charRotation==3))
+
3318  {
+
3319  charWidthLocal = charHeight;
+
3320  charHeightLocal = charWidth;
+
3321  }
+
3322  else
+
3323  {
+
3324  charWidthLocal = charWidth;
+
3325  charHeightLocal = charHeight;
+
3326  }
+
3327 
+
3328  /* Clear character cache */
+
3329  for (i = 0; i < 256; i++) {
+
3330  if (gfxPrimitivesFont[i]) {
+
3331  SDL_DestroyTexture(gfxPrimitivesFont[i]);
+
3332  gfxPrimitivesFont[i] = NULL;
+
3333  }
+
3334  }
+
3335  }
+
3336 }
+
3337 
+
3352 int characterRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
3353 {
+
3354  SDL_Rect srect;
+
3355  SDL_Rect drect;
+
3356  int result;
+
3357  Uint32 ix, iy;
+
3358  const unsigned char *charpos;
+
3359  Uint8 *curpos;
+
3360  Uint8 patt, mask;
+
3361  Uint8 *linepos;
+
3362  Uint32 pitch;
+
3363  SDL_Surface *character;
+
3364  SDL_Surface *rotatedCharacter;
+
3365  Uint32 ci;
+
3366 
+
3367  /*
+
3368  * Setup source rectangle
+
3369  */
+
3370  srect.x = 0;
+
3371  srect.y = 0;
+
3372  srect.w = charWidthLocal;
+
3373  srect.h = charHeightLocal;
+
3374 
+
3375  /*
+
3376  * Setup destination rectangle
+
3377  */
+
3378  drect.x = x;
+
3379  drect.y = y;
+
3380  drect.w = charWidthLocal;
+
3381  drect.h = charHeightLocal;
+
3382 
+
3383  /* Character index in cache */
+
3384  ci = (unsigned char) c;
+
3385 
+
3386  /*
+
3387  * Create new charWidth x charHeight bitmap surface if not already present.
+
3388  * Might get rotated later.
+
3389  */
+
3390  if (gfxPrimitivesFont[ci] == NULL) {
+
3391  /*
+
3392  * Redraw character into surface
+
3393  */
+
3394  character = SDL_CreateRGBSurface(SDL_SWSURFACE,
+
3395  charWidth, charHeight, 32,
+
3396  0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
+
3397  if (character == NULL) {
+
3398  return (-1);
+
3399  }
+
3400 
+
3401  charpos = currentFontdata + ci * charSize;
+
3402  linepos = (Uint8 *)character->pixels;
+
3403  pitch = character->pitch;
+
3404 
+
3405  /*
+
3406  * Drawing loop
+
3407  */
+
3408  patt = 0;
+
3409  for (iy = 0; iy < charHeight; iy++) {
+
3410  mask = 0x00;
+
3411  curpos = linepos;
+
3412  for (ix = 0; ix < charWidth; ix++) {
+
3413  if (!(mask >>= 1)) {
+
3414  patt = *charpos++;
+
3415  mask = 0x80;
+
3416  }
+
3417  if (patt & mask) {
+
3418  *(Uint32 *)curpos = 0xffffffff;
+
3419  } else {
+
3420  *(Uint32 *)curpos = 0;
+
3421  }
+
3422  curpos += 4;
+
3423  }
+
3424  linepos += pitch;
+
3425  }
+
3426 
+
3427  /* Maybe rotate and replace cached image */
+
3428  if (charRotation>0)
+
3429  {
+
3430  rotatedCharacter = rotateSurface90Degrees(character, charRotation);
+
3431  SDL_FreeSurface(character);
+
3432  character = rotatedCharacter;
+
3433  }
+
3434 
+
3435  /* Convert temp surface into texture */
+
3436  gfxPrimitivesFont[ci] = SDL_CreateTextureFromSurface(renderer, character);
+
3437  SDL_FreeSurface(character);
+
3438 
+
3439  /*
+
3440  * Check pointer
+
3441  */
+
3442  if (gfxPrimitivesFont[ci] == NULL) {
+
3443  return (-1);
+
3444  }
+
3445  }
+
3446 
+
3447  /*
+
3448  * Set color
+
3449  */
+
3450  result = 0;
+
3451  result |= SDL_SetTextureColorMod(gfxPrimitivesFont[ci], r, g, b);
+
3452  result |= SDL_SetTextureAlphaMod(gfxPrimitivesFont[ci], a);
+
3453 
+
3454  /*
+
3455  * Draw texture onto destination
+
3456  */
+
3457  result |= SDL_RenderCopy(renderer, gfxPrimitivesFont[ci], &srect, &drect);
+
3458 
+
3459  return (result);
+
3460 }
+
3461 
+
3462 
+
3474 int characterColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, char c, Uint32 color)
+
3475 {
+
3476  Uint8 *co = (Uint8 *)&color;
+
3477  return characterRGBA(renderer, x, y, c, co[0], co[1], co[2], co[3]);
+
3478 }
+
3479 
+
3480 
+
3495 int stringColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
+
3496 {
+
3497  Uint8 *c = (Uint8 *)&color;
+
3498  return stringRGBA(renderer, x, y, s, c[0], c[1], c[2], c[3]);
+
3499 }
+
3500 
+
3515 int stringRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
3516 {
+
3517  int result = 0;
+
3518  Sint16 curx = x;
+
3519  Sint16 cury = y;
+
3520  const char *curchar = s;
+
3521 
+
3522  while (*curchar && !result) {
+
3523  result |= characterRGBA(renderer, curx, cury, *curchar, r, g, b, a);
+
3524  switch (charRotation)
+
3525  {
+
3526  case 0:
+
3527  curx += charWidthLocal;
+
3528  break;
+
3529  case 2:
+
3530  curx -= charWidthLocal;
+
3531  break;
+
3532  case 1:
+
3533  cury += charHeightLocal;
+
3534  break;
+
3535  case 3:
+
3536  cury -= charHeightLocal;
+
3537  break;
+
3538  }
+
3539  curchar++;
+
3540  }
+
3541 
+
3542  return (result);
+
3543 }
+
3544 
+
3545 /* ---- Bezier curve */
+
3546 
+
3556 double _evaluateBezier (double *data, int ndata, double t)
+
3557 {
+
3558  double mu, result;
+
3559  int n,k,kn,nn,nkn;
+
3560  double blend,muk,munk;
+
3561 
+
3562  /* Sanity check bounds */
+
3563  if (t<0.0) {
+
3564  return(data[0]);
+
3565  }
+
3566  if (t>=(double)ndata) {
+
3567  return(data[ndata-1]);
+
3568  }
+
3569 
+
3570  /* Adjust t to the range 0.0 to 1.0 */
+
3571  mu=t/(double)ndata;
+
3572 
+
3573  /* Calculate interpolate */
+
3574  n=ndata-1;
+
3575  result=0.0;
+
3576  muk = 1;
+
3577  munk = pow(1-mu,(double)n);
+
3578  for (k=0;k<=n;k++) {
+
3579  nn = n;
+
3580  kn = k;
+
3581  nkn = n - k;
+
3582  blend = muk * munk;
+
3583  muk *= mu;
+
3584  munk /= (1-mu);
+
3585  while (nn >= 1) {
+
3586  blend *= nn;
+
3587  nn--;
+
3588  if (kn > 1) {
+
3589  blend /= (double)kn;
+
3590  kn--;
+
3591  }
+
3592  if (nkn > 1) {
+
3593  blend /= (double)nkn;
+
3594  nkn--;
+
3595  }
+
3596  }
+
3597  result += data[k] * blend;
+
3598  }
+
3599 
+
3600  return (result);
+
3601 }
+
3602 
+
3615 int bezierColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color)
+
3616 {
+
3617  Uint8 *c = (Uint8 *)&color;
+
3618  return bezierRGBA(renderer, vx, vy, n, s, c[0], c[1], c[2], c[3]);
+
3619 }
+
3620 
+
3636 int bezierRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
3637 {
+
3638  int result;
+
3639  int i;
+
3640  double *x, *y, t, stepsize;
+
3641  Sint16 x1, y1, x2, y2;
+
3642 
+
3643  /*
+
3644  * Sanity check
+
3645  */
+
3646  if (n < 3) {
+
3647  return (-1);
+
3648  }
+
3649  if (s < 2) {
+
3650  return (-1);
+
3651  }
+
3652 
+
3653  /*
+
3654  * Variable setup
+
3655  */
+
3656  stepsize=(double)1.0/(double)s;
+
3657 
+
3658  /* Transfer vertices into float arrays */
+
3659  if ((x=(double *)malloc(sizeof(double)*(n+1)))==NULL) {
+
3660  return(-1);
+
3661  }
+
3662  if ((y=(double *)malloc(sizeof(double)*(n+1)))==NULL) {
+
3663  free(x);
+
3664  return(-1);
+
3665  }
+
3666  for (i=0; i<n; i++) {
+
3667  x[i]=(double)vx[i];
+
3668  y[i]=(double)vy[i];
+
3669  }
+
3670  x[n]=(double)vx[0];
+
3671  y[n]=(double)vy[0];
+
3672 
+
3673  /*
+
3674  * Set color
+
3675  */
+
3676  result = 0;
+
3677  result |= SDL_SetRenderDrawBlendMode(renderer, (a == 255) ? SDL_BLENDMODE_NONE : SDL_BLENDMODE_BLEND);
+
3678  result |= SDL_SetRenderDrawColor(renderer, r, g, b, a);
+
3679 
+
3680  /*
+
3681  * Draw
+
3682  */
+
3683  t=0.0;
+
3684  x1=(Sint16)lrint(_evaluateBezier(x,n+1,t));
+
3685  y1=(Sint16)lrint(_evaluateBezier(y,n+1,t));
+
3686  for (i = 0; i <= (n*s); i++) {
+
3687  t += stepsize;
+
3688  x2=(Sint16)_evaluateBezier(x,n,t);
+
3689  y2=(Sint16)_evaluateBezier(y,n,t);
+
3690  result |= line(renderer, x1, y1, x2, y2);
+
3691  x1 = x2;
+
3692  y1 = y2;
+
3693  }
+
3694 
+
3695  /* Clean up temporary array */
+
3696  free(x);
+
3697  free(y);
+
3698 
+
3699  return (result);
+
3700 }
+
3701 
+
3702 
+
3716 int thickLineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
+
3717 {
+
3718  Uint8 *c = (Uint8 *)&color;
+
3719  return thickLineRGBA(renderer, x1, y1, x2, y2, width, c[0], c[1], c[2], c[3]);
+
3720 }
+
3721 
+
3738 int thickLineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+
3739 {
+
3740  int wh;
+
3741  double dx, dy, dx1, dy1, dx2, dy2;
+
3742  double l, wl2, nx, ny, ang, adj;
+
3743  Sint16 px[4], py[4];
+
3744 
+
3745  if (renderer == NULL) {
+
3746  return -1;
+
3747  }
+
3748 
+
3749  if (width < 1) {
+
3750  return -1;
+
3751  }
+
3752 
+
3753  /* Special case: thick "point" */
+
3754  if ((x1 == x2) && (y1 == y2)) {
+
3755  wh = width / 2;
+
3756  return boxRGBA(renderer, x1 - wh, y1 - wh, x2 + width, y2 + width, r, g, b, a);
+
3757  }
+
3758 
+
3759  /* Special case: width == 1 */
+
3760  if (width == 1) {
+
3761  return lineRGBA(renderer, x1, y1, x2, y2, r, g, b, a);
+
3762  }
+
3763 
+
3764  /* Calculate offsets for sides */
+
3765  dx = (double)(x2 - x1);
+
3766  dy = (double)(y2 - y1);
+
3767  l = SDL_sqrt(dx*dx + dy*dy);
+
3768  ang = SDL_atan2(dx, dy);
+
3769  adj = 0.1 + 0.9 * SDL_fabs(SDL_cos(2.0 * ang));
+
3770  wl2 = ((double)width - adj)/(2.0 * l);
+
3771  nx = dx * wl2;
+
3772  ny = dy * wl2;
+
3773 
+
3774  /* Build polygon */
+
3775  dx1 = (double)x1;
+
3776  dy1 = (double)y1;
+
3777  dx2 = (double)x2;
+
3778  dy2 = (double)y2;
+
3779  px[0] = (Sint16)(dx1 + ny);
+
3780  px[1] = (Sint16)(dx1 - ny);
+
3781  px[2] = (Sint16)(dx2 - ny);
+
3782  px[3] = (Sint16)(dx2 + ny);
+
3783  py[0] = (Sint16)(dy1 - nx);
+
3784  py[1] = (Sint16)(dy1 + nx);
+
3785  py[2] = (Sint16)(dy2 + nx);
+
3786  py[3] = (Sint16)(dy2 - nx);
+
3787 
+
3788  /* Draw polygon */
+
3789  return filledPolygonRGBA(renderer, px, py, 4, r, g, b, a);
+
3790 }
+
int polygonColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
Draw polygon with alpha blending.
+
int filledPieColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
Draw filled pie with alpha blending.
+ +
int line(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2)
Draw line with alpha blending using the currently set color.
+
int _drawQuadrants(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 dx, Sint16 dy, Sint32 f)
Internal function to draw pixels or lines in 4 quadrants.
+
int filledPolygonRGBAMT(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated)
Draw filled polygon with alpha blending (multi-threaded capable).
+
int roundedBoxRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw rounded-corner box (filled rectangle) with blending.
+
int boxColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw box (filled rectangle) with blending.
+
int pixelColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint32 color)
Draw pixel with blending enabled if a<255.
+
The structure passed to the internal Murphy iterator.
+
int ellipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw ellipse with blending.
+
int filledEllipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled ellipse with blending.
+
int trigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw trigon (triangle outline) with alpha blending.
+
The structure passed to the internal Bresenham iterator.
+ +
int arcColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
Arc with blending.
+
int aatrigonColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
Draw anti-aliased trigon (triangle outline) with alpha blending.
+
int filledPolygonColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
Draw filled polygon with alpha blending.
+
void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch)
Sets or resets the current global font data.
+
int pixelRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw pixel with blending enabled if a<255.
+
int ellipseColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
Draw ellipse with blending.
+
int roundedRectangleColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
Draw rounded-corner rectangle with blending.
+
int boxRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw box (filled rectangle) with blending.
+
int roundedRectangleRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw rounded-corner rectangle with blending.
+
int polygon(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n)
Draw polygon with the currently set color and blend mode.
+
int circleColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
Draw circle with blending.
+
int hlineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw horizontal line with blending.
+
int rectangleColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw rectangle with blending.
+
int texturedPolygon(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy)
Draws a polygon filled with the given texture.
+
int stringRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a string in the currently set font.
+
int aapolygonColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
Draw anti-aliased polygon with alpha blending.
+
#define AAbits
+
int pixelRGBAWeight(SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint32 weight)
Draw pixel with blending enabled and using alpha weight on color.
+
int pixel(SDL_Renderer *renderer, Sint16 x, Sint16 y)
Draw pixel in currently set color.
+
int aacircleColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
Draw anti-aliased circle with blending.
+
int filledCircleColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
Draw filled circle with blending.
+
int lineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw line with alpha blending.
+
int aaellipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased ellipse with blending.
+
int filledTrigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled trigon (triangle) with alpha blending.
+ + +
int _HLineTextured(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, SDL_Texture *texture, int texture_w, int texture_h, int texture_dx, int texture_dy)
Internal function to draw a textured horizontal line.
+
double _evaluateBezier(double *data, int ndata, double t)
Internal function to calculate bezier interpolator of data array with ndata values at position 't'...
+
int aalineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw anti-aliased line with alpha blending.
+
void gfxPrimitivesSetFontRotation(Uint32 rotation)
Sets current global font character rotation steps.
+
int bezierRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a bezier curve with alpha blending.
+
int lineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw line with alpha blending.
+ +
int thickLineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a thick line with alpha blending.
+ +
#define AAlevels
+
int circleRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw circle with blending.
+
int _gfxPrimitivesCompareInt(const void *a, const void *b)
Internal helper qsort callback functions used in filled polygon drawing.
+
int _ellipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Sint32 f)
+
int hlineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
Draw horizontal line with blending.
+
int stringColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
Draw a string in the currently set font.
+
int rectangleRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw rectangle with blending.
+ +
int polygonRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw polygon with alpha blending.
+
int vline(SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2)
Draw vertical line in currently set color.
+
int aacircleRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased circle with blending.
+
int filledCircleRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled circle with blending.
+
int filledTrigonColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
Draw filled trigon (triangle) with alpha blending.
+
int characterRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a character of the currently set font.
+
int aapolygonRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased polygon with alpha blending.
+
int _aalineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int draw_endpoint)
Internal function to draw anti-aliased line with alpha blending and endpoint control.
+
int trigonColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
Draw trigon (triangle outline) with alpha blending.
+
int aatrigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased trigon (triangle outline) with alpha blending.
+
int thickLineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
Draw a thick line with alpha blending.
+
#define M_PI
+ +
int texturedPolygonMT(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy, int **polyInts, int *polyAllocated)
Draws a polygon filled with the given texture (Multi-Threading Capable).
+ +
int characterColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint32 color)
Draw a character of the currently set font.
+
int bezierColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color)
Draw a bezier curve with alpha blending.
+
int _pieRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint8 filled)
Internal float (low-speed) pie-calc implementation by drawing polygons.
+
int filledEllipseColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
Draw filled ellipse with blending.
+
int hline(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y)
Draw horizontal line in currently set color.
+
int filledPolygonRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled polygon with alpha blending.
+
int pieColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
Draw pie (outline) with alpha blending.
+
#define ELLIPSE_OVERSCAN
Internal function to draw ellipse or filled ellipse with blending.
+ +
int filledPieRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled pie with alpha blending.
+
int vlineRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw vertical line with blending.
+ +
int aalineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased line with alpha blending.
+
int roundedBoxColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
Draw rounded-corner box (filled rectangle) with blending.
+
int pieRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw pie (outline) with alpha blending.
+
int aaellipseColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
Draw anti-aliased ellipse with blending.
+
int vlineColor(SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
Draw vertical line with blending.
+
int arcRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Arc with blending.
+
SDL_Surface * rotateSurface90Degrees(SDL_Surface *src, int numClockwiseTurns)
Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
+ +
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html new file mode 100755 index 000000000..fbd41588d --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html @@ -0,0 +1,4766 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.h File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.h File Reference
+
+
+
#include <math.h>
+#include "SDL.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + +

+Macros

#define M_PI   3.1415926535897932384626433832795
 
#define SDL2_GFXPRIMITIVES_MAJOR   1
 
#define SDL2_GFXPRIMITIVES_MINOR   0
 
#define SDL2_GFXPRIMITIVES_MICRO   2
 
#define SDL2_GFXPRIMITIVES_SCOPE   extern
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

SDL2_GFXPRIMITIVES_SCOPE int pixelColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint32 color)
 Draw pixel with blending enabled if a<255. More...
 
SDL2_GFXPRIMITIVES_SCOPE int pixelRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw pixel with blending enabled if a<255. More...
 
SDL2_GFXPRIMITIVES_SCOPE int hlineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
 Draw horizontal line with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int hlineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw horizontal line with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int vlineColor (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
 Draw vertical line with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int vlineRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw vertical line with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int rectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw rectangle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int rectangleRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rectangle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
 Draw rounded-corner rectangle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rounded-corner rectangle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int boxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw box (filled rectangle) with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int boxRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw box (filled rectangle) with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
 Draw rounded-corner box (filled rectangle) with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rounded-corner box (filled rectangle) with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int lineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw line with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int lineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw line with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aalineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw anti-aliased line with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aalineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased line with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int thickLineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
 Draw a thick line with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int thickLineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a thick line with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int circleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw circle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int circleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw circle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int arcColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Arc with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int arcRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Arc with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aacircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw anti-aliased circle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aacircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased circle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledCircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 r, Uint32 color)
 Draw filled circle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledCircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled circle with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int ellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw ellipse with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int ellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw ellipse with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aaellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw anti-aliased ellipse with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aaellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased ellipse with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw filled ellipse with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled ellipse with blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int pieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Draw pie (outline) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int pieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw pie (outline) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledPieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Draw filled pie with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledPieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled pie with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int trigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw trigon (triangle outline) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int trigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw trigon (triangle outline) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aatrigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw anti-aliased trigon (triangle outline) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aatrigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased trigon (triangle outline) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw filled trigon (triangle) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled trigon (triangle) with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int polygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw polygon with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int polygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw polygon with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aapolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw anti-aliased polygon with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int aapolygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased polygon with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw filled polygon with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled polygon with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int texturedPolygon (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy)
 Draws a polygon filled with the given texture. More...
 
SDL2_GFXPRIMITIVES_SCOPE int bezierColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color)
 Draw a bezier curve with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE int bezierRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a bezier curve with alpha blending. More...
 
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont (const void *fontdata, Uint32 cw, Uint32 ch)
 Sets or resets the current global font data. More...
 
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation (Uint32 rotation)
 Sets current global font character rotation steps. More...
 
SDL2_GFXPRIMITIVES_SCOPE int characterColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint32 color)
 Draw a character of the currently set font. More...
 
SDL2_GFXPRIMITIVES_SCOPE int characterRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a character of the currently set font. More...
 
SDL2_GFXPRIMITIVES_SCOPE int stringColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
 Draw a string in the currently set font. More...
 
SDL2_GFXPRIMITIVES_SCOPE int stringRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a string in the currently set font. More...
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define M_PI   3.1415926535897932384626433832795
+
+ +

Definition at line 35 of file SDL2_gfxPrimitives.h.

+ +
+
+ +
+
+ + + + +
#define SDL2_GFXPRIMITIVES_MAJOR   1
+
+ +

Definition at line 47 of file SDL2_gfxPrimitives.h.

+ +
+
+ +
+
+ + + + +
#define SDL2_GFXPRIMITIVES_MICRO   2
+
+ +

Definition at line 49 of file SDL2_gfxPrimitives.h.

+ +
+
+ +
+
+ + + + +
#define SDL2_GFXPRIMITIVES_MINOR   0
+
+ +

Definition at line 48 of file SDL2_gfxPrimitives.h.

+ +
+
+ +
+
+ + + + +
#define SDL2_GFXPRIMITIVES_SCOPE   extern
+
+ +

Definition at line 64 of file SDL2_gfxPrimitives.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aacircleColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw anti-aliased circle with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-circle.
yY coordinate of the center of the aa-circle.
radRadius in pixels of the aa-circle.
colorThe color value of the aa-circle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1433 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aacircleRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased circle with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-circle.
yY coordinate of the center of the aa-circle.
radRadius in pixels of the aa-circle.
rThe red value of the aa-circle to draw.
gThe green value of the aa-circle to draw.
bThe blue value of the aa-circle to draw.
aThe alpha value of the aa-circle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1453 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aaellipseColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint32 color 
)
+
+ +

Draw anti-aliased ellipse with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-ellipse.
yY coordinate of the center of the aa-ellipse.
rxHorizontal radius in pixels of the aa-ellipse.
ryVertical radius in pixels of the aa-ellipse.
colorThe color value of the aa-ellipse to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1791 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aaellipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased ellipse with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the aa-ellipse.
yY coordinate of the center of the aa-ellipse.
rxHorizontal radius in pixels of the aa-ellipse.
ryVertical radius in pixels of the aa-ellipse.
rThe red value of the aa-ellipse to draw.
gThe green value of the aa-ellipse to draw.
bThe blue value of the aa-ellipse to draw.
aThe alpha value of the aa-ellipse to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1812 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aalineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw anti-aliased line with alpha blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
colorThe color value of the aa-line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1096 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aalineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased line with alpha blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
rThe red value of the aa-line to draw.
gThe green value of the aa-line to draw.
bThe blue value of the aa-line to draw.
aThe alpha value of the aa-line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1117 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aapolygonColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint32 color 
)
+
+ +

Draw anti-aliased polygon with alpha blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the aa-polygon.
vyVertex array containing Y coordinates of the points of the aa-polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the aa-polygon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2596 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aapolygonRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased polygon with alpha blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the aa-polygon.
vyVertex array containing Y coordinates of the points of the aa-polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the aa-polygon to draw.
gThe green value of the aa-polygon to draw.
bThe blue value of the aa-polygon to draw.
aThe alpha value of the aa-polygon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2616 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aatrigonColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint32 color 
)
+
+ +

Draw anti-aliased trigon (triangle outline) with alpha blending.

+

Note: Creates vertex array and uses aapolygon routine to render.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-trigon.
y1Y coordinate of the first point of the aa-trigon.
x2X coordinate of the second point of the aa-trigon.
y2Y coordinate of the second point of the aa-trigon.
x3X coordinate of the third point of the aa-trigon.
y3Y coordinate of the third point of the aa-trigon.
colorThe color value of the aa-trigon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2324 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int aatrigonRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw anti-aliased trigon (triangle outline) with alpha blending.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-trigon.
y1Y coordinate of the first point of the aa-trigon.
x2X coordinate of the second point of the aa-trigon.
y2Y coordinate of the second point of the aa-trigon.
x3X coordinate of the third point of the aa-trigon.
y3Y coordinate of the third point of the aa-trigon.
rThe red value of the aa-trigon to draw.
gThe green value of the aa-trigon to draw.
bThe blue value of the aa-trigon to draw.
aThe alpha value of the aa-trigon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2356 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int arcColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint32 color 
)
+
+ +

Arc with blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the arc.
yY coordinate of the center of the arc.
radRadius in pixels of the arc.
startStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
endEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
colorThe color value of the arc to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1175 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int arcRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Arc with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the arc.
yY coordinate of the center of the arc.
radRadius in pixels of the arc.
startStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
endEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
rThe red value of the arc to draw.
gThe green value of the arc to draw.
bThe blue value of the arc to draw.
aThe alpha value of the arc to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1198 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int bezierColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
int s,
Uint32 color 
)
+
+ +

Draw a bezier curve with alpha blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the bezier curve.
vyVertex array containing Y coordinates of the points of the bezier curve.
nNumber of points in the vertex array. Minimum number is 3.
sNumber of steps for the interpolation. Minimum number is 2.
colorThe color value of the bezier curve to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3615 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int bezierRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
int s,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a bezier curve with alpha blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the bezier curve.
vyVertex array containing Y coordinates of the points of the bezier curve.
nNumber of points in the vertex array. Minimum number is 3.
sNumber of steps for the interpolation. Minimum number is 2.
rThe red value of the bezier curve to draw.
gThe green value of the bezier curve to draw.
bThe blue value of the bezier curve to draw.
aThe alpha value of the bezier curve to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3636 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int boxColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw box (filled rectangle) with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
colorThe color value of the box to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 710 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int boxRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw box (filled rectangle) with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
rThe red value of the box to draw.
gThe green value of the box to draw.
bThe blue value of the box to draw.
aThe alpha value of the box to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 731 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int characterColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
char c,
Uint32 color 
)
+
+ +

Draw a character of the currently set font.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the character.
yY (vertical) coordinate of the upper left corner of the character.
cThe character to draw.
colorThe color value of the character to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3474 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int characterRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
char c,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a character of the currently set font.

+
Parameters
+ + + + + + + + + +
rendererThe Renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the character.
yY (vertical) coordinate of the upper left corner of the character.
cThe character to draw.
rThe red value of the character to draw.
gThe green value of the character to draw.
bThe blue value of the character to draw.
aThe alpha value of the character to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3352 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int circleColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw circle with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the circle.
yY coordinate of the center of the circle.
radRadius in pixels of the circle.
colorThe color value of the circle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1135 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int circleRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw circle with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the circle.
yY coordinate of the center of the circle.
radRadius in pixels of the circle.
rThe red value of the circle to draw.
gThe green value of the circle to draw.
bThe blue value of the circle to draw.
aThe alpha value of the circle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1155 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int ellipseColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint32 color 
)
+
+ +

Draw ellipse with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
colorThe color value of the ellipse to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1672 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int ellipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw ellipse with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
rThe red value of the ellipse to draw.
gThe green value of the ellipse to draw.
bThe blue value of the ellipse to draw.
aThe alpha value of the ellipse to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1693 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledCircleColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw filled circle with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled circle.
yY coordinate of the center of the filled circle.
radRadius in pixels of the filled circle.
colorThe color value of the filled circle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1711 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledCircleRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled circle with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled circle.
yY coordinate of the center of the filled circle.
radRadius in pixels of the filled circle.
rThe red value of the filled circle to draw.
gThe green value of the filled circle to draw.
bThe blue value of the filled circle to draw.
aThe alpha value of the filled circle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 1731 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint32 color 
)
+
+ +

Draw filled ellipse with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled ellipse.
yY coordinate of the center of the filled ellipse.
rxHorizontal radius in pixels of the filled ellipse.
ryVertical radius in pixels of the filled ellipse.
colorThe color value of the filled ellipse to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2007 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rx,
Sint16 ry,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled ellipse with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled ellipse.
yY coordinate of the center of the filled ellipse.
rxHorizontal radius in pixels of the filled ellipse.
ryVertical radius in pixels of the filled ellipse.
rThe red value of the filled ellipse to draw.
gThe green value of the filled ellipse to draw.
bThe blue value of the filled ellipse to draw.
aThe alpha value of the filled ellipse to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2028 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledPieColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint32 color 
)
+
+ +

Draw filled pie with alpha blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled pie.
yY coordinate of the center of the filled pie.
radRadius in pixels of the filled pie.
startStarting radius in degrees of the filled pie.
endEnding radius in degrees of the filled pie.
colorThe color value of the filled pie to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2212 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledPieRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled pie with alpha blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the filled pie.
yY coordinate of the center of the filled pie.
radRadius in pixels of the filled pie.
startStarting radius in degrees of the filled pie.
endEnding radius in degrees of the filled pie.
rThe red value of the filled pie to draw.
gThe green value of the filled pie to draw.
bThe blue value of the filled pie to draw.
aThe alpha value of the filled pie to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2234 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint32 color 
)
+
+ +

Draw filled polygon with alpha blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the filled polygon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2879 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled polygon with alpha blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the filled polygon to draw.
gThe green value of the filled polygon to draw.
bThe blue value of the filed polygon to draw.
aThe alpha value of the filled polygon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2899 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint32 color 
)
+
+ +

Draw filled trigon (triangle) with alpha blending.

+

Note: Creates vertex array and uses aapolygon routine to render.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the filled trigon.
y1Y coordinate of the first point of the filled trigon.
x2X coordinate of the second point of the filled trigon.
y2Y coordinate of the second point of the filled trigon.
x3X coordinate of the third point of the filled trigon.
y3Y coordinate of the third point of the filled trigon.
colorThe color value of the filled trigon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2390 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw filled trigon (triangle) with alpha blending.

+

Note: Creates vertex array and uses aapolygon routine to render.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the filled trigon.
y1Y coordinate of the first point of the filled trigon.
x2X coordinate of the second point of the filled trigon.
y2Y coordinate of the second point of the filled trigon.
x3X coordinate of the third point of the filled trigon.
y3Y coordinate of the third point of the filled trigon.
rThe red value of the filled trigon to draw.
gThe green value of the filled trigon to draw.
bThe blue value of the filled trigon to draw.
aThe alpha value of the filled trigon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2424 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont (const void * fontdata,
Uint32 cw,
Uint32 ch 
)
+
+ +

Sets or resets the current global font data.

+

The font data array is organized in follows: [fontdata] = [character 0][character 1]...[character 255] where [character n] = [byte 1 row 1][byte 2 row 1]...[byte {pitch} row 1][byte 1 row 2] ...[byte {pitch} row height] where [byte n] = [bit 0]...[bit 7] where [bit n] = [0 for transparent pixel|1 for colored pixel]

+
Parameters
+ + + + +
fontdataPointer to array of font data. Set to NULL, to reset global font to the default 8x8 font.
cwWidth of character in bytes. Ignored if fontdata==NULL.
chHeight of character in bytes. Ignored if fontdata==NULL.
+
+
+ +

Definition at line 3260 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation (Uint32 rotation)
+
+ +

Sets current global font character rotation steps.

+

Default is 0 (no rotation). 1 = 90deg clockwise. 2 = 180deg clockwise. 3 = 270deg clockwise. Changing the rotation, will reset the character cache.

+
Parameters
+ + +
rotationNumber of 90deg clockwise steps to rotate
+
+
+ +

Definition at line 3306 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int hlineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 x2,
Sint16 y,
Uint32 color 
)
+
+ +

Draw horizontal line with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 175 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int hlineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 x2,
Sint16 y,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw horizontal line with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 195 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int lineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw line with alpha blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the seond point of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 821 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int lineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw line with alpha blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 842 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int pieColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint32 color 
)
+
+ +

Draw pie (outline) with alpha blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
colorThe color value of the pie to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2170 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int pieRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Sint16 rad,
Sint16 start,
Sint16 end,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw pie (outline) with alpha blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
rThe red value of the pie to draw.
gThe green value of the pie to draw.
bThe blue value of the pie to draw.
aThe alpha value of the pie to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2193 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int pixelColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Uint32 color 
)
+
+ +

Draw pixel with blending enabled if a<255.

+
Parameters
+ + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
colorThe color value of the pixel to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 88 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int pixelRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw pixel with blending enabled if a<255.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
rThe red color value of the pixel to draw.
gThe green color value of the pixel to draw.
bThe blue color value of the pixel to draw.
aThe alpha value of the pixel to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 107 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int polygonColor (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint32 color 
)
+
+ +

Draw polygon with alpha blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the polygon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2453 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int polygonRGBA (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw polygon with alpha blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the polygon to draw.
gThe green value of the polygon to draw.
bThe blue value of the polygon to draw.
aThe alpha value of the polygon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2535 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int rectangleColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw rectangle with blending.

+
Parameters
+ + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
colorThe color value of the rectangle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 275 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int rectangleRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw rectangle with blending.

+
Parameters
+ + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
rThe red value of the rectangle to draw.
gThe green value of the rectangle to draw.
bThe blue value of the rectangle to draw.
aThe alpha value of the rectangle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 296 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw rounded-corner box (filled rectangle) with blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
radThe radius of the corner arcs of the box.
colorThe color value of the box to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 513 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw rounded-corner box (filled rectangle) with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
radThe radius of the corner arcs of the box.
rThe red value of the box to draw.
gThe green value of the box to draw.
bThe blue value of the box to draw.
aThe alpha value of the box to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 535 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint32 color 
)
+
+ +

Draw rounded-corner rectangle with blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
radThe radius of the corner arc.
colorThe color value of the rectangle to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 368 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 rad,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw rounded-corner rectangle with blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
radThe radius of the corner arc.
rThe red value of the rectangle to draw.
gThe green value of the rectangle to draw.
bThe blue value of the rectangle to draw.
aThe alpha value of the rectangle to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 390 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int stringColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
const char * s,
Uint32 color 
)
+
+ +

Draw a string in the currently set font.

+

The spacing between consequtive characters in the string is the fixed number of pixels of the character width of the current global font.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the string.
yY (vertical) coordinate of the upper left corner of the string.
sThe string to draw.
colorThe color value of the string to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3495 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int stringRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y,
const char * s,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a string in the currently set font.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the string.
yY (vertical) coordinate of the upper left corner of the string.
sThe string to draw.
rThe red value of the string to draw.
gThe green value of the string to draw.
bThe blue value of the string to draw.
aThe alpha value of the string to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3515 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int texturedPolygon (SDL_Renderer * renderer,
const Sint16 * vx,
const Sint16 * vy,
int n,
SDL_Surface * texture,
int texture_dx,
int texture_dy 
)
+
+ +

Draws a polygon filled with the given texture.

+

This standard version is calling multithreaded versions with NULL cache parameters.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
vxarray of x vector components
vyarray of x vector components
nthe amount of vectors in the vx and vy array
texturethe sdl surface to use to fill the polygon
texture_dxthe offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value
texture_dysee texture_dx
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3192 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int thickLineColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 width,
Uint32 color 
)
+
+ +

Draw a thick line with alpha blending.

+
Parameters
+ + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
widthWidth of the line in pixels. Must be >0.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3716 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int thickLineRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Uint8 width,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw a thick line with alpha blending.

+
Parameters
+ + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
widthWidth of the line in pixels. Must be >0.
rThe red value of the character to draw.
gThe green value of the character to draw.
bThe blue value of the character to draw.
aThe alpha value of the character to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 3738 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int trigonColor (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint32 color 
)
+
+ +

Draw trigon (triangle outline) with alpha blending.

+

Note: Creates vertex array and uses polygon routine to render.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the trigon.
y1Y coordinate of the first point of the trigon.
x2X coordinate of the second point of the trigon.
y2Y coordinate of the second point of the trigon.
x3X coordinate of the third point of the trigon.
y3Y coordinate of the third point of the trigon.
colorThe color value of the trigon to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2258 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int trigonRGBA (SDL_Renderer * renderer,
Sint16 x1,
Sint16 y1,
Sint16 x2,
Sint16 y2,
Sint16 x3,
Sint16 y3,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw trigon (triangle outline) with alpha blending.

+
Parameters
+ + + + + + + + + + + + +
rendererThe renderer to draw on.
x1X coordinate of the first point of the trigon.
y1Y coordinate of the first point of the trigon.
x2X coordinate of the second point of the trigon.
y2Y coordinate of the second point of the trigon.
x3X coordinate of the third point of the trigon.
y3Y coordinate of the third point of the trigon.
rThe red value of the trigon to draw.
gThe green value of the trigon to draw.
bThe blue value of the trigon to draw.
aThe alpha value of the trigon to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 2290 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int vlineColor (SDL_Renderer * renderer,
Sint16 x,
Sint16 y1,
Sint16 y2,
Uint32 color 
)
+
+ +

Draw vertical line with blending.

+
Parameters
+ + + + + + +
rendererThe renderer to draw on.
xX coordinate of the points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 232 of file SDL2_gfxPrimitives.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_GFXPRIMITIVES_SCOPE int vlineRGBA (SDL_Renderer * renderer,
Sint16 x,
Sint16 y1,
Sint16 y2,
Uint8 r,
Uint8 g,
Uint8 b,
Uint8 a 
)
+
+ +

Draw vertical line with blending.

+
Parameters
+ + + + + + + + + +
rendererThe renderer to draw on.
xX coordinate of the points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
+
+
+
Returns
Returns 0 on success, -1 on failure.
+ +

Definition at line 252 of file SDL2_gfxPrimitives.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h_source.html new file mode 100755 index 000000000..f389d6ad1 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h_source.html @@ -0,0 +1,359 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.h Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives.h
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_gfxPrimitives.h: graphics primitives for SDL
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #ifndef _SDL2_gfxPrimitives_h
+
31 #define _SDL2_gfxPrimitives_h
+
32 
+
33 #include <math.h>
+
34 #ifndef M_PI
+
35 #define M_PI 3.1415926535897932384626433832795
+
36 #endif
+
37 
+
38 #include "SDL.h"
+
39 
+
40 /* Set up for C function definitions, even when using C++ */
+
41 #ifdef __cplusplus
+
42 extern "C" {
+
43 #endif
+
44 
+
45  /* ----- Versioning */
+
46 
+
47 #define SDL2_GFXPRIMITIVES_MAJOR 1
+
48 #define SDL2_GFXPRIMITIVES_MINOR 0
+
49 #define SDL2_GFXPRIMITIVES_MICRO 2
+
50 
+
51 
+
52  /* ---- Function Prototypes */
+
53 
+
54 #ifdef _MSC_VER
+
55 # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT)
+
56 # define SDL2_GFXPRIMITIVES_SCOPE __declspec(dllexport)
+
57 # else
+
58 # ifdef LIBSDL2_GFX_DLL_IMPORT
+
59 # define SDL2_GFXPRIMITIVES_SCOPE __declspec(dllimport)
+
60 # endif
+
61 # endif
+
62 #endif
+
63 #ifndef SDL2_GFXPRIMITIVES_SCOPE
+
64 # define SDL2_GFXPRIMITIVES_SCOPE extern
+
65 #endif
+
66 
+
67  /* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */
+
68 
+
69  /* Pixel */
+
70 
+
71  SDL2_GFXPRIMITIVES_SCOPE int pixelColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint32 color);
+
72  SDL2_GFXPRIMITIVES_SCOPE int pixelRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
73 
+
74  /* Horizontal line */
+
75 
+
76  SDL2_GFXPRIMITIVES_SCOPE int hlineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
+
77  SDL2_GFXPRIMITIVES_SCOPE int hlineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
78 
+
79  /* Vertical line */
+
80 
+
81  SDL2_GFXPRIMITIVES_SCOPE int vlineColor(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color);
+
82  SDL2_GFXPRIMITIVES_SCOPE int vlineRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
83 
+
84  /* Rectangle */
+
85 
+
86  SDL2_GFXPRIMITIVES_SCOPE int rectangleColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
+
87  SDL2_GFXPRIMITIVES_SCOPE int rectangleRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
+
88  Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
89 
+
90  /* Rounded-Corner Rectangle */
+
91 
+
92  SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color);
+
93  SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
+
94  Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
95 
+
96  /* Filled rectangle (Box) */
+
97 
+
98  SDL2_GFXPRIMITIVES_SCOPE int boxColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
+
99  SDL2_GFXPRIMITIVES_SCOPE int boxRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2,
+
100  Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
101 
+
102  /* Rounded-Corner Filled rectangle (Box) */
+
103 
+
104  SDL2_GFXPRIMITIVES_SCOPE int roundedBoxColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color);
+
105  SDL2_GFXPRIMITIVES_SCOPE int roundedBoxRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2,
+
106  Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
107 
+
108  /* Line */
+
109 
+
110  SDL2_GFXPRIMITIVES_SCOPE int lineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
+
111  SDL2_GFXPRIMITIVES_SCOPE int lineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
+
112  Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
113 
+
114  /* AA Line */
+
115 
+
116  SDL2_GFXPRIMITIVES_SCOPE int aalineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
+
117  SDL2_GFXPRIMITIVES_SCOPE int aalineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1,
+
118  Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
119 
+
120  /* Thick Line */
+
121  SDL2_GFXPRIMITIVES_SCOPE int thickLineColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2,
+
122  Uint8 width, Uint32 color);
+
123  SDL2_GFXPRIMITIVES_SCOPE int thickLineRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2,
+
124  Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
125 
+
126  /* Circle */
+
127 
+
128  SDL2_GFXPRIMITIVES_SCOPE int circleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
+
129  SDL2_GFXPRIMITIVES_SCOPE int circleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
130 
+
131  /* Arc */
+
132 
+
133  SDL2_GFXPRIMITIVES_SCOPE int arcColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color);
+
134  SDL2_GFXPRIMITIVES_SCOPE int arcRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end,
+
135  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
136 
+
137  /* AA Circle */
+
138 
+
139  SDL2_GFXPRIMITIVES_SCOPE int aacircleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
+
140  SDL2_GFXPRIMITIVES_SCOPE int aacircleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
+
141  Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
142 
+
143  /* Filled Circle */
+
144 
+
145  SDL2_GFXPRIMITIVES_SCOPE int filledCircleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
+
146  SDL2_GFXPRIMITIVES_SCOPE int filledCircleRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
+
147  Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
148 
+
149  /* Ellipse */
+
150 
+
151  SDL2_GFXPRIMITIVES_SCOPE int ellipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
+
152  SDL2_GFXPRIMITIVES_SCOPE int ellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
+
153  Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
154 
+
155  /* AA Ellipse */
+
156 
+
157  SDL2_GFXPRIMITIVES_SCOPE int aaellipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
+
158  SDL2_GFXPRIMITIVES_SCOPE int aaellipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
+
159  Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
160 
+
161  /* Filled Ellipse */
+
162 
+
163  SDL2_GFXPRIMITIVES_SCOPE int filledEllipseColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
+
164  SDL2_GFXPRIMITIVES_SCOPE int filledEllipseRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y,
+
165  Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
166 
+
167  /* Pie */
+
168 
+
169  SDL2_GFXPRIMITIVES_SCOPE int pieColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
170  Sint16 start, Sint16 end, Uint32 color);
+
171  SDL2_GFXPRIMITIVES_SCOPE int pieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
172  Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
173 
+
174  /* Filled Pie */
+
175 
+
176  SDL2_GFXPRIMITIVES_SCOPE int filledPieColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
177  Sint16 start, Sint16 end, Uint32 color);
+
178  SDL2_GFXPRIMITIVES_SCOPE int filledPieRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad,
+
179  Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
180 
+
181  /* Trigon */
+
182 
+
183  SDL2_GFXPRIMITIVES_SCOPE int trigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
+
184  SDL2_GFXPRIMITIVES_SCOPE int trigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
+
185  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
186 
+
187  /* AA-Trigon */
+
188 
+
189  SDL2_GFXPRIMITIVES_SCOPE int aatrigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
+
190  SDL2_GFXPRIMITIVES_SCOPE int aatrigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
+
191  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
192 
+
193  /* Filled Trigon */
+
194 
+
195  SDL2_GFXPRIMITIVES_SCOPE int filledTrigonColor(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
+
196  SDL2_GFXPRIMITIVES_SCOPE int filledTrigonRGBA(SDL_Renderer * renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
+
197  Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
198 
+
199  /* Polygon */
+
200 
+
201  SDL2_GFXPRIMITIVES_SCOPE int polygonColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color);
+
202  SDL2_GFXPRIMITIVES_SCOPE int polygonRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy,
+
203  int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
204 
+
205  /* AA-Polygon */
+
206 
+
207  SDL2_GFXPRIMITIVES_SCOPE int aapolygonColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color);
+
208  SDL2_GFXPRIMITIVES_SCOPE int aapolygonRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy,
+
209  int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
210 
+
211  /* Filled Polygon */
+
212 
+
213  SDL2_GFXPRIMITIVES_SCOPE int filledPolygonColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color);
+
214  SDL2_GFXPRIMITIVES_SCOPE int filledPolygonRGBA(SDL_Renderer * renderer, const Sint16 * vx,
+
215  const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
216 
+
217  /* Textured Polygon */
+
218 
+
219  SDL2_GFXPRIMITIVES_SCOPE int texturedPolygon(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy);
+
220 
+
221  /* Bezier */
+
222 
+
223  SDL2_GFXPRIMITIVES_SCOPE int bezierColor(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color);
+
224  SDL2_GFXPRIMITIVES_SCOPE int bezierRGBA(SDL_Renderer * renderer, const Sint16 * vx, const Sint16 * vy,
+
225  int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
226 
+
227  /* Characters/Strings */
+
228 
+
229  SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch);
+ +
231  SDL2_GFXPRIMITIVES_SCOPE int characterColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, char c, Uint32 color);
+
232  SDL2_GFXPRIMITIVES_SCOPE int characterRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
233  SDL2_GFXPRIMITIVES_SCOPE int stringColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, const char *s, Uint32 color);
+
234  SDL2_GFXPRIMITIVES_SCOPE int stringRGBA(SDL_Renderer * renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+
235 
+
236  /* Ends C function definitions when using C++ */
+
237 #ifdef __cplusplus
+
238 }
+
239 #endif
+
240 
+
241 #endif /* _SDL2_gfxPrimitives_h */
+
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
Draw rounded-corner box (filled rectangle) with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int ellipseColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
Draw ellipse with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
Draw filled ellipse with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int bezierRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a bezier curve with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aacircleRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased circle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int stringRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a string in the currently set font.
+
SDL2_GFXPRIMITIVES_SCOPE int thickLineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
Draw a thick line with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int hlineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw horizontal line with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int texturedPolygon(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy)
Draws a polygon filled with the given texture.
+
SDL2_GFXPRIMITIVES_SCOPE int circleRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw circle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int trigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw trigon (triangle outline) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aalineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased line with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int arcColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
Arc with blending.
+
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation(Uint32 rotation)
Sets current global font character rotation steps.
+
SDL2_GFXPRIMITIVES_SCOPE int characterColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint32 color)
Draw a character of the currently set font.
+
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch)
Sets or resets the current global font data.
+
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled ellipse with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int arcRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Arc with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int hlineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
Draw horizontal line with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int trigonColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
Draw trigon (triangle outline) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aacircleColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
Draw anti-aliased circle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int pixelRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw pixel with blending enabled if a<255.
+
SDL2_GFXPRIMITIVES_SCOPE int pixelColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint32 color)
Draw pixel with blending enabled if a<255.
+
SDL2_GFXPRIMITIVES_SCOPE int filledPieRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled pie with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledPieColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
Draw filled pie with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int boxColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw box (filled rectangle) with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw rounded-corner rectangle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledCircleRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled circle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int rectangleRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw rectangle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int pieRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw pie (outline) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled trigon (triangle) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int characterRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a character of the currently set font.
+
SDL2_GFXPRIMITIVES_SCOPE int aapolygonRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased polygon with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw filled polygon with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int ellipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw ellipse with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int vlineRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw vertical line with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int thickLineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw a thick line with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int lineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw line with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
Draw rounded-corner rectangle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int stringColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
Draw a string in the currently set font.
+
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
Draw filled trigon (triangle) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int bezierColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color)
Draw a bezier curve with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int polygonColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
Draw polygon with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int polygonRGBA(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw polygon with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aalineColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw anti-aliased line with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
Draw filled polygon with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aatrigonRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased trigon (triangle outline) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aapolygonColor(SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
Draw anti-aliased polygon with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int boxRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw box (filled rectangle) with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int pieColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
Draw pie (outline) with alpha blending.
+
#define SDL2_GFXPRIMITIVES_SCOPE
+
SDL2_GFXPRIMITIVES_SCOPE int lineRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw line with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int filledCircleColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 r, Uint32 color)
Draw filled circle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aaellipseRGBA(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw anti-aliased ellipse with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aatrigonColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
Draw anti-aliased trigon (triangle outline) with alpha blending.
+
SDL2_GFXPRIMITIVES_SCOPE int circleColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
Draw circle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int rectangleColor(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
Draw rectangle with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int aaellipseColor(SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
Draw anti-aliased ellipse with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxRGBA(SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Draw rounded-corner box (filled rectangle) with blending.
+
SDL2_GFXPRIMITIVES_SCOPE int vlineColor(SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
Draw vertical line with blending.
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives__font_8h.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives__font_8h.html new file mode 100755 index 000000000..db87d4014 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives__font_8h.html @@ -0,0 +1,83 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives_font.h File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives_font.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Macros

#define GFX_FONTDATAMAX   (8*256)
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define GFX_FONTDATAMAX   (8*256)
+
+ +

Definition at line 30 of file SDL2_gfxPrimitives_font.h.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives__font_8h_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives__font_8h_source.html new file mode 100755 index 000000000..f3970f050 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives__font_8h_source.html @@ -0,0 +1,3165 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives_font.h Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_gfxPrimitives_font.h
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_gfxPrimitives_font.h: 8x8 font definition
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #define GFX_FONTDATAMAX (8*256)
+
31 
+
32 static unsigned char gfxPrimitivesFontdata[GFX_FONTDATAMAX] = {
+
33 
+
34  /*
+
35  * 0 0x00 '^@'
+
36  */
+
37  0x00, /* 00000000 */
+
38  0x00, /* 00000000 */
+
39  0x00, /* 00000000 */
+
40  0x00, /* 00000000 */
+
41  0x00, /* 00000000 */
+
42  0x00, /* 00000000 */
+
43  0x00, /* 00000000 */
+
44  0x00, /* 00000000 */
+
45 
+
46  /*
+
47  * 1 0x01 '^A'
+
48  */
+
49  0x7e, /* 01111110 */
+
50  0x81, /* 10000001 */
+
51  0xa5, /* 10100101 */
+
52  0x81, /* 10000001 */
+
53  0xbd, /* 10111101 */
+
54  0x99, /* 10011001 */
+
55  0x81, /* 10000001 */
+
56  0x7e, /* 01111110 */
+
57 
+
58  /*
+
59  * 2 0x02 '^B'
+
60  */
+
61  0x7e, /* 01111110 */
+
62  0xff, /* 11111111 */
+
63  0xdb, /* 11011011 */
+
64  0xff, /* 11111111 */
+
65  0xc3, /* 11000011 */
+
66  0xe7, /* 11100111 */
+
67  0xff, /* 11111111 */
+
68  0x7e, /* 01111110 */
+
69 
+
70  /*
+
71  * 3 0x03 '^C'
+
72  */
+
73  0x6c, /* 01101100 */
+
74  0xfe, /* 11111110 */
+
75  0xfe, /* 11111110 */
+
76  0xfe, /* 11111110 */
+
77  0x7c, /* 01111100 */
+
78  0x38, /* 00111000 */
+
79  0x10, /* 00010000 */
+
80  0x00, /* 00000000 */
+
81 
+
82  /*
+
83  * 4 0x04 '^D'
+
84  */
+
85  0x10, /* 00010000 */
+
86  0x38, /* 00111000 */
+
87  0x7c, /* 01111100 */
+
88  0xfe, /* 11111110 */
+
89  0x7c, /* 01111100 */
+
90  0x38, /* 00111000 */
+
91  0x10, /* 00010000 */
+
92  0x00, /* 00000000 */
+
93 
+
94  /*
+
95  * 5 0x05 '^E'
+
96  */
+
97  0x38, /* 00111000 */
+
98  0x7c, /* 01111100 */
+
99  0x38, /* 00111000 */
+
100  0xfe, /* 11111110 */
+
101  0xfe, /* 11111110 */
+
102  0xd6, /* 11010110 */
+
103  0x10, /* 00010000 */
+
104  0x38, /* 00111000 */
+
105 
+
106  /*
+
107  * 6 0x06 '^F'
+
108  */
+
109  0x10, /* 00010000 */
+
110  0x38, /* 00111000 */
+
111  0x7c, /* 01111100 */
+
112  0xfe, /* 11111110 */
+
113  0xfe, /* 11111110 */
+
114  0x7c, /* 01111100 */
+
115  0x10, /* 00010000 */
+
116  0x38, /* 00111000 */
+
117 
+
118  /*
+
119  * 7 0x07 '^G'
+
120  */
+
121  0x00, /* 00000000 */
+
122  0x00, /* 00000000 */
+
123  0x18, /* 00011000 */
+
124  0x3c, /* 00111100 */
+
125  0x3c, /* 00111100 */
+
126  0x18, /* 00011000 */
+
127  0x00, /* 00000000 */
+
128  0x00, /* 00000000 */
+
129 
+
130  /*
+
131  * 8 0x08 '^H'
+
132  */
+
133  0xff, /* 11111111 */
+
134  0xff, /* 11111111 */
+
135  0xe7, /* 11100111 */
+
136  0xc3, /* 11000011 */
+
137  0xc3, /* 11000011 */
+
138  0xe7, /* 11100111 */
+
139  0xff, /* 11111111 */
+
140  0xff, /* 11111111 */
+
141 
+
142  /*
+
143  * 9 0x09 '^I'
+
144  */
+
145  0x00, /* 00000000 */
+
146  0x3c, /* 00111100 */
+
147  0x66, /* 01100110 */
+
148  0x42, /* 01000010 */
+
149  0x42, /* 01000010 */
+
150  0x66, /* 01100110 */
+
151  0x3c, /* 00111100 */
+
152  0x00, /* 00000000 */
+
153 
+
154  /*
+
155  * 10 0x0a '^J'
+
156  */
+
157  0xff, /* 11111111 */
+
158  0xc3, /* 11000011 */
+
159  0x99, /* 10011001 */
+
160  0xbd, /* 10111101 */
+
161  0xbd, /* 10111101 */
+
162  0x99, /* 10011001 */
+
163  0xc3, /* 11000011 */
+
164  0xff, /* 11111111 */
+
165 
+
166  /*
+
167  * 11 0x0b '^K'
+
168  */
+
169  0x0f, /* 00001111 */
+
170  0x07, /* 00000111 */
+
171  0x0f, /* 00001111 */
+
172  0x7d, /* 01111101 */
+
173  0xcc, /* 11001100 */
+
174  0xcc, /* 11001100 */
+
175  0xcc, /* 11001100 */
+
176  0x78, /* 01111000 */
+
177 
+
178  /*
+
179  * 12 0x0c '^L'
+
180  */
+
181  0x3c, /* 00111100 */
+
182  0x66, /* 01100110 */
+
183  0x66, /* 01100110 */
+
184  0x66, /* 01100110 */
+
185  0x3c, /* 00111100 */
+
186  0x18, /* 00011000 */
+
187  0x7e, /* 01111110 */
+
188  0x18, /* 00011000 */
+
189 
+
190  /*
+
191  * 13 0x0d '^M'
+
192  */
+
193  0x3f, /* 00111111 */
+
194  0x33, /* 00110011 */
+
195  0x3f, /* 00111111 */
+
196  0x30, /* 00110000 */
+
197  0x30, /* 00110000 */
+
198  0x70, /* 01110000 */
+
199  0xf0, /* 11110000 */
+
200  0xe0, /* 11100000 */
+
201 
+
202  /*
+
203  * 14 0x0e '^N'
+
204  */
+
205  0x7f, /* 01111111 */
+
206  0x63, /* 01100011 */
+
207  0x7f, /* 01111111 */
+
208  0x63, /* 01100011 */
+
209  0x63, /* 01100011 */
+
210  0x67, /* 01100111 */
+
211  0xe6, /* 11100110 */
+
212  0xc0, /* 11000000 */
+
213 
+
214  /*
+
215  * 15 0x0f '^O'
+
216  */
+
217  0x18, /* 00011000 */
+
218  0xdb, /* 11011011 */
+
219  0x3c, /* 00111100 */
+
220  0xe7, /* 11100111 */
+
221  0xe7, /* 11100111 */
+
222  0x3c, /* 00111100 */
+
223  0xdb, /* 11011011 */
+
224  0x18, /* 00011000 */
+
225 
+
226  /*
+
227  * 16 0x10 '^P'
+
228  */
+
229  0x80, /* 10000000 */
+
230  0xe0, /* 11100000 */
+
231  0xf8, /* 11111000 */
+
232  0xfe, /* 11111110 */
+
233  0xf8, /* 11111000 */
+
234  0xe0, /* 11100000 */
+
235  0x80, /* 10000000 */
+
236  0x00, /* 00000000 */
+
237 
+
238  /*
+
239  * 17 0x11 '^Q'
+
240  */
+
241  0x02, /* 00000010 */
+
242  0x0e, /* 00001110 */
+
243  0x3e, /* 00111110 */
+
244  0xfe, /* 11111110 */
+
245  0x3e, /* 00111110 */
+
246  0x0e, /* 00001110 */
+
247  0x02, /* 00000010 */
+
248  0x00, /* 00000000 */
+
249 
+
250  /*
+
251  * 18 0x12 '^R'
+
252  */
+
253  0x18, /* 00011000 */
+
254  0x3c, /* 00111100 */
+
255  0x7e, /* 01111110 */
+
256  0x18, /* 00011000 */
+
257  0x18, /* 00011000 */
+
258  0x7e, /* 01111110 */
+
259  0x3c, /* 00111100 */
+
260  0x18, /* 00011000 */
+
261 
+
262  /*
+
263  * 19 0x13 '^S'
+
264  */
+
265  0x66, /* 01100110 */
+
266  0x66, /* 01100110 */
+
267  0x66, /* 01100110 */
+
268  0x66, /* 01100110 */
+
269  0x66, /* 01100110 */
+
270  0x00, /* 00000000 */
+
271  0x66, /* 01100110 */
+
272  0x00, /* 00000000 */
+
273 
+
274  /*
+
275  * 20 0x14 '^T'
+
276  */
+
277  0x7f, /* 01111111 */
+
278  0xdb, /* 11011011 */
+
279  0xdb, /* 11011011 */
+
280  0x7b, /* 01111011 */
+
281  0x1b, /* 00011011 */
+
282  0x1b, /* 00011011 */
+
283  0x1b, /* 00011011 */
+
284  0x00, /* 00000000 */
+
285 
+
286  /*
+
287  * 21 0x15 '^U'
+
288  */
+
289  0x3e, /* 00111110 */
+
290  0x61, /* 01100001 */
+
291  0x3c, /* 00111100 */
+
292  0x66, /* 01100110 */
+
293  0x66, /* 01100110 */
+
294  0x3c, /* 00111100 */
+
295  0x86, /* 10000110 */
+
296  0x7c, /* 01111100 */
+
297 
+
298  /*
+
299  * 22 0x16 '^V'
+
300  */
+
301  0x00, /* 00000000 */
+
302  0x00, /* 00000000 */
+
303  0x00, /* 00000000 */
+
304  0x00, /* 00000000 */
+
305  0x7e, /* 01111110 */
+
306  0x7e, /* 01111110 */
+
307  0x7e, /* 01111110 */
+
308  0x00, /* 00000000 */
+
309 
+
310  /*
+
311  * 23 0x17 '^W'
+
312  */
+
313  0x18, /* 00011000 */
+
314  0x3c, /* 00111100 */
+
315  0x7e, /* 01111110 */
+
316  0x18, /* 00011000 */
+
317  0x7e, /* 01111110 */
+
318  0x3c, /* 00111100 */
+
319  0x18, /* 00011000 */
+
320  0xff, /* 11111111 */
+
321 
+
322  /*
+
323  * 24 0x18 '^X'
+
324  */
+
325  0x18, /* 00011000 */
+
326  0x3c, /* 00111100 */
+
327  0x7e, /* 01111110 */
+
328  0x18, /* 00011000 */
+
329  0x18, /* 00011000 */
+
330  0x18, /* 00011000 */
+
331  0x18, /* 00011000 */
+
332  0x00, /* 00000000 */
+
333 
+
334  /*
+
335  * 25 0x19 '^Y'
+
336  */
+
337  0x18, /* 00011000 */
+
338  0x18, /* 00011000 */
+
339  0x18, /* 00011000 */
+
340  0x18, /* 00011000 */
+
341  0x7e, /* 01111110 */
+
342  0x3c, /* 00111100 */
+
343  0x18, /* 00011000 */
+
344  0x00, /* 00000000 */
+
345 
+
346  /*
+
347  * 26 0x1a '^Z'
+
348  */
+
349  0x00, /* 00000000 */
+
350  0x18, /* 00011000 */
+
351  0x0c, /* 00001100 */
+
352  0xfe, /* 11111110 */
+
353  0x0c, /* 00001100 */
+
354  0x18, /* 00011000 */
+
355  0x00, /* 00000000 */
+
356  0x00, /* 00000000 */
+
357 
+
358  /*
+
359  * 27 0x1b '^['
+
360  */
+
361  0x00, /* 00000000 */
+
362  0x30, /* 00110000 */
+
363  0x60, /* 01100000 */
+
364  0xfe, /* 11111110 */
+
365  0x60, /* 01100000 */
+
366  0x30, /* 00110000 */
+
367  0x00, /* 00000000 */
+
368  0x00, /* 00000000 */
+
369 
+
370  /*
+
371  * 28 0x1c '^\'
+
372  */
+
373  0x00, /* 00000000 */
+
374  0x00, /* 00000000 */
+
375  0xc0, /* 11000000 */
+
376  0xc0, /* 11000000 */
+
377  0xc0, /* 11000000 */
+
378  0xfe, /* 11111110 */
+
379  0x00, /* 00000000 */
+
380  0x00, /* 00000000 */
+
381 
+
382  /*
+
383  * 29 0x1d '^]'
+
384  */
+
385  0x00, /* 00000000 */
+
386  0x24, /* 00100100 */
+
387  0x66, /* 01100110 */
+
388  0xff, /* 11111111 */
+
389  0x66, /* 01100110 */
+
390  0x24, /* 00100100 */
+
391  0x00, /* 00000000 */
+
392  0x00, /* 00000000 */
+
393 
+
394  /*
+
395  * 30 0x1e '^^'
+
396  */
+
397  0x00, /* 00000000 */
+
398  0x18, /* 00011000 */
+
399  0x3c, /* 00111100 */
+
400  0x7e, /* 01111110 */
+
401  0xff, /* 11111111 */
+
402  0xff, /* 11111111 */
+
403  0x00, /* 00000000 */
+
404  0x00, /* 00000000 */
+
405 
+
406  /*
+
407  * 31 0x1f '^_'
+
408  */
+
409  0x00, /* 00000000 */
+
410  0xff, /* 11111111 */
+
411  0xff, /* 11111111 */
+
412  0x7e, /* 01111110 */
+
413  0x3c, /* 00111100 */
+
414  0x18, /* 00011000 */
+
415  0x00, /* 00000000 */
+
416  0x00, /* 00000000 */
+
417 
+
418  /*
+
419  * 32 0x20 ' '
+
420  */
+
421  0x00, /* 00000000 */
+
422  0x00, /* 00000000 */
+
423  0x00, /* 00000000 */
+
424  0x00, /* 00000000 */
+
425  0x00, /* 00000000 */
+
426  0x00, /* 00000000 */
+
427  0x00, /* 00000000 */
+
428  0x00, /* 00000000 */
+
429 
+
430  /*
+
431  * 33 0x21 '!'
+
432  */
+
433  0x18, /* 00011000 */
+
434  0x3c, /* 00111100 */
+
435  0x3c, /* 00111100 */
+
436  0x18, /* 00011000 */
+
437  0x18, /* 00011000 */
+
438  0x00, /* 00000000 */
+
439  0x18, /* 00011000 */
+
440  0x00, /* 00000000 */
+
441 
+
442  /*
+
443  * 34 0x22 '"'
+
444  */
+
445  0x66, /* 01100110 */
+
446  0x66, /* 01100110 */
+
447  0x24, /* 00100100 */
+
448  0x00, /* 00000000 */
+
449  0x00, /* 00000000 */
+
450  0x00, /* 00000000 */
+
451  0x00, /* 00000000 */
+
452  0x00, /* 00000000 */
+
453 
+
454  /*
+
455  * 35 0x23 '#'
+
456  */
+
457  0x6c, /* 01101100 */
+
458  0x6c, /* 01101100 */
+
459  0xfe, /* 11111110 */
+
460  0x6c, /* 01101100 */
+
461  0xfe, /* 11111110 */
+
462  0x6c, /* 01101100 */
+
463  0x6c, /* 01101100 */
+
464  0x00, /* 00000000 */
+
465 
+
466  /*
+
467  * 36 0x24 '$'
+
468  */
+
469  0x18, /* 00011000 */
+
470  0x3e, /* 00111110 */
+
471  0x60, /* 01100000 */
+
472  0x3c, /* 00111100 */
+
473  0x06, /* 00000110 */
+
474  0x7c, /* 01111100 */
+
475  0x18, /* 00011000 */
+
476  0x00, /* 00000000 */
+
477 
+
478  /*
+
479  * 37 0x25 '%'
+
480  */
+
481  0x00, /* 00000000 */
+
482  0xc6, /* 11000110 */
+
483  0xcc, /* 11001100 */
+
484  0x18, /* 00011000 */
+
485  0x30, /* 00110000 */
+
486  0x66, /* 01100110 */
+
487  0xc6, /* 11000110 */
+
488  0x00, /* 00000000 */
+
489 
+
490  /*
+
491  * 38 0x26 '&'
+
492  */
+
493  0x38, /* 00111000 */
+
494  0x6c, /* 01101100 */
+
495  0x38, /* 00111000 */
+
496  0x76, /* 01110110 */
+
497  0xdc, /* 11011100 */
+
498  0xcc, /* 11001100 */
+
499  0x76, /* 01110110 */
+
500  0x00, /* 00000000 */
+
501 
+
502  /*
+
503  * 39 0x27 '''
+
504  */
+
505  0x18, /* 00011000 */
+
506  0x18, /* 00011000 */
+
507  0x30, /* 00110000 */
+
508  0x00, /* 00000000 */
+
509  0x00, /* 00000000 */
+
510  0x00, /* 00000000 */
+
511  0x00, /* 00000000 */
+
512  0x00, /* 00000000 */
+
513 
+
514  /*
+
515  * 40 0x28 '('
+
516  */
+
517  0x0c, /* 00001100 */
+
518  0x18, /* 00011000 */
+
519  0x30, /* 00110000 */
+
520  0x30, /* 00110000 */
+
521  0x30, /* 00110000 */
+
522  0x18, /* 00011000 */
+
523  0x0c, /* 00001100 */
+
524  0x00, /* 00000000 */
+
525 
+
526  /*
+
527  * 41 0x29 ')'
+
528  */
+
529  0x30, /* 00110000 */
+
530  0x18, /* 00011000 */
+
531  0x0c, /* 00001100 */
+
532  0x0c, /* 00001100 */
+
533  0x0c, /* 00001100 */
+
534  0x18, /* 00011000 */
+
535  0x30, /* 00110000 */
+
536  0x00, /* 00000000 */
+
537 
+
538  /*
+
539  * 42 0x2a '*'
+
540  */
+
541  0x00, /* 00000000 */
+
542  0x66, /* 01100110 */
+
543  0x3c, /* 00111100 */
+
544  0xff, /* 11111111 */
+
545  0x3c, /* 00111100 */
+
546  0x66, /* 01100110 */
+
547  0x00, /* 00000000 */
+
548  0x00, /* 00000000 */
+
549 
+
550  /*
+
551  * 43 0x2b '+'
+
552  */
+
553  0x00, /* 00000000 */
+
554  0x18, /* 00011000 */
+
555  0x18, /* 00011000 */
+
556  0x7e, /* 01111110 */
+
557  0x18, /* 00011000 */
+
558  0x18, /* 00011000 */
+
559  0x00, /* 00000000 */
+
560  0x00, /* 00000000 */
+
561 
+
562  /*
+
563  * 44 0x2c ','
+
564  */
+
565  0x00, /* 00000000 */
+
566  0x00, /* 00000000 */
+
567  0x00, /* 00000000 */
+
568  0x00, /* 00000000 */
+
569  0x00, /* 00000000 */
+
570  0x18, /* 00011000 */
+
571  0x18, /* 00011000 */
+
572  0x30, /* 00110000 */
+
573 
+
574  /*
+
575  * 45 0x2d '-'
+
576  */
+
577  0x00, /* 00000000 */
+
578  0x00, /* 00000000 */
+
579  0x00, /* 00000000 */
+
580  0x7e, /* 01111110 */
+
581  0x00, /* 00000000 */
+
582  0x00, /* 00000000 */
+
583  0x00, /* 00000000 */
+
584  0x00, /* 00000000 */
+
585 
+
586  /*
+
587  * 46 0x2e '.'
+
588  */
+
589  0x00, /* 00000000 */
+
590  0x00, /* 00000000 */
+
591  0x00, /* 00000000 */
+
592  0x00, /* 00000000 */
+
593  0x00, /* 00000000 */
+
594  0x18, /* 00011000 */
+
595  0x18, /* 00011000 */
+
596  0x00, /* 00000000 */
+
597 
+
598  /*
+
599  * 47 0x2f '/'
+
600  */
+
601  0x06, /* 00000110 */
+
602  0x0c, /* 00001100 */
+
603  0x18, /* 00011000 */
+
604  0x30, /* 00110000 */
+
605  0x60, /* 01100000 */
+
606  0xc0, /* 11000000 */
+
607  0x80, /* 10000000 */
+
608  0x00, /* 00000000 */
+
609 
+
610  /*
+
611  * 48 0x30 '0'
+
612  */
+
613  0x38, /* 00111000 */
+
614  0x6c, /* 01101100 */
+
615  0xc6, /* 11000110 */
+
616  0xd6, /* 11010110 */
+
617  0xc6, /* 11000110 */
+
618  0x6c, /* 01101100 */
+
619  0x38, /* 00111000 */
+
620  0x00, /* 00000000 */
+
621 
+
622  /*
+
623  * 49 0x31 '1'
+
624  */
+
625  0x18, /* 00011000 */
+
626  0x38, /* 00111000 */
+
627  0x18, /* 00011000 */
+
628  0x18, /* 00011000 */
+
629  0x18, /* 00011000 */
+
630  0x18, /* 00011000 */
+
631  0x7e, /* 01111110 */
+
632  0x00, /* 00000000 */
+
633 
+
634  /*
+
635  * 50 0x32 '2'
+
636  */
+
637  0x7c, /* 01111100 */
+
638  0xc6, /* 11000110 */
+
639  0x06, /* 00000110 */
+
640  0x1c, /* 00011100 */
+
641  0x30, /* 00110000 */
+
642  0x66, /* 01100110 */
+
643  0xfe, /* 11111110 */
+
644  0x00, /* 00000000 */
+
645 
+
646  /*
+
647  * 51 0x33 '3'
+
648  */
+
649  0x7c, /* 01111100 */
+
650  0xc6, /* 11000110 */
+
651  0x06, /* 00000110 */
+
652  0x3c, /* 00111100 */
+
653  0x06, /* 00000110 */
+
654  0xc6, /* 11000110 */
+
655  0x7c, /* 01111100 */
+
656  0x00, /* 00000000 */
+
657 
+
658  /*
+
659  * 52 0x34 '4'
+
660  */
+
661  0x1c, /* 00011100 */
+
662  0x3c, /* 00111100 */
+
663  0x6c, /* 01101100 */
+
664  0xcc, /* 11001100 */
+
665  0xfe, /* 11111110 */
+
666  0x0c, /* 00001100 */
+
667  0x1e, /* 00011110 */
+
668  0x00, /* 00000000 */
+
669 
+
670  /*
+
671  * 53 0x35 '5'
+
672  */
+
673  0xfe, /* 11111110 */
+
674  0xc0, /* 11000000 */
+
675  0xc0, /* 11000000 */
+
676  0xfc, /* 11111100 */
+
677  0x06, /* 00000110 */
+
678  0xc6, /* 11000110 */
+
679  0x7c, /* 01111100 */
+
680  0x00, /* 00000000 */
+
681 
+
682  /*
+
683  * 54 0x36 '6'
+
684  */
+
685  0x38, /* 00111000 */
+
686  0x60, /* 01100000 */
+
687  0xc0, /* 11000000 */
+
688  0xfc, /* 11111100 */
+
689  0xc6, /* 11000110 */
+
690  0xc6, /* 11000110 */
+
691  0x7c, /* 01111100 */
+
692  0x00, /* 00000000 */
+
693 
+
694  /*
+
695  * 55 0x37 '7'
+
696  */
+
697  0xfe, /* 11111110 */
+
698  0xc6, /* 11000110 */
+
699  0x0c, /* 00001100 */
+
700  0x18, /* 00011000 */
+
701  0x30, /* 00110000 */
+
702  0x30, /* 00110000 */
+
703  0x30, /* 00110000 */
+
704  0x00, /* 00000000 */
+
705 
+
706  /*
+
707  * 56 0x38 '8'
+
708  */
+
709  0x7c, /* 01111100 */
+
710  0xc6, /* 11000110 */
+
711  0xc6, /* 11000110 */
+
712  0x7c, /* 01111100 */
+
713  0xc6, /* 11000110 */
+
714  0xc6, /* 11000110 */
+
715  0x7c, /* 01111100 */
+
716  0x00, /* 00000000 */
+
717 
+
718  /*
+
719  * 57 0x39 '9'
+
720  */
+
721  0x7c, /* 01111100 */
+
722  0xc6, /* 11000110 */
+
723  0xc6, /* 11000110 */
+
724  0x7e, /* 01111110 */
+
725  0x06, /* 00000110 */
+
726  0x0c, /* 00001100 */
+
727  0x78, /* 01111000 */
+
728  0x00, /* 00000000 */
+
729 
+
730  /*
+
731  * 58 0x3a ':'
+
732  */
+
733  0x00, /* 00000000 */
+
734  0x18, /* 00011000 */
+
735  0x18, /* 00011000 */
+
736  0x00, /* 00000000 */
+
737  0x00, /* 00000000 */
+
738  0x18, /* 00011000 */
+
739  0x18, /* 00011000 */
+
740  0x00, /* 00000000 */
+
741 
+
742  /*
+
743  * 59 0x3b ';'
+
744  */
+
745  0x00, /* 00000000 */
+
746  0x18, /* 00011000 */
+
747  0x18, /* 00011000 */
+
748  0x00, /* 00000000 */
+
749  0x00, /* 00000000 */
+
750  0x18, /* 00011000 */
+
751  0x18, /* 00011000 */
+
752  0x30, /* 00110000 */
+
753 
+
754  /*
+
755  * 60 0x3c '<'
+
756  */
+
757  0x06, /* 00000110 */
+
758  0x0c, /* 00001100 */
+
759  0x18, /* 00011000 */
+
760  0x30, /* 00110000 */
+
761  0x18, /* 00011000 */
+
762  0x0c, /* 00001100 */
+
763  0x06, /* 00000110 */
+
764  0x00, /* 00000000 */
+
765 
+
766  /*
+
767  * 61 0x3d '='
+
768  */
+
769  0x00, /* 00000000 */
+
770  0x00, /* 00000000 */
+
771  0x7e, /* 01111110 */
+
772  0x00, /* 00000000 */
+
773  0x00, /* 00000000 */
+
774  0x7e, /* 01111110 */
+
775  0x00, /* 00000000 */
+
776  0x00, /* 00000000 */
+
777 
+
778  /*
+
779  * 62 0x3e '>'
+
780  */
+
781  0x60, /* 01100000 */
+
782  0x30, /* 00110000 */
+
783  0x18, /* 00011000 */
+
784  0x0c, /* 00001100 */
+
785  0x18, /* 00011000 */
+
786  0x30, /* 00110000 */
+
787  0x60, /* 01100000 */
+
788  0x00, /* 00000000 */
+
789 
+
790  /*
+
791  * 63 0x3f '?'
+
792  */
+
793  0x7c, /* 01111100 */
+
794  0xc6, /* 11000110 */
+
795  0x0c, /* 00001100 */
+
796  0x18, /* 00011000 */
+
797  0x18, /* 00011000 */
+
798  0x00, /* 00000000 */
+
799  0x18, /* 00011000 */
+
800  0x00, /* 00000000 */
+
801 
+
802  /*
+
803  * 64 0x40 '@'
+
804  */
+
805  0x7c, /* 01111100 */
+
806  0xc6, /* 11000110 */
+
807  0xde, /* 11011110 */
+
808  0xde, /* 11011110 */
+
809  0xde, /* 11011110 */
+
810  0xc0, /* 11000000 */
+
811  0x78, /* 01111000 */
+
812  0x00, /* 00000000 */
+
813 
+
814  /*
+
815  * 65 0x41 'A'
+
816  */
+
817  0x38, /* 00111000 */
+
818  0x6c, /* 01101100 */
+
819  0xc6, /* 11000110 */
+
820  0xfe, /* 11111110 */
+
821  0xc6, /* 11000110 */
+
822  0xc6, /* 11000110 */
+
823  0xc6, /* 11000110 */
+
824  0x00, /* 00000000 */
+
825 
+
826  /*
+
827  * 66 0x42 'B'
+
828  */
+
829  0xfc, /* 11111100 */
+
830  0x66, /* 01100110 */
+
831  0x66, /* 01100110 */
+
832  0x7c, /* 01111100 */
+
833  0x66, /* 01100110 */
+
834  0x66, /* 01100110 */
+
835  0xfc, /* 11111100 */
+
836  0x00, /* 00000000 */
+
837 
+
838  /*
+
839  * 67 0x43 'C'
+
840  */
+
841  0x3c, /* 00111100 */
+
842  0x66, /* 01100110 */
+
843  0xc0, /* 11000000 */
+
844  0xc0, /* 11000000 */
+
845  0xc0, /* 11000000 */
+
846  0x66, /* 01100110 */
+
847  0x3c, /* 00111100 */
+
848  0x00, /* 00000000 */
+
849 
+
850  /*
+
851  * 68 0x44 'D'
+
852  */
+
853  0xf8, /* 11111000 */
+
854  0x6c, /* 01101100 */
+
855  0x66, /* 01100110 */
+
856  0x66, /* 01100110 */
+
857  0x66, /* 01100110 */
+
858  0x6c, /* 01101100 */
+
859  0xf8, /* 11111000 */
+
860  0x00, /* 00000000 */
+
861 
+
862  /*
+
863  * 69 0x45 'E'
+
864  */
+
865  0xfe, /* 11111110 */
+
866  0x62, /* 01100010 */
+
867  0x68, /* 01101000 */
+
868  0x78, /* 01111000 */
+
869  0x68, /* 01101000 */
+
870  0x62, /* 01100010 */
+
871  0xfe, /* 11111110 */
+
872  0x00, /* 00000000 */
+
873 
+
874  /*
+
875  * 70 0x46 'F'
+
876  */
+
877  0xfe, /* 11111110 */
+
878  0x62, /* 01100010 */
+
879  0x68, /* 01101000 */
+
880  0x78, /* 01111000 */
+
881  0x68, /* 01101000 */
+
882  0x60, /* 01100000 */
+
883  0xf0, /* 11110000 */
+
884  0x00, /* 00000000 */
+
885 
+
886  /*
+
887  * 71 0x47 'G'
+
888  */
+
889  0x3c, /* 00111100 */
+
890  0x66, /* 01100110 */
+
891  0xc0, /* 11000000 */
+
892  0xc0, /* 11000000 */
+
893  0xce, /* 11001110 */
+
894  0x66, /* 01100110 */
+
895  0x3a, /* 00111010 */
+
896  0x00, /* 00000000 */
+
897 
+
898  /*
+
899  * 72 0x48 'H'
+
900  */
+
901  0xc6, /* 11000110 */
+
902  0xc6, /* 11000110 */
+
903  0xc6, /* 11000110 */
+
904  0xfe, /* 11111110 */
+
905  0xc6, /* 11000110 */
+
906  0xc6, /* 11000110 */
+
907  0xc6, /* 11000110 */
+
908  0x00, /* 00000000 */
+
909 
+
910  /*
+
911  * 73 0x49 'I'
+
912  */
+
913  0x3c, /* 00111100 */
+
914  0x18, /* 00011000 */
+
915  0x18, /* 00011000 */
+
916  0x18, /* 00011000 */
+
917  0x18, /* 00011000 */
+
918  0x18, /* 00011000 */
+
919  0x3c, /* 00111100 */
+
920  0x00, /* 00000000 */
+
921 
+
922  /*
+
923  * 74 0x4a 'J'
+
924  */
+
925  0x1e, /* 00011110 */
+
926  0x0c, /* 00001100 */
+
927  0x0c, /* 00001100 */
+
928  0x0c, /* 00001100 */
+
929  0xcc, /* 11001100 */
+
930  0xcc, /* 11001100 */
+
931  0x78, /* 01111000 */
+
932  0x00, /* 00000000 */
+
933 
+
934  /*
+
935  * 75 0x4b 'K'
+
936  */
+
937  0xe6, /* 11100110 */
+
938  0x66, /* 01100110 */
+
939  0x6c, /* 01101100 */
+
940  0x78, /* 01111000 */
+
941  0x6c, /* 01101100 */
+
942  0x66, /* 01100110 */
+
943  0xe6, /* 11100110 */
+
944  0x00, /* 00000000 */
+
945 
+
946  /*
+
947  * 76 0x4c 'L'
+
948  */
+
949  0xf0, /* 11110000 */
+
950  0x60, /* 01100000 */
+
951  0x60, /* 01100000 */
+
952  0x60, /* 01100000 */
+
953  0x62, /* 01100010 */
+
954  0x66, /* 01100110 */
+
955  0xfe, /* 11111110 */
+
956  0x00, /* 00000000 */
+
957 
+
958  /*
+
959  * 77 0x4d 'M'
+
960  */
+
961  0xc6, /* 11000110 */
+
962  0xee, /* 11101110 */
+
963  0xfe, /* 11111110 */
+
964  0xfe, /* 11111110 */
+
965  0xd6, /* 11010110 */
+
966  0xc6, /* 11000110 */
+
967  0xc6, /* 11000110 */
+
968  0x00, /* 00000000 */
+
969 
+
970  /*
+
971  * 78 0x4e 'N'
+
972  */
+
973  0xc6, /* 11000110 */
+
974  0xe6, /* 11100110 */
+
975  0xf6, /* 11110110 */
+
976  0xde, /* 11011110 */
+
977  0xce, /* 11001110 */
+
978  0xc6, /* 11000110 */
+
979  0xc6, /* 11000110 */
+
980  0x00, /* 00000000 */
+
981 
+
982  /*
+
983  * 79 0x4f 'O'
+
984  */
+
985  0x7c, /* 01111100 */
+
986  0xc6, /* 11000110 */
+
987  0xc6, /* 11000110 */
+
988  0xc6, /* 11000110 */
+
989  0xc6, /* 11000110 */
+
990  0xc6, /* 11000110 */
+
991  0x7c, /* 01111100 */
+
992  0x00, /* 00000000 */
+
993 
+
994  /*
+
995  * 80 0x50 'P'
+
996  */
+
997  0xfc, /* 11111100 */
+
998  0x66, /* 01100110 */
+
999  0x66, /* 01100110 */
+
1000  0x7c, /* 01111100 */
+
1001  0x60, /* 01100000 */
+
1002  0x60, /* 01100000 */
+
1003  0xf0, /* 11110000 */
+
1004  0x00, /* 00000000 */
+
1005 
+
1006  /*
+
1007  * 81 0x51 'Q'
+
1008  */
+
1009  0x7c, /* 01111100 */
+
1010  0xc6, /* 11000110 */
+
1011  0xc6, /* 11000110 */
+
1012  0xc6, /* 11000110 */
+
1013  0xc6, /* 11000110 */
+
1014  0xce, /* 11001110 */
+
1015  0x7c, /* 01111100 */
+
1016  0x0e, /* 00001110 */
+
1017 
+
1018  /*
+
1019  * 82 0x52 'R'
+
1020  */
+
1021  0xfc, /* 11111100 */
+
1022  0x66, /* 01100110 */
+
1023  0x66, /* 01100110 */
+
1024  0x7c, /* 01111100 */
+
1025  0x6c, /* 01101100 */
+
1026  0x66, /* 01100110 */
+
1027  0xe6, /* 11100110 */
+
1028  0x00, /* 00000000 */
+
1029 
+
1030  /*
+
1031  * 83 0x53 'S'
+
1032  */
+
1033  0x3c, /* 00111100 */
+
1034  0x66, /* 01100110 */
+
1035  0x30, /* 00110000 */
+
1036  0x18, /* 00011000 */
+
1037  0x0c, /* 00001100 */
+
1038  0x66, /* 01100110 */
+
1039  0x3c, /* 00111100 */
+
1040  0x00, /* 00000000 */
+
1041 
+
1042  /*
+
1043  * 84 0x54 'T'
+
1044  */
+
1045  0x7e, /* 01111110 */
+
1046  0x7e, /* 01111110 */
+
1047  0x5a, /* 01011010 */
+
1048  0x18, /* 00011000 */
+
1049  0x18, /* 00011000 */
+
1050  0x18, /* 00011000 */
+
1051  0x3c, /* 00111100 */
+
1052  0x00, /* 00000000 */
+
1053 
+
1054  /*
+
1055  * 85 0x55 'U'
+
1056  */
+
1057  0xc6, /* 11000110 */
+
1058  0xc6, /* 11000110 */
+
1059  0xc6, /* 11000110 */
+
1060  0xc6, /* 11000110 */
+
1061  0xc6, /* 11000110 */
+
1062  0xc6, /* 11000110 */
+
1063  0x7c, /* 01111100 */
+
1064  0x00, /* 00000000 */
+
1065 
+
1066  /*
+
1067  * 86 0x56 'V'
+
1068  */
+
1069  0xc6, /* 11000110 */
+
1070  0xc6, /* 11000110 */
+
1071  0xc6, /* 11000110 */
+
1072  0xc6, /* 11000110 */
+
1073  0xc6, /* 11000110 */
+
1074  0x6c, /* 01101100 */
+
1075  0x38, /* 00111000 */
+
1076  0x00, /* 00000000 */
+
1077 
+
1078  /*
+
1079  * 87 0x57 'W'
+
1080  */
+
1081  0xc6, /* 11000110 */
+
1082  0xc6, /* 11000110 */
+
1083  0xc6, /* 11000110 */
+
1084  0xd6, /* 11010110 */
+
1085  0xd6, /* 11010110 */
+
1086  0xfe, /* 11111110 */
+
1087  0x6c, /* 01101100 */
+
1088  0x00, /* 00000000 */
+
1089 
+
1090  /*
+
1091  * 88 0x58 'X'
+
1092  */
+
1093  0xc6, /* 11000110 */
+
1094  0xc6, /* 11000110 */
+
1095  0x6c, /* 01101100 */
+
1096  0x38, /* 00111000 */
+
1097  0x6c, /* 01101100 */
+
1098  0xc6, /* 11000110 */
+
1099  0xc6, /* 11000110 */
+
1100  0x00, /* 00000000 */
+
1101 
+
1102  /*
+
1103  * 89 0x59 'Y'
+
1104  */
+
1105  0x66, /* 01100110 */
+
1106  0x66, /* 01100110 */
+
1107  0x66, /* 01100110 */
+
1108  0x3c, /* 00111100 */
+
1109  0x18, /* 00011000 */
+
1110  0x18, /* 00011000 */
+
1111  0x3c, /* 00111100 */
+
1112  0x00, /* 00000000 */
+
1113 
+
1114  /*
+
1115  * 90 0x5a 'Z'
+
1116  */
+
1117  0xfe, /* 11111110 */
+
1118  0xc6, /* 11000110 */
+
1119  0x8c, /* 10001100 */
+
1120  0x18, /* 00011000 */
+
1121  0x32, /* 00110010 */
+
1122  0x66, /* 01100110 */
+
1123  0xfe, /* 11111110 */
+
1124  0x00, /* 00000000 */
+
1125 
+
1126  /*
+
1127  * 91 0x5b '['
+
1128  */
+
1129  0x3c, /* 00111100 */
+
1130  0x30, /* 00110000 */
+
1131  0x30, /* 00110000 */
+
1132  0x30, /* 00110000 */
+
1133  0x30, /* 00110000 */
+
1134  0x30, /* 00110000 */
+
1135  0x3c, /* 00111100 */
+
1136  0x00, /* 00000000 */
+
1137 
+
1138  /*
+
1139  * 92 0x5c '\'
+
1140  */
+
1141  0xc0, /* 11000000 */
+
1142  0x60, /* 01100000 */
+
1143  0x30, /* 00110000 */
+
1144  0x18, /* 00011000 */
+
1145  0x0c, /* 00001100 */
+
1146  0x06, /* 00000110 */
+
1147  0x02, /* 00000010 */
+
1148  0x00, /* 00000000 */
+
1149 
+
1150  /*
+
1151  * 93 0x5d ']'
+
1152  */
+
1153  0x3c, /* 00111100 */
+
1154  0x0c, /* 00001100 */
+
1155  0x0c, /* 00001100 */
+
1156  0x0c, /* 00001100 */
+
1157  0x0c, /* 00001100 */
+
1158  0x0c, /* 00001100 */
+
1159  0x3c, /* 00111100 */
+
1160  0x00, /* 00000000 */
+
1161 
+
1162  /*
+
1163  * 94 0x5e '^'
+
1164  */
+
1165  0x10, /* 00010000 */
+
1166  0x38, /* 00111000 */
+
1167  0x6c, /* 01101100 */
+
1168  0xc6, /* 11000110 */
+
1169  0x00, /* 00000000 */
+
1170  0x00, /* 00000000 */
+
1171  0x00, /* 00000000 */
+
1172  0x00, /* 00000000 */
+
1173 
+
1174  /*
+
1175  * 95 0x5f '_'
+
1176  */
+
1177  0x00, /* 00000000 */
+
1178  0x00, /* 00000000 */
+
1179  0x00, /* 00000000 */
+
1180  0x00, /* 00000000 */
+
1181  0x00, /* 00000000 */
+
1182  0x00, /* 00000000 */
+
1183  0x00, /* 00000000 */
+
1184  0xff, /* 11111111 */
+
1185 
+
1186  /*
+
1187  * 96 0x60 '`'
+
1188  */
+
1189  0x30, /* 00110000 */
+
1190  0x18, /* 00011000 */
+
1191  0x0c, /* 00001100 */
+
1192  0x00, /* 00000000 */
+
1193  0x00, /* 00000000 */
+
1194  0x00, /* 00000000 */
+
1195  0x00, /* 00000000 */
+
1196  0x00, /* 00000000 */
+
1197 
+
1198  /*
+
1199  * 97 0x61 'a'
+
1200  */
+
1201  0x00, /* 00000000 */
+
1202  0x00, /* 00000000 */
+
1203  0x78, /* 01111000 */
+
1204  0x0c, /* 00001100 */
+
1205  0x7c, /* 01111100 */
+
1206  0xcc, /* 11001100 */
+
1207  0x76, /* 01110110 */
+
1208  0x00, /* 00000000 */
+
1209 
+
1210  /*
+
1211  * 98 0x62 'b'
+
1212  */
+
1213  0xe0, /* 11100000 */
+
1214  0x60, /* 01100000 */
+
1215  0x7c, /* 01111100 */
+
1216  0x66, /* 01100110 */
+
1217  0x66, /* 01100110 */
+
1218  0x66, /* 01100110 */
+
1219  0xdc, /* 11011100 */
+
1220  0x00, /* 00000000 */
+
1221 
+
1222  /*
+
1223  * 99 0x63 'c'
+
1224  */
+
1225  0x00, /* 00000000 */
+
1226  0x00, /* 00000000 */
+
1227  0x7c, /* 01111100 */
+
1228  0xc6, /* 11000110 */
+
1229  0xc0, /* 11000000 */
+
1230  0xc6, /* 11000110 */
+
1231  0x7c, /* 01111100 */
+
1232  0x00, /* 00000000 */
+
1233 
+
1234  /*
+
1235  * 100 0x64 'd'
+
1236  */
+
1237  0x1c, /* 00011100 */
+
1238  0x0c, /* 00001100 */
+
1239  0x7c, /* 01111100 */
+
1240  0xcc, /* 11001100 */
+
1241  0xcc, /* 11001100 */
+
1242  0xcc, /* 11001100 */
+
1243  0x76, /* 01110110 */
+
1244  0x00, /* 00000000 */
+
1245 
+
1246  /*
+
1247  * 101 0x65 'e'
+
1248  */
+
1249  0x00, /* 00000000 */
+
1250  0x00, /* 00000000 */
+
1251  0x7c, /* 01111100 */
+
1252  0xc6, /* 11000110 */
+
1253  0xfe, /* 11111110 */
+
1254  0xc0, /* 11000000 */
+
1255  0x7c, /* 01111100 */
+
1256  0x00, /* 00000000 */
+
1257 
+
1258  /*
+
1259  * 102 0x66 'f'
+
1260  */
+
1261  0x3c, /* 00111100 */
+
1262  0x66, /* 01100110 */
+
1263  0x60, /* 01100000 */
+
1264  0xf8, /* 11111000 */
+
1265  0x60, /* 01100000 */
+
1266  0x60, /* 01100000 */
+
1267  0xf0, /* 11110000 */
+
1268  0x00, /* 00000000 */
+
1269 
+
1270  /*
+
1271  * 103 0x67 'g'
+
1272  */
+
1273  0x00, /* 00000000 */
+
1274  0x00, /* 00000000 */
+
1275  0x76, /* 01110110 */
+
1276  0xcc, /* 11001100 */
+
1277  0xcc, /* 11001100 */
+
1278  0x7c, /* 01111100 */
+
1279  0x0c, /* 00001100 */
+
1280  0xf8, /* 11111000 */
+
1281 
+
1282  /*
+
1283  * 104 0x68 'h'
+
1284  */
+
1285  0xe0, /* 11100000 */
+
1286  0x60, /* 01100000 */
+
1287  0x6c, /* 01101100 */
+
1288  0x76, /* 01110110 */
+
1289  0x66, /* 01100110 */
+
1290  0x66, /* 01100110 */
+
1291  0xe6, /* 11100110 */
+
1292  0x00, /* 00000000 */
+
1293 
+
1294  /*
+
1295  * 105 0x69 'i'
+
1296  */
+
1297  0x18, /* 00011000 */
+
1298  0x00, /* 00000000 */
+
1299  0x38, /* 00111000 */
+
1300  0x18, /* 00011000 */
+
1301  0x18, /* 00011000 */
+
1302  0x18, /* 00011000 */
+
1303  0x3c, /* 00111100 */
+
1304  0x00, /* 00000000 */
+
1305 
+
1306  /*
+
1307  * 106 0x6a 'j'
+
1308  */
+
1309  0x06, /* 00000110 */
+
1310  0x00, /* 00000000 */
+
1311  0x06, /* 00000110 */
+
1312  0x06, /* 00000110 */
+
1313  0x06, /* 00000110 */
+
1314  0x66, /* 01100110 */
+
1315  0x66, /* 01100110 */
+
1316  0x3c, /* 00111100 */
+
1317 
+
1318  /*
+
1319  * 107 0x6b 'k'
+
1320  */
+
1321  0xe0, /* 11100000 */
+
1322  0x60, /* 01100000 */
+
1323  0x66, /* 01100110 */
+
1324  0x6c, /* 01101100 */
+
1325  0x78, /* 01111000 */
+
1326  0x6c, /* 01101100 */
+
1327  0xe6, /* 11100110 */
+
1328  0x00, /* 00000000 */
+
1329 
+
1330  /*
+
1331  * 108 0x6c 'l'
+
1332  */
+
1333  0x38, /* 00111000 */
+
1334  0x18, /* 00011000 */
+
1335  0x18, /* 00011000 */
+
1336  0x18, /* 00011000 */
+
1337  0x18, /* 00011000 */
+
1338  0x18, /* 00011000 */
+
1339  0x3c, /* 00111100 */
+
1340  0x00, /* 00000000 */
+
1341 
+
1342  /*
+
1343  * 109 0x6d 'm'
+
1344  */
+
1345  0x00, /* 00000000 */
+
1346  0x00, /* 00000000 */
+
1347  0xec, /* 11101100 */
+
1348  0xfe, /* 11111110 */
+
1349  0xd6, /* 11010110 */
+
1350  0xd6, /* 11010110 */
+
1351  0xd6, /* 11010110 */
+
1352  0x00, /* 00000000 */
+
1353 
+
1354  /*
+
1355  * 110 0x6e 'n'
+
1356  */
+
1357  0x00, /* 00000000 */
+
1358  0x00, /* 00000000 */
+
1359  0xdc, /* 11011100 */
+
1360  0x66, /* 01100110 */
+
1361  0x66, /* 01100110 */
+
1362  0x66, /* 01100110 */
+
1363  0x66, /* 01100110 */
+
1364  0x00, /* 00000000 */
+
1365 
+
1366  /*
+
1367  * 111 0x6f 'o'
+
1368  */
+
1369  0x00, /* 00000000 */
+
1370  0x00, /* 00000000 */
+
1371  0x7c, /* 01111100 */
+
1372  0xc6, /* 11000110 */
+
1373  0xc6, /* 11000110 */
+
1374  0xc6, /* 11000110 */
+
1375  0x7c, /* 01111100 */
+
1376  0x00, /* 00000000 */
+
1377 
+
1378  /*
+
1379  * 112 0x70 'p'
+
1380  */
+
1381  0x00, /* 00000000 */
+
1382  0x00, /* 00000000 */
+
1383  0xdc, /* 11011100 */
+
1384  0x66, /* 01100110 */
+
1385  0x66, /* 01100110 */
+
1386  0x7c, /* 01111100 */
+
1387  0x60, /* 01100000 */
+
1388  0xf0, /* 11110000 */
+
1389 
+
1390  /*
+
1391  * 113 0x71 'q'
+
1392  */
+
1393  0x00, /* 00000000 */
+
1394  0x00, /* 00000000 */
+
1395  0x76, /* 01110110 */
+
1396  0xcc, /* 11001100 */
+
1397  0xcc, /* 11001100 */
+
1398  0x7c, /* 01111100 */
+
1399  0x0c, /* 00001100 */
+
1400  0x1e, /* 00011110 */
+
1401 
+
1402  /*
+
1403  * 114 0x72 'r'
+
1404  */
+
1405  0x00, /* 00000000 */
+
1406  0x00, /* 00000000 */
+
1407  0xdc, /* 11011100 */
+
1408  0x76, /* 01110110 */
+
1409  0x60, /* 01100000 */
+
1410  0x60, /* 01100000 */
+
1411  0xf0, /* 11110000 */
+
1412  0x00, /* 00000000 */
+
1413 
+
1414  /*
+
1415  * 115 0x73 's'
+
1416  */
+
1417  0x00, /* 00000000 */
+
1418  0x00, /* 00000000 */
+
1419  0x7e, /* 01111110 */
+
1420  0xc0, /* 11000000 */
+
1421  0x7c, /* 01111100 */
+
1422  0x06, /* 00000110 */
+
1423  0xfc, /* 11111100 */
+
1424  0x00, /* 00000000 */
+
1425 
+
1426  /*
+
1427  * 116 0x74 't'
+
1428  */
+
1429  0x30, /* 00110000 */
+
1430  0x30, /* 00110000 */
+
1431  0xfc, /* 11111100 */
+
1432  0x30, /* 00110000 */
+
1433  0x30, /* 00110000 */
+
1434  0x36, /* 00110110 */
+
1435  0x1c, /* 00011100 */
+
1436  0x00, /* 00000000 */
+
1437 
+
1438  /*
+
1439  * 117 0x75 'u'
+
1440  */
+
1441  0x00, /* 00000000 */
+
1442  0x00, /* 00000000 */
+
1443  0xcc, /* 11001100 */
+
1444  0xcc, /* 11001100 */
+
1445  0xcc, /* 11001100 */
+
1446  0xcc, /* 11001100 */
+
1447  0x76, /* 01110110 */
+
1448  0x00, /* 00000000 */
+
1449 
+
1450  /*
+
1451  * 118 0x76 'v'
+
1452  */
+
1453  0x00, /* 00000000 */
+
1454  0x00, /* 00000000 */
+
1455  0xc6, /* 11000110 */
+
1456  0xc6, /* 11000110 */
+
1457  0xc6, /* 11000110 */
+
1458  0x6c, /* 01101100 */
+
1459  0x38, /* 00111000 */
+
1460  0x00, /* 00000000 */
+
1461 
+
1462  /*
+
1463  * 119 0x77 'w'
+
1464  */
+
1465  0x00, /* 00000000 */
+
1466  0x00, /* 00000000 */
+
1467  0xc6, /* 11000110 */
+
1468  0xd6, /* 11010110 */
+
1469  0xd6, /* 11010110 */
+
1470  0xfe, /* 11111110 */
+
1471  0x6c, /* 01101100 */
+
1472  0x00, /* 00000000 */
+
1473 
+
1474  /*
+
1475  * 120 0x78 'x'
+
1476  */
+
1477  0x00, /* 00000000 */
+
1478  0x00, /* 00000000 */
+
1479  0xc6, /* 11000110 */
+
1480  0x6c, /* 01101100 */
+
1481  0x38, /* 00111000 */
+
1482  0x6c, /* 01101100 */
+
1483  0xc6, /* 11000110 */
+
1484  0x00, /* 00000000 */
+
1485 
+
1486  /*
+
1487  * 121 0x79 'y'
+
1488  */
+
1489  0x00, /* 00000000 */
+
1490  0x00, /* 00000000 */
+
1491  0xc6, /* 11000110 */
+
1492  0xc6, /* 11000110 */
+
1493  0xc6, /* 11000110 */
+
1494  0x7e, /* 01111110 */
+
1495  0x06, /* 00000110 */
+
1496  0xfc, /* 11111100 */
+
1497 
+
1498  /*
+
1499  * 122 0x7a 'z'
+
1500  */
+
1501  0x00, /* 00000000 */
+
1502  0x00, /* 00000000 */
+
1503  0x7e, /* 01111110 */
+
1504  0x4c, /* 01001100 */
+
1505  0x18, /* 00011000 */
+
1506  0x32, /* 00110010 */
+
1507  0x7e, /* 01111110 */
+
1508  0x00, /* 00000000 */
+
1509 
+
1510  /*
+
1511  * 123 0x7b '{'
+
1512  */
+
1513  0x0e, /* 00001110 */
+
1514  0x18, /* 00011000 */
+
1515  0x18, /* 00011000 */
+
1516  0x70, /* 01110000 */
+
1517  0x18, /* 00011000 */
+
1518  0x18, /* 00011000 */
+
1519  0x0e, /* 00001110 */
+
1520  0x00, /* 00000000 */
+
1521 
+
1522  /*
+
1523  * 124 0x7c '|'
+
1524  */
+
1525  0x18, /* 00011000 */
+
1526  0x18, /* 00011000 */
+
1527  0x18, /* 00011000 */
+
1528  0x18, /* 00011000 */
+
1529  0x18, /* 00011000 */
+
1530  0x18, /* 00011000 */
+
1531  0x18, /* 00011000 */
+
1532  0x00, /* 00000000 */
+
1533 
+
1534  /*
+
1535  * 125 0x7d '}'
+
1536  */
+
1537  0x70, /* 01110000 */
+
1538  0x18, /* 00011000 */
+
1539  0x18, /* 00011000 */
+
1540  0x0e, /* 00001110 */
+
1541  0x18, /* 00011000 */
+
1542  0x18, /* 00011000 */
+
1543  0x70, /* 01110000 */
+
1544  0x00, /* 00000000 */
+
1545 
+
1546  /*
+
1547  * 126 0x7e '~'
+
1548  */
+
1549  0x76, /* 01110110 */
+
1550  0xdc, /* 11011100 */
+
1551  0x00, /* 00000000 */
+
1552  0x00, /* 00000000 */
+
1553  0x00, /* 00000000 */
+
1554  0x00, /* 00000000 */
+
1555  0x00, /* 00000000 */
+
1556  0x00, /* 00000000 */
+
1557 
+
1558  /*
+
1559  * 127 0x7f ''
+
1560  */
+
1561  0x00, /* 00000000 */
+
1562  0x10, /* 00010000 */
+
1563  0x38, /* 00111000 */
+
1564  0x6c, /* 01101100 */
+
1565  0xc6, /* 11000110 */
+
1566  0xc6, /* 11000110 */
+
1567  0xfe, /* 11111110 */
+
1568  0x00, /* 00000000 */
+
1569 
+
1570  /*
+
1571  * 128 0x80 '€'
+
1572  */
+
1573  0x7c, /* 01111100 */
+
1574  0xc6, /* 11000110 */
+
1575  0xc0, /* 11000000 */
+
1576  0xc0, /* 11000000 */
+
1577  0xc6, /* 11000110 */
+
1578  0x7c, /* 01111100 */
+
1579  0x0c, /* 00001100 */
+
1580  0x78, /* 01111000 */
+
1581 
+
1582  /*
+
1583  * 129 0x81 ''
+
1584  */
+
1585  0xcc, /* 11001100 */
+
1586  0x00, /* 00000000 */
+
1587  0xcc, /* 11001100 */
+
1588  0xcc, /* 11001100 */
+
1589  0xcc, /* 11001100 */
+
1590  0xcc, /* 11001100 */
+
1591  0x76, /* 01110110 */
+
1592  0x00, /* 00000000 */
+
1593 
+
1594  /*
+
1595  * 130 0x82 '‚'
+
1596  */
+
1597  0x0c, /* 00001100 */
+
1598  0x18, /* 00011000 */
+
1599  0x7c, /* 01111100 */
+
1600  0xc6, /* 11000110 */
+
1601  0xfe, /* 11111110 */
+
1602  0xc0, /* 11000000 */
+
1603  0x7c, /* 01111100 */
+
1604  0x00, /* 00000000 */
+
1605 
+
1606  /*
+
1607  * 131 0x83 'ƒ'
+
1608  */
+
1609  0x7c, /* 01111100 */
+
1610  0x82, /* 10000010 */
+
1611  0x78, /* 01111000 */
+
1612  0x0c, /* 00001100 */
+
1613  0x7c, /* 01111100 */
+
1614  0xcc, /* 11001100 */
+
1615  0x76, /* 01110110 */
+
1616  0x00, /* 00000000 */
+
1617 
+
1618  /*
+
1619  * 132 0x84 '„'
+
1620  */
+
1621  0xc6, /* 11000110 */
+
1622  0x00, /* 00000000 */
+
1623  0x78, /* 01111000 */
+
1624  0x0c, /* 00001100 */
+
1625  0x7c, /* 01111100 */
+
1626  0xcc, /* 11001100 */
+
1627  0x76, /* 01110110 */
+
1628  0x00, /* 00000000 */
+
1629 
+
1630  /*
+
1631  * 133 0x85 '…'
+
1632  */
+
1633  0x30, /* 00110000 */
+
1634  0x18, /* 00011000 */
+
1635  0x78, /* 01111000 */
+
1636  0x0c, /* 00001100 */
+
1637  0x7c, /* 01111100 */
+
1638  0xcc, /* 11001100 */
+
1639  0x76, /* 01110110 */
+
1640  0x00, /* 00000000 */
+
1641 
+
1642  /*
+
1643  * 134 0x86 '†'
+
1644  */
+
1645  0x30, /* 00110000 */
+
1646  0x30, /* 00110000 */
+
1647  0x78, /* 01111000 */
+
1648  0x0c, /* 00001100 */
+
1649  0x7c, /* 01111100 */
+
1650  0xcc, /* 11001100 */
+
1651  0x76, /* 01110110 */
+
1652  0x00, /* 00000000 */
+
1653 
+
1654  /*
+
1655  * 135 0x87 '‡'
+
1656  */
+
1657  0x00, /* 00000000 */
+
1658  0x00, /* 00000000 */
+
1659  0x7e, /* 01111110 */
+
1660  0xc0, /* 11000000 */
+
1661  0xc0, /* 11000000 */
+
1662  0x7e, /* 01111110 */
+
1663  0x0c, /* 00001100 */
+
1664  0x38, /* 00111000 */
+
1665 
+
1666  /*
+
1667  * 136 0x88 'ˆ'
+
1668  */
+
1669  0x7c, /* 01111100 */
+
1670  0x82, /* 10000010 */
+
1671  0x7c, /* 01111100 */
+
1672  0xc6, /* 11000110 */
+
1673  0xfe, /* 11111110 */
+
1674  0xc0, /* 11000000 */
+
1675  0x7c, /* 01111100 */
+
1676  0x00, /* 00000000 */
+
1677 
+
1678  /*
+
1679  * 137 0x89 '‰'
+
1680  */
+
1681  0xc6, /* 11000110 */
+
1682  0x00, /* 00000000 */
+
1683  0x7c, /* 01111100 */
+
1684  0xc6, /* 11000110 */
+
1685  0xfe, /* 11111110 */
+
1686  0xc0, /* 11000000 */
+
1687  0x7c, /* 01111100 */
+
1688  0x00, /* 00000000 */
+
1689 
+
1690  /*
+
1691  * 138 0x8a 'Š'
+
1692  */
+
1693  0x30, /* 00110000 */
+
1694  0x18, /* 00011000 */
+
1695  0x7c, /* 01111100 */
+
1696  0xc6, /* 11000110 */
+
1697  0xfe, /* 11111110 */
+
1698  0xc0, /* 11000000 */
+
1699  0x7c, /* 01111100 */
+
1700  0x00, /* 00000000 */
+
1701 
+
1702  /*
+
1703  * 139 0x8b '‹'
+
1704  */
+
1705  0x66, /* 01100110 */
+
1706  0x00, /* 00000000 */
+
1707  0x38, /* 00111000 */
+
1708  0x18, /* 00011000 */
+
1709  0x18, /* 00011000 */
+
1710  0x18, /* 00011000 */
+
1711  0x3c, /* 00111100 */
+
1712  0x00, /* 00000000 */
+
1713 
+
1714  /*
+
1715  * 140 0x8c 'Œ'
+
1716  */
+
1717  0x7c, /* 01111100 */
+
1718  0x82, /* 10000010 */
+
1719  0x38, /* 00111000 */
+
1720  0x18, /* 00011000 */
+
1721  0x18, /* 00011000 */
+
1722  0x18, /* 00011000 */
+
1723  0x3c, /* 00111100 */
+
1724  0x00, /* 00000000 */
+
1725 
+
1726  /*
+
1727  * 141 0x8d ''
+
1728  */
+
1729  0x30, /* 00110000 */
+
1730  0x18, /* 00011000 */
+
1731  0x00, /* 00000000 */
+
1732  0x38, /* 00111000 */
+
1733  0x18, /* 00011000 */
+
1734  0x18, /* 00011000 */
+
1735  0x3c, /* 00111100 */
+
1736  0x00, /* 00000000 */
+
1737 
+
1738  /*
+
1739  * 142 0x8e 'Ž'
+
1740  */
+
1741  0xc6, /* 11000110 */
+
1742  0x38, /* 00111000 */
+
1743  0x6c, /* 01101100 */
+
1744  0xc6, /* 11000110 */
+
1745  0xfe, /* 11111110 */
+
1746  0xc6, /* 11000110 */
+
1747  0xc6, /* 11000110 */
+
1748  0x00, /* 00000000 */
+
1749 
+
1750  /*
+
1751  * 143 0x8f ''
+
1752  */
+
1753  0x38, /* 00111000 */
+
1754  0x6c, /* 01101100 */
+
1755  0x7c, /* 01111100 */
+
1756  0xc6, /* 11000110 */
+
1757  0xfe, /* 11111110 */
+
1758  0xc6, /* 11000110 */
+
1759  0xc6, /* 11000110 */
+
1760  0x00, /* 00000000 */
+
1761 
+
1762  /*
+
1763  * 144 0x90 ''
+
1764  */
+
1765  0x18, /* 00011000 */
+
1766  0x30, /* 00110000 */
+
1767  0xfe, /* 11111110 */
+
1768  0xc0, /* 11000000 */
+
1769  0xf8, /* 11111000 */
+
1770  0xc0, /* 11000000 */
+
1771  0xfe, /* 11111110 */
+
1772  0x00, /* 00000000 */
+
1773 
+
1774  /*
+
1775  * 145 0x91 '‘'
+
1776  */
+
1777  0x00, /* 00000000 */
+
1778  0x00, /* 00000000 */
+
1779  0x7e, /* 01111110 */
+
1780  0x18, /* 00011000 */
+
1781  0x7e, /* 01111110 */
+
1782  0xd8, /* 11011000 */
+
1783  0x7e, /* 01111110 */
+
1784  0x00, /* 00000000 */
+
1785 
+
1786  /*
+
1787  * 146 0x92 '’'
+
1788  */
+
1789  0x3e, /* 00111110 */
+
1790  0x6c, /* 01101100 */
+
1791  0xcc, /* 11001100 */
+
1792  0xfe, /* 11111110 */
+
1793  0xcc, /* 11001100 */
+
1794  0xcc, /* 11001100 */
+
1795  0xce, /* 11001110 */
+
1796  0x00, /* 00000000 */
+
1797 
+
1798  /*
+
1799  * 147 0x93 '“'
+
1800  */
+
1801  0x7c, /* 01111100 */
+
1802  0x82, /* 10000010 */
+
1803  0x7c, /* 01111100 */
+
1804  0xc6, /* 11000110 */
+
1805  0xc6, /* 11000110 */
+
1806  0xc6, /* 11000110 */
+
1807  0x7c, /* 01111100 */
+
1808  0x00, /* 00000000 */
+
1809 
+
1810  /*
+
1811  * 148 0x94 '”'
+
1812  */
+
1813  0xc6, /* 11000110 */
+
1814  0x00, /* 00000000 */
+
1815  0x7c, /* 01111100 */
+
1816  0xc6, /* 11000110 */
+
1817  0xc6, /* 11000110 */
+
1818  0xc6, /* 11000110 */
+
1819  0x7c, /* 01111100 */
+
1820  0x00, /* 00000000 */
+
1821 
+
1822  /*
+
1823  * 149 0x95 '•'
+
1824  */
+
1825  0x30, /* 00110000 */
+
1826  0x18, /* 00011000 */
+
1827  0x7c, /* 01111100 */
+
1828  0xc6, /* 11000110 */
+
1829  0xc6, /* 11000110 */
+
1830  0xc6, /* 11000110 */
+
1831  0x7c, /* 01111100 */
+
1832  0x00, /* 00000000 */
+
1833 
+
1834  /*
+
1835  * 150 0x96 '–'
+
1836  */
+
1837  0x78, /* 01111000 */
+
1838  0x84, /* 10000100 */
+
1839  0x00, /* 00000000 */
+
1840  0xcc, /* 11001100 */
+
1841  0xcc, /* 11001100 */
+
1842  0xcc, /* 11001100 */
+
1843  0x76, /* 01110110 */
+
1844  0x00, /* 00000000 */
+
1845 
+
1846  /*
+
1847  * 151 0x97 '—'
+
1848  */
+
1849  0x60, /* 01100000 */
+
1850  0x30, /* 00110000 */
+
1851  0xcc, /* 11001100 */
+
1852  0xcc, /* 11001100 */
+
1853  0xcc, /* 11001100 */
+
1854  0xcc, /* 11001100 */
+
1855  0x76, /* 01110110 */
+
1856  0x00, /* 00000000 */
+
1857 
+
1858  /*
+
1859  * 152 0x98 '˜'
+
1860  */
+
1861  0xc6, /* 11000110 */
+
1862  0x00, /* 00000000 */
+
1863  0xc6, /* 11000110 */
+
1864  0xc6, /* 11000110 */
+
1865  0xc6, /* 11000110 */
+
1866  0x7e, /* 01111110 */
+
1867  0x06, /* 00000110 */
+
1868  0xfc, /* 11111100 */
+
1869 
+
1870  /*
+
1871  * 153 0x99 '™'
+
1872  */
+
1873  0xc6, /* 11000110 */
+
1874  0x38, /* 00111000 */
+
1875  0x6c, /* 01101100 */
+
1876  0xc6, /* 11000110 */
+
1877  0xc6, /* 11000110 */
+
1878  0x6c, /* 01101100 */
+
1879  0x38, /* 00111000 */
+
1880  0x00, /* 00000000 */
+
1881 
+
1882  /*
+
1883  * 154 0x9a 'š'
+
1884  */
+
1885  0xc6, /* 11000110 */
+
1886  0x00, /* 00000000 */
+
1887  0xc6, /* 11000110 */
+
1888  0xc6, /* 11000110 */
+
1889  0xc6, /* 11000110 */
+
1890  0xc6, /* 11000110 */
+
1891  0x7c, /* 01111100 */
+
1892  0x00, /* 00000000 */
+
1893 
+
1894  /*
+
1895  * 155 0x9b '›'
+
1896  */
+
1897  0x18, /* 00011000 */
+
1898  0x18, /* 00011000 */
+
1899  0x7e, /* 01111110 */
+
1900  0xc0, /* 11000000 */
+
1901  0xc0, /* 11000000 */
+
1902  0x7e, /* 01111110 */
+
1903  0x18, /* 00011000 */
+
1904  0x18, /* 00011000 */
+
1905 
+
1906  /*
+
1907  * 156 0x9c 'œ'
+
1908  */
+
1909  0x38, /* 00111000 */
+
1910  0x6c, /* 01101100 */
+
1911  0x64, /* 01100100 */
+
1912  0xf0, /* 11110000 */
+
1913  0x60, /* 01100000 */
+
1914  0x66, /* 01100110 */
+
1915  0xfc, /* 11111100 */
+
1916  0x00, /* 00000000 */
+
1917 
+
1918  /*
+
1919  * 157 0x9d ''
+
1920  */
+
1921  0x66, /* 01100110 */
+
1922  0x66, /* 01100110 */
+
1923  0x3c, /* 00111100 */
+
1924  0x7e, /* 01111110 */
+
1925  0x18, /* 00011000 */
+
1926  0x7e, /* 01111110 */
+
1927  0x18, /* 00011000 */
+
1928  0x18, /* 00011000 */
+
1929 
+
1930  /*
+
1931  * 158 0x9e 'ž'
+
1932  */
+
1933  0xf8, /* 11111000 */
+
1934  0xcc, /* 11001100 */
+
1935  0xcc, /* 11001100 */
+
1936  0xfa, /* 11111010 */
+
1937  0xc6, /* 11000110 */
+
1938  0xcf, /* 11001111 */
+
1939  0xc6, /* 11000110 */
+
1940  0xc7, /* 11000111 */
+
1941 
+
1942  /*
+
1943  * 159 0x9f 'Ÿ'
+
1944  */
+
1945  0x0e, /* 00001110 */
+
1946  0x1b, /* 00011011 */
+
1947  0x18, /* 00011000 */
+
1948  0x3c, /* 00111100 */
+
1949  0x18, /* 00011000 */
+
1950  0xd8, /* 11011000 */
+
1951  0x70, /* 01110000 */
+
1952  0x00, /* 00000000 */
+
1953 
+
1954  /*
+
1955  * 160 0xa0 ' '
+
1956  */
+
1957  0x18, /* 00011000 */
+
1958  0x30, /* 00110000 */
+
1959  0x78, /* 01111000 */
+
1960  0x0c, /* 00001100 */
+
1961  0x7c, /* 01111100 */
+
1962  0xcc, /* 11001100 */
+
1963  0x76, /* 01110110 */
+
1964  0x00, /* 00000000 */
+
1965 
+
1966  /*
+
1967  * 161 0xa1 '¡'
+
1968  */
+
1969  0x0c, /* 00001100 */
+
1970  0x18, /* 00011000 */
+
1971  0x00, /* 00000000 */
+
1972  0x38, /* 00111000 */
+
1973  0x18, /* 00011000 */
+
1974  0x18, /* 00011000 */
+
1975  0x3c, /* 00111100 */
+
1976  0x00, /* 00000000 */
+
1977 
+
1978  /*
+
1979  * 162 0xa2 '¢'
+
1980  */
+
1981  0x0c, /* 00001100 */
+
1982  0x18, /* 00011000 */
+
1983  0x7c, /* 01111100 */
+
1984  0xc6, /* 11000110 */
+
1985  0xc6, /* 11000110 */
+
1986  0xc6, /* 11000110 */
+
1987  0x7c, /* 01111100 */
+
1988  0x00, /* 00000000 */
+
1989 
+
1990  /*
+
1991  * 163 0xa3 '£'
+
1992  */
+
1993  0x18, /* 00011000 */
+
1994  0x30, /* 00110000 */
+
1995  0xcc, /* 11001100 */
+
1996  0xcc, /* 11001100 */
+
1997  0xcc, /* 11001100 */
+
1998  0xcc, /* 11001100 */
+
1999  0x76, /* 01110110 */
+
2000  0x00, /* 00000000 */
+
2001 
+
2002  /*
+
2003  * 164 0xa4 '¤'
+
2004  */
+
2005  0x76, /* 01110110 */
+
2006  0xdc, /* 11011100 */
+
2007  0x00, /* 00000000 */
+
2008  0xdc, /* 11011100 */
+
2009  0x66, /* 01100110 */
+
2010  0x66, /* 01100110 */
+
2011  0x66, /* 01100110 */
+
2012  0x00, /* 00000000 */
+
2013 
+
2014  /*
+
2015  * 165 0xa5 '¥'
+
2016  */
+
2017  0x76, /* 01110110 */
+
2018  0xdc, /* 11011100 */
+
2019  0x00, /* 00000000 */
+
2020  0xe6, /* 11100110 */
+
2021  0xf6, /* 11110110 */
+
2022  0xde, /* 11011110 */
+
2023  0xce, /* 11001110 */
+
2024  0x00, /* 00000000 */
+
2025 
+
2026  /*
+
2027  * 166 0xa6 '¦'
+
2028  */
+
2029  0x3c, /* 00111100 */
+
2030  0x6c, /* 01101100 */
+
2031  0x6c, /* 01101100 */
+
2032  0x3e, /* 00111110 */
+
2033  0x00, /* 00000000 */
+
2034  0x7e, /* 01111110 */
+
2035  0x00, /* 00000000 */
+
2036  0x00, /* 00000000 */
+
2037 
+
2038  /*
+
2039  * 167 0xa7 '§'
+
2040  */
+
2041  0x38, /* 00111000 */
+
2042  0x6c, /* 01101100 */
+
2043  0x6c, /* 01101100 */
+
2044  0x38, /* 00111000 */
+
2045  0x00, /* 00000000 */
+
2046  0x7c, /* 01111100 */
+
2047  0x00, /* 00000000 */
+
2048  0x00, /* 00000000 */
+
2049 
+
2050  /*
+
2051  * 168 0xa8 '¨'
+
2052  */
+
2053  0x18, /* 00011000 */
+
2054  0x00, /* 00000000 */
+
2055  0x18, /* 00011000 */
+
2056  0x18, /* 00011000 */
+
2057  0x30, /* 00110000 */
+
2058  0x63, /* 01100011 */
+
2059  0x3e, /* 00111110 */
+
2060  0x00, /* 00000000 */
+
2061 
+
2062  /*
+
2063  * 169 0xa9 '©'
+
2064  */
+
2065  0x00, /* 00000000 */
+
2066  0x00, /* 00000000 */
+
2067  0x00, /* 00000000 */
+
2068  0xfe, /* 11111110 */
+
2069  0xc0, /* 11000000 */
+
2070  0xc0, /* 11000000 */
+
2071  0x00, /* 00000000 */
+
2072  0x00, /* 00000000 */
+
2073 
+
2074  /*
+
2075  * 170 0xaa 'ª'
+
2076  */
+
2077  0x00, /* 00000000 */
+
2078  0x00, /* 00000000 */
+
2079  0x00, /* 00000000 */
+
2080  0xfe, /* 11111110 */
+
2081  0x06, /* 00000110 */
+
2082  0x06, /* 00000110 */
+
2083  0x00, /* 00000000 */
+
2084  0x00, /* 00000000 */
+
2085 
+
2086  /*
+
2087  * 171 0xab '«'
+
2088  */
+
2089  0x63, /* 01100011 */
+
2090  0xe6, /* 11100110 */
+
2091  0x6c, /* 01101100 */
+
2092  0x7e, /* 01111110 */
+
2093  0x33, /* 00110011 */
+
2094  0x66, /* 01100110 */
+
2095  0xcc, /* 11001100 */
+
2096  0x0f, /* 00001111 */
+
2097 
+
2098  /*
+
2099  * 172 0xac '¬'
+
2100  */
+
2101  0x63, /* 01100011 */
+
2102  0xe6, /* 11100110 */
+
2103  0x6c, /* 01101100 */
+
2104  0x7a, /* 01111010 */
+
2105  0x36, /* 00110110 */
+
2106  0x6a, /* 01101010 */
+
2107  0xdf, /* 11011111 */
+
2108  0x06, /* 00000110 */
+
2109 
+
2110  /*
+
2111  * 173 0xad '­'
+
2112  */
+
2113  0x18, /* 00011000 */
+
2114  0x00, /* 00000000 */
+
2115  0x18, /* 00011000 */
+
2116  0x18, /* 00011000 */
+
2117  0x3c, /* 00111100 */
+
2118  0x3c, /* 00111100 */
+
2119  0x18, /* 00011000 */
+
2120  0x00, /* 00000000 */
+
2121 
+
2122  /*
+
2123  * 174 0xae '®'
+
2124  */
+
2125  0x00, /* 00000000 */
+
2126  0x33, /* 00110011 */
+
2127  0x66, /* 01100110 */
+
2128  0xcc, /* 11001100 */
+
2129  0x66, /* 01100110 */
+
2130  0x33, /* 00110011 */
+
2131  0x00, /* 00000000 */
+
2132  0x00, /* 00000000 */
+
2133 
+
2134  /*
+
2135  * 175 0xaf '¯'
+
2136  */
+
2137  0x00, /* 00000000 */
+
2138  0xcc, /* 11001100 */
+
2139  0x66, /* 01100110 */
+
2140  0x33, /* 00110011 */
+
2141  0x66, /* 01100110 */
+
2142  0xcc, /* 11001100 */
+
2143  0x00, /* 00000000 */
+
2144  0x00, /* 00000000 */
+
2145 
+
2146  /*
+
2147  * 176 0xb0 '°'
+
2148  */
+
2149  0x22, /* 00100010 */
+
2150  0x88, /* 10001000 */
+
2151  0x22, /* 00100010 */
+
2152  0x88, /* 10001000 */
+
2153  0x22, /* 00100010 */
+
2154  0x88, /* 10001000 */
+
2155  0x22, /* 00100010 */
+
2156  0x88, /* 10001000 */
+
2157 
+
2158  /*
+
2159  * 177 0xb1 '±'
+
2160  */
+
2161  0x55, /* 01010101 */
+
2162  0xaa, /* 10101010 */
+
2163  0x55, /* 01010101 */
+
2164  0xaa, /* 10101010 */
+
2165  0x55, /* 01010101 */
+
2166  0xaa, /* 10101010 */
+
2167  0x55, /* 01010101 */
+
2168  0xaa, /* 10101010 */
+
2169 
+
2170  /*
+
2171  * 178 0xb2 '²'
+
2172  */
+
2173  0x77, /* 01110111 */
+
2174  0xdd, /* 11011101 */
+
2175  0x77, /* 01110111 */
+
2176  0xdd, /* 11011101 */
+
2177  0x77, /* 01110111 */
+
2178  0xdd, /* 11011101 */
+
2179  0x77, /* 01110111 */
+
2180  0xdd, /* 11011101 */
+
2181 
+
2182  /*
+
2183  * 179 0xb3 '³'
+
2184  */
+
2185  0x18, /* 00011000 */
+
2186  0x18, /* 00011000 */
+
2187  0x18, /* 00011000 */
+
2188  0x18, /* 00011000 */
+
2189  0x18, /* 00011000 */
+
2190  0x18, /* 00011000 */
+
2191  0x18, /* 00011000 */
+
2192  0x18, /* 00011000 */
+
2193 
+
2194  /*
+
2195  * 180 0xb4 '´'
+
2196  */
+
2197  0x18, /* 00011000 */
+
2198  0x18, /* 00011000 */
+
2199  0x18, /* 00011000 */
+
2200  0x18, /* 00011000 */
+
2201  0xf8, /* 11111000 */
+
2202  0x18, /* 00011000 */
+
2203  0x18, /* 00011000 */
+
2204  0x18, /* 00011000 */
+
2205 
+
2206  /*
+
2207  * 181 0xb5 'µ'
+
2208  */
+
2209  0x18, /* 00011000 */
+
2210  0x18, /* 00011000 */
+
2211  0xf8, /* 11111000 */
+
2212  0x18, /* 00011000 */
+
2213  0xf8, /* 11111000 */
+
2214  0x18, /* 00011000 */
+
2215  0x18, /* 00011000 */
+
2216  0x18, /* 00011000 */
+
2217 
+
2218  /*
+
2219  * 182 0xb6 '¶'
+
2220  */
+
2221  0x36, /* 00110110 */
+
2222  0x36, /* 00110110 */
+
2223  0x36, /* 00110110 */
+
2224  0x36, /* 00110110 */
+
2225  0xf6, /* 11110110 */
+
2226  0x36, /* 00110110 */
+
2227  0x36, /* 00110110 */
+
2228  0x36, /* 00110110 */
+
2229 
+
2230  /*
+
2231  * 183 0xb7 '·'
+
2232  */
+
2233  0x00, /* 00000000 */
+
2234  0x00, /* 00000000 */
+
2235  0x00, /* 00000000 */
+
2236  0x00, /* 00000000 */
+
2237  0xfe, /* 11111110 */
+
2238  0x36, /* 00110110 */
+
2239  0x36, /* 00110110 */
+
2240  0x36, /* 00110110 */
+
2241 
+
2242  /*
+
2243  * 184 0xb8 '¸'
+
2244  */
+
2245  0x00, /* 00000000 */
+
2246  0x00, /* 00000000 */
+
2247  0xf8, /* 11111000 */
+
2248  0x18, /* 00011000 */
+
2249  0xf8, /* 11111000 */
+
2250  0x18, /* 00011000 */
+
2251  0x18, /* 00011000 */
+
2252  0x18, /* 00011000 */
+
2253 
+
2254  /*
+
2255  * 185 0xb9 '¹'
+
2256  */
+
2257  0x36, /* 00110110 */
+
2258  0x36, /* 00110110 */
+
2259  0xf6, /* 11110110 */
+
2260  0x06, /* 00000110 */
+
2261  0xf6, /* 11110110 */
+
2262  0x36, /* 00110110 */
+
2263  0x36, /* 00110110 */
+
2264  0x36, /* 00110110 */
+
2265 
+
2266  /*
+
2267  * 186 0xba 'º'
+
2268  */
+
2269  0x36, /* 00110110 */
+
2270  0x36, /* 00110110 */
+
2271  0x36, /* 00110110 */
+
2272  0x36, /* 00110110 */
+
2273  0x36, /* 00110110 */
+
2274  0x36, /* 00110110 */
+
2275  0x36, /* 00110110 */
+
2276  0x36, /* 00110110 */
+
2277 
+
2278  /*
+
2279  * 187 0xbb '»'
+
2280  */
+
2281  0x00, /* 00000000 */
+
2282  0x00, /* 00000000 */
+
2283  0xfe, /* 11111110 */
+
2284  0x06, /* 00000110 */
+
2285  0xf6, /* 11110110 */
+
2286  0x36, /* 00110110 */
+
2287  0x36, /* 00110110 */
+
2288  0x36, /* 00110110 */
+
2289 
+
2290  /*
+
2291  * 188 0xbc '¼'
+
2292  */
+
2293  0x36, /* 00110110 */
+
2294  0x36, /* 00110110 */
+
2295  0xf6, /* 11110110 */
+
2296  0x06, /* 00000110 */
+
2297  0xfe, /* 11111110 */
+
2298  0x00, /* 00000000 */
+
2299  0x00, /* 00000000 */
+
2300  0x00, /* 00000000 */
+
2301 
+
2302  /*
+
2303  * 189 0xbd '½'
+
2304  */
+
2305  0x36, /* 00110110 */
+
2306  0x36, /* 00110110 */
+
2307  0x36, /* 00110110 */
+
2308  0x36, /* 00110110 */
+
2309  0xfe, /* 11111110 */
+
2310  0x00, /* 00000000 */
+
2311  0x00, /* 00000000 */
+
2312  0x00, /* 00000000 */
+
2313 
+
2314  /*
+
2315  * 190 0xbe '¾'
+
2316  */
+
2317  0x18, /* 00011000 */
+
2318  0x18, /* 00011000 */
+
2319  0xf8, /* 11111000 */
+
2320  0x18, /* 00011000 */
+
2321  0xf8, /* 11111000 */
+
2322  0x00, /* 00000000 */
+
2323  0x00, /* 00000000 */
+
2324  0x00, /* 00000000 */
+
2325 
+
2326  /*
+
2327  * 191 0xbf '¿'
+
2328  */
+
2329  0x00, /* 00000000 */
+
2330  0x00, /* 00000000 */
+
2331  0x00, /* 00000000 */
+
2332  0x00, /* 00000000 */
+
2333  0xf8, /* 11111000 */
+
2334  0x18, /* 00011000 */
+
2335  0x18, /* 00011000 */
+
2336  0x18, /* 00011000 */
+
2337 
+
2338  /*
+
2339  * 192 0xc0 'À'
+
2340  */
+
2341  0x18, /* 00011000 */
+
2342  0x18, /* 00011000 */
+
2343  0x18, /* 00011000 */
+
2344  0x18, /* 00011000 */
+
2345  0x1f, /* 00011111 */
+
2346  0x00, /* 00000000 */
+
2347  0x00, /* 00000000 */
+
2348  0x00, /* 00000000 */
+
2349 
+
2350  /*
+
2351  * 193 0xc1 'Á'
+
2352  */
+
2353  0x18, /* 00011000 */
+
2354  0x18, /* 00011000 */
+
2355  0x18, /* 00011000 */
+
2356  0x18, /* 00011000 */
+
2357  0xff, /* 11111111 */
+
2358  0x00, /* 00000000 */
+
2359  0x00, /* 00000000 */
+
2360  0x00, /* 00000000 */
+
2361 
+
2362  /*
+
2363  * 194 0xc2 'Â'
+
2364  */
+
2365  0x00, /* 00000000 */
+
2366  0x00, /* 00000000 */
+
2367  0x00, /* 00000000 */
+
2368  0x00, /* 00000000 */
+
2369  0xff, /* 11111111 */
+
2370  0x18, /* 00011000 */
+
2371  0x18, /* 00011000 */
+
2372  0x18, /* 00011000 */
+
2373 
+
2374  /*
+
2375  * 195 0xc3 'Ã'
+
2376  */
+
2377  0x18, /* 00011000 */
+
2378  0x18, /* 00011000 */
+
2379  0x18, /* 00011000 */
+
2380  0x18, /* 00011000 */
+
2381  0x1f, /* 00011111 */
+
2382  0x18, /* 00011000 */
+
2383  0x18, /* 00011000 */
+
2384  0x18, /* 00011000 */
+
2385 
+
2386  /*
+
2387  * 196 0xc4 'Ä'
+
2388  */
+
2389  0x00, /* 00000000 */
+
2390  0x00, /* 00000000 */
+
2391  0x00, /* 00000000 */
+
2392  0x00, /* 00000000 */
+
2393  0xff, /* 11111111 */
+
2394  0x00, /* 00000000 */
+
2395  0x00, /* 00000000 */
+
2396  0x00, /* 00000000 */
+
2397 
+
2398  /*
+
2399  * 197 0xc5 'Å'
+
2400  */
+
2401  0x18, /* 00011000 */
+
2402  0x18, /* 00011000 */
+
2403  0x18, /* 00011000 */
+
2404  0x18, /* 00011000 */
+
2405  0xff, /* 11111111 */
+
2406  0x18, /* 00011000 */
+
2407  0x18, /* 00011000 */
+
2408  0x18, /* 00011000 */
+
2409 
+
2410  /*
+
2411  * 198 0xc6 'Æ'
+
2412  */
+
2413  0x18, /* 00011000 */
+
2414  0x18, /* 00011000 */
+
2415  0x1f, /* 00011111 */
+
2416  0x18, /* 00011000 */
+
2417  0x1f, /* 00011111 */
+
2418  0x18, /* 00011000 */
+
2419  0x18, /* 00011000 */
+
2420  0x18, /* 00011000 */
+
2421 
+
2422  /*
+
2423  * 199 0xc7 'Ç'
+
2424  */
+
2425  0x36, /* 00110110 */
+
2426  0x36, /* 00110110 */
+
2427  0x36, /* 00110110 */
+
2428  0x36, /* 00110110 */
+
2429  0x37, /* 00110111 */
+
2430  0x36, /* 00110110 */
+
2431  0x36, /* 00110110 */
+
2432  0x36, /* 00110110 */
+
2433 
+
2434  /*
+
2435  * 200 0xc8 'È'
+
2436  */
+
2437  0x36, /* 00110110 */
+
2438  0x36, /* 00110110 */
+
2439  0x37, /* 00110111 */
+
2440  0x30, /* 00110000 */
+
2441  0x3f, /* 00111111 */
+
2442  0x00, /* 00000000 */
+
2443  0x00, /* 00000000 */
+
2444  0x00, /* 00000000 */
+
2445 
+
2446  /*
+
2447  * 201 0xc9 'É'
+
2448  */
+
2449  0x00, /* 00000000 */
+
2450  0x00, /* 00000000 */
+
2451  0x3f, /* 00111111 */
+
2452  0x30, /* 00110000 */
+
2453  0x37, /* 00110111 */
+
2454  0x36, /* 00110110 */
+
2455  0x36, /* 00110110 */
+
2456  0x36, /* 00110110 */
+
2457 
+
2458  /*
+
2459  * 202 0xca 'Ê'
+
2460  */
+
2461  0x36, /* 00110110 */
+
2462  0x36, /* 00110110 */
+
2463  0xf7, /* 11110111 */
+
2464  0x00, /* 00000000 */
+
2465  0xff, /* 11111111 */
+
2466  0x00, /* 00000000 */
+
2467  0x00, /* 00000000 */
+
2468  0x00, /* 00000000 */
+
2469 
+
2470  /*
+
2471  * 203 0xcb 'Ë'
+
2472  */
+
2473  0x00, /* 00000000 */
+
2474  0x00, /* 00000000 */
+
2475  0xff, /* 11111111 */
+
2476  0x00, /* 00000000 */
+
2477  0xf7, /* 11110111 */
+
2478  0x36, /* 00110110 */
+
2479  0x36, /* 00110110 */
+
2480  0x36, /* 00110110 */
+
2481 
+
2482  /*
+
2483  * 204 0xcc 'Ì'
+
2484  */
+
2485  0x36, /* 00110110 */
+
2486  0x36, /* 00110110 */
+
2487  0x37, /* 00110111 */
+
2488  0x30, /* 00110000 */
+
2489  0x37, /* 00110111 */
+
2490  0x36, /* 00110110 */
+
2491  0x36, /* 00110110 */
+
2492  0x36, /* 00110110 */
+
2493 
+
2494  /*
+
2495  * 205 0xcd 'Í'
+
2496  */
+
2497  0x00, /* 00000000 */
+
2498  0x00, /* 00000000 */
+
2499  0xff, /* 11111111 */
+
2500  0x00, /* 00000000 */
+
2501  0xff, /* 11111111 */
+
2502  0x00, /* 00000000 */
+
2503  0x00, /* 00000000 */
+
2504  0x00, /* 00000000 */
+
2505 
+
2506  /*
+
2507  * 206 0xce 'Î'
+
2508  */
+
2509  0x36, /* 00110110 */
+
2510  0x36, /* 00110110 */
+
2511  0xf7, /* 11110111 */
+
2512  0x00, /* 00000000 */
+
2513  0xf7, /* 11110111 */
+
2514  0x36, /* 00110110 */
+
2515  0x36, /* 00110110 */
+
2516  0x36, /* 00110110 */
+
2517 
+
2518  /*
+
2519  * 207 0xcf 'Ï'
+
2520  */
+
2521  0x18, /* 00011000 */
+
2522  0x18, /* 00011000 */
+
2523  0xff, /* 11111111 */
+
2524  0x00, /* 00000000 */
+
2525  0xff, /* 11111111 */
+
2526  0x00, /* 00000000 */
+
2527  0x00, /* 00000000 */
+
2528  0x00, /* 00000000 */
+
2529 
+
2530  /*
+
2531  * 208 0xd0 'Ð'
+
2532  */
+
2533  0x36, /* 00110110 */
+
2534  0x36, /* 00110110 */
+
2535  0x36, /* 00110110 */
+
2536  0x36, /* 00110110 */
+
2537  0xff, /* 11111111 */
+
2538  0x00, /* 00000000 */
+
2539  0x00, /* 00000000 */
+
2540  0x00, /* 00000000 */
+
2541 
+
2542  /*
+
2543  * 209 0xd1 'Ñ'
+
2544  */
+
2545  0x00, /* 00000000 */
+
2546  0x00, /* 00000000 */
+
2547  0xff, /* 11111111 */
+
2548  0x00, /* 00000000 */
+
2549  0xff, /* 11111111 */
+
2550  0x18, /* 00011000 */
+
2551  0x18, /* 00011000 */
+
2552  0x18, /* 00011000 */
+
2553 
+
2554  /*
+
2555  * 210 0xd2 'Ò'
+
2556  */
+
2557  0x00, /* 00000000 */
+
2558  0x00, /* 00000000 */
+
2559  0x00, /* 00000000 */
+
2560  0x00, /* 00000000 */
+
2561  0xff, /* 11111111 */
+
2562  0x36, /* 00110110 */
+
2563  0x36, /* 00110110 */
+
2564  0x36, /* 00110110 */
+
2565 
+
2566  /*
+
2567  * 211 0xd3 'Ó'
+
2568  */
+
2569  0x36, /* 00110110 */
+
2570  0x36, /* 00110110 */
+
2571  0x36, /* 00110110 */
+
2572  0x36, /* 00110110 */
+
2573  0x3f, /* 00111111 */
+
2574  0x00, /* 00000000 */
+
2575  0x00, /* 00000000 */
+
2576  0x00, /* 00000000 */
+
2577 
+
2578  /*
+
2579  * 212 0xd4 'Ô'
+
2580  */
+
2581  0x18, /* 00011000 */
+
2582  0x18, /* 00011000 */
+
2583  0x1f, /* 00011111 */
+
2584  0x18, /* 00011000 */
+
2585  0x1f, /* 00011111 */
+
2586  0x00, /* 00000000 */
+
2587  0x00, /* 00000000 */
+
2588  0x00, /* 00000000 */
+
2589 
+
2590  /*
+
2591  * 213 0xd5 'Õ'
+
2592  */
+
2593  0x00, /* 00000000 */
+
2594  0x00, /* 00000000 */
+
2595  0x1f, /* 00011111 */
+
2596  0x18, /* 00011000 */
+
2597  0x1f, /* 00011111 */
+
2598  0x18, /* 00011000 */
+
2599  0x18, /* 00011000 */
+
2600  0x18, /* 00011000 */
+
2601 
+
2602  /*
+
2603  * 214 0xd6 'Ö'
+
2604  */
+
2605  0x00, /* 00000000 */
+
2606  0x00, /* 00000000 */
+
2607  0x00, /* 00000000 */
+
2608  0x00, /* 00000000 */
+
2609  0x3f, /* 00111111 */
+
2610  0x36, /* 00110110 */
+
2611  0x36, /* 00110110 */
+
2612  0x36, /* 00110110 */
+
2613 
+
2614  /*
+
2615  * 215 0xd7 '×'
+
2616  */
+
2617  0x36, /* 00110110 */
+
2618  0x36, /* 00110110 */
+
2619  0x36, /* 00110110 */
+
2620  0x36, /* 00110110 */
+
2621  0xff, /* 11111111 */
+
2622  0x36, /* 00110110 */
+
2623  0x36, /* 00110110 */
+
2624  0x36, /* 00110110 */
+
2625 
+
2626  /*
+
2627  * 216 0xd8 'Ø'
+
2628  */
+
2629  0x18, /* 00011000 */
+
2630  0x18, /* 00011000 */
+
2631  0xff, /* 11111111 */
+
2632  0x18, /* 00011000 */
+
2633  0xff, /* 11111111 */
+
2634  0x18, /* 00011000 */
+
2635  0x18, /* 00011000 */
+
2636  0x18, /* 00011000 */
+
2637 
+
2638  /*
+
2639  * 217 0xd9 'Ù'
+
2640  */
+
2641  0x18, /* 00011000 */
+
2642  0x18, /* 00011000 */
+
2643  0x18, /* 00011000 */
+
2644  0x18, /* 00011000 */
+
2645  0xf8, /* 11111000 */
+
2646  0x00, /* 00000000 */
+
2647  0x00, /* 00000000 */
+
2648  0x00, /* 00000000 */
+
2649 
+
2650  /*
+
2651  * 218 0xda 'Ú'
+
2652  */
+
2653  0x00, /* 00000000 */
+
2654  0x00, /* 00000000 */
+
2655  0x00, /* 00000000 */
+
2656  0x00, /* 00000000 */
+
2657  0x1f, /* 00011111 */
+
2658  0x18, /* 00011000 */
+
2659  0x18, /* 00011000 */
+
2660  0x18, /* 00011000 */
+
2661 
+
2662  /*
+
2663  * 219 0xdb 'Û'
+
2664  */
+
2665  0xff, /* 11111111 */
+
2666  0xff, /* 11111111 */
+
2667  0xff, /* 11111111 */
+
2668  0xff, /* 11111111 */
+
2669  0xff, /* 11111111 */
+
2670  0xff, /* 11111111 */
+
2671  0xff, /* 11111111 */
+
2672  0xff, /* 11111111 */
+
2673 
+
2674  /*
+
2675  * 220 0xdc 'Ü'
+
2676  */
+
2677  0x00, /* 00000000 */
+
2678  0x00, /* 00000000 */
+
2679  0x00, /* 00000000 */
+
2680  0x00, /* 00000000 */
+
2681  0xff, /* 11111111 */
+
2682  0xff, /* 11111111 */
+
2683  0xff, /* 11111111 */
+
2684  0xff, /* 11111111 */
+
2685 
+
2686  /*
+
2687  * 221 0xdd 'Ý'
+
2688  */
+
2689  0xf0, /* 11110000 */
+
2690  0xf0, /* 11110000 */
+
2691  0xf0, /* 11110000 */
+
2692  0xf0, /* 11110000 */
+
2693  0xf0, /* 11110000 */
+
2694  0xf0, /* 11110000 */
+
2695  0xf0, /* 11110000 */
+
2696  0xf0, /* 11110000 */
+
2697 
+
2698  /*
+
2699  * 222 0xde 'Þ'
+
2700  */
+
2701  0x0f, /* 00001111 */
+
2702  0x0f, /* 00001111 */
+
2703  0x0f, /* 00001111 */
+
2704  0x0f, /* 00001111 */
+
2705  0x0f, /* 00001111 */
+
2706  0x0f, /* 00001111 */
+
2707  0x0f, /* 00001111 */
+
2708  0x0f, /* 00001111 */
+
2709 
+
2710  /*
+
2711  * 223 0xdf 'ß'
+
2712  */
+
2713  0xff, /* 11111111 */
+
2714  0xff, /* 11111111 */
+
2715  0xff, /* 11111111 */
+
2716  0xff, /* 11111111 */
+
2717  0x00, /* 00000000 */
+
2718  0x00, /* 00000000 */
+
2719  0x00, /* 00000000 */
+
2720  0x00, /* 00000000 */
+
2721 
+
2722  /*
+
2723  * 224 0xe0 'à'
+
2724  */
+
2725  0x00, /* 00000000 */
+
2726  0x00, /* 00000000 */
+
2727  0x76, /* 01110110 */
+
2728  0xdc, /* 11011100 */
+
2729  0xc8, /* 11001000 */
+
2730  0xdc, /* 11011100 */
+
2731  0x76, /* 01110110 */
+
2732  0x00, /* 00000000 */
+
2733 
+
2734  /*
+
2735  * 225 0xe1 'á'
+
2736  */
+
2737  0x78, /* 01111000 */
+
2738  0xcc, /* 11001100 */
+
2739  0xcc, /* 11001100 */
+
2740  0xd8, /* 11011000 */
+
2741  0xcc, /* 11001100 */
+
2742  0xc6, /* 11000110 */
+
2743  0xcc, /* 11001100 */
+
2744  0x00, /* 00000000 */
+
2745 
+
2746  /*
+
2747  * 226 0xe2 'â'
+
2748  */
+
2749  0xfe, /* 11111110 */
+
2750  0xc6, /* 11000110 */
+
2751  0xc0, /* 11000000 */
+
2752  0xc0, /* 11000000 */
+
2753  0xc0, /* 11000000 */
+
2754  0xc0, /* 11000000 */
+
2755  0xc0, /* 11000000 */
+
2756  0x00, /* 00000000 */
+
2757 
+
2758  /*
+
2759  * 227 0xe3 'ã'
+
2760  */
+
2761  0x00, /* 00000000 */
+
2762  0x00, /* 00000000 */
+
2763  0xfe, /* 11111110 */
+
2764  0x6c, /* 01101100 */
+
2765  0x6c, /* 01101100 */
+
2766  0x6c, /* 01101100 */
+
2767  0x6c, /* 01101100 */
+
2768  0x00, /* 00000000 */
+
2769 
+
2770  /*
+
2771  * 228 0xe4 'ä'
+
2772  */
+
2773  0xfe, /* 11111110 */
+
2774  0xc6, /* 11000110 */
+
2775  0x60, /* 01100000 */
+
2776  0x30, /* 00110000 */
+
2777  0x60, /* 01100000 */
+
2778  0xc6, /* 11000110 */
+
2779  0xfe, /* 11111110 */
+
2780  0x00, /* 00000000 */
+
2781 
+
2782  /*
+
2783  * 229 0xe5 'å'
+
2784  */
+
2785  0x00, /* 00000000 */
+
2786  0x00, /* 00000000 */
+
2787  0x7e, /* 01111110 */
+
2788  0xd8, /* 11011000 */
+
2789  0xd8, /* 11011000 */
+
2790  0xd8, /* 11011000 */
+
2791  0x70, /* 01110000 */
+
2792  0x00, /* 00000000 */
+
2793 
+
2794  /*
+
2795  * 230 0xe6 'æ'
+
2796  */
+
2797  0x00, /* 00000000 */
+
2798  0x00, /* 00000000 */
+
2799  0x66, /* 01100110 */
+
2800  0x66, /* 01100110 */
+
2801  0x66, /* 01100110 */
+
2802  0x66, /* 01100110 */
+
2803  0x7c, /* 01111100 */
+
2804  0xc0, /* 11000000 */
+
2805 
+
2806  /*
+
2807  * 231 0xe7 'ç'
+
2808  */
+
2809  0x00, /* 00000000 */
+
2810  0x76, /* 01110110 */
+
2811  0xdc, /* 11011100 */
+
2812  0x18, /* 00011000 */
+
2813  0x18, /* 00011000 */
+
2814  0x18, /* 00011000 */
+
2815  0x18, /* 00011000 */
+
2816  0x00, /* 00000000 */
+
2817 
+
2818  /*
+
2819  * 232 0xe8 'è'
+
2820  */
+
2821  0x7e, /* 01111110 */
+
2822  0x18, /* 00011000 */
+
2823  0x3c, /* 00111100 */
+
2824  0x66, /* 01100110 */
+
2825  0x66, /* 01100110 */
+
2826  0x3c, /* 00111100 */
+
2827  0x18, /* 00011000 */
+
2828  0x7e, /* 01111110 */
+
2829 
+
2830  /*
+
2831  * 233 0xe9 'é'
+
2832  */
+
2833  0x38, /* 00111000 */
+
2834  0x6c, /* 01101100 */
+
2835  0xc6, /* 11000110 */
+
2836  0xfe, /* 11111110 */
+
2837  0xc6, /* 11000110 */
+
2838  0x6c, /* 01101100 */
+
2839  0x38, /* 00111000 */
+
2840  0x00, /* 00000000 */
+
2841 
+
2842  /*
+
2843  * 234 0xea 'ê'
+
2844  */
+
2845  0x38, /* 00111000 */
+
2846  0x6c, /* 01101100 */
+
2847  0xc6, /* 11000110 */
+
2848  0xc6, /* 11000110 */
+
2849  0x6c, /* 01101100 */
+
2850  0x6c, /* 01101100 */
+
2851  0xee, /* 11101110 */
+
2852  0x00, /* 00000000 */
+
2853 
+
2854  /*
+
2855  * 235 0xeb 'ë'
+
2856  */
+
2857  0x0e, /* 00001110 */
+
2858  0x18, /* 00011000 */
+
2859  0x0c, /* 00001100 */
+
2860  0x3e, /* 00111110 */
+
2861  0x66, /* 01100110 */
+
2862  0x66, /* 01100110 */
+
2863  0x3c, /* 00111100 */
+
2864  0x00, /* 00000000 */
+
2865 
+
2866  /*
+
2867  * 236 0xec 'ì'
+
2868  */
+
2869  0x00, /* 00000000 */
+
2870  0x00, /* 00000000 */
+
2871  0x7e, /* 01111110 */
+
2872  0xdb, /* 11011011 */
+
2873  0xdb, /* 11011011 */
+
2874  0x7e, /* 01111110 */
+
2875  0x00, /* 00000000 */
+
2876  0x00, /* 00000000 */
+
2877 
+
2878  /*
+
2879  * 237 0xed 'í'
+
2880  */
+
2881  0x06, /* 00000110 */
+
2882  0x0c, /* 00001100 */
+
2883  0x7e, /* 01111110 */
+
2884  0xdb, /* 11011011 */
+
2885  0xdb, /* 11011011 */
+
2886  0x7e, /* 01111110 */
+
2887  0x60, /* 01100000 */
+
2888  0xc0, /* 11000000 */
+
2889 
+
2890  /*
+
2891  * 238 0xee 'î'
+
2892  */
+
2893  0x1e, /* 00011110 */
+
2894  0x30, /* 00110000 */
+
2895  0x60, /* 01100000 */
+
2896  0x7e, /* 01111110 */
+
2897  0x60, /* 01100000 */
+
2898  0x30, /* 00110000 */
+
2899  0x1e, /* 00011110 */
+
2900  0x00, /* 00000000 */
+
2901 
+
2902  /*
+
2903  * 239 0xef 'ï'
+
2904  */
+
2905  0x00, /* 00000000 */
+
2906  0x7c, /* 01111100 */
+
2907  0xc6, /* 11000110 */
+
2908  0xc6, /* 11000110 */
+
2909  0xc6, /* 11000110 */
+
2910  0xc6, /* 11000110 */
+
2911  0xc6, /* 11000110 */
+
2912  0x00, /* 00000000 */
+
2913 
+
2914  /*
+
2915  * 240 0xf0 'ð'
+
2916  */
+
2917  0x00, /* 00000000 */
+
2918  0xfe, /* 11111110 */
+
2919  0x00, /* 00000000 */
+
2920  0xfe, /* 11111110 */
+
2921  0x00, /* 00000000 */
+
2922  0xfe, /* 11111110 */
+
2923  0x00, /* 00000000 */
+
2924  0x00, /* 00000000 */
+
2925 
+
2926  /*
+
2927  * 241 0xf1 'ñ'
+
2928  */
+
2929  0x18, /* 00011000 */
+
2930  0x18, /* 00011000 */
+
2931  0x7e, /* 01111110 */
+
2932  0x18, /* 00011000 */
+
2933  0x18, /* 00011000 */
+
2934  0x00, /* 00000000 */
+
2935  0x7e, /* 01111110 */
+
2936  0x00, /* 00000000 */
+
2937 
+
2938  /*
+
2939  * 242 0xf2 'ò'
+
2940  */
+
2941  0x30, /* 00110000 */
+
2942  0x18, /* 00011000 */
+
2943  0x0c, /* 00001100 */
+
2944  0x18, /* 00011000 */
+
2945  0x30, /* 00110000 */
+
2946  0x00, /* 00000000 */
+
2947  0x7e, /* 01111110 */
+
2948  0x00, /* 00000000 */
+
2949 
+
2950  /*
+
2951  * 243 0xf3 'ó'
+
2952  */
+
2953  0x0c, /* 00001100 */
+
2954  0x18, /* 00011000 */
+
2955  0x30, /* 00110000 */
+
2956  0x18, /* 00011000 */
+
2957  0x0c, /* 00001100 */
+
2958  0x00, /* 00000000 */
+
2959  0x7e, /* 01111110 */
+
2960  0x00, /* 00000000 */
+
2961 
+
2962  /*
+
2963  * 244 0xf4 'ô'
+
2964  */
+
2965  0x0e, /* 00001110 */
+
2966  0x1b, /* 00011011 */
+
2967  0x1b, /* 00011011 */
+
2968  0x18, /* 00011000 */
+
2969  0x18, /* 00011000 */
+
2970  0x18, /* 00011000 */
+
2971  0x18, /* 00011000 */
+
2972  0x18, /* 00011000 */
+
2973 
+
2974  /*
+
2975  * 245 0xf5 'õ'
+
2976  */
+
2977  0x18, /* 00011000 */
+
2978  0x18, /* 00011000 */
+
2979  0x18, /* 00011000 */
+
2980  0x18, /* 00011000 */
+
2981  0x18, /* 00011000 */
+
2982  0xd8, /* 11011000 */
+
2983  0xd8, /* 11011000 */
+
2984  0x70, /* 01110000 */
+
2985 
+
2986  /*
+
2987  * 246 0xf6 'ö'
+
2988  */
+
2989  0x00, /* 00000000 */
+
2990  0x18, /* 00011000 */
+
2991  0x00, /* 00000000 */
+
2992  0x7e, /* 01111110 */
+
2993  0x00, /* 00000000 */
+
2994  0x18, /* 00011000 */
+
2995  0x00, /* 00000000 */
+
2996  0x00, /* 00000000 */
+
2997 
+
2998  /*
+
2999  * 247 0xf7 '÷'
+
3000  */
+
3001  0x00, /* 00000000 */
+
3002  0x76, /* 01110110 */
+
3003  0xdc, /* 11011100 */
+
3004  0x00, /* 00000000 */
+
3005  0x76, /* 01110110 */
+
3006  0xdc, /* 11011100 */
+
3007  0x00, /* 00000000 */
+
3008  0x00, /* 00000000 */
+
3009 
+
3010  /*
+
3011  * 248 0xf8 'ø'
+
3012  */
+
3013  0x38, /* 00111000 */
+
3014  0x6c, /* 01101100 */
+
3015  0x6c, /* 01101100 */
+
3016  0x38, /* 00111000 */
+
3017  0x00, /* 00000000 */
+
3018  0x00, /* 00000000 */
+
3019  0x00, /* 00000000 */
+
3020  0x00, /* 00000000 */
+
3021 
+
3022  /*
+
3023  * 249 0xf9 'ù'
+
3024  */
+
3025  0x00, /* 00000000 */
+
3026  0x00, /* 00000000 */
+
3027  0x00, /* 00000000 */
+
3028  0x18, /* 00011000 */
+
3029  0x18, /* 00011000 */
+
3030  0x00, /* 00000000 */
+
3031  0x00, /* 00000000 */
+
3032  0x00, /* 00000000 */
+
3033 
+
3034  /*
+
3035  * 250 0xfa 'ú'
+
3036  */
+
3037  0x00, /* 00000000 */
+
3038  0x00, /* 00000000 */
+
3039  0x00, /* 00000000 */
+
3040  0x18, /* 00011000 */
+
3041  0x00, /* 00000000 */
+
3042  0x00, /* 00000000 */
+
3043  0x00, /* 00000000 */
+
3044  0x00, /* 00000000 */
+
3045 
+
3046  /*
+
3047  * 251 0xfb 'û'
+
3048  */
+
3049  0x0f, /* 00001111 */
+
3050  0x0c, /* 00001100 */
+
3051  0x0c, /* 00001100 */
+
3052  0x0c, /* 00001100 */
+
3053  0xec, /* 11101100 */
+
3054  0x6c, /* 01101100 */
+
3055  0x3c, /* 00111100 */
+
3056  0x1c, /* 00011100 */
+
3057 
+
3058  /*
+
3059  * 252 0xfc 'ü'
+
3060  */
+
3061  0x6c, /* 01101100 */
+
3062  0x36, /* 00110110 */
+
3063  0x36, /* 00110110 */
+
3064  0x36, /* 00110110 */
+
3065  0x36, /* 00110110 */
+
3066  0x00, /* 00000000 */
+
3067  0x00, /* 00000000 */
+
3068  0x00, /* 00000000 */
+
3069 
+
3070  /*
+
3071  * 253 0xfd 'ý'
+
3072  */
+
3073  0x78, /* 01111000 */
+
3074  0x0c, /* 00001100 */
+
3075  0x18, /* 00011000 */
+
3076  0x30, /* 00110000 */
+
3077  0x7c, /* 01111100 */
+
3078  0x00, /* 00000000 */
+
3079  0x00, /* 00000000 */
+
3080  0x00, /* 00000000 */
+
3081 
+
3082  /*
+
3083  * 254 0xfe 'þ'
+
3084  */
+
3085  0x00, /* 00000000 */
+
3086  0x00, /* 00000000 */
+
3087  0x3c, /* 00111100 */
+
3088  0x3c, /* 00111100 */
+
3089  0x3c, /* 00111100 */
+
3090  0x3c, /* 00111100 */
+
3091  0x00, /* 00000000 */
+
3092  0x00, /* 00000000 */
+
3093 
+
3094  /*
+
3095  * 255 0xff ' '
+
3096  */
+
3097  0x00, /* 00000000 */
+
3098  0x00, /* 00000000 */
+
3099  0x00, /* 00000000 */
+
3100  0x00, /* 00000000 */
+
3101  0x00, /* 00000000 */
+
3102  0x00, /* 00000000 */
+
3103  0x00, /* 00000000 */
+
3104  0x00, /* 00000000 */
+
3105 
+
3106 };
+
#define GFX_FONTDATAMAX
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8c.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8c.html new file mode 100755 index 000000000..1d2054cd1 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8c.html @@ -0,0 +1,2518 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.c File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.c File Reference
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SDL.h"
+#include "SDL2_imageFilter.h"
+
+

Go to the source code of this file.

+ + + + + +

+Macros

#define SWAP_32(x)   (((x) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | ((x) << 24))
 Swaps the byte order in a 32bit integer (LSB becomes MSB, etc.). More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

int SDL_imageFilterMMXdetect (void)
 MMX detection routine (with override flag). More...
 
void SDL_imageFilterMMXoff ()
 Disable MMX check for filter functions and and force to use non-MMX C based code. More...
 
void SDL_imageFilterMMXon ()
 Enable MMX check for filter functions and use MMX code if available. More...
 
int SDL_imageFilterAdd (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Add: D = saturation255(S1 + S2) More...
 
int SDL_imageFilterMean (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Mean: D = S1/2 + S2/2. More...
 
int SDL_imageFilterSub (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Sub: D = saturation0(S1 - S2) More...
 
int SDL_imageFilterAbsDiff (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using AbsDiff: D = | S1 - S2 |. More...
 
int SDL_imageFilterMult (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Mult: D = saturation255(S1 * S2) More...
 
int SDL_imageFilterMultNorASM (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
 Internal ASM Filter using MultNor: D = S1 * S2. More...
 
int SDL_imageFilterMultNor (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultNor: D = S1 * S2. More...
 
int SDL_imageFilterMultDivby2 (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultDivby2: D = saturation255(S1/2 * S2) More...
 
int SDL_imageFilterMultDivby4 (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultDivby4: D = saturation255(S1/2 * S2/2) More...
 
int SDL_imageFilterBitAnd (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using BitAnd: D = S1 & S2. More...
 
int SDL_imageFilterBitOr (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using BitOr: D = S1 | S2. More...
 
int SDL_imageFilterDiv (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Div: D = S1 / S2. More...
 
int SDL_imageFilterBitNegation (unsigned char *Src1, unsigned char *Dest, unsigned int length)
 Filter using BitNegation: D = !S. More...
 
int SDL_imageFilterAddByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using AddByte: D = saturation255(S + C) More...
 
int SDL_imageFilterAddUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
 Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C) More...
 
int SDL_imageFilterAddByteToHalf (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using AddByteToHalf: D = saturation255(S/2 + C) More...
 
int SDL_imageFilterSubByteMMX (unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char C)
 Internal MMX Filter using SubByte: D = saturation0(S - C) More...
 
int SDL_imageFilterSubByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using SubByte: D = saturation0(S - C) More...
 
int SDL_imageFilterSubUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
 Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C) More...
 
int SDL_imageFilterShiftRight (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftRight: D = saturation0(S >> N) More...
 
int SDL_imageFilterShiftRightUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N) More...
 
int SDL_imageFilterMultByByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using MultByByte: D = saturation255(S * C) More...
 
int SDL_imageFilterShiftRightAndMultByByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N, unsigned char C)
 Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C) More...
 
int SDL_imageFilterShiftLeftByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftLeftByte: D = (S << N) More...
 
int SDL_imageFilterShiftLeftUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftLeftUint: D = ((uint)S << N) More...
 
int SDL_imageFilterShiftLeft (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter ShiftLeft: D = saturation255(S << N) More...
 
int SDL_imageFilterBinarizeUsingThreshold (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char T)
 Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0. More...
 
int SDL_imageFilterClipToRange (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char Tmin, unsigned char Tmax)
 Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax. More...
 
int SDL_imageFilterNormalizeLinear (unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin, int Cmax, int Nmin, int Nmax)
 Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin) More...
 
int SDL_imageFilterConvolveKernel3x3Divide (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
 Filter using ConvolveKernel3x3Divide: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel5x5Divide (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
 Filter using ConvolveKernel5x5Divide: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel7x7Divide (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
 Filter using ConvolveKernel7x7Divide: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel9x9Divide (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
 Filter using ConvolveKernel9x9Divide: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel3x3ShiftRight (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
 Filter using ConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel5x5ShiftRight (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
 Filter using ConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel7x7ShiftRight (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
 Filter using ConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... ) More...
 
int SDL_imageFilterConvolveKernel9x9ShiftRight (unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
 Filter using ConvolveKernel9x9ShiftRight: Dij = saturation255( ... ) More...
 
int SDL_imageFilterSobelX (unsigned char *Src, unsigned char *Dest, int rows, int columns)
 Filter using SobelX: Dij = saturation255( ... ) More...
 
int SDL_imageFilterSobelXShiftRight (unsigned char *Src, unsigned char *Dest, int rows, int columns, unsigned char NRightShift)
 Filter using SobelXShiftRight: Dij = saturation255( ... ) More...
 
void SDL_imageFilterAlignStack (void)
 Align stack to 32 byte boundary,. More...
 
void SDL_imageFilterRestoreStack (void)
 Restore previously aligned stack. More...
 
+

Macro Definition Documentation

+ +
+
+ + + + + + + + +
#define SWAP_32( x)   (((x) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | ((x) << 24))
+
+ +

Swaps the byte order in a 32bit integer (LSB becomes MSB, etc.).

+ +

Definition at line 61 of file SDL2_imageFilter.c.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterAbsDiff (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using AbsDiff: D = | S1 - S2 |.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 542 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterAdd (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Add: D = saturation255(S1 + S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 173 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterAddByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using AddByte: D = saturation255(S + C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant value to add (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1791 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterAddByteToHalf (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using AddByteToHalf: D = saturation255(S/2 + C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to add (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2068 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterAddUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned int C 
)
+
+ +

Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to add (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1919 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
void SDL_imageFilterAlignStack (void )
+
+ +

Align stack to 32 byte boundary,.

+ +

Definition at line 7326 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterBinarizeUsingThreshold (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char T 
)
+
+ +

Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0.

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
TThe threshold boundary (inclusive).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3534 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterBitAnd (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using BitAnd: D = S1 & S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1278 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterBitNegation (unsigned char * Src1,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using BitNegation: D = !S.

+
Parameters
+ + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1671 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterBitOr (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using BitOr: D = S1 | S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1392 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterClipToRange (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char Tmin,
unsigned char Tmax 
)
+
+ +

Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.

+
Parameters
+ + + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
TminLower (inclusive) boundary of the clipping range.
TmaxUpper (inclusive) boundary of the clipping range.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3691 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel3x3Divide (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char Divisor 
)
+
+ +

Filter using ConvolveKernel3x3Divide: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >2.
columnsNumber of columns in source/destination array. Must be >2.
KernelThe 2D convolution kernel of size 3x3.
DivisorThe divisor of the convolution sum. Must be >0.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 3980 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel3x3ShiftRight (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char NRightShift 
)
+
+ +

Filter using ConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >2.
columnsNumber of columns in source/destination array. Must be >2.
KernelThe 2D convolution kernel of size 3x3.
NRightShiftThe number of right bit shifts to apply to the convolution sum. Must be <7.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 5378 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel5x5Divide (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char Divisor 
)
+
+ +

Filter using ConvolveKernel5x5Divide: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >4.
columnsNumber of columns in source/destination array. Must be >4.
KernelThe 2D convolution kernel of size 5x5.
DivisorThe divisor of the convolution sum. Must be >0.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 4170 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel5x5ShiftRight (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char NRightShift 
)
+
+ +

Filter using ConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >4.
columnsNumber of columns in source/destination array. Must be >4.
KernelThe 2D convolution kernel of size 5x5.
NRightShiftThe number of right bit shifts to apply to the convolution sum. Must be <7.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 5555 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel7x7Divide (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char Divisor 
)
+
+ +

Filter using ConvolveKernel7x7Divide: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >6.
columnsNumber of columns in source/destination array. Must be >6.
KernelThe 2D convolution kernel of size 7x7.
DivisorThe divisor of the convolution sum. Must be >0.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 4473 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel7x7ShiftRight (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char NRightShift 
)
+
+ +

Filter using ConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >6.
columnsNumber of columns in source/destination array. Must be >6.
KernelThe 2D convolution kernel of size 7x7.
NRightShiftThe number of right bit shifts to apply to the convolution sum. Must be <7.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 5856 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel9x9Divide (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char Divisor 
)
+
+ +

Filter using ConvolveKernel9x9Divide: Dij = saturation0and255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >8.
columnsNumber of columns in source/destination array. Must be >8.
KernelThe 2D convolution kernel of size 9x9.
DivisorThe divisor of the convolution sum. Must be >0.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 4830 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterConvolveKernel9x9ShiftRight (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
signed short * Kernel,
unsigned char NRightShift 
)
+
+ +

Filter using ConvolveKernel9x9ShiftRight: Dij = saturation255( ... )

+
Parameters
+ + + + + + + +
SrcThe source 2D byte array to convolve. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >8.
columnsNumber of columns in source/destination array. Must be >8.
KernelThe 2D convolution kernel of size 9x9.
NRightShiftThe number of right bit shifts to apply to the convolution sum. Must be <7.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 6219 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterDiv (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Div: D = S1 / S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1549 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMean (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Mean: D = S1/2 + S2/2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 308 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
int SDL_imageFilterMMXdetect (void )
+
+ +

MMX detection routine (with override flag).

+
Returns
1 of MMX was detected, 0 otherwise.
+ +

Definition at line 80 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
void SDL_imageFilterMMXoff (void )
+
+ +

Disable MMX check for filter functions and and force to use non-MMX C based code.

+ +

Definition at line 93 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
void SDL_imageFilterMMXon (void )
+
+ +

Enable MMX check for filter functions and use MMX code if available.

+ +

Definition at line 101 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMult (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Mult: D = saturation255(S1 * S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 729 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMultByByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using MultByByte: D = saturation255(S * C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
CConstant to multiply with (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2790 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMultDivby2 (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using MultDivby2: D = saturation255(S1/2 * S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1000 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMultDivby4 (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using MultDivby4: D = saturation255(S1/2 * S2/2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1141 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMultNor (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using MultNor: D = S1 * S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 862 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterMultNorASM (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int SrcLength 
)
+
+ +

Internal ASM Filter using MultNor: D = S1 * S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
SrcLengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 792 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterNormalizeLinear (unsigned char * Src,
unsigned char * Dest,
unsigned int length,
int Cmin,
int Cmax,
int Nmin,
int Nmax 
)
+
+ +

Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)

+
Parameters
+ + + + + + + + +
SrcPointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CminNormalization constant.
CmaxNormalization constant.
NminNormalization constant.
NmaxNormalization constant.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3909 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
void SDL_imageFilterRestoreStack (void )
+
+ +

Restore previously aligned stack.

+ +

Definition at line 7354 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterShiftLeft (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter ShiftLeft: D = saturation255(S << N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3393 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterShiftLeftByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftLeftByte: D = (S << N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3093 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterShiftLeftUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftLeftUint: D = ((uint)S << N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 32.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3210 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterShiftRight (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftRight: D = saturation0(S >> N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2476 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterShiftRightAndMultByByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N,
unsigned char C 
)
+
+ +

Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C)

+
Parameters
+ + + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
CConstant to multiply with (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2943 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterShiftRightUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 32.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2594 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterSobelX (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns 
)
+
+ +

Filter using SobelX: Dij = saturation255( ... )

+
Parameters
+ + + + + +
SrcThe source 2D byte array to sobel-filter. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >2.
columnsNumber of columns in source/destination array. Must be >7.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 6799 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterSobelXShiftRight (unsigned char * Src,
unsigned char * Dest,
int rows,
int columns,
unsigned char NRightShift 
)
+
+ +

Filter using SobelXShiftRight: Dij = saturation255( ... )

+
Parameters
+ + + + + + +
SrcThe source 2D byte array to sobel-filter. Should be different from destination.
DestThe destination 2D byte array to store the result in. Should be different from source.
rowsNumber of rows in source/destination array. Must be >2.
columnsNumber of columns in source/destination array. Must be >8.
NRightShiftThe number of right bit shifts to apply to the filter sum. Must be <7.
+
+
+

Note: Non-MMX implementation not available for this function.

+
Returns
Returns 1 if filter was applied, 0 otherwise.
+ +

Definition at line 7052 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterSub (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Sub: D = saturation0(S1 - S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 422 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterSubByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using SubByte: D = saturation0(S - C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
CConstant to subtract (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2196 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterSubByteMMX (unsigned char * Src1,
unsigned char * Dest,
unsigned int SrcLength,
unsigned char C 
)
+
+ +

Internal MMX Filter using SubByte: D = saturation0(S - C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
SrcLengthThe number of bytes in the source array.
CConstant to subtract (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2130 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int SDL_imageFilterSubUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned int C 
)
+
+ +

Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to subtract (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2325 of file SDL2_imageFilter.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8c_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8c_source.html new file mode 100755 index 000000000..4dae2efca --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8c_source.html @@ -0,0 +1,6760 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.c Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.c
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_imageFilter.c: byte-image "filter" routines
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 Copyright (C) 2013 Sylvain Beucler
+
7 
+
8 This software is provided 'as-is', without any express or implied
+
9 warranty. In no event will the authors be held liable for any damages
+
10 arising from the use of this software.
+
11 
+
12 Permission is granted to anyone to use this software for any purpose,
+
13 including commercial applications, and to alter it and redistribute it
+
14 freely, subject to the following restrictions:
+
15 
+
16  1. The origin of this software must not be misrepresented; you must not
+
17  claim that you wrote the original software. If you use this software
+
18  in a product, an acknowledgment in the product documentation would be
+
19  appreciated but is not required.
+
20 
+
21  2. Altered source versions must be plainly marked as such, and must not be
+
22  misrepresented as being the original software.
+
23 
+
24  3. This notice may not be removed or altered from any source
+
25  distribution.
+
26 
+
27 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
28 
+
29 */
+
30 
+
31 /*
+
32 
+
33 Note: Uses inline x86 MMX or ASM optimizations if available and enabled.
+
34 
+
35 Note: Most of the MMX code is based on published routines
+
36 by Vladimir Kravtchenko at vk@cs.ubc.ca - credits go to
+
37 him for his work.
+
38 
+
39 */
+
40 
+
41 #include <stdio.h>
+
42 #include <stdlib.h>
+
43 #include <string.h>
+
44 
+
45 #include "SDL.h"
+
46 
+
47 /* Use GCC intrinsics if available: they support both i386 and x86_64,
+
48  provide ASM-grade performances, and lift the PUSHA/POPA issues. */
+
49 #ifdef __GNUC__
+
50 # ifdef USE_MMX
+
51 # include <mmintrin.h>
+
52 # endif
+
53 # include <SDL_cpuinfo.h>
+
54 #endif
+
55 
+
56 #include "SDL2_imageFilter.h"
+
57 
+
61 #define SWAP_32(x) (((x) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | ((x) << 24))
+
62 
+
63 /* ------ Static variables ----- */
+
64 
+
68 static int SDL_imageFilterUseMMX = 1;
+
69 
+
70 /* Detect GCC */
+
71 #if defined(__GNUC__)
+
72 #define GCC__
+
73 #endif
+
74 
+ +
81 {
+
82  /* Check override flag */
+
83  if (SDL_imageFilterUseMMX == 0) {
+
84  return (0);
+
85  }
+
86 
+
87  return SDL_HasMMX();
+
88 }
+
89 
+ +
94 {
+
95  SDL_imageFilterUseMMX = 0;
+
96 }
+
97 
+ +
102 {
+
103  SDL_imageFilterUseMMX = 1;
+
104 }
+
105 
+
106 /* ------------------------------------------------------------------------------------ */
+
107 
+
118 static int SDL_imageFilterAddMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
119 {
+
120 #ifdef USE_MMX
+
121 #if !defined(GCC__)
+
122  __asm
+
123  {
+
124  pusha
+
125  mov eax, Src1 /* load Src1 address into eax */
+
126  mov ebx, Src2 /* load Src2 address into ebx */
+
127  mov edi, Dest /* load Dest address into edi */
+
128  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
129  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
130  align 16 /* 16 byte alignment of the loop entry */
+
131 L1010:
+
132  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
133  paddusb mm1, [ebx] /* mm1=Src1+Src2 (add 8 bytes with saturation) */
+
134  movq [edi], mm1 /* store result in Dest */
+
135  add eax, 8 /* increase Src1, Src2 and Dest */
+
136  add ebx, 8 /* register pointers by 8 */
+
137  add edi, 8
+
138  dec ecx /* decrease loop counter */
+
139  jnz L1010 /* check loop termination, proceed if required */
+
140  emms /* exit MMX state */
+
141  popa
+
142  }
+
143 #else
+
144  /* i386 and x86_64 */
+
145  __m64 *mSrc1 = (__m64*)Src1;
+
146  __m64 *mSrc2 = (__m64*)Src2;
+
147  __m64 *mDest = (__m64*)Dest;
+
148  int i;
+
149  for (i = 0; i < SrcLength/8; i++) {
+
150  *mDest = _m_paddusb(*mSrc1, *mSrc2); /* Src1+Src2 (add 8 bytes with saturation) */
+
151  mSrc1++;
+
152  mSrc2++;
+
153  mDest++;
+
154  }
+
155  _m_empty(); /* clean MMX state */
+
156 #endif
+
157  return (0);
+
158 #else
+
159  return (-1);
+
160 #endif
+
161 }
+
162 
+
173 int SDL_imageFilterAdd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
174 {
+
175  unsigned int i, istart;
+
176  unsigned char *cursrc1, *cursrc2, *curdst;
+
177  int result;
+
178 
+
179  /* Validate input parameters */
+
180  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
181  return(-1);
+
182  if (length == 0)
+
183  return(0);
+
184 
+
185  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
186 
+
187  /* Use MMX assembly routine */
+
188  SDL_imageFilterAddMMX(Src1, Src2, Dest, length);
+
189 
+
190  /* Check for unaligned bytes */
+
191  if ((length & 7) > 0) {
+
192  /* Setup to process unaligned bytes */
+
193  istart = length & 0xfffffff8;
+
194  cursrc1 = &Src1[istart];
+
195  cursrc2 = &Src2[istart];
+
196  curdst = &Dest[istart];
+
197  } else {
+
198  /* No unaligned bytes - we are done */
+
199  return (0);
+
200  }
+
201  } else {
+
202  /* Setup to process whole image */
+
203  istart = 0;
+
204  cursrc1 = Src1;
+
205  cursrc2 = Src2;
+
206  curdst = Dest;
+
207  }
+
208 
+
209  /* C routine to process image */
+
210  for (i = istart; i < length; i++) {
+
211  result = (int) *cursrc1 + (int) *cursrc2;
+
212  if (result > 255)
+
213  result = 255;
+
214  *curdst = (unsigned char) result;
+
215  /* Advance pointers */
+
216  cursrc1++;
+
217  cursrc2++;
+
218  curdst++;
+
219  }
+
220 
+
221  return (0);
+
222 }
+
223 
+
235 static int SDL_imageFilterMeanMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength,
+
236  unsigned char *Mask)
+
237 {
+
238 #ifdef USE_MMX
+
239 #if !defined(GCC__)
+
240  __asm
+
241  {
+
242  pusha
+
243  mov edx, Mask /* load Mask address into edx */
+
244  movq mm0, [edx] /* load Mask into mm0 */
+
245  mov eax, Src1 /* load Src1 address into eax */
+
246  mov ebx, Src2 /* load Src2 address into ebx */
+
247  mov edi, Dest /* load Dest address into edi */
+
248  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
249  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
250  align 16 /* 16 byte alignment of the loop entry */
+
251 L21011:
+
252  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
253  movq mm2, [ebx] /* load 8 bytes from Src2 into mm2 */
+
254  /* --- Byte shift via Word shift --- */
+
255  psrlw mm1, 1 /* shift 4 WORDS of mm1 1 bit to the right */
+
256  psrlw mm2, 1 /* shift 4 WORDS of mm2 1 bit to the right */
+
257  pand mm1, mm0 // apply Mask to 8 BYTES of mm1 */
+
258  /* byte 0x0f, 0xdb, 0xc8 */
+
259  pand mm2, mm0 // apply Mask to 8 BYTES of mm2 */
+
260  /* byte 0x0f, 0xdb, 0xd0 */
+
261  paddusb mm1, mm2 /* mm1=mm1+mm2 (add 8 bytes with saturation) */
+
262  movq [edi], mm1 /* store result in Dest */
+
263  add eax, 8 /* increase Src1, Src2 and Dest */
+
264  add ebx, 8 /* register pointers by 8 */
+
265  add edi, 8
+
266  dec ecx /* decrease loop counter */
+
267  jnz L21011 /* check loop termination, proceed if required */
+
268  emms /* exit MMX state */
+
269  popa
+
270  }
+
271 #else
+
272  /* i386 and x86_64 */
+
273  __m64 *mSrc1 = (__m64*)Src1;
+
274  __m64 *mSrc2 = (__m64*)Src2;
+
275  __m64 *mDest = (__m64*)Dest;
+
276  __m64 *mMask = (__m64*)Mask;
+
277  int i;
+
278  for (i = 0; i < SrcLength/8; i++) {
+
279  __m64 mm1 = *mSrc1,
+
280  mm2 = *mSrc2;
+
281  mm1 = _m_psrlwi(mm1, 1); /* shift 4 WORDS of mm1 1 bit to the right */
+
282  mm2 = _m_psrlwi(mm2, 1); /* shift 4 WORDS of mm2 1 bit to the right */
+
283  mm1 = _m_pand(mm1, *mMask); /* apply Mask to 8 BYTES of mm1 */
+
284  mm2 = _m_pand(mm2, *mMask); /* apply Mask to 8 BYTES of mm2 */
+
285  *mDest = _m_paddusb(mm1, mm2); /* mm1+mm2 (add 8 bytes with saturation) */
+
286  mSrc1++;
+
287  mSrc2++;
+
288  mDest++;
+
289  }
+
290  _m_empty(); /* clean MMX state */
+
291 #endif
+
292  return (0);
+
293 #else
+
294  return (-1);
+
295 #endif
+
296 }
+
297 
+
308 int SDL_imageFilterMean(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
309 {
+
310  static unsigned char Mask[8] = { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F };
+
311  unsigned int i, istart;
+
312  unsigned char *cursrc1, *cursrc2, *curdst;
+
313  int result;
+
314 
+
315  /* Validate input parameters */
+
316  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
317  return(-1);
+
318  if (length == 0)
+
319  return(0);
+
320 
+
321  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
322  /* MMX routine */
+
323  SDL_imageFilterMeanMMX(Src1, Src2, Dest, length, Mask);
+
324 
+
325  /* Check for unaligned bytes */
+
326  if ((length & 7) > 0) {
+
327  /* Setup to process unaligned bytes */
+
328  istart = length & 0xfffffff8;
+
329  cursrc1 = &Src1[istart];
+
330  cursrc2 = &Src2[istart];
+
331  curdst = &Dest[istart];
+
332  } else {
+
333  /* No unaligned bytes - we are done */
+
334  return (0);
+
335  }
+
336  } else {
+
337  /* Setup to process whole image */
+
338  istart = 0;
+
339  cursrc1 = Src1;
+
340  cursrc2 = Src2;
+
341  curdst = Dest;
+
342  }
+
343 
+
344  /* C routine to process image */
+
345  for (i = istart; i < length; i++) {
+
346  result = (int) *cursrc1 / 2 + (int) *cursrc2 / 2;
+
347  *curdst = (unsigned char) result;
+
348  /* Advance pointers */
+
349  cursrc1++;
+
350  cursrc2++;
+
351  curdst++;
+
352  }
+
353 
+
354  return (0);
+
355 }
+
356 
+
367 static int SDL_imageFilterSubMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
368 {
+
369 #ifdef USE_MMX
+
370 #if !defined(GCC__)
+
371  __asm
+
372  {
+
373  pusha
+
374  mov eax, Src1 /* load Src1 address into eax */
+
375  mov ebx, Src2 /* load Src2 address into ebx */
+
376  mov edi, Dest /* load Dest address into edi */
+
377  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
378  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
379  align 16 /* 16 byte alignment of the loop entry */
+
380 L1012:
+
381  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
382  psubusb mm1, [ebx] /* mm1=Src1-Src2 (sub 8 bytes with saturation) */
+
383  movq [edi], mm1 /* store result in Dest */
+
384  add eax, 8 /* increase Src1, Src2 and Dest */
+
385  add ebx, 8 /* register pointers by 8 */
+
386  add edi, 8
+
387  dec ecx /* decrease loop counter */
+
388  jnz L1012 /* check loop termination, proceed if required */
+
389  emms /* exit MMX state */
+
390  popa
+
391  }
+
392 #else
+
393  /* i386 and x86_64 */
+
394  __m64 *mSrc1 = (__m64*)Src1;
+
395  __m64 *mSrc2 = (__m64*)Src2;
+
396  __m64 *mDest = (__m64*)Dest;
+
397  int i;
+
398  for (i = 0; i < SrcLength/8; i++) {
+
399  *mDest = _m_psubusb(*mSrc1, *mSrc2); /* Src1-Src2 (sub 8 bytes with saturation) */
+
400  mSrc1++;
+
401  mSrc2++;
+
402  mDest++;
+
403  }
+
404  _m_empty(); /* clean MMX state */
+
405 #endif
+
406  return (0);
+
407 #else
+
408  return (-1);
+
409 #endif
+
410 }
+
411 
+
422 int SDL_imageFilterSub(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
423 {
+
424  unsigned int i, istart;
+
425  unsigned char *cursrc1, *cursrc2, *curdst;
+
426  int result;
+
427 
+
428  /* Validate input parameters */
+
429  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
430  return(-1);
+
431  if (length == 0)
+
432  return(0);
+
433 
+
434  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
435  /* MMX routine */
+
436  SDL_imageFilterSubMMX(Src1, Src2, Dest, length);
+
437 
+
438  /* Check for unaligned bytes */
+
439  if ((length & 7) > 0) {
+
440  /* Setup to process unaligned bytes */
+
441  istart = length & 0xfffffff8;
+
442  cursrc1 = &Src1[istart];
+
443  cursrc2 = &Src2[istart];
+
444  curdst = &Dest[istart];
+
445  } else {
+
446  /* No unaligned bytes - we are done */
+
447  return (0);
+
448  }
+
449  } else {
+
450  /* Setup to process whole image */
+
451  istart = 0;
+
452  cursrc1 = Src1;
+
453  cursrc2 = Src2;
+
454  curdst = Dest;
+
455  }
+
456 
+
457  /* C routine to process image */
+
458  for (i = istart; i < length; i++) {
+
459  result = (int) *cursrc1 - (int) *cursrc2;
+
460  if (result < 0)
+
461  result = 0;
+
462  *curdst = (unsigned char) result;
+
463  /* Advance pointers */
+
464  cursrc1++;
+
465  cursrc2++;
+
466  curdst++;
+
467  }
+
468 
+
469  return (0);
+
470 }
+
471 
+
482 static int SDL_imageFilterAbsDiffMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
483 {
+
484 #ifdef USE_MMX
+
485 #if !defined(GCC__)
+
486  __asm
+
487  {
+
488  pusha
+
489  mov eax, Src1 /* load Src1 address into eax */
+
490  mov ebx, Src2 /* load Src2 address into ebx */
+
491  mov edi, Dest /* load Dest address into edi */
+
492  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
493  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
494  align 16 /* 16 byte alignment of the loop entry */
+
495 L1013:
+
496  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
497  movq mm2, [ebx] /* load 8 bytes from Src2 into mm2 */
+
498  psubusb mm1, [ebx] /* mm1=Src1-Src2 (sub 8 bytes with saturation) */
+
499  psubusb mm2, [eax] /* mm2=Src2-Src1 (sub 8 bytes with saturation) */
+
500  por mm1, mm2 /* combine both mm2 and mm1 results */
+
501  movq [edi], mm1 /* store result in Dest */
+
502  add eax, 8 /* increase Src1, Src2 and Dest */
+
503  add ebx, 8 /* register pointers by 8 */
+
504  add edi, 8
+
505  dec ecx /* decrease loop counter */
+
506  jnz L1013 /* check loop termination, proceed if required */
+
507  emms /* exit MMX state */
+
508  popa
+
509  }
+
510 #else
+
511  /* i386 and x86_64 */
+
512  __m64 *mSrc1 = (__m64*)Src1;
+
513  __m64 *mSrc2 = (__m64*)Src2;
+
514  __m64 *mDest = (__m64*)Dest;
+
515  int i;
+
516  for (i = 0; i < SrcLength/8; i++) {
+
517  __m64 mm1 = _m_psubusb(*mSrc2, *mSrc1); /* Src1-Src2 (sub 8 bytes with saturation) */
+
518  __m64 mm2 = _m_psubusb(*mSrc1, *mSrc2); /* Src2-Src1 (sub 8 bytes with saturation) */
+
519  *mDest = _m_por(mm1, mm2); /* combine both mm2 and mm1 results */
+
520  mSrc1++;
+
521  mSrc2++;
+
522  mDest++;
+
523  }
+
524  _m_empty(); /* clean MMX state */
+
525 #endif
+
526  return (0);
+
527 #else
+
528  return (-1);
+
529 #endif
+
530 }
+
531 
+
542 int SDL_imageFilterAbsDiff(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
543 {
+
544  unsigned int i, istart;
+
545  unsigned char *cursrc1, *cursrc2, *curdst;
+
546  int result;
+
547 
+
548  /* Validate input parameters */
+
549  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
550  return(-1);
+
551  if (length == 0)
+
552  return(0);
+
553 
+
554  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
555  /* MMX routine */
+
556  SDL_imageFilterAbsDiffMMX(Src1, Src2, Dest, length);
+
557 
+
558  /* Check for unaligned bytes */
+
559  if ((length & 7) > 0) {
+
560  /* Setup to process unaligned bytes */
+
561  istart = length & 0xfffffff8;
+
562  cursrc1 = &Src1[istart];
+
563  cursrc2 = &Src2[istart];
+
564  curdst = &Dest[istart];
+
565  } else {
+
566  /* No unaligned bytes - we are done */
+
567  return (0);
+
568  }
+
569  } else {
+
570  /* Setup to process whole image */
+
571  istart = 0;
+
572  cursrc1 = Src1;
+
573  cursrc2 = Src2;
+
574  curdst = Dest;
+
575  }
+
576 
+
577  /* C routine to process image */
+
578  for (i = istart; i < length; i++) {
+
579  result = abs((int) *cursrc1 - (int) *cursrc2);
+
580  *curdst = (unsigned char) result;
+
581  /* Advance pointers */
+
582  cursrc1++;
+
583  cursrc2++;
+
584  curdst++;
+
585  }
+
586 
+
587  return (0);
+
588 }
+
589 
+
600 static int SDL_imageFilterMultMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
601 {
+
602 #ifdef USE_MMX
+
603 #if !defined(GCC__)
+
604  __asm
+
605  {
+
606  pusha
+
607  mov eax, Src1 /* load Src1 address into eax */
+
608  mov ebx, Src2 /* load Src2 address into ebx */
+
609  mov edi, Dest /* load Dest address into edi */
+
610  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
611  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
612  pxor mm0, mm0 /* zero mm0 register */
+
613  align 16 /* 16 byte alignment of the loop entry */
+
614 L1014:
+
615  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
616  movq mm3, [ebx] /* load 8 bytes from Src2 into mm3 */
+
617  movq mm2, mm1 /* copy mm1 into mm2 */
+
618  movq mm4, mm3 /* copy mm3 into mm4 */
+
619  punpcklbw mm1, mm0 /* unpack low bytes of Src1 into words */
+
620  punpckhbw mm2, mm0 /* unpack high bytes of Src1 into words */
+
621  punpcklbw mm3, mm0 /* unpack low bytes of Src2 into words */
+
622  punpckhbw mm4, mm0 /* unpack high bytes of Src2 into words */
+
623  pmullw mm1, mm3 /* mul low bytes of Src1 and Src2 */
+
624  pmullw mm2, mm4 /* mul high bytes of Src1 and Src2 */
+
625  /* Take abs value of the results (signed words) */
+
626  movq mm5, mm1 /* copy mm1 into mm5 */
+
627  movq mm6, mm2 /* copy mm2 into mm6 */
+
628  psraw mm5, 15 /* fill mm5 words with word sign bit */
+
629  psraw mm6, 15 /* fill mm6 words with word sign bit */
+
630  pxor mm1, mm5 /* take 1's compliment of only neg. words */
+
631  pxor mm2, mm6 /* take 1's compliment of only neg. words */
+
632  psubsw mm1, mm5 /* add 1 to only neg. words, W-(-1) or W-0 */
+
633  psubsw mm2, mm6 /* add 1 to only neg. words, W-(-1) or W-0 */
+
634  packuswb mm1, mm2 /* pack words back into bytes with saturation */
+
635  movq [edi], mm1 /* store result in Dest */
+
636  add eax, 8 /* increase Src1, Src2 and Dest */
+
637  add ebx, 8 /* register pointers by 8 */
+
638  add edi, 8
+
639  dec ecx /* decrease loop counter */
+
640  jnz L1014 /* check loop termination, proceed if required */
+
641  emms /* exit MMX state */
+
642  popa
+
643  }
+
644 #else
+
645  /* i386 ASM with constraints: */
+
646  /* asm volatile ( */
+
647  /* "shr $3, %%ecx \n\t" /\* counter/8 (MMX loads 8 bytes at a time) *\/ */
+
648  /* "pxor %%mm0, %%mm0 \n\t" /\* zero mm0 register *\/ */
+
649  /* ".align 16 \n\t" /\* 16 byte alignment of the loop entry *\/ */
+
650  /* "1: movq (%%eax), %%mm1 \n\t" /\* load 8 bytes from Src1 into mm1 *\/ */
+
651  /* "movq (%%ebx), %%mm3 \n\t" /\* load 8 bytes from Src2 into mm3 *\/ */
+
652  /* "movq %%mm1, %%mm2 \n\t" /\* copy mm1 into mm2 *\/ */
+
653  /* "movq %%mm3, %%mm4 \n\t" /\* copy mm3 into mm4 *\/ */
+
654  /* "punpcklbw %%mm0, %%mm1 \n\t" /\* unpack low bytes of Src1 into words *\/ */
+
655  /* "punpckhbw %%mm0, %%mm2 \n\t" /\* unpack high bytes of Src1 into words *\/ */
+
656  /* "punpcklbw %%mm0, %%mm3 \n\t" /\* unpack low bytes of Src2 into words *\/ */
+
657  /* "punpckhbw %%mm0, %%mm4 \n\t" /\* unpack high bytes of Src2 into words *\/ */
+
658  /* "pmullw %%mm3, %%mm1 \n\t" /\* mul low bytes of Src1 and Src2 *\/ */
+
659  /* "pmullw %%mm4, %%mm2 \n\t" /\* mul high bytes of Src1 and Src2 *\/ */
+
660  /* /\* Take abs value of the results (signed words) *\/ */
+
661  /* "movq %%mm1, %%mm5 \n\t" /\* copy mm1 into mm5 *\/ */
+
662  /* "movq %%mm2, %%mm6 \n\t" /\* copy mm2 into mm6 *\/ */
+
663  /* "psraw $15, %%mm5 \n\t" /\* fill mm5 words with word sign bit *\/ */
+
664  /* "psraw $15, %%mm6 \n\t" /\* fill mm6 words with word sign bit *\/ */
+
665  /* "pxor %%mm5, %%mm1 \n\t" /\* take 1's compliment of only neg. words *\/ */
+
666  /* "pxor %%mm6, %%mm2 \n\t" /\* take 1's compliment of only neg. words *\/ */
+
667  /* "psubsw %%mm5, %%mm1 \n\t" /\* add 1 to only neg. words, W-(-1) or W-0 *\/ */
+
668  /* "psubsw %%mm6, %%mm2 \n\t" /\* add 1 to only neg. words, W-(-1) or W-0 *\/ */
+
669  /* "packuswb %%mm2, %%mm1 \n\t" /\* pack words back into bytes with saturation *\/ */
+
670  /* "movq %%mm1, (%%edi) \n\t" /\* store result in Dest *\/ */
+
671  /* "add $8, %%eax \n\t" /\* increase Src1, Src2 and Dest *\/ */
+
672  /* "add $8, %%ebx \n\t" /\* register pointers by 8 *\/ */
+
673  /* "add $8, %%edi \n\t" */
+
674  /* "dec %%ecx \n\t" /\* decrease loop counter *\/ */
+
675  /* "jnz 1b \n\t" /\* check loop termination, proceed if required *\/ */
+
676  /* "emms \n\t" /\* exit MMX state *\/ */
+
677  /* : "+a" (Src1), /\* load Src1 address into rax, modified by the loop *\/ */
+
678  /* "+b" (Src2), /\* load Src2 address into rbx, modified by the loop *\/ */
+
679  /* "+c" (SrcLength), /\* load loop counter (SIZE) into rcx, modified by the loop *\/ */
+
680  /* "+D" (Dest) /\* load Dest address into rdi, modified by the loop *\/ */
+
681  /* : */
+
682  /* : "memory", /\* *Dest is modified *\/ */
+
683  /* "mm0","mm1","mm2","mm3","mm4","mm5","mm6" /\* registers modified *\/ */
+
684  /* ); */
+
685 
+
686  /* i386 and x86_64 */
+
687  __m64 *mSrc1 = (__m64*)Src1;
+
688  __m64 *mSrc2 = (__m64*)Src2;
+
689  __m64 *mDest = (__m64*)Dest;
+
690  __m64 mm0 = _m_from_int(0); /* zero mm0 register */
+
691  int i;
+
692  for (i = 0; i < SrcLength/8; i++) {
+
693  __m64 mm1, mm2, mm3, mm4, mm5, mm6;
+
694  mm1 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
695  mm2 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
696  mm3 = _m_punpcklbw(*mSrc2, mm0); /* unpack low bytes of Src2 into words */
+
697  mm4 = _m_punpckhbw(*mSrc2, mm0); /* unpack high bytes of Src2 into words */
+
698  mm1 = _m_pmullw(mm1, mm3); /* mul low bytes of Src1 and Src2 */
+
699  mm2 = _m_pmullw(mm2, mm4); /* mul high bytes of Src1 and Src2 */
+
700  mm5 = _m_psrawi(mm1, 15); /* fill mm5 words with word sign bit */
+
701  mm6 = _m_psrawi(mm2, 15); /* fill mm6 words with word sign bit */
+
702  mm1 = _m_pxor(mm1, mm5); /* take 1's compliment of only neg. words */
+
703  mm2 = _m_pxor(mm2, mm6); /* take 1's compliment of only neg. words */
+
704  mm1 = _m_psubsw(mm1, mm5); /* add 1 to only neg. words, W-(-1) or W-0 */
+
705  mm2 = _m_psubsw(mm2, mm6); /* add 1 to only neg. words, W-(-1) or W-0 */
+
706  *mDest = _m_packuswb(mm1, mm2); /* pack words back into bytes with saturation */
+
707  mSrc1++;
+
708  mSrc2++;
+
709  mDest++;
+
710  }
+
711  _m_empty(); /* clean MMX state */
+
712 #endif
+
713  return (0);
+
714 #else
+
715  return (-1);
+
716 #endif
+
717 }
+
718 
+
729 int SDL_imageFilterMult(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
730 {
+
731  unsigned int i, istart;
+
732  unsigned char *cursrc1, *cursrc2, *curdst;
+
733  int result;
+
734 
+
735  /* Validate input parameters */
+
736  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
737  return(-1);
+
738  if (length == 0)
+
739  return(0);
+
740 
+
741  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
742  /* MMX routine */
+
743  SDL_imageFilterMultMMX(Src1, Src2, Dest, length);
+
744 
+
745  /* Check for unaligned bytes */
+
746  if ((length & 7) > 0) {
+
747  /* Setup to process unaligned bytes */
+
748  istart = length & 0xfffffff8;
+
749  cursrc1 = &Src1[istart];
+
750  cursrc2 = &Src2[istart];
+
751  curdst = &Dest[istart];
+
752  } else {
+
753  /* No unaligned bytes - we are done */
+
754  return (0);
+
755  }
+
756  } else {
+
757  /* Setup to process whole image */
+
758  istart = 0;
+
759  cursrc1 = Src1;
+
760  cursrc2 = Src2;
+
761  curdst = Dest;
+
762  }
+
763 
+
764  /* C routine to process image */
+
765  for (i = istart; i < length; i++) {
+
766 
+
767  /* NOTE: this is probably wrong - dunno what the MMX code does */
+
768 
+
769  result = (int) *cursrc1 * (int) *cursrc2;
+
770  if (result > 255)
+
771  result = 255;
+
772  *curdst = (unsigned char) result;
+
773  /* Advance pointers */
+
774  cursrc1++;
+
775  cursrc2++;
+
776  curdst++;
+
777  }
+
778 
+
779  return (0);
+
780 }
+
781 
+
792 int SDL_imageFilterMultNorASM(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
793 {
+
794 #ifdef USE_MMX
+
795 #if !defined(GCC__)
+
796  __asm
+
797  {
+
798  pusha
+
799  mov edx, Src1 /* load Src1 address into edx */
+
800  mov esi, Src2 /* load Src2 address into esi */
+
801  mov edi, Dest /* load Dest address into edi */
+
802  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
803  align 16 /* 16 byte alignment of the loop entry */
+
804 L10141:
+
805  mov al, [edx] /* load a byte from Src1 */
+
806  mul [esi] /* mul with a byte from Src2 */
+
807  mov [edi], al /* move a byte result to Dest */
+
808  inc edx /* increment Src1, Src2, Dest */
+
809  inc esi /* pointer registers by one */
+
810  inc edi
+
811  dec ecx /* decrease loop counter */
+
812  jnz L10141 /* check loop termination, proceed if required */
+
813  popa
+
814  }
+
815 #else
+
816  /* Note: ~5% gain on i386, less efficient than C on x86_64 */
+
817  /* Also depends on whether this function is static (?!) */
+
818  asm volatile (
+
819  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
820 # if defined(i386)
+
821  "1:mov (%%edx), %%al \n\t" /* load a byte from Src1 */
+
822  "mulb (%%esi) \n\t" /* mul with a byte from Src2 */
+
823  "mov %%al, (%%edi) \n\t" /* move a byte result to Dest */
+
824  "inc %%edx \n\t" /* increment Src1, Src2, Dest */
+
825  "inc %%esi \n\t" /* pointer registers by one */
+
826  "inc %%edi \n\t"
+
827  "dec %%ecx \n\t" /* decrease loop counter */
+
828 # elif defined(__x86_64__)
+
829  "1:mov (%%rdx), %%al \n\t" /* load a byte from Src1 */
+
830  "mulb (%%rsi) \n\t" /* mul with a byte from Src2 */
+
831  "mov %%al, (%%rdi) \n\t" /* move a byte result to Dest */
+
832  "inc %%rdx \n\t" /* increment Src1, Src2, Dest */
+
833  "inc %%rsi \n\t" /* pointer registers by one */
+
834  "inc %%rdi \n\t"
+
835  "dec %%rcx \n\t" /* decrease loop counter */
+
836 # endif
+
837  "jnz 1b \n\t" /* check loop termination, proceed if required */
+
838  : "+d" (Src1), /* load Src1 address into edx */
+
839  "+S" (Src2), /* load Src2 address into esi */
+
840  "+c" (SrcLength), /* load loop counter (SIZE) into ecx */
+
841  "+D" (Dest) /* load Dest address into edi */
+
842  :
+
843  : "memory", "rax"
+
844  );
+
845 #endif
+
846  return (0);
+
847 #else
+
848  return (-1);
+
849 #endif
+
850 }
+
851 
+
862 int SDL_imageFilterMultNor(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
863 {
+
864  unsigned int i, istart;
+
865  unsigned char *cursrc1, *cursrc2, *curdst;
+
866 
+
867  /* Validate input parameters */
+
868  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
869  return(-1);
+
870  if (length == 0)
+
871  return(0);
+
872 
+
873  if (SDL_imageFilterMMXdetect()) {
+
874  if (length > 0) {
+
875  /* ASM routine */
+
876  SDL_imageFilterMultNorASM(Src1, Src2, Dest, length);
+
877 
+
878  /* Check for unaligned bytes */
+
879  if ((length & 7) > 0) {
+
880  /* Setup to process unaligned bytes */
+
881  istart = length & 0xfffffff8;
+
882  cursrc1 = &Src1[istart];
+
883  cursrc2 = &Src2[istart];
+
884  curdst = &Dest[istart];
+
885  } else {
+
886  /* No unaligned bytes - we are done */
+
887  return (0);
+
888  }
+
889  } else {
+
890  /* No bytes - we are done */
+
891  return (0);
+
892  }
+
893  } else {
+
894  /* Setup to process whole image */
+
895  istart = 0;
+
896  cursrc1 = Src1;
+
897  cursrc2 = Src2;
+
898  curdst = Dest;
+
899  }
+
900 
+
901  /* C routine to process image */
+
902  for (i = istart; i < length; i++) {
+
903  *curdst = (int)*cursrc1 * (int)*cursrc2; // (int) for efficiency
+
904  /* Advance pointers */
+
905  cursrc1++;
+
906  cursrc2++;
+
907  curdst++;
+
908  }
+
909 
+
910  return (0);
+
911 }
+
912 
+
923 static int SDL_imageFilterMultDivby2MMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
924 {
+
925 #ifdef USE_MMX
+
926 #if !defined(GCC__)
+
927  __asm
+
928  {
+
929  pusha
+
930  mov eax, Src1 /* load Src1 address into eax */
+
931  mov ebx, Src2 /* load Src2 address into ebx */
+
932  mov edi, Dest /* load Dest address into edi */
+
933  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
934  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
935  pxor mm0, mm0 /* zero mm0 register */
+
936  align 16 /* 16 byte alignment of the loop entry */
+
937 L1015:
+
938  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
939  movq mm3, [ebx] /* load 8 bytes from Src2 into mm3 */
+
940  movq mm2, mm1 /* copy mm1 into mm2 */
+
941  movq mm4, mm3 /* copy mm3 into mm4 */
+
942  punpcklbw mm1, mm0 /* unpack low bytes of Src1 into words */
+
943  punpckhbw mm2, mm0 /* unpack high bytes of Src1 into words */
+
944  punpcklbw mm3, mm0 /* unpack low bytes of Src2 into words */
+
945  punpckhbw mm4, mm0 /* unpack high bytes of Src2 into words */
+
946  psrlw mm1, 1 /* divide mm1 words by 2, Src1 low bytes */
+
947  psrlw mm2, 1 /* divide mm2 words by 2, Src1 high bytes */
+
948  pmullw mm1, mm3 /* mul low bytes of Src1 and Src2 */
+
949  pmullw mm2, mm4 /* mul high bytes of Src1 and Src2 */
+
950  packuswb mm1, mm2 /* pack words back into bytes with saturation */
+
951  movq [edi], mm1 /* store result in Dest */
+
952  add eax, 8 /* increase Src1, Src2 and Dest */
+
953  add ebx, 8 /* register pointers by 8 */
+
954  add edi, 8
+
955  dec ecx /* decrease loop counter */
+
956  jnz L1015 /* check loop termination, proceed if required */
+
957  emms /* exit MMX state */
+
958  popa
+
959  }
+
960 #else
+
961  /* i386 and x86_64 */
+
962  __m64 *mSrc1 = (__m64*)Src1;
+
963  __m64 *mSrc2 = (__m64*)Src2;
+
964  __m64 *mDest = (__m64*)Dest;
+
965  __m64 mm0 = _m_from_int(0); /* zero mm0 register */
+
966  int i;
+
967  for (i = 0; i < SrcLength/8; i++) {
+
968  __m64 mm1, mm2, mm3, mm4, mm5, mm6;
+
969  mm1 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
970  mm2 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
971  mm3 = _m_punpcklbw(*mSrc2, mm0); /* unpack low bytes of Src2 into words */
+
972  mm4 = _m_punpckhbw(*mSrc2, mm0); /* unpack high bytes of Src2 into words */
+
973  mm1 = _m_psrlwi(mm1, 1); /* divide mm1 words by 2, Src1 low bytes */
+
974  mm2 = _m_psrlwi(mm2, 1); /* divide mm2 words by 2, Src1 high bytes */
+
975  mm1 = _m_pmullw(mm1, mm3); /* mul low bytes of Src1 and Src2 */
+
976  mm2 = _m_pmullw(mm2, mm4); /* mul high bytes of Src1 and Src2 */
+
977  *mDest = _m_packuswb(mm1, mm2); /* pack words back into bytes with saturation */
+
978  mSrc1++;
+
979  mSrc2++;
+
980  mDest++;
+
981  }
+
982  _m_empty(); /* clean MMX state */
+
983 #endif
+
984  return (0);
+
985 #else
+
986  return (-1);
+
987 #endif
+
988 }
+
989 
+
1000 int SDL_imageFilterMultDivby2(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
1001 {
+
1002  unsigned int i, istart;
+
1003  unsigned char *cursrc1, *cursrc2, *curdst;
+
1004  int result;
+
1005 
+
1006  /* Validate input parameters */
+
1007  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
1008  return(-1);
+
1009  if (length == 0)
+
1010  return(0);
+
1011 
+
1012  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
1013  /* MMX routine */
+
1014  SDL_imageFilterMultDivby2MMX(Src1, Src2, Dest, length);
+
1015 
+
1016  /* Check for unaligned bytes */
+
1017  if ((length & 7) > 0) {
+
1018  /* Setup to process unaligned bytes */
+
1019  istart = length & 0xfffffff8;
+
1020  cursrc1 = &Src1[istart];
+
1021  cursrc2 = &Src2[istart];
+
1022  curdst = &Dest[istart];
+
1023  } else {
+
1024  /* No unaligned bytes - we are done */
+
1025  return (0);
+
1026  }
+
1027  } else {
+
1028  /* Setup to process whole image */
+
1029  istart = 0;
+
1030  cursrc1 = Src1;
+
1031  cursrc2 = Src2;
+
1032  curdst = Dest;
+
1033  }
+
1034 
+
1035  /* C routine to process image */
+
1036  for (i = istart; i < length; i++) {
+
1037  result = ((int) *cursrc1 / 2) * (int) *cursrc2;
+
1038  if (result > 255)
+
1039  result = 255;
+
1040  *curdst = (unsigned char) result;
+
1041  /* Advance pointers */
+
1042  cursrc1++;
+
1043  cursrc2++;
+
1044  curdst++;
+
1045  }
+
1046 
+
1047  return (0);
+
1048 }
+
1049 
+
1060 static int SDL_imageFilterMultDivby4MMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
1061 {
+
1062 #ifdef USE_MMX
+
1063 #if !defined(GCC__)
+
1064  __asm
+
1065  {
+
1066  pusha
+
1067  mov eax, Src1 /* load Src1 address into eax */
+
1068  mov ebx, Src2 /* load Src2 address into ebx */
+
1069  mov edi, Dest /* load Dest address into edi */
+
1070  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1071  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
1072  pxor mm0, mm0 /* zero mm0 register */
+
1073  align 16 /* 16 byte alignment of the loop entry */
+
1074 L1016:
+
1075  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
1076  movq mm3, [ebx] /* load 8 bytes from Src2 into mm3 */
+
1077  movq mm2, mm1 /* copy mm1 into mm2 */
+
1078  movq mm4, mm3 /* copy mm3 into mm4 */
+
1079  punpcklbw mm1, mm0 /* unpack low bytes of Src1 into words */
+
1080  punpckhbw mm2, mm0 /* unpack high bytes of Src1 into words */
+
1081  punpcklbw mm3, mm0 /* unpack low bytes of Src2 into words */
+
1082  punpckhbw mm4, mm0 /* unpack high bytes of Src2 into words */
+
1083  psrlw mm1, 1 /* divide mm1 words by 2, Src1 low bytes */
+
1084  psrlw mm2, 1 /* divide mm2 words by 2, Src1 high bytes */
+
1085  psrlw mm3, 1 /* divide mm3 words by 2, Src2 low bytes */
+
1086  psrlw mm4, 1 /* divide mm4 words by 2, Src2 high bytes */
+
1087  pmullw mm1, mm3 /* mul low bytes of Src1 and Src2 */
+
1088  pmullw mm2, mm4 /* mul high bytes of Src1 and Src2 */
+
1089  packuswb mm1, mm2 /* pack words back into bytes with saturation */
+
1090  movq [edi], mm1 /* store result in Dest */
+
1091  add eax, 8 /* increase Src1, Src2 and Dest */
+
1092  add ebx, 8 /* register pointers by 8 */
+
1093  add edi, 8
+
1094  dec ecx /* decrease loop counter */
+
1095  jnz L1016 /* check loop termination, proceed if required */
+
1096  emms /* exit MMX state */
+
1097  popa
+
1098  }
+
1099 #else
+
1100  /* i386 and x86_64 */
+
1101  __m64 *mSrc1 = (__m64*)Src1;
+
1102  __m64 *mSrc2 = (__m64*)Src2;
+
1103  __m64 *mDest = (__m64*)Dest;
+
1104  __m64 mm0 = _m_from_int(0); /* zero mm0 register */
+
1105  int i;
+
1106  for (i = 0; i < SrcLength/8; i++) {
+
1107  __m64 mm1, mm2, mm3, mm4, mm5, mm6;
+
1108  mm1 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
1109  mm2 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
1110  mm3 = _m_punpcklbw(*mSrc2, mm0); /* unpack low bytes of Src2 into words */
+
1111  mm4 = _m_punpckhbw(*mSrc2, mm0); /* unpack high bytes of Src2 into words */
+
1112  mm1 = _m_psrlwi(mm1, 1); /* divide mm1 words by 2, Src1 low bytes */
+
1113  mm2 = _m_psrlwi(mm2, 1); /* divide mm2 words by 2, Src1 high bytes */
+
1114  mm3 = _m_psrlwi(mm3, 1); /* divide mm3 words by 2, Src2 low bytes */
+
1115  mm4 = _m_psrlwi(mm4, 1); /* divide mm4 words by 2, Src2 high bytes */
+
1116  mm1 = _m_pmullw(mm1, mm3); /* mul low bytes of Src1 and Src2 */
+
1117  mm2 = _m_pmullw(mm2, mm4); /* mul high bytes of Src1 and Src2 */
+
1118  *mDest = _m_packuswb(mm1, mm2); /* pack words back into bytes with saturation */
+
1119  mSrc1++;
+
1120  mSrc2++;
+
1121  mDest++;
+
1122  }
+
1123  _m_empty(); /* clean MMX state */
+
1124 #endif
+
1125  return (0);
+
1126 #else
+
1127  return (-1);
+
1128 #endif
+
1129 }
+
1130 
+
1141 int SDL_imageFilterMultDivby4(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
1142 {
+
1143  unsigned int i, istart;
+
1144  unsigned char *cursrc1, *cursrc2, *curdst;
+
1145  int result;
+
1146 
+
1147  /* Validate input parameters */
+
1148  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
1149  return(-1);
+
1150  if (length == 0)
+
1151  return(0);
+
1152 
+
1153  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
1154  /* MMX routine */
+
1155  SDL_imageFilterMultDivby4MMX(Src1, Src2, Dest, length);
+
1156 
+
1157  /* Check for unaligned bytes */
+
1158  if ((length & 7) > 0) {
+
1159  /* Setup to process unaligned bytes */
+
1160  istart = length & 0xfffffff8;
+
1161  cursrc1 = &Src1[istart];
+
1162  cursrc2 = &Src2[istart];
+
1163  curdst = &Dest[istart];
+
1164  } else {
+
1165  /* No unaligned bytes - we are done */
+
1166  return (0);
+
1167  }
+
1168  } else {
+
1169  /* Setup to process whole image */
+
1170  istart = 0;
+
1171  cursrc1 = Src1;
+
1172  cursrc2 = Src2;
+
1173  curdst = Dest;
+
1174  }
+
1175 
+
1176  /* C routine to process image */
+
1177  for (i = istart; i < length; i++) {
+
1178  result = ((int) *cursrc1 / 2) * ((int) *cursrc2 / 2);
+
1179  if (result > 255)
+
1180  result = 255;
+
1181  *curdst = (unsigned char) result;
+
1182  /* Advance pointers */
+
1183  cursrc1++;
+
1184  cursrc2++;
+
1185  curdst++;
+
1186  }
+
1187 
+
1188  return (0);
+
1189 }
+
1190 
+
1201 static int SDL_imageFilterBitAndMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
1202 {
+
1203 #ifdef USE_MMX
+
1204 #if !defined(GCC__)
+
1205  __asm
+
1206  {
+
1207  pusha
+
1208  mov eax, Src1 /* load Src1 address into eax */
+
1209  mov ebx, Src2 /* load Src2 address into ebx */
+
1210  mov edi, Dest /* load Dest address into edi */
+
1211  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1212  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
1213  align 16 /* 16 byte alignment of the loop entry */
+
1214 L1017:
+
1215  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
1216  pand mm1, [ebx] /* mm1=Src1&Src2 */
+
1217  movq [edi], mm1 /* store result in Dest */
+
1218  add eax, 8 /* increase Src1, Src2 and Dest */
+
1219  add ebx, 8 /* register pointers by 8 */
+
1220  add edi, 8
+
1221  dec ecx /* decrease loop counter */
+
1222  jnz L1017 /* check loop termination, proceed if required */
+
1223  emms /* exit MMX state */
+
1224  popa
+
1225  }
+
1226 #else
+
1227  /* x86_64 ASM with constraints: */
+
1228  /* asm volatile ( */
+
1229  /* "shr $3, %%rcx \n\t" /\* counter/8 (MMX loads 8 bytes at a time) *\/ */
+
1230  /* ".align 16 \n\t" /\* 16 byte alignment of the loop entry *\/ */
+
1231  /* "1: movq (%%rax), %%mm1 \n\t" /\* load 8 bytes from Src1 into mm1 *\/ */
+
1232  /* "pand (%%rbx), %%mm1 \n\t" /\* mm1=Src1&Src2 *\/ */
+
1233  /* "movq %%mm1, (%%rdi) \n\t" /\* store result in Dest *\/ */
+
1234  /* "add $8, %%rax \n\t" /\* increase Src1, Src2 and Dest *\/ */
+
1235  /* "add $8, %%rbx \n\t" /\* register pointers by 8 *\/ */
+
1236  /* "add $8, %%rdi \n\t" */
+
1237  /* "dec %%rcx \n\t" /\* decrease loop counter *\/ */
+
1238  /* "jnz 1b \n\t" /\* check loop termination, proceed if required *\/ */
+
1239  /* "emms \n\t" /\* exit MMX state *\/ */
+
1240  /* : "+a" (Src1), /\* load Src1 address into rax, modified by the loop *\/ */
+
1241  /* "+b" (Src2), /\* load Src2 address into rbx, modified by the loop *\/ */
+
1242  /* "+c" (SrcLength), /\* load loop counter (SIZE) into rcx, modified by the loop *\/ */
+
1243  /* "+D" (Dest) /\* load Dest address into rdi, modified by the loop *\/ */
+
1244  /* : */
+
1245  /* : "memory", /\* *Dest is modified *\/ */
+
1246  /* "mm1" /\* register mm1 modified *\/ */
+
1247  /* ); */
+
1248 
+
1249  /* i386 and x86_64 */
+
1250  __m64 *mSrc1 = (__m64*)Src1;
+
1251  __m64 *mSrc2 = (__m64*)Src2;
+
1252  __m64 *mDest = (__m64*)Dest;
+
1253  int i;
+
1254  for (i = 0; i < SrcLength/8; i++) {
+
1255  *mDest = _m_pand(*mSrc1, *mSrc2); /* Src1&Src2 */
+
1256  mSrc1++;
+
1257  mSrc2++;
+
1258  mDest++;
+
1259  }
+
1260  _m_empty(); /* clean MMX state */
+
1261 #endif
+
1262  return (0);
+
1263 #else
+
1264  return (-1);
+
1265 #endif
+
1266 }
+
1267 
+
1278 int SDL_imageFilterBitAnd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
1279 {
+
1280  unsigned int i, istart;
+
1281  unsigned char *cursrc1, *cursrc2, *curdst;
+
1282 
+
1283  /* Validate input parameters */
+
1284  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
1285  return(-1);
+
1286  if (length == 0)
+
1287  return(0);
+
1288 
+
1289  if ((SDL_imageFilterMMXdetect()>0) && (length>7)) {
+
1290  /* if (length > 7) { */
+
1291  /* Call MMX routine */
+
1292 
+
1293  SDL_imageFilterBitAndMMX(Src1, Src2, Dest, length);
+
1294 
+
1295  /* Check for unaligned bytes */
+
1296  if ((length & 7) > 0) {
+
1297 
+
1298  /* Setup to process unaligned bytes */
+
1299  istart = length & 0xfffffff8;
+
1300  cursrc1 = &Src1[istart];
+
1301  cursrc2 = &Src2[istart];
+
1302  curdst = &Dest[istart];
+
1303  } else {
+
1304  /* No unaligned bytes - we are done */
+
1305  return (0);
+
1306  }
+
1307  } else {
+
1308  /* Setup to process whole image */
+
1309  istart = 0;
+
1310  cursrc1 = Src1;
+
1311  cursrc2 = Src2;
+
1312  curdst = Dest;
+
1313  }
+
1314 
+
1315  /* C routine to process image */
+
1316  for (i = istart; i < length; i++) {
+
1317  *curdst = (*cursrc1) & (*cursrc2);
+
1318  /* Advance pointers */
+
1319  cursrc1++;
+
1320  cursrc2++;
+
1321  curdst++;
+
1322  }
+
1323 
+
1324  return (0);
+
1325 }
+
1326 
+
1337 static int SDL_imageFilterBitOrMMX(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
1338 {
+
1339 #ifdef USE_MMX
+
1340 #if !defined(GCC__)
+
1341  __asm
+
1342  {
+
1343  pusha
+
1344  mov eax, Src1 /* load Src1 address into eax */
+
1345  mov ebx, Src2 /* load Src2 address into ebx */
+
1346  mov edi, Dest /* load Dest address into edi */
+
1347  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1348  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
1349  align 16 /* 16 byte alignment of the loop entry */
+
1350 L91017:
+
1351  movq mm1, [eax] /* load 8 bytes from Src1 into mm1 */
+
1352  por mm1, [ebx] /* mm1=Src1|Src2 */
+
1353  movq [edi], mm1 /* store result in Dest */
+
1354  add eax, 8 /* increase Src1, Src2 and Dest */
+
1355  add ebx, 8 /* register pointers by 8 */
+
1356  add edi, 8
+
1357  dec ecx /* decrease loop counter */
+
1358  jnz L91017 /* check loop termination, proceed if required */
+
1359  emms /* exit MMX state */
+
1360  popa
+
1361  }
+
1362 #else
+
1363  /* i386 and x86_64 */
+
1364  __m64 *mSrc1 = (__m64*)Src1;
+
1365  __m64 *mSrc2 = (__m64*)Src2;
+
1366  __m64 *mDest = (__m64*)Dest;
+
1367  int i;
+
1368  for (i = 0; i < SrcLength/8; i++) {
+
1369  *mDest = _m_por(*mSrc1, *mSrc2); /* Src1|Src2 */
+
1370  mSrc1++;
+
1371  mSrc2++;
+
1372  mDest++;
+
1373  }
+
1374  _m_empty(); /* clean MMX state */
+
1375 #endif
+
1376  return (0);
+
1377 #else
+
1378  return (-1);
+
1379 #endif
+
1380 }
+
1381 
+
1392 int SDL_imageFilterBitOr(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
1393 {
+
1394  unsigned int i, istart;
+
1395  unsigned char *cursrc1, *cursrc2, *curdst;
+
1396 
+
1397  /* Validate input parameters */
+
1398  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
1399  return(-1);
+
1400  if (length == 0)
+
1401  return(0);
+
1402 
+
1403  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
1404 
+
1405  /* MMX routine */
+
1406  SDL_imageFilterBitOrMMX(Src1, Src2, Dest, length);
+
1407 
+
1408  /* Check for unaligned bytes */
+
1409  if ((length & 7) > 0) {
+
1410  /* Setup to process unaligned bytes */
+
1411  istart = length & 0xfffffff8;
+
1412  cursrc1 = &Src1[istart];
+
1413  cursrc2 = &Src2[istart];
+
1414  curdst = &Dest[istart];
+
1415  } else {
+
1416  /* No unaligned bytes - we are done */
+
1417  return (0);
+
1418  }
+
1419  } else {
+
1420  /* Setup to process whole image */
+
1421  istart = 0;
+
1422  cursrc1 = Src1;
+
1423  cursrc2 = Src2;
+
1424  curdst = Dest;
+
1425  }
+
1426 
+
1427  /* C routine to process image */
+
1428  for (i = istart; i < length; i++) {
+
1429  *curdst = *cursrc1 | *cursrc2;
+
1430  /* Advance pointers */
+
1431  cursrc1++;
+
1432  cursrc2++;
+
1433  curdst++;
+
1434  }
+
1435  return (0);
+
1436 }
+
1437 
+
1448 static int SDL_imageFilterDivASM(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
+
1449 {
+
1450 #ifdef USE_MMX
+
1451 #if !defined(GCC__)
+
1452  __asm
+
1453  {
+
1454  pusha
+
1455  mov edx, Src1 /* load Src1 address into edx */
+
1456  mov esi, Src2 /* load Src2 address into esi */
+
1457  mov edi, Dest /* load Dest address into edi */
+
1458  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1459  align 16 /* 16 byte alignment of the loop entry */
+
1460 L10191:
+
1461  mov bl, [esi] /* load a byte from Src2 */
+
1462  cmp bl, 0 /* check if it zero */
+
1463  jnz L10192
+
1464  mov [edi], 255 /* division by zero = 255 !!! */
+
1465  jmp L10193
+
1466 L10192:
+
1467  xor ah, ah /* prepare AX, zero AH register */
+
1468  mov al, [edx] /* load a byte from Src1 into AL */
+
1469  div bl /* divide AL by BL */
+
1470  mov [edi], al /* move a byte result to Dest */
+
1471 L10193:
+
1472  inc edx /* increment Src1, Src2, Dest */
+
1473  inc esi /* pointer registers by one */
+
1474  inc edi
+
1475  dec ecx /* decrease loop counter */
+
1476  jnz L10191 /* check loop termination, proceed if required */
+
1477  popa
+
1478  }
+
1479 #else
+
1480  /* Note: ~15% gain on i386, less efficient than C on x86_64 */
+
1481  /* Also depends on whether the function is static (?!) */
+
1482  /* Also depends on whether we work on malloc() or static char[] */
+
1483  asm volatile (
+
1484 # if defined(i386)
+
1485  "pushl %%ebx \n\t" /* %ebx may be the PIC register. */
+
1486  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
1487  "1: mov (%%esi), %%bl \n\t" /* load a byte from Src2 */
+
1488  "cmp $0, %%bl \n\t" /* check if it zero */
+
1489  "jnz 2f \n\t"
+
1490  "movb $255, (%%edi) \n\t" /* division by zero = 255 !!! */
+
1491  "jmp 3f \n\t"
+
1492  "2: xor %%ah, %%ah \n\t" /* prepare AX, zero AH register */
+
1493  "mov (%%edx), %%al \n\t" /* load a byte from Src1 into AL */
+
1494  "div %%bl \n\t" /* divide AL by BL */
+
1495  "mov %%al, (%%edi) \n\t" /* move a byte result to Dest */
+
1496  "3: inc %%edx \n\t" /* increment Src1, Src2, Dest */
+
1497  "inc %%esi \n\t" /* pointer registers by one */
+
1498  "inc %%edi \n\t"
+
1499  "dec %%ecx \n\t" /* decrease loop counter */
+
1500  "jnz 1b \n\t" /* check loop termination, proceed if required */
+
1501  "popl %%ebx \n\t" /* restore %ebx */
+
1502  : "+d" (Src1), /* load Src1 address into edx */
+
1503  "+S" (Src2), /* load Src2 address into esi */
+
1504  "+c" (SrcLength), /* load loop counter (SIZE) into ecx */
+
1505  "+D" (Dest) /* load Dest address into edi */
+
1506  :
+
1507  : "memory", "rax"
+
1508 # elif defined(__x86_64__)
+
1509  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
1510  "1: mov (%%rsi), %%bl \n\t" /* load a byte from Src2 */
+
1511  "cmp $0, %%bl \n\t" /* check if it zero */
+
1512  "jnz 2f \n\t"
+
1513  "movb $255, (%%rdi) \n\t" /* division by zero = 255 !!! */
+
1514  "jmp 3f \n\t"
+
1515  "2: xor %%ah, %%ah \n\t" /* prepare AX, zero AH register */
+
1516  "mov (%%rdx), %%al \n\t" /* load a byte from Src1 into AL */
+
1517  "div %%bl \n\t" /* divide AL by BL */
+
1518  "mov %%al, (%%rdi) \n\t" /* move a byte result to Dest */
+
1519  "3: inc %%rdx \n\t" /* increment Src1, Src2, Dest */
+
1520  "inc %%rsi \n\t" /* pointer registers by one */
+
1521  "inc %%rdi \n\t"
+
1522  "dec %%rcx \n\t" /* decrease loop counter */
+
1523  "jnz 1b \n\t" /* check loop termination, proceed if required */
+
1524  : "+d" (Src1), /* load Src1 address into edx */
+
1525  "+S" (Src2), /* load Src2 address into esi */
+
1526  "+c" (SrcLength), /* load loop counter (SIZE) into ecx */
+
1527  "+D" (Dest) /* load Dest address into edi */
+
1528  :
+
1529  : "memory", "rax", "rbx"
+
1530 # endif
+
1531  );
+
1532 #endif
+
1533  return (0);
+
1534 #else
+
1535  return (-1);
+
1536 #endif
+
1537 }
+
1538 
+
1549 int SDL_imageFilterDiv(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
+
1550 {
+
1551  unsigned int i, istart;
+
1552  unsigned char *cursrc1, *cursrc2, *curdst;
+
1553 
+
1554  /* Validate input parameters */
+
1555  if ((Src1 == NULL) || (Src2 == NULL) || (Dest == NULL))
+
1556  return(-1);
+
1557  if (length == 0)
+
1558  return(0);
+
1559 
+
1560  if (SDL_imageFilterMMXdetect()) {
+
1561  if (length > 0) {
+
1562  /* Call ASM routine */
+
1563  SDL_imageFilterDivASM(Src1, Src2, Dest, length);
+
1564 
+
1565  /* Never unaligned bytes - we are done */
+
1566  return (0);
+
1567  } else {
+
1568  return (-1);
+
1569  }
+
1570  }
+
1571 
+
1572  /* Setup to process whole image */
+
1573  istart = 0;
+
1574  cursrc1 = Src1;
+
1575  cursrc2 = Src2;
+
1576  curdst = Dest;
+
1577 
+
1578  /* C routine to process image */
+
1579  /* for (i = istart; i < length; i++) { */
+
1580  /* if (*cursrc2 == 0) { */
+
1581  /* *curdst = 255; */
+
1582  /* } else { */
+
1583  /* result = (int) *cursrc1 / (int) *cursrc2; */
+
1584  /* *curdst = (unsigned char) result; */
+
1585  /* } */
+
1586  /* /\* Advance pointers *\/ */
+
1587  /* cursrc1++; */
+
1588  /* cursrc2++; */
+
1589  /* curdst++; */
+
1590  /* } */
+
1591  for (i = istart; i < length; i++) {
+
1592  if (*cursrc2 == 0) {
+
1593  *curdst = 255;
+
1594  } else {
+
1595  *curdst = (int)*cursrc1 / (int)*cursrc2; // (int) for efficiency
+
1596  }
+
1597  /* Advance pointers */
+
1598  cursrc1++;
+
1599  cursrc2++;
+
1600  curdst++;
+
1601  }
+
1602 
+
1603  return (0);
+
1604 }
+
1605 
+
1606 /* ------------------------------------------------------------------------------------ */
+
1607 
+
1617 static int SDL_imageFilterBitNegationMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength)
+
1618 {
+
1619 #ifdef USE_MMX
+
1620 #if !defined(GCC__)
+
1621  __asm
+
1622  {
+
1623  pusha
+
1624  pcmpeqb mm1, mm1 /* generate all 1's in mm1 */
+
1625  mov eax, Src1 /* load Src1 address into eax */
+
1626  mov edi, Dest /* load Dest address into edi */
+
1627  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1628  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
1629  align 16 /* 16 byte alignment of the loop entry */
+
1630 L91117:
+
1631  movq mm0, [eax] /* load 8 bytes from Src1 into mm1 */
+
1632  pxor mm0, mm1 /* negate mm0 by xoring with mm1 */
+
1633  movq [edi], mm0 /* store result in Dest */
+
1634  add eax, 8 /* increase Src1, Src2 and Dest */
+
1635  add edi, 8
+
1636  dec ecx /* decrease loop counter */
+
1637  jnz L91117 /* check loop termination, proceed if required */
+
1638  emms /* exit MMX state */
+
1639  popa
+
1640  }
+
1641 #else
+
1642  /* i386 and x86_64 */
+
1643  __m64 *mSrc1 = (__m64*)Src1;
+
1644  __m64 *mDest = (__m64*)Dest;
+
1645  __m64 mm1;
+
1646  mm1 = _m_pcmpeqb(mm1, mm1); /* generate all 1's in mm1 */
+
1647  int i;
+
1648  for (i = 0; i < SrcLength/8; i++) {
+
1649  *mDest = _m_pxor(*mSrc1, mm1); /* negate mm0 by xoring with mm1 */
+
1650  mSrc1++;
+
1651  mDest++;
+
1652  }
+
1653  _m_empty(); /* clean MMX state */
+
1654 
+
1655 #endif
+
1656  return (0);
+
1657 #else
+
1658  return (-1);
+
1659 #endif
+
1660 }
+
1661 
+
1671 int SDL_imageFilterBitNegation(unsigned char *Src1, unsigned char *Dest, unsigned int length)
+
1672 {
+
1673  unsigned int i, istart;
+
1674  unsigned char *cursrc1, *curdst;
+
1675 
+
1676  /* Validate input parameters */
+
1677  if ((Src1 == NULL) || (Dest == NULL))
+
1678  return(-1);
+
1679  if (length == 0)
+
1680  return(0);
+
1681 
+
1682  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
1683  /* MMX routine */
+
1684  SDL_imageFilterBitNegationMMX(Src1, Dest, length);
+
1685 
+
1686  /* Check for unaligned bytes */
+
1687  if ((length & 7) > 0) {
+
1688  /* Setup to process unaligned bytes */
+
1689  istart = length & 0xfffffff8;
+
1690  cursrc1 = &Src1[istart];
+
1691  curdst = &Dest[istart];
+
1692  } else {
+
1693  /* No unaligned bytes - we are done */
+
1694  return (0);
+
1695  }
+
1696  } else {
+
1697  /* Setup to process whole image */
+
1698  istart = 0;
+
1699  cursrc1 = Src1;
+
1700  curdst = Dest;
+
1701  }
+
1702 
+
1703  /* C routine to process image */
+
1704  for (i = istart; i < length; i++) {
+
1705  *curdst = ~(*cursrc1);
+
1706  /* Advance pointers */
+
1707  cursrc1++;
+
1708  curdst++;
+
1709  }
+
1710 
+
1711  return (0);
+
1712 }
+
1713 
+
1724 static int SDL_imageFilterAddByteMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char C)
+
1725 {
+
1726 #ifdef USE_MMX
+
1727 #if !defined(GCC__)
+
1728  __asm
+
1729  {
+
1730  pusha
+
1731  /* ** Duplicate C in 8 bytes of MM1 ** */
+
1732  mov al, C /* load C into AL */
+
1733  mov ah, al /* copy AL into AH */
+
1734  mov bx, ax /* copy AX into BX */
+
1735  shl eax, 16 /* shift 2 bytes of EAX left */
+
1736  mov ax, bx /* copy BX into AX */
+
1737  movd mm1, eax /* copy EAX into MM1 */
+
1738  movd mm2, eax /* copy EAX into MM2 */
+
1739  punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
+
1740  mov eax, Src1 /* load Src1 address into eax */
+
1741  mov edi, Dest /* load Dest address into edi */
+
1742  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1743  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
1744  align 16 /* 16 byte alignment of the loop entry */
+
1745 L1021:
+
1746  movq mm0, [eax] /* load 8 bytes from Src1 into MM0 */
+
1747  paddusb mm0, mm1 /* MM0=SrcDest+C (add 8 bytes with saturation) */
+
1748  movq [edi], mm0 /* store result in Dest */
+
1749  add eax, 8 /* increase Dest register pointer by 8 */
+
1750  add edi, 8 /* increase Dest register pointer by 8 */
+
1751  dec ecx /* decrease loop counter */
+
1752  jnz L1021 /* check loop termination, proceed if required */
+
1753  emms /* exit MMX state */
+
1754  popa
+
1755  }
+
1756 #else
+
1757  /* i386 and x86_64 */
+
1758  __m64 *mSrc1 = (__m64*)Src1;
+
1759  __m64 *mDest = (__m64*)Dest;
+
1760  /* Duplicate C in 8 bytes of MM1 */
+
1761  int i;
+
1762  memset(&i, C, 4);
+
1763  __m64 mm1 = _m_from_int(i);
+
1764  __m64 mm2 = _m_from_int(i);
+
1765  mm1 = _m_punpckldq(mm1, mm2); /* fill higher bytes of MM1 with C */
+
1766  //__m64 mm1 = _m_from_int64(lli); // x86_64 only
+
1767  for (i = 0; i < SrcLength/8; i++) {
+
1768  *mDest = _m_paddusb(*mSrc1, mm1); /* Src1+C (add 8 bytes with saturation) */
+
1769  mSrc1++;
+
1770  mDest++;
+
1771  }
+
1772  _m_empty(); /* clean MMX state */
+
1773 #endif
+
1774  return (0);
+
1775 #else
+
1776  return (-1);
+
1777 #endif
+
1778 }
+
1779 
+
1791 int SDL_imageFilterAddByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
+
1792 {
+
1793  unsigned int i, istart;
+
1794  int iC;
+
1795  unsigned char *cursrc1, *curdest;
+
1796  int result;
+
1797 
+
1798  /* Validate input parameters */
+
1799  if ((Src1 == NULL) || (Dest == NULL))
+
1800  return(-1);
+
1801  if (length == 0)
+
1802  return(0);
+
1803 
+
1804  /* Special case: C==0 */
+
1805  if (C == 0) {
+
1806  memcpy(Src1, Dest, length);
+
1807  return (0);
+
1808  }
+
1809 
+
1810  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
1811 
+
1812  /* MMX routine */
+
1813  SDL_imageFilterAddByteMMX(Src1, Dest, length, C);
+
1814 
+
1815  /* Check for unaligned bytes */
+
1816  if ((length & 7) > 0) {
+
1817  /* Setup to process unaligned bytes */
+
1818  istart = length & 0xfffffff8;
+
1819  cursrc1 = &Src1[istart];
+
1820  curdest = &Dest[istart];
+
1821  } else {
+
1822  /* No unaligned bytes - we are done */
+
1823  return (0);
+
1824  }
+
1825  } else {
+
1826  /* Setup to process whole image */
+
1827  istart = 0;
+
1828  cursrc1 = Src1;
+
1829  curdest = Dest;
+
1830  }
+
1831 
+
1832  /* C routine to process image */
+
1833  iC = (int) C;
+
1834  for (i = istart; i < length; i++) {
+
1835  result = (int) *cursrc1 + iC;
+
1836  if (result > 255)
+
1837  result = 255;
+
1838  *curdest = (unsigned char) result;
+
1839  /* Advance pointers */
+
1840  cursrc1++;
+
1841  curdest++;
+
1842  }
+
1843  return (0);
+
1844 }
+
1845 
+
1857 static int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned int C, unsigned int D)
+
1858 {
+
1859 #ifdef USE_MMX
+
1860 #if !defined(GCC__)
+
1861  __asm
+
1862  {
+
1863  pusha
+
1864  /* ** Duplicate (int)C in 8 bytes of MM1 ** */
+
1865  mov eax, C /* load C into EAX */
+
1866  movd mm1, eax /* copy EAX into MM1 */
+
1867  mov eax, D /* load D into EAX */
+
1868  movd mm2, eax /* copy EAX into MM2 */
+
1869  punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
+
1870  mov eax, Src1 /* load Src1 address into eax */
+
1871  mov edi, Dest /* load Dest address into edi */
+
1872  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
1873  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
1874  align 16 /* 16 byte alignment of the loop entry */
+
1875 L11023:
+
1876  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
1877  paddusb mm0, mm1 /* MM0=SrcDest+C (add 8 bytes with saturation) */
+
1878  movq [edi], mm0 /* store result in SrcDest */
+
1879  add eax, 8 /* increase Src1 register pointer by 8 */
+
1880  add edi, 8 /* increase Dest register pointer by 8 */
+
1881  dec ecx /* decrease loop counter */
+
1882  jnz L11023 /* check loop termination, proceed if required */
+
1883  emms /* exit MMX state */
+
1884  popa
+
1885  }
+
1886 #else
+
1887  /* i386 and x86_64 */
+
1888  __m64 *mSrc1 = (__m64*)Src1;
+
1889  __m64 *mDest = (__m64*)Dest;
+
1890  /* Duplicate (int)C in 8 bytes of MM1 */
+
1891  __m64 mm1 = _m_from_int(C);
+
1892  __m64 mm2 = _m_from_int(C);
+
1893  mm1 = _m_punpckldq(mm1, mm2); /* fill higher bytes of MM1 with C */
+
1894  //__m64 mm1 = _m_from_int64(lli); // x86_64 only
+
1895  int i;
+
1896  for (i = 0; i < SrcLength/8; i++) {
+
1897  *mDest = _m_paddusb(*mSrc1, mm1); /* Src1+C (add 8 bytes with saturation) */
+
1898  mSrc1++;
+
1899  mDest++;
+
1900  }
+
1901  _m_empty(); /* clean MMX state */
+
1902 #endif
+
1903  return (0);
+
1904 #else
+
1905  return (-1);
+
1906 #endif
+
1907 }
+
1908 
+
1919 int SDL_imageFilterAddUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
+
1920 {
+
1921  unsigned int i, j, istart, D;
+
1922  int iC[4];
+
1923  unsigned char *cursrc1;
+
1924  unsigned char *curdest;
+
1925  int result;
+
1926 
+
1927  /* Validate input parameters */
+
1928  if ((Src1 == NULL) || (Dest == NULL))
+
1929  return(-1);
+
1930  if (length == 0)
+
1931  return(0);
+
1932 
+
1933  /* Special case: C==0 */
+
1934  if (C == 0) {
+
1935  memcpy(Src1, Dest, length);
+
1936  return (0);
+
1937  }
+
1938 
+
1939  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
1940 
+
1941  /* MMX routine */
+
1942  D=SWAP_32(C);
+
1943  SDL_imageFilterAddUintMMX(Src1, Dest, length, C, D);
+
1944 
+
1945  /* Check for unaligned bytes */
+
1946  if ((length & 7) > 0) {
+
1947  /* Setup to process unaligned bytes */
+
1948  istart = length & 0xfffffff8;
+
1949  cursrc1 = &Src1[istart];
+
1950  curdest = &Dest[istart];
+
1951  } else {
+
1952  /* No unaligned bytes - we are done */
+
1953  return (0);
+
1954  }
+
1955  } else {
+
1956  /* Setup to process whole image */
+
1957  istart = 0;
+
1958  cursrc1 = Src1;
+
1959  curdest = Dest;
+
1960  }
+
1961 
+
1962  /* C routine to process bytes */
+
1963  iC[3] = (int) ((C >> 24) & 0xff);
+
1964  iC[2] = (int) ((C >> 16) & 0xff);
+
1965  iC[1] = (int) ((C >> 8) & 0xff);
+
1966  iC[0] = (int) ((C >> 0) & 0xff);
+
1967  for (i = istart; i < length; i += 4) {
+
1968  for (j = 0; j < 4; j++) {
+
1969  if ((i+j)<length) {
+
1970  result = (int) *cursrc1 + iC[j];
+
1971  if (result > 255) result = 255;
+
1972  *curdest = (unsigned char) result;
+
1973  /* Advance pointers */
+
1974  cursrc1++;
+
1975  curdest++;
+
1976  }
+
1977  }
+
1978  }
+
1979  return (0);
+
1980 }
+
1981 
+
1993 static int SDL_imageFilterAddByteToHalfMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char C,
+
1994  unsigned char *Mask)
+
1995 {
+
1996 #ifdef USE_MMX
+
1997 #if !defined(GCC__)
+
1998  __asm
+
1999  {
+
2000  pusha
+
2001  /* ** Duplicate C in 8 bytes of MM1 ** */
+
2002  mov al, C /* load C into AL */
+
2003  mov ah, al /* copy AL into AH */
+
2004  mov bx, ax /* copy AX into BX */
+
2005  shl eax, 16 /* shift 2 bytes of EAX left */
+
2006  mov ax, bx /* copy BX into AX */
+
2007  movd mm1, eax /* copy EAX into MM1 */
+
2008  movd mm2, eax /* copy EAX into MM2 */
+
2009  punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
+
2010  mov edx, Mask /* load Mask address into edx */
+
2011  movq mm0, [edx] /* load Mask into mm0 */
+
2012  mov eax, Src1 /* load Src1 address into eax */
+
2013  mov edi, Dest /* load Dest address into edi */
+
2014  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2015  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2016  align 16 /* 16 byte alignment of the loop entry */
+
2017 L1022:
+
2018  movq mm2, [eax] /* load 8 bytes from Src1 into MM2 */
+
2019  psrlw mm2, 1 /* shift 4 WORDS of MM2 1 bit to the right */
+
2020  pand mm2, mm0 // apply Mask to 8 BYTES of MM2 */
+
2021  paddusb mm2, mm1 /* MM2=SrcDest+C (add 8 bytes with saturation) */
+
2022  movq [edi], mm2 /* store result in Dest */
+
2023  add eax, 8 /* increase Src1 register pointer by 8 */
+
2024  add edi, 8 /* increase Dest register pointer by 8 */
+
2025  dec ecx /* decrease loop counter */
+
2026  jnz L1022 /* check loop termination, proceed if required */
+
2027  emms /* exit MMX state */
+
2028  popa
+
2029  }
+
2030 #else
+
2031  /* i386 and x86_64 */
+
2032  __m64 *mSrc1 = (__m64*)Src1;
+
2033  __m64 *mDest = (__m64*)Dest;
+
2034  __m64 *mMask = (__m64*)Mask;
+
2035  /* Duplicate C in 8 bytes of MM1 */
+
2036  int i;
+
2037  memset(&i, C, 4);
+
2038  __m64 mm1 = _m_from_int(i);
+
2039  __m64 mm2 = _m_from_int(i);
+
2040  mm1 = _m_punpckldq(mm1, mm2); /* fill higher bytes of MM1 with C */
+
2041  //__m64 mm1 = _m_from_int64(lli); // x86_64 only
+
2042  for (i = 0; i < SrcLength/8; i++) {
+
2043  __m64 mm2 = _m_psrlwi(*mSrc1, 1); /* shift 4 WORDS of MM2 1 bit to the right */
+
2044  mm2 = _m_pand(mm2, *mMask); /* apply Mask to 8 BYTES of MM2 */
+
2045  /* byte 0x0f, 0xdb, 0xd0 */
+
2046  *mDest = _m_paddusb(mm1, mm2); /* Src1+C (add 8 bytes with saturation) */
+
2047  mSrc1++;
+
2048  mDest++;
+
2049  }
+
2050  _m_empty(); /* clean MMX state */
+
2051 #endif
+
2052  return (0);
+
2053 #else
+
2054  return (-1);
+
2055 #endif
+
2056 }
+
2057 
+
2068 int SDL_imageFilterAddByteToHalf(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
+
2069 {
+
2070  static unsigned char Mask[8] = { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F };
+
2071  unsigned int i, istart;
+
2072  int iC;
+
2073  unsigned char *cursrc1;
+
2074  unsigned char *curdest;
+
2075  int result;
+
2076 
+
2077  /* Validate input parameters */
+
2078  if ((Src1 == NULL) || (Dest == NULL))
+
2079  return(-1);
+
2080  if (length == 0)
+
2081  return(0);
+
2082 
+
2083  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2084 
+
2085  /* MMX routine */
+
2086  SDL_imageFilterAddByteToHalfMMX(Src1, Dest, length, C, Mask);
+
2087 
+
2088  /* Check for unaligned bytes */
+
2089  if ((length & 7) > 0) {
+
2090  /* Setup to process unaligned bytes */
+
2091  istart = length & 0xfffffff8;
+
2092  cursrc1 = &Src1[istart];
+
2093  curdest = &Dest[istart];
+
2094  } else {
+
2095  /* No unaligned bytes - we are done */
+
2096  return (0);
+
2097  }
+
2098  } else {
+
2099  /* Setup to process whole image */
+
2100  istart = 0;
+
2101  cursrc1 = Src1;
+
2102  curdest = Dest;
+
2103  }
+
2104 
+
2105  /* C routine to process image */
+
2106  iC = (int) C;
+
2107  for (i = istart; i < length; i++) {
+
2108  result = (int) (*cursrc1 / 2) + iC;
+
2109  if (result > 255)
+
2110  result = 255;
+
2111  *curdest = (unsigned char) result;
+
2112  /* Advance pointers */
+
2113  cursrc1++;
+
2114  curdest++;
+
2115  }
+
2116 
+
2117  return (0);
+
2118 }
+
2119 
+
2130 int SDL_imageFilterSubByteMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char C)
+
2131 {
+
2132 #ifdef USE_MMX
+
2133 #if !defined(GCC__)
+
2134  __asm
+
2135  {
+
2136  pusha
+
2137  /* ** Duplicate C in 8 bytes of MM1 ** */
+
2138  mov al, C /* load C into AL */
+
2139  mov ah, al /* copy AL into AH */
+
2140  mov bx, ax /* copy AX into BX */
+
2141  shl eax, 16 /* shift 2 bytes of EAX left */
+
2142  mov ax, bx /* copy BX into AX */
+
2143  movd mm1, eax /* copy EAX into MM1 */
+
2144  movd mm2, eax /* copy EAX into MM2 */
+
2145  punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
+
2146  mov eax, Src1 /* load Src1 address into eax */
+
2147  mov edi, Dest /* load Dest address into edi */
+
2148  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2149  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2150  align 16 /* 16 byte alignment of the loop entry */
+
2151 L1023:
+
2152  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
2153  psubusb mm0, mm1 /* MM0=SrcDest-C (sub 8 bytes with saturation) */
+
2154  movq [edi], mm0 /* store result in SrcDest */
+
2155  add eax, 8 /* increase Src1 register pointer by 8 */
+
2156  add edi, 8 /* increase Dest register pointer by 8 */
+
2157  dec ecx /* decrease loop counter */
+
2158  jnz L1023 /* check loop termination, proceed if required */
+
2159  emms /* exit MMX state */
+
2160  popa
+
2161  }
+
2162 #else
+
2163  /* i386 and x86_64 */
+
2164  __m64 *mSrc1 = (__m64*)Src1;
+
2165  __m64 *mDest = (__m64*)Dest;
+
2166  /* Duplicate C in 8 bytes of MM1 */
+
2167  int i;
+
2168  memset(&i, C, 4);
+
2169  __m64 mm1 = _m_from_int(i);
+
2170  __m64 mm2 = _m_from_int(i);
+
2171  mm1 = _m_punpckldq(mm1, mm2); /* fill higher bytes of MM1 with C */
+
2172  //__m64 mm1 = _m_from_int64(lli); // x86_64 only
+
2173  for (i = 0; i < SrcLength/8; i++) {
+
2174  *mDest = _m_psubusb(*mSrc1, mm1); /* Src1-C (sub 8 bytes with saturation) */
+
2175  mSrc1++;
+
2176  mDest++;
+
2177  }
+
2178  _m_empty(); /* clean MMX state */
+
2179 #endif
+
2180  return (0);
+
2181 #else
+
2182  return (-1);
+
2183 #endif
+
2184 }
+
2185 
+
2196 int SDL_imageFilterSubByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
+
2197 {
+
2198  unsigned int i, istart;
+
2199  int iC;
+
2200  unsigned char *cursrc1;
+
2201  unsigned char *curdest;
+
2202  int result;
+
2203 
+
2204  /* Validate input parameters */
+
2205  if ((Src1 == NULL) || (Dest == NULL))
+
2206  return(-1);
+
2207  if (length == 0)
+
2208  return(0);
+
2209 
+
2210  /* Special case: C==0 */
+
2211  if (C == 0) {
+
2212  memcpy(Src1, Dest, length);
+
2213  return (0);
+
2214  }
+
2215 
+
2216  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2217 
+
2218  /* MMX routine */
+
2219  SDL_imageFilterSubByteMMX(Src1, Dest, length, C);
+
2220 
+
2221  /* Check for unaligned bytes */
+
2222  if ((length & 7) > 0) {
+
2223  /* Setup to process unaligned bytes */
+
2224  istart = length & 0xfffffff8;
+
2225  cursrc1 = &Src1[istart];
+
2226  curdest = &Dest[istart];
+
2227  } else {
+
2228  /* No unaligned bytes - we are done */
+
2229  return (0);
+
2230  }
+
2231  } else {
+
2232  /* Setup to process whole image */
+
2233  istart = 0;
+
2234  cursrc1 = Src1;
+
2235  curdest = Dest;
+
2236  }
+
2237 
+
2238  /* C routine to process image */
+
2239  iC = (int) C;
+
2240  for (i = istart; i < length; i++) {
+
2241  result = (int) *cursrc1 - iC;
+
2242  if (result < 0)
+
2243  result = 0;
+
2244  *curdest = (unsigned char) result;
+
2245  /* Advance pointers */
+
2246  cursrc1++;
+
2247  curdest++;
+
2248  }
+
2249  return (0);
+
2250 }
+
2251 
+
2263 static int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned int C, unsigned int D)
+
2264 {
+
2265 #ifdef USE_MMX
+
2266 #if !defined(GCC__)
+
2267  __asm
+
2268  {
+
2269  pusha
+
2270  /* ** Duplicate (int)C in 8 bytes of MM1 ** */
+
2271  mov eax, C /* load C into EAX */
+
2272  movd mm1, eax /* copy EAX into MM1 */
+
2273  mov eax, D /* load D into EAX */
+
2274  movd mm2, eax /* copy EAX into MM2 */
+
2275  punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
+
2276  mov eax, Src1 /* load Src1 address into eax */
+
2277  mov edi, Dest /* load Dest address into edi */
+
2278  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2279  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2280  align 16 /* 16 byte alignment of the loop entry */
+
2281 L11024:
+
2282  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
2283  psubusb mm0, mm1 /* MM0=SrcDest-C (sub 8 bytes with saturation) */
+
2284  movq [edi], mm0 /* store result in SrcDest */
+
2285  add eax, 8 /* increase Src1 register pointer by 8 */
+
2286  add edi, 8 /* increase Dest register pointer by 8 */
+
2287  dec ecx /* decrease loop counter */
+
2288  jnz L11024 /* check loop termination, proceed if required */
+
2289  emms /* exit MMX state */
+
2290  popa
+
2291  }
+
2292 #else
+
2293  /* i386 and x86_64 */
+
2294  __m64 *mSrc1 = (__m64*)Src1;
+
2295  __m64 *mDest = (__m64*)Dest;
+
2296  /* Duplicate (int)C in 8 bytes of MM1 */
+
2297  __m64 mm1 = _m_from_int(C);
+
2298  __m64 mm2 = _m_from_int(C);
+
2299  mm1 = _m_punpckldq(mm1, mm2); /* fill higher bytes of MM1 with C */
+
2300  //__m64 mm1 = _m_from_int64(lli); // x86_64 only
+
2301  int i;
+
2302  for (i = 0; i < SrcLength/8; i++) {
+
2303  *mDest = _m_psubusb(*mSrc1, mm1); /* Src1-C (sub 8 bytes with saturation) */
+
2304  mSrc1++;
+
2305  mDest++;
+
2306  }
+
2307  _m_empty(); /* clean MMX state */
+
2308 #endif
+
2309  return (0);
+
2310 #else
+
2311  return (-1);
+
2312 #endif
+
2313 }
+
2314 
+
2325 int SDL_imageFilterSubUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
+
2326 {
+
2327  unsigned int i, j, istart, D;
+
2328  int iC[4];
+
2329  unsigned char *cursrc1;
+
2330  unsigned char *curdest;
+
2331  int result;
+
2332 
+
2333  /* Validate input parameters */
+
2334  if ((Src1 == NULL) || (Dest == NULL))
+
2335  return(-1);
+
2336  if (length == 0)
+
2337  return(0);
+
2338 
+
2339  /* Special case: C==0 */
+
2340  if (C == 0) {
+
2341  memcpy(Src1, Dest, length);
+
2342  return (0);
+
2343  }
+
2344 
+
2345  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2346 
+
2347  /* MMX routine */
+
2348  D=SWAP_32(C);
+
2349  SDL_imageFilterSubUintMMX(Src1, Dest, length, C, D);
+
2350 
+
2351  /* Check for unaligned bytes */
+
2352  if ((length & 7) > 0) {
+
2353  /* Setup to process unaligned bytes */
+
2354  istart = length & 0xfffffff8;
+
2355  cursrc1 = &Src1[istart];
+
2356  curdest = &Dest[istart];
+
2357  } else {
+
2358  /* No unaligned bytes - we are done */
+
2359  return (0);
+
2360  }
+
2361  } else {
+
2362  /* Setup to process whole image */
+
2363  istart = 0;
+
2364  cursrc1 = Src1;
+
2365  curdest = Dest;
+
2366  }
+
2367 
+
2368  /* C routine to process image */
+
2369  iC[3] = (int) ((C >> 24) & 0xff);
+
2370  iC[2] = (int) ((C >> 16) & 0xff);
+
2371  iC[1] = (int) ((C >> 8) & 0xff);
+
2372  iC[0] = (int) ((C >> 0) & 0xff);
+
2373  for (i = istart; i < length; i += 4) {
+
2374  for (j = 0; j < 4; j++) {
+
2375  if ((i+j)<length) {
+
2376  result = (int) *cursrc1 - iC[j];
+
2377  if (result < 0) result = 0;
+
2378  *curdest = (unsigned char) result;
+
2379  /* Advance pointers */
+
2380  cursrc1++;
+
2381  curdest++;
+
2382  }
+
2383  }
+
2384  }
+
2385  return (0);
+
2386 }
+
2387 
+
2399 static int SDL_imageFilterShiftRightMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char N,
+
2400  unsigned char *Mask)
+
2401 {
+
2402 #ifdef USE_MMX
+
2403 #if !defined(GCC__)
+
2404  __asm
+
2405  {
+
2406  pusha
+
2407  mov edx, Mask /* load Mask address into edx */
+
2408  movq mm0, [edx] /* load Mask into mm0 */
+
2409  xor ecx, ecx /* zero ECX */
+
2410  mov cl, N /* load loop counter (N) into CL */
+
2411  movd mm3, ecx /* copy (N) into MM3 */
+
2412  pcmpeqb mm1, mm1 /* generate all 1's in mm1 */
+
2413 L10240: /* ** Prepare proper bit-Mask in MM1 ** */
+
2414  psrlw mm1, 1 /* shift 4 WORDS of MM1 1 bit to the right */
+
2415  pand mm1, mm0 // apply Mask to 8 BYTES of MM1 */
+
2416  /* byte 0x0f, 0xdb, 0xc8 */
+
2417  dec cl /* decrease loop counter */
+
2418  jnz L10240 /* check loop termination, proceed if required */
+
2419  /* ** Shift all bytes of the image ** */
+
2420  mov eax, Src1 /* load Src1 address into eax */
+
2421  mov edi, Dest /* load Dest address into edi */
+
2422  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2423  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2424  align 16 /* 16 byte alignment of the loop entry */
+
2425 L10241:
+
2426  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
2427  psrlw mm0, mm3 /* shift 4 WORDS of MM0 (N) bits to the right */
+
2428  pand mm0, mm1 // apply proper bit-Mask to 8 BYTES of MM0 */
+
2429  /* byte 0x0f, 0xdb, 0xc1 */
+
2430  movq [edi], mm0 /* store result in SrcDest */
+
2431  add eax, 8 /* increase Src1 register pointer by 8 */
+
2432  add edi, 8 /* increase Dest register pointer by 8 */
+
2433  dec ecx /* decrease loop counter */
+
2434  jnz L10241 /* check loop termination, proceed if required */
+
2435  emms /* exit MMX state */
+
2436  popa
+
2437  }
+
2438 #else
+
2439  /* i386 and x86_64 */
+
2440  __m64 *mSrc1 = (__m64*)Src1;
+
2441  __m64 *mDest = (__m64*)Dest;
+
2442  __m64 *mMask = (__m64*)Mask;
+
2443  __m64 mm1;
+
2444  int i;
+
2445  mm1 = _m_pcmpeqb(mm1, mm1); /* generate all 1's in mm1 */
+
2446  /* Prepare proper bit-Mask in MM1 */
+
2447  for (i = 0; i < N; i++) {
+
2448  mm1 = _m_psrlwi(mm1, 1); /* shift 4 WORDS of MM1 1 bit to the right */
+
2449  mm1 = _m_pand(mm1, *mMask); /* apply Mask to 8 BYTES of MM1 */
+
2450  }
+
2451  /* Shift all bytes of the image */
+
2452  for (i = 0; i < SrcLength/8; i++) {
+
2453  __m64 mm0 = _m_psrlwi(*mSrc1, N); /* shift 4 WORDS of MM0 (N) bits to the right */
+
2454  *mDest = _m_pand(mm0, mm1); /* apply proper bit-Mask to 8 BYTES of MM0 */
+
2455  mSrc1++;
+
2456  mDest++;
+
2457  }
+
2458  _m_empty(); /* clean MMX state */
+
2459 #endif
+
2460  return (0);
+
2461 #else
+
2462  return (-1);
+
2463 #endif
+
2464 }
+
2465 
+
2476 int SDL_imageFilterShiftRight(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
+
2477 {
+
2478  static unsigned char Mask[8] = { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F };
+
2479  unsigned int i, istart;
+
2480  unsigned char *cursrc1;
+
2481  unsigned char *curdest;
+
2482 
+
2483  /* Validate input parameters */
+
2484  if ((Src1 == NULL) || (Dest == NULL))
+
2485  return(-1);
+
2486  if (length == 0)
+
2487  return(0);
+
2488 
+
2489  /* Check shift */
+
2490  if (N > 8) {
+
2491  return (-1);
+
2492  }
+
2493 
+
2494  /* Special case: N==0 */
+
2495  if (N == 0) {
+
2496  memcpy(Src1, Dest, length);
+
2497  return (0);
+
2498  }
+
2499 
+
2500  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2501 
+
2502  /* MMX routine */
+
2503  SDL_imageFilterShiftRightMMX(Src1, Dest, length, N, Mask);
+
2504 
+
2505  /* Check for unaligned bytes */
+
2506  if ((length & 7) > 0) {
+
2507  /* Setup to process unaligned bytes */
+
2508  istart = length & 0xfffffff8;
+
2509  cursrc1 = &Src1[istart];
+
2510  curdest = &Dest[istart];
+
2511  } else {
+
2512  /* No unaligned bytes - we are done */
+
2513  return (0);
+
2514  }
+
2515  } else {
+
2516  /* Setup to process whole image */
+
2517  istart = 0;
+
2518  cursrc1 = Src1;
+
2519  curdest = Dest;
+
2520  }
+
2521 
+
2522  /* C routine to process image */
+
2523  for (i = istart; i < length; i++) {
+
2524  *curdest = (unsigned char) *cursrc1 >> N;
+
2525  /* Advance pointers */
+
2526  cursrc1++;
+
2527  curdest++;
+
2528  }
+
2529 
+
2530  return (0);
+
2531 }
+
2532 
+
2543 static int SDL_imageFilterShiftRightUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char N)
+
2544 {
+
2545 #ifdef USE_MMX
+
2546 #if !defined(GCC__)
+
2547  __asm
+
2548  {
+
2549  pusha
+
2550  mov eax, Src1 /* load Src1 address into eax */
+
2551  mov edi, Dest /* load Dest address into edi */
+
2552  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2553  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2554  align 16 /* 16 byte alignment of the loop entry */
+
2555 L13023:
+
2556  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
2557  psrld mm0, N
+
2558  movq [edi], mm0 /* store result in SrcDest */
+
2559  add eax, 8 /* increase Src1 register pointer by 8 */
+
2560  add edi, 8 /* increase Dest register pointer by 8 */
+
2561  dec ecx /* decrease loop counter */
+
2562  jnz L13023 /* check loop termination, proceed if required */
+
2563  emms /* exit MMX state */
+
2564  popa
+
2565  }
+
2566 #else
+
2567  /* i386 and x86_64 */
+
2568  __m64 *mSrc1 = (__m64*)Src1;
+
2569  __m64 *mDest = (__m64*)Dest;
+
2570  int i;
+
2571  for (i = 0; i < SrcLength/8; i++) {
+
2572  *mDest = _m_psrldi(*mSrc1, N);
+
2573  mSrc1++;
+
2574  mDest++;
+
2575  }
+
2576  _m_empty(); /* clean MMX state */
+
2577 #endif
+
2578  return (0);
+
2579 #else
+
2580  return (-1);
+
2581 #endif
+
2582 }
+
2583 
+
2594 int SDL_imageFilterShiftRightUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
+
2595 {
+
2596  unsigned int i, istart;
+
2597  unsigned char *cursrc1, *curdest;
+
2598  unsigned int *icursrc1, *icurdest;
+
2599  unsigned int result;
+
2600 
+
2601  /* Validate input parameters */
+
2602  if ((Src1 == NULL) || (Dest == NULL))
+
2603  return(-1);
+
2604  if (length == 0)
+
2605  return(0);
+
2606 
+
2607  if (N > 32) {
+
2608  return (-1);
+
2609  }
+
2610 
+
2611  /* Special case: N==0 */
+
2612  if (N == 0) {
+
2613  memcpy(Src1, Dest, length);
+
2614  return (0);
+
2615  }
+
2616 
+
2617  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2618 
+
2619  SDL_imageFilterShiftRightUintMMX(Src1, Dest, length, N);
+
2620 
+
2621  /* Check for unaligned bytes */
+
2622  if ((length & 7) > 0) {
+
2623  /* Setup to process unaligned bytes */
+
2624  istart = length & 0xfffffff8;
+
2625  cursrc1 = &Src1[istart];
+
2626  curdest = &Dest[istart];
+
2627  } else {
+
2628  /* No unaligned bytes - we are done */
+
2629  return (0);
+
2630  }
+
2631  } else {
+
2632  /* Setup to process whole image */
+
2633  istart = 0;
+
2634  cursrc1 = Src1;
+
2635  curdest = Dest;
+
2636  }
+
2637 
+
2638  /* C routine to process image */
+
2639  icursrc1=(unsigned int *)cursrc1;
+
2640  icurdest=(unsigned int *)curdest;
+
2641  for (i = istart; i < length; i += 4) {
+
2642  if ((i+4)<length) {
+
2643  result = ((unsigned int)*icursrc1 >> N);
+
2644  *icurdest = result;
+
2645  }
+
2646  /* Advance pointers */
+
2647  icursrc1++;
+
2648  icurdest++;
+
2649  }
+
2650 
+
2651  return (0);
+
2652 }
+
2653 
+
2664 static int SDL_imageFilterMultByByteMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char C)
+
2665 {
+
2666 #ifdef USE_MMX
+
2667 #if !defined(GCC__)
+
2668  __asm
+
2669  {
+
2670  pusha
+
2671  /* ** Duplicate C in 4 words of MM1 ** */
+
2672  mov al, C /* load C into AL */
+
2673  xor ah, ah /* zero AH */
+
2674  mov bx, ax /* copy AX into BX */
+
2675  shl eax, 16 /* shift 2 bytes of EAX left */
+
2676  mov ax, bx /* copy BX into AX */
+
2677  movd mm1, eax /* copy EAX into MM1 */
+
2678  movd mm2, eax /* copy EAX into MM2 */
+
2679  punpckldq mm1, mm2 /* fill higher words of MM1 with C */
+
2680  pxor mm0, mm0 /* zero MM0 register */
+
2681  mov eax, Src1 /* load Src1 address into eax */
+
2682  mov edi, Dest /* load Dest address into edi */
+
2683  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2684  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2685  cmp al, 128 /* if (C <= 128) execute more efficient code */
+
2686  jg L10251
+
2687  align 16 /* 16 byte alignment of the loop entry */
+
2688 L10250:
+
2689  movq mm3, [eax] /* load 8 bytes from Src1 into MM3 */
+
2690  movq mm4, mm3 /* copy MM3 into MM4 */
+
2691  punpcklbw mm3, mm0 /* unpack low bytes of SrcDest into words */
+
2692  punpckhbw mm4, mm0 /* unpack high bytes of SrcDest into words */
+
2693  pmullw mm3, mm1 /* mul low bytes of SrcDest and MM1 */
+
2694  pmullw mm4, mm1 /* mul high bytes of SrcDest and MM1 */
+
2695  packuswb mm3, mm4 /* pack words back into bytes with saturation */
+
2696  movq [edi], mm3 /* store result in Dest */
+
2697  add eax, 8 /* increase Src1 register pointer by 8 */
+
2698  add edi, 8 /* increase Dest register pointer by 8 */
+
2699  dec ecx /* decrease loop counter */
+
2700  jnz L10250 /* check loop termination, proceed if required */
+
2701  jmp L10252
+
2702  align 16 /* 16 byte alignment of the loop entry */
+
2703 L10251:
+
2704  movq mm3, [eax] /* load 8 bytes from Src1 into MM3 */
+
2705  movq mm4, mm3 /* copy MM3 into MM4 */
+
2706  punpcklbw mm3, mm0 /* unpack low bytes of SrcDest into words */
+
2707  punpckhbw mm4, mm0 /* unpack high bytes of SrcDest into words */
+
2708  pmullw mm3, mm1 /* mul low bytes of SrcDest and MM1 */
+
2709  pmullw mm4, mm1 /* mul high bytes of SrcDest and MM1 */
+
2710  /* ** Take abs value of the results (signed words) ** */
+
2711  movq mm5, mm3 /* copy mm3 into mm5 */
+
2712  movq mm6, mm4 /* copy mm4 into mm6 */
+
2713  psraw mm5, 15 /* fill mm5 words with word sign bit */
+
2714  psraw mm6, 15 /* fill mm6 words with word sign bit */
+
2715  pxor mm3, mm5 /* take 1's compliment of only neg words */
+
2716  pxor mm4, mm6 /* take 1's compliment of only neg words */
+
2717  psubsw mm3, mm5 /* add 1 to only neg words, W-(-1) or W-0 */
+
2718  psubsw mm4, mm6 /* add 1 to only neg words, W-(-1) or W-0 */
+
2719  packuswb mm3, mm4 /* pack words back into bytes with saturation */
+
2720  movq [edi], mm3 /* store result in Dest */
+
2721  add eax, 8 /* increase Src1 register pointer by 8 */
+
2722  add edi, 8 /* increase Dest register pointer by 8 */
+
2723  dec ecx /* decrease loop counter */
+
2724  jnz L10251 /* check loop termination, proceed if required */
+
2725 L10252:
+
2726  emms /* exit MMX state */
+
2727  popa
+
2728  }
+
2729 #else
+
2730  /* i386 and x86_64 */
+
2731  __m64 *mSrc1 = (__m64*)Src1;
+
2732  __m64 *mDest = (__m64*)Dest;
+
2733  __m64 mm0 = _m_from_int(0); /* zero mm0 register */
+
2734  /* Duplicate C in 4 words of MM1 */
+
2735  int i;
+
2736  i = C | C<<16;
+
2737  __m64 mm1 = _m_from_int(i);
+
2738  __m64 mm2 = _m_from_int(i);
+
2739  mm1 = _m_punpckldq(mm1, mm2); /* fill higher words of MM1 with C */
+
2740  // long long lli = C | C<<16 | (long long)C<<32 | (long long)C<<48;
+
2741  //__m64 mm1 = _m_from_int64(lli); // x86_64 only
+
2742  if (C <= 128) { /* if (C <= 128) execute more efficient code */
+
2743  for (i = 0; i < SrcLength/8; i++) {
+
2744  __m64 mm3, mm4;
+
2745  mm3 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
2746  mm4 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
2747  mm3 = _m_pmullw(mm3, mm1); /* mul low bytes of Src1 and MM1 */
+
2748  mm4 = _m_pmullw(mm4, mm1); /* mul high bytes of Src1 and MM1 */
+
2749  *mDest = _m_packuswb(mm3, mm4); /* pack words back into bytes with saturation */
+
2750  mSrc1++;
+
2751  mDest++;
+
2752  }
+
2753  } else {
+
2754  for (i = 0; i < SrcLength/8; i++) {
+
2755  __m64 mm3, mm4, mm5, mm6;
+
2756  mm3 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
2757  mm4 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
2758  mm3 = _m_pmullw(mm3, mm1); /* mul low bytes of Src1 and MM1 */
+
2759  mm4 = _m_pmullw(mm4, mm1); /* mul high bytes of Src1 and MM1 */
+
2760  /* Take abs value of the results (signed words) */
+
2761  mm5 = _m_psrawi(mm3, 15); /* fill mm5 words with word sign bit */
+
2762  mm6 = _m_psrawi(mm4, 15); /* fill mm6 words with word sign bit */
+
2763  mm3 = _m_pxor(mm3, mm5); /* take 1's compliment of only neg. words */
+
2764  mm4 = _m_pxor(mm4, mm6); /* take 1's compliment of only neg. words */
+
2765  mm3 = _m_psubsw(mm3, mm5); /* add 1 to only neg. words, W-(-1) or W-0 */
+
2766  mm4 = _m_psubsw(mm4, mm6); /* add 1 to only neg. words, W-(-1) or W-0 */
+
2767  *mDest = _m_packuswb(mm3, mm4); /* pack words back into bytes with saturation */
+
2768  mSrc1++;
+
2769  mDest++;
+
2770  }
+
2771  }
+
2772  _m_empty(); /* clean MMX state */
+
2773 #endif
+
2774  return (0);
+
2775 #else
+
2776  return (-1);
+
2777 #endif
+
2778 }
+
2779 
+
2790 int SDL_imageFilterMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
+
2791 {
+
2792  unsigned int i, istart;
+
2793  int iC;
+
2794  unsigned char *cursrc1;
+
2795  unsigned char *curdest;
+
2796  int result;
+
2797 
+
2798  /* Validate input parameters */
+
2799  if ((Src1 == NULL) || (Dest == NULL))
+
2800  return(-1);
+
2801  if (length == 0)
+
2802  return(0);
+
2803 
+
2804  /* Special case: C==1 */
+
2805  if (C == 1) {
+
2806  memcpy(Src1, Dest, length);
+
2807  return (0);
+
2808  }
+
2809 
+
2810  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2811 
+
2812  SDL_imageFilterMultByByteMMX(Src1, Dest, length, C);
+
2813 
+
2814  /* Check for unaligned bytes */
+
2815  if ((length & 7) > 0) {
+
2816  /* Setup to process unaligned bytes */
+
2817  istart = length & 0xfffffff8;
+
2818  cursrc1 = &Src1[istart];
+
2819  curdest = &Dest[istart];
+
2820  } else {
+
2821  /* No unaligned bytes - we are done */
+
2822  return (0);
+
2823  }
+
2824  } else {
+
2825  /* Setup to process whole image */
+
2826  istart = 0;
+
2827  cursrc1 = Src1;
+
2828  curdest = Dest;
+
2829  }
+
2830 
+
2831  /* C routine to process image */
+
2832  iC = (int) C;
+
2833  for (i = istart; i < length; i++) {
+
2834  result = (int) *cursrc1 * iC;
+
2835  if (result > 255)
+
2836  result = 255;
+
2837  *curdest = (unsigned char) result;
+
2838  /* Advance pointers */
+
2839  cursrc1++;
+
2840  curdest++;
+
2841  }
+
2842 
+
2843  return (0);
+
2844 }
+
2845 
+
2857 static int SDL_imageFilterShiftRightAndMultByByteMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char N,
+
2858  unsigned char C)
+
2859 {
+
2860 #ifdef USE_MMX
+
2861 #if !defined(GCC__)
+
2862  __asm
+
2863  {
+
2864  pusha
+
2865  /* ** Duplicate C in 4 words of MM1 ** */
+
2866  mov al, C /* load C into AL */
+
2867  xor ah, ah /* zero AH */
+
2868  mov bx, ax /* copy AX into BX */
+
2869  shl eax, 16 /* shift 2 bytes of EAX left */
+
2870  mov ax, bx /* copy BX into AX */
+
2871  movd mm1, eax /* copy EAX into MM1 */
+
2872  movd mm2, eax /* copy EAX into MM2 */
+
2873  punpckldq mm1, mm2 /* fill higher words of MM1 with C */
+
2874  xor ecx, ecx /* zero ECX */
+
2875  mov cl, N /* load N into CL */
+
2876  movd mm7, ecx /* copy N into MM7 */
+
2877  pxor mm0, mm0 /* zero MM0 register */
+
2878  mov eax, Src1 /* load Src1 address into eax */
+
2879  mov edi, Dest /* load Dest address into edi */
+
2880  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
2881  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
2882  align 16 /* 16 byte alignment of the loop entry */
+
2883 L1026:
+
2884  movq mm3, [eax] /* load 8 bytes from Src1 into MM3 */
+
2885  movq mm4, mm3 /* copy MM3 into MM4 */
+
2886  punpcklbw mm3, mm0 /* unpack low bytes of SrcDest into words */
+
2887  punpckhbw mm4, mm0 /* unpack high bytes of SrcDest into words */
+
2888  psrlw mm3, mm7 /* shift 4 WORDS of MM3 (N) bits to the right */
+
2889  psrlw mm4, mm7 /* shift 4 WORDS of MM4 (N) bits to the right */
+
2890  pmullw mm3, mm1 /* mul low bytes of SrcDest by MM1 */
+
2891  pmullw mm4, mm1 /* mul high bytes of SrcDest by MM1 */
+
2892  packuswb mm3, mm4 /* pack words back into bytes with saturation */
+
2893  movq [edi], mm3 /* store result in Dest */
+
2894  add eax, 8 /* increase Src1 register pointer by 8 */
+
2895  add edi, 8 /* increase Dest register pointer by 8 */
+
2896  dec ecx /* decrease loop counter */
+
2897  jnz L1026 /* check loop termination, proceed if required */
+
2898  emms /* exit MMX state */
+
2899  popa
+
2900  }
+
2901 #else
+
2902  /* i386 and x86_64 */
+
2903  __m64 *mSrc1 = (__m64*)Src1;
+
2904  __m64 *mDest = (__m64*)Dest;
+
2905  __m64 mm0 = _m_from_int(0); /* zero mm0 register */
+
2906  /* Duplicate C in 4 words of MM1 */
+
2907  int i;
+
2908  i = (C<<16)|C;
+
2909  __m64 mm1 = _m_from_int(i);
+
2910  __m64 mm2 = _m_from_int(i);
+
2911  mm1 = _m_punpckldq(mm1, mm2); /* fill higher words of MM1 with C */
+
2912  for (i = 0; i < SrcLength/8; i++) {
+
2913  __m64 mm3, mm4, mm5, mm6;
+
2914  mm3 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
2915  mm4 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
2916  mm3 = _m_psrlwi(mm3, N); /* shift 4 WORDS of MM3 (N) bits to the right */
+
2917  mm4 = _m_psrlwi(mm4, N); /* shift 4 WORDS of MM4 (N) bits to the right */
+
2918  mm3 = _m_pmullw(mm3, mm1); /* mul low bytes of Src1 and MM1 */
+
2919  mm4 = _m_pmullw(mm4, mm1); /* mul high bytes of Src1 and MM1 */
+
2920  *mDest = _m_packuswb(mm3, mm4); /* pack words back into bytes with saturation */
+
2921  mSrc1++;
+
2922  mDest++;
+
2923  }
+
2924  _m_empty(); /* clean MMX state */
+
2925 #endif
+
2926  return (0);
+
2927 #else
+
2928  return (-1);
+
2929 #endif
+
2930 }
+
2931 
+
2943 int SDL_imageFilterShiftRightAndMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N,
+
2944  unsigned char C)
+
2945 {
+
2946  unsigned int i, istart;
+
2947  int iC;
+
2948  unsigned char *cursrc1;
+
2949  unsigned char *curdest;
+
2950  int result;
+
2951 
+
2952  /* Validate input parameters */
+
2953  if ((Src1 == NULL) || (Dest == NULL))
+
2954  return(-1);
+
2955  if (length == 0)
+
2956  return(0);
+
2957 
+
2958  /* Check shift */
+
2959  if (N > 8) {
+
2960  return (-1);
+
2961  }
+
2962 
+
2963  /* Special case: N==0 && C==1 */
+
2964  if ((N == 0) && (C == 1)) {
+
2965  memcpy(Src1, Dest, length);
+
2966  return (0);
+
2967  }
+
2968 
+
2969  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
2970 
+
2971  SDL_imageFilterShiftRightAndMultByByteMMX(Src1, Dest, length, N, C);
+
2972 
+
2973  /* Check for unaligned bytes */
+
2974  if ((length & 7) > 0) {
+
2975  /* Setup to process unaligned bytes */
+
2976  istart = length & 0xfffffff8;
+
2977  cursrc1 = &Src1[istart];
+
2978  curdest = &Dest[istart];
+
2979  } else {
+
2980  /* No unaligned bytes - we are done */
+
2981  return (0);
+
2982  }
+
2983  } else {
+
2984  /* Setup to process whole image */
+
2985  istart = 0;
+
2986  cursrc1 = Src1;
+
2987  curdest = Dest;
+
2988  }
+
2989 
+
2990  /* C routine to process image */
+
2991  iC = (int) C;
+
2992  for (i = istart; i < length; i++) {
+
2993  result = (int) (*cursrc1 >> N) * iC;
+
2994  if (result > 255)
+
2995  result = 255;
+
2996  *curdest = (unsigned char) result;
+
2997  /* Advance pointers */
+
2998  cursrc1++;
+
2999  curdest++;
+
3000  }
+
3001 
+
3002  return (0);
+
3003 }
+
3004 
+
3016 static int SDL_imageFilterShiftLeftByteMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char N,
+
3017  unsigned char *Mask)
+
3018 {
+
3019 #ifdef USE_MMX
+
3020 #if !defined(GCC__)
+
3021  __asm
+
3022  {
+
3023  pusha
+
3024  mov edx, Mask /* load Mask address into edx */
+
3025  movq mm0, [edx] /* load Mask into mm0 */
+
3026  xor ecx, ecx /* zero ECX */
+
3027  mov cl, N /* load loop counter (N) into CL */
+
3028  movd mm3, ecx /* copy (N) into MM3 */
+
3029  pcmpeqb mm1, mm1 /* generate all 1's in mm1 */
+
3030 L10270: /* ** Prepare proper bit-Mask in MM1 ** */
+
3031  psllw mm1, 1 /* shift 4 WORDS of MM1 1 bit to the left */
+
3032  pand mm1, mm0 // apply Mask to 8 BYTES of MM1 */
+
3033  /* byte 0x0f, 0xdb, 0xc8 */
+
3034  dec cl /* decrease loop counter */
+
3035  jnz L10270 /* check loop termination, proceed if required */
+
3036  /* ** Shift all bytes of the image ** */
+
3037  mov eax, Src1 /* load Src1 address into eax */
+
3038  mov edi, Dest /* load SrcDest address into edi */
+
3039  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
3040  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
3041  align 16 /* 16 byte alignment of the loop entry */
+
3042 L10271:
+
3043  movq mm0, [eax] /* load 8 bytes from Src1 into MM0 */
+
3044  psllw mm0, mm3 /* shift 4 WORDS of MM0 (N) bits to the left */
+
3045  pand mm0, mm1 // apply proper bit-Mask to 8 BYTES of MM0 */
+
3046  /* byte 0x0f, 0xdb, 0xc1 */
+
3047  movq [edi], mm0 /* store result in Dest */
+
3048  add eax, 8 /* increase Src1 register pointer by 8 */
+
3049  add edi, 8 /* increase Dest register pointer by 8 */
+
3050  dec ecx /* decrease loop counter */
+
3051  jnz L10271 /* check loop termination, proceed if required */
+
3052  emms /* exit MMX state */
+
3053  popa
+
3054  }
+
3055 #else
+
3056  /* i386 and x86_64 */
+
3057  __m64 *mSrc1 = (__m64*)Src1;
+
3058  __m64 *mDest = (__m64*)Dest;
+
3059  __m64 *mMask = (__m64*)Mask;
+
3060  __m64 mm1;
+
3061  int i;
+
3062  mm1 = _m_pcmpeqb(mm1, mm1); /* generate all 1's in mm1 */
+
3063  /* Prepare proper bit-Mask in MM1 */
+
3064  for (i = 0; i < N; i++) {
+
3065  mm1 = _m_psllwi(mm1, 1); /* shift 4 WORDS of MM1 1 bit to the left */
+
3066  mm1 = _m_pand(mm1, *mMask); /* apply Mask to 8 BYTES of MM1 */
+
3067  }
+
3068  /* ** Shift all bytes of the image ** */
+
3069  for (i = 0; i < SrcLength/8; i++) {
+
3070  __m64 mm0 = _m_psllwi(*mSrc1, N); /* shift 4 WORDS of MM0 (N) bits to the left */
+
3071  *mDest = _m_pand(mm0, mm1); /* apply proper bit-Mask to 8 BYTES of MM0 */
+
3072  mSrc1++;
+
3073  mDest++;
+
3074  }
+
3075  _m_empty(); /* clean MMX state */
+
3076 #endif
+
3077  return (0);
+
3078 #else
+
3079  return (-1);
+
3080 #endif
+
3081 }
+
3082 
+
3093 int SDL_imageFilterShiftLeftByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
+
3094 {
+
3095  static unsigned char Mask[8] = { 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE };
+
3096  unsigned int i, istart;
+
3097  unsigned char *cursrc1, *curdest;
+
3098  int result;
+
3099 
+
3100  /* Validate input parameters */
+
3101  if ((Src1 == NULL) || (Dest == NULL))
+
3102  return(-1);
+
3103  if (length == 0)
+
3104  return(0);
+
3105 
+
3106  if (N > 8) {
+
3107  return (-1);
+
3108  }
+
3109 
+
3110  /* Special case: N==0 */
+
3111  if (N == 0) {
+
3112  memcpy(Src1, Dest, length);
+
3113  return (0);
+
3114  }
+
3115 
+
3116  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
3117 
+
3118  SDL_imageFilterShiftLeftByteMMX(Src1, Dest, length, N, Mask);
+
3119 
+
3120  /* Check for unaligned bytes */
+
3121  if ((length & 7) > 0) {
+
3122  /* Setup to process unaligned bytes */
+
3123  istart = length & 0xfffffff8;
+
3124  cursrc1 = &Src1[istart];
+
3125  curdest = &Dest[istart];
+
3126  } else {
+
3127  /* No unaligned bytes - we are done */
+
3128  return (0);
+
3129  }
+
3130  } else {
+
3131  /* Setup to process whole image */
+
3132  istart = 0;
+
3133  cursrc1 = Src1;
+
3134  curdest = Dest;
+
3135  }
+
3136 
+
3137  /* C routine to process image */
+
3138  for (i = istart; i < length; i++) {
+
3139  result = ((int) *cursrc1 << N) & 0xff;
+
3140  *curdest = (unsigned char) result;
+
3141  /* Advance pointers */
+
3142  cursrc1++;
+
3143  curdest++;
+
3144  }
+
3145 
+
3146  return (0);
+
3147 }
+
3148 
+
3159 static int SDL_imageFilterShiftLeftUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char N)
+
3160 {
+
3161 #ifdef USE_MMX
+
3162 #if !defined(GCC__)
+
3163  __asm
+
3164  {
+
3165  pusha
+
3166  mov eax, Src1 /* load Src1 address into eax */
+
3167  mov edi, Dest /* load Dest address into edi */
+
3168  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
3169  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
3170  align 16 /* 16 byte alignment of the loop entry */
+
3171 L12023:
+
3172  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
3173  pslld mm0, N /* MM0=SrcDest+C (add 8 bytes with saturation) */
+
3174  movq [edi], mm0 /* store result in SrcDest */
+
3175  add eax, 8 /* increase Src1 register pointer by 8 */
+
3176  add edi, 8 /* increase Dest register pointer by 8 */
+
3177  dec ecx /* decrease loop counter */
+
3178  jnz L12023 /* check loop termination, proceed if required */
+
3179  emms /* exit MMX state */
+
3180  popa
+
3181  }
+
3182 #else
+
3183  /* i386 and x86_64 */
+
3184  __m64 *mSrc1 = (__m64*)Src1;
+
3185  __m64 *mDest = (__m64*)Dest;
+
3186  int i;
+
3187  for (i = 0; i < SrcLength/8; i++) {
+
3188  *mDest = _m_pslldi(*mSrc1, N); /* Src1+C (add 8 bytes with saturation) */
+
3189  mSrc1++;
+
3190  mDest++;
+
3191  }
+
3192  _m_empty(); /* clean MMX state */
+
3193 #endif
+
3194  return (0);
+
3195 #else
+
3196  return (-1);
+
3197 #endif
+
3198 }
+
3199 
+
3210 int SDL_imageFilterShiftLeftUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
+
3211 {
+
3212  unsigned int i, istart;
+
3213  unsigned char *cursrc1, *curdest;
+
3214  unsigned int *icursrc1, *icurdest;
+
3215  unsigned int result;
+
3216 
+
3217  /* Validate input parameters */
+
3218  if ((Src1 == NULL) || (Dest == NULL))
+
3219  return(-1);
+
3220  if (length == 0)
+
3221  return(0);
+
3222 
+
3223  if (N > 32) {
+
3224  return (-1);
+
3225  }
+
3226 
+
3227  /* Special case: N==0 */
+
3228  if (N == 0) {
+
3229  memcpy(Src1, Dest, length);
+
3230  return (0);
+
3231  }
+
3232 
+
3233  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
3234 
+
3235  SDL_imageFilterShiftLeftUintMMX(Src1, Dest, length, N);
+
3236 
+
3237  /* Check for unaligned bytes */
+
3238  if ((length & 7) > 0) {
+
3239  /* Setup to process unaligned bytes */
+
3240  istart = length & 0xfffffff8;
+
3241  cursrc1 = &Src1[istart];
+
3242  curdest = &Dest[istart];
+
3243  } else {
+
3244  /* No unaligned bytes - we are done */
+
3245  return (0);
+
3246  }
+
3247  } else {
+
3248  /* Setup to process whole image */
+
3249  istart = 0;
+
3250  cursrc1 = Src1;
+
3251  curdest = Dest;
+
3252  }
+
3253 
+
3254  /* C routine to process image */
+
3255  icursrc1=(unsigned int *)cursrc1;
+
3256  icurdest=(unsigned int *)curdest;
+
3257  for (i = istart; i < length; i += 4) {
+
3258  if ((i+4)<length) {
+
3259  result = ((unsigned int)*icursrc1 << N);
+
3260  *icurdest = result;
+
3261  }
+
3262  /* Advance pointers */
+
3263  icursrc1++;
+
3264  icurdest++;
+
3265  }
+
3266 
+
3267  return (0);
+
3268 }
+
3269 
+
3280 static int SDL_imageFilterShiftLeftMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char N)
+
3281 {
+
3282 #ifdef USE_MMX
+
3283 #if !defined(GCC__)
+
3284  __asm
+
3285  {
+
3286  pusha
+
3287  xor eax, eax /* zero EAX */
+
3288  mov al, N /* load N into AL */
+
3289  movd mm7, eax /* copy N into MM7 */
+
3290  pxor mm0, mm0 /* zero MM0 register */
+
3291  mov eax, Src1 /* load Src1 address into eax */
+
3292  mov edi, Dest /* load Dest address into edi */
+
3293  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
3294  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
3295  cmp al, 7 /* if (N <= 7) execute more efficient code */
+
3296  jg L10281
+
3297  align 16 /* 16 byte alignment of the loop entry */
+
3298 L10280:
+
3299  movq mm3, [eax] /* load 8 bytes from Src1 into MM3 */
+
3300  movq mm4, mm3 /* copy MM3 into MM4 */
+
3301  punpcklbw mm3, mm0 /* unpack low bytes of SrcDest into words */
+
3302  punpckhbw mm4, mm0 /* unpack high bytes of SrcDest into words */
+
3303  psllw mm3, mm7 /* shift 4 WORDS of MM3 (N) bits to the left */
+
3304  psllw mm4, mm7 /* shift 4 WORDS of MM4 (N) bits to the left */
+
3305  packuswb mm3, mm4 /* pack words back into bytes with saturation */
+
3306  movq [edi], mm3 /* store result in Dest */
+
3307  add eax, 8 /* increase Src1 register pointer by 8 */
+
3308  add edi, 8 /* increase Dest register pointer by 8 */
+
3309  dec ecx /* decrease loop counter */
+
3310  jnz L10280 /* check loop termination, proceed if required */
+
3311  jmp L10282
+
3312  align 16 /* 16 byte alignment of the loop entry */
+
3313 L10281:
+
3314  movq mm3, [eax] /* load 8 bytes from Src1 into MM3 */
+
3315  movq mm4, mm3 /* copy MM3 into MM4 */
+
3316  punpcklbw mm3, mm0 /* unpack low bytes of SrcDest into words */
+
3317  punpckhbw mm4, mm0 /* unpack high bytes of SrcDest into words */
+
3318  psllw mm3, mm7 /* shift 4 WORDS of MM3 (N) bits to the left */
+
3319  psllw mm4, mm7 /* shift 4 WORDS of MM4 (N) bits to the left */
+
3320  /* ** Take abs value of the signed words ** */
+
3321  movq mm5, mm3 /* copy mm3 into mm5 */
+
3322  movq mm6, mm4 /* copy mm4 into mm6 */
+
3323  psraw mm5, 15 /* fill mm5 words with word sign bit */
+
3324  psraw mm6, 15 /* fill mm6 words with word sign bit */
+
3325  pxor mm3, mm5 /* take 1's compliment of only neg words */
+
3326  pxor mm4, mm6 /* take 1's compliment of only neg words */
+
3327  psubsw mm3, mm5 /* add 1 to only neg words, W-(-1) or W-0 */
+
3328  psubsw mm4, mm6 /* add 1 to only neg words, W-(-1) or W-0 */
+
3329  packuswb mm3, mm4 /* pack words back into bytes with saturation */
+
3330  movq [edi], mm3 /* store result in Dest */
+
3331  add eax, 8 /* increase Src1 register pointer by 8 */
+
3332  add edi, 8 /* increase Dest register pointer by 8 */
+
3333  dec ecx /* decrease loop counter */
+
3334  jnz L10281 /* check loop termination, proceed if required */
+
3335 L10282:
+
3336  emms /* exit MMX state */
+
3337  popa
+
3338  }
+
3339 #else
+
3340  /* i386 and x86_64 */
+
3341  __m64 *mSrc1 = (__m64*)Src1;
+
3342  __m64 *mDest = (__m64*)Dest;
+
3343  __m64 mm0 = _m_from_int(0); /* zero mm0 register */
+
3344  int i;
+
3345  if (N <= 7) { /* if (N <= 7) execute more efficient code */
+
3346  for (i = 0; i < SrcLength/8; i++) {
+
3347  __m64 mm3, mm4;
+
3348  mm3 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
3349  mm4 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
3350  mm3 = _m_psllwi(mm3, N); /* shift 4 WORDS of MM3 (N) bits to the left */
+
3351  mm4 = _m_psllwi(mm4, N); /* shift 4 WORDS of MM4 (N) bits to the left */
+
3352  *mDest = _m_packuswb(mm3, mm4); /* pack words back into bytes with saturation */
+
3353  mSrc1++;
+
3354  mDest++;
+
3355  }
+
3356  } else {
+
3357  for (i = 0; i < SrcLength/8; i++) {
+
3358  __m64 mm3, mm4, mm5, mm6;
+
3359  mm3 = _m_punpcklbw(*mSrc1, mm0); /* unpack low bytes of Src1 into words */
+
3360  mm4 = _m_punpckhbw(*mSrc1, mm0); /* unpack high bytes of Src1 into words */
+
3361  mm3 = _m_psllwi(mm3, N); /* shift 4 WORDS of MM3 (N) bits to the left */
+
3362  mm4 = _m_psllwi(mm4, N); /* shift 4 WORDS of MM4 (N) bits to the left */
+
3363  /* Take abs value of the signed words */
+
3364  mm5 = _m_psrawi(mm3, 15); /* fill mm5 words with word sign bit */
+
3365  mm6 = _m_psrawi(mm4, 15); /* fill mm6 words with word sign bit */
+
3366  mm3 = _m_pxor(mm3, mm5); /* take 1's compliment of only neg. words */
+
3367  mm4 = _m_pxor(mm4, mm6); /* take 1's compliment of only neg. words */
+
3368  mm3 = _m_psubsw(mm3, mm5); /* add 1 to only neg. words, W-(-1) or W-0 */
+
3369  mm4 = _m_psubsw(mm4, mm6); /* add 1 to only neg. words, W-(-1) or W-0 */
+
3370  *mDest = _m_packuswb(mm3, mm4); /* pack words back into bytes with saturation */
+
3371  mSrc1++;
+
3372  mDest++;
+
3373  }
+
3374  }
+
3375  _m_empty(); /* clean MMX state */
+
3376 #endif
+
3377  return (0);
+
3378 #else
+
3379  return (-1);
+
3380 #endif
+
3381 }
+
3382 
+
3393 int SDL_imageFilterShiftLeft(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
+
3394 {
+
3395  unsigned int i, istart;
+
3396  unsigned char *cursrc1, *curdest;
+
3397  int result;
+
3398 
+
3399  /* Validate input parameters */
+
3400  if ((Src1 == NULL) || (Dest == NULL))
+
3401  return(-1);
+
3402  if (length == 0)
+
3403  return(0);
+
3404 
+
3405  if (N > 8) {
+
3406  return (-1);
+
3407  }
+
3408 
+
3409  /* Special case: N==0 */
+
3410  if (N == 0) {
+
3411  memcpy(Src1, Dest, length);
+
3412  return (0);
+
3413  }
+
3414 
+
3415  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
3416 
+
3417  SDL_imageFilterShiftLeftMMX(Src1, Dest, length, N);
+
3418 
+
3419  /* Check for unaligned bytes */
+
3420  if ((length & 7) > 0) {
+
3421  /* Setup to process unaligned bytes */
+
3422  istart = length & 0xfffffff8;
+
3423  cursrc1 = &Src1[istart];
+
3424  curdest = &Dest[istart];
+
3425  } else {
+
3426  /* No unaligned bytes - we are done */
+
3427  return (0);
+
3428  }
+
3429  } else {
+
3430  /* Setup to process whole image */
+
3431  istart = 0;
+
3432  cursrc1 = Src1;
+
3433  curdest = Dest;
+
3434  }
+
3435 
+
3436  /* C routine to process image */
+
3437  for (i = istart; i < length; i++) {
+
3438  result = (int) *cursrc1 << N;
+
3439  if (result > 255)
+
3440  result = 255;
+
3441  *curdest = (unsigned char) result;
+
3442  /* Advance pointers */
+
3443  cursrc1++;
+
3444  curdest++;
+
3445  }
+
3446 
+
3447  return (0);
+
3448 }
+
3449 
+
3460 static int SDL_imageFilterBinarizeUsingThresholdMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char T)
+
3461 {
+
3462 #ifdef USE_MMX
+
3463 #if !defined(GCC__)
+
3464  __asm
+
3465  {
+
3466  pusha
+
3467  /* ** Duplicate T in 8 bytes of MM3 ** */
+
3468  pcmpeqb mm1, mm1 /* generate all 1's in mm1 */
+
3469  pcmpeqb mm2, mm2 /* generate all 1's in mm2 */
+
3470  mov al, T /* load T into AL */
+
3471  mov ah, al /* copy AL into AH */
+
3472  mov bx, ax /* copy AX into BX */
+
3473  shl eax, 16 /* shift 2 bytes of EAX left */
+
3474  mov ax, bx /* copy BX into AX */
+
3475  movd mm3, eax /* copy EAX into MM3 */
+
3476  movd mm4, eax /* copy EAX into MM4 */
+
3477  punpckldq mm3, mm4 /* fill higher bytes of MM3 with T */
+
3478  psubusb mm2, mm3 /* store 0xFF - T in MM2 */
+
3479  mov eax, Src1 /* load Src1 address into eax */
+
3480  mov edi, Dest /* load Dest address into edi */
+
3481  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
3482  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
3483  align 16 /* 16 byte alignment of the loop entry */
+
3484 L1029:
+
3485  movq mm0, [eax] /* load 8 bytes from SrcDest into MM0 */
+
3486  paddusb mm0, mm2 /* MM0=SrcDest+(0xFF-T) (add 8 bytes with saturation) */
+
3487  pcmpeqb mm0, mm1 /* binarize 255:0, comparing to 255 */
+
3488  movq [edi], mm0 /* store result in SrcDest */
+
3489  add eax, 8 /* increase Src1 register pointer by 8 */
+
3490  add edi, 8 /* increase Dest register pointer by 8 */
+
3491  dec ecx /* decrease loop counter */
+
3492  jnz L1029 /* check loop termination, proceed if required */
+
3493  emms /* exit MMX state */
+
3494  popa
+
3495  }
+
3496 #else
+
3497  /* i386 and x86_64 */
+
3498  __m64 *mSrc1 = (__m64*)Src1;
+
3499  __m64 *mDest = (__m64*)Dest;
+
3500  /* Duplicate T in 8 bytes of MM3 */
+
3501  __m64 mm1 = _m_pcmpeqb(mm1, mm1); /* generate all 1's in mm1 */
+
3502  __m64 mm2 = _m_pcmpeqb(mm2, mm2); /* generate all 1's in mm1 */
+
3503  int i;
+
3504  memset(&i, T, 4);
+
3505  __m64 mm3 = _m_from_int(i);
+
3506  __m64 mm4 = _m_from_int(i);
+
3507  mm3 = _m_punpckldq(mm3, mm4); /* fill higher bytes of MM3 with T */
+
3508  mm2 = _m_psubusb(mm2, mm3); /* store 0xFF - T in MM2 */
+
3509  //__m64 mm3 = _m_from_int64(lli); // x86_64 only
+
3510  for (i = 0; i < SrcLength/8; i++) {
+
3511  __m64 mm0 = _m_paddusb(*mSrc1, mm2); /* Src1+(0xFF-T) (add 8 bytes with saturation) */
+
3512  *mDest = _m_pcmpeqb(mm0, mm1); /* binarize 255:0, comparing to 255 */
+
3513  mSrc1++;
+
3514  mDest++;
+
3515  }
+
3516  _m_empty(); /* clean MMX state */
+
3517 #endif
+
3518  return (0);
+
3519 #else
+
3520  return (-1);
+
3521 #endif
+
3522 }
+
3523 
+
3534 int SDL_imageFilterBinarizeUsingThreshold(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char T)
+
3535 {
+
3536  unsigned int i, istart;
+
3537  unsigned char *cursrc1;
+
3538  unsigned char *curdest;
+
3539 
+
3540  /* Validate input parameters */
+
3541  if ((Src1 == NULL) || (Dest == NULL))
+
3542  return(-1);
+
3543  if (length == 0)
+
3544  return(0);
+
3545 
+
3546  /* Special case: T==0 */
+
3547  if (T == 0) {
+
3548  memset(Dest, 255, length);
+
3549  return (0);
+
3550  }
+
3551 
+
3552  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
3553 
+
3554  SDL_imageFilterBinarizeUsingThresholdMMX(Src1, Dest, length, T);
+
3555 
+
3556  /* Check for unaligned bytes */
+
3557  if ((length & 7) > 0) {
+
3558  /* Setup to process unaligned bytes */
+
3559  istart = length & 0xfffffff8;
+
3560  cursrc1 = &Src1[istart];
+
3561  curdest = &Dest[istart];
+
3562  } else {
+
3563  /* No unaligned bytes - we are done */
+
3564  return (0);
+
3565  }
+
3566  } else {
+
3567  /* Setup to process whole image */
+
3568  istart = 0;
+
3569  cursrc1 = Src1;
+
3570  curdest = Dest;
+
3571  }
+
3572 
+
3573  /* C routine to process image */
+
3574  for (i = istart; i < length; i++) {
+
3575  *curdest = (unsigned char)(((unsigned char)*cursrc1 >= T) ? 255 : 0);
+
3576  /* Advance pointers */
+
3577  cursrc1++;
+
3578  curdest++;
+
3579  }
+
3580 
+
3581  return (0);
+
3582 }
+
3583 
+
3595 static int SDL_imageFilterClipToRangeMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char Tmin,
+
3596  unsigned char Tmax)
+
3597 {
+
3598 #ifdef USE_MMX
+
3599 #if !defined(GCC__)
+
3600  __asm
+
3601  {
+
3602  pusha
+
3603  pcmpeqb mm1, mm1 /* generate all 1's in mm1 */
+
3604  /* ** Duplicate Tmax in 8 bytes of MM3 ** */
+
3605  mov al, Tmax /* load Tmax into AL */
+
3606  mov ah, al /* copy AL into AH */
+
3607  mov bx, ax /* copy AX into BX */
+
3608  shl eax, 16 /* shift 2 bytes of EAX left */
+
3609  mov ax, bx /* copy BX into AX */
+
3610  movd mm3, eax /* copy EAX into MM3 */
+
3611  movd mm4, eax /* copy EAX into MM4 */
+
3612  punpckldq mm3, mm4 /* fill higher bytes of MM3 with Tmax */
+
3613  psubusb mm1, mm3 /* store 0xFF - Tmax in MM1 */
+
3614  /* ** Duplicate Tmin in 8 bytes of MM5 ** */
+
3615  mov al, Tmin /* load Tmin into AL */
+
3616  mov ah, al /* copy AL into AH */
+
3617  mov bx, ax /* copy AX into BX */
+
3618  shl eax, 16 /* shift 2 bytes of EAX left */
+
3619  mov ax, bx /* copy BX into AX */
+
3620  movd mm5, eax /* copy EAX into MM5 */
+
3621  movd mm4, eax /* copy EAX into MM4 */
+
3622  punpckldq mm5, mm4 /* fill higher bytes of MM5 with Tmin */
+
3623  movq mm7, mm5 /* copy MM5 into MM7 */
+
3624  paddusb mm7, mm1 /* store 0xFF - Tmax + Tmin in MM7 */
+
3625  mov eax, Src1 /* load Src1 address into eax */
+
3626  mov edi, Dest /* load Dest address into edi */
+
3627  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
3628  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
3629  align 16 /* 16 byte alignment of the loop entry */
+
3630 L1030:
+
3631  movq mm0, [eax] /* load 8 bytes from Src1 into MM0 */
+
3632  paddusb mm0, mm1 /* MM0=SrcDest+(0xFF-Tmax) */
+
3633  psubusb mm0, mm7 /* MM0=MM0-(0xFF-Tmax+Tmin) */
+
3634  paddusb mm0, mm5 /* MM0=MM0+Tmin */
+
3635  movq [edi], mm0 /* store result in Dest */
+
3636  add eax, 8 /* increase Src1 register pointer by 8 */
+
3637  add edi, 8 /* increase Dest register pointer by 8 */
+
3638  dec ecx /* decrease loop counter */
+
3639  jnz L1030 /* check loop termination, proceed if required */
+
3640  emms /* exit MMX state */
+
3641  popa
+
3642  }
+
3643 #else
+
3644  /* i386 and x86_64 */
+
3645  __m64 *mSrc1 = (__m64*)Src1;
+
3646  __m64 *mDest = (__m64*)Dest;
+
3647  __m64 mm1 = _m_pcmpeqb(mm1, mm1); /* generate all 1's in mm1 */
+
3648  int i;
+
3649  /* Duplicate Tmax in 8 bytes of MM3 */
+
3650  __m64 mm3, mm4;
+
3651  memset(&i, Tmax, 4);
+
3652  mm3 = _m_from_int(i);
+
3653  mm4 = _m_from_int(i);
+
3654  mm3 = _m_punpckldq(mm3, mm4); /* fill higher bytes of MM3 with Tmax */
+
3655  mm1 = _m_psubusb(mm1, mm3); /* store 0xFF - Tmax in MM1 */
+
3656  //__m64 mm3 = _m_from_int64(lli); // x86_64 only
+
3657  /* Duplicate Tmax in 8 bytes of MM3 */
+
3658  __m64 mm5, mm7;
+
3659  memset(&i, Tmin, 4);
+
3660  mm5 = _m_from_int(i);
+
3661  mm4 = _m_from_int(i);
+
3662  mm5 = _m_punpckldq(mm5, mm4); /* fill higher bytes of MM5 with Tmin */
+
3663  mm7 = _m_paddusb(mm5, mm1); /* store 0xFF - Tmax + Tmin in MM7 */
+
3664  for (i = 0; i < SrcLength/8; i++) {
+
3665  __m64 mm0;
+
3666  mm0 = _m_paddusb(*mSrc1, mm1); /* MM0=Src1+(0xFF-Tmax) */
+
3667  mm0 = _m_psubusb(mm0, mm7); /* MM0=MM0-(0xFF-Tmax+Tmin) */
+
3668  *mDest = _m_paddusb(mm0, mm5); /* MM0+Tmin */
+
3669  mSrc1++;
+
3670  mDest++;
+
3671  }
+
3672  _m_empty(); /* clean MMX state */
+
3673 #endif
+
3674  return (0);
+
3675 #else
+
3676  return (-1);
+
3677 #endif
+
3678 }
+
3679 
+
3691 int SDL_imageFilterClipToRange(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char Tmin,
+
3692  unsigned char Tmax)
+
3693 {
+
3694  unsigned int i, istart;
+
3695  unsigned char *cursrc1;
+
3696  unsigned char *curdest;
+
3697 
+
3698  /* Validate input parameters */
+
3699  if ((Src1 == NULL) || (Dest == NULL))
+
3700  return(-1);
+
3701  if (length == 0)
+
3702  return(0);
+
3703 
+
3704  /* Special case: Tmin==0 && Tmax = 255 */
+
3705  if ((Tmin == 0) && (Tmax == 25)) {
+
3706  memcpy(Src1, Dest, length);
+
3707  return (0);
+
3708  }
+
3709 
+
3710  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
3711 
+
3712  SDL_imageFilterClipToRangeMMX(Src1, Dest, length, Tmin, Tmax);
+
3713 
+
3714  /* Check for unaligned bytes */
+
3715  if ((length & 7) > 0) {
+
3716  /* Setup to process unaligned bytes */
+
3717  istart = length & 0xfffffff8;
+
3718  cursrc1 = &Src1[istart];
+
3719  curdest = &Dest[istart];
+
3720  } else {
+
3721  /* No unaligned bytes - we are done */
+
3722  return (0);
+
3723  }
+
3724  } else {
+
3725  /* Setup to process whole image */
+
3726  istart = 0;
+
3727  cursrc1 = Src1;
+
3728  curdest = Dest;
+
3729  }
+
3730 
+
3731  /* C routine to process image */
+
3732  for (i = istart; i < length; i++) {
+
3733  if (*cursrc1 < Tmin) {
+
3734  *curdest = Tmin;
+
3735  } else if (*cursrc1 > Tmax) {
+
3736  *curdest = Tmax;
+
3737  } else {
+
3738  *curdest = *cursrc1;
+
3739  }
+
3740  /* Advance pointers */
+
3741  cursrc1++;
+
3742  curdest++;
+
3743  }
+
3744 
+
3745  return (0);
+
3746 }
+
3747 
+
3761 static int SDL_imageFilterNormalizeLinearMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, int Cmin, int Cmax,
+
3762  int Nmin, int Nmax)
+
3763 {
+
3764 #ifdef USE_MMX
+
3765 #if !defined(GCC__)
+
3766  __asm
+
3767  {
+
3768  pusha
+
3769  mov ax, WORD PTR Nmax /* load Nmax in AX */
+
3770  mov bx, WORD PTR Cmax /* load Cmax in BX */
+
3771  sub ax, WORD PTR Nmin /* AX = Nmax - Nmin */
+
3772  sub bx, WORD PTR Cmin /* BX = Cmax - Cmin */
+
3773  jz L10311 /* check division by zero */
+
3774  xor dx, dx /* prepare for division, zero DX */
+
3775  div bx /* AX = AX/BX */
+
3776  jmp L10312
+
3777 L10311:
+
3778  mov ax, 255 /* if div by zero, assume result max byte value */
+
3779 L10312: /* ** Duplicate AX in 4 words of MM0 ** */
+
3780  mov bx, ax /* copy AX into BX */
+
3781  shl eax, 16 /* shift 2 bytes of EAX left */
+
3782  mov ax, bx /* copy BX into AX */
+
3783  movd mm0, eax /* copy EAX into MM0 */
+
3784  movd mm1, eax /* copy EAX into MM1 */
+
3785  punpckldq mm0, mm1 /* fill higher words of MM0 with AX */
+
3786  /* ** Duplicate Cmin in 4 words of MM1 ** */
+
3787  mov ax, WORD PTR Cmin /* load Cmin into AX */
+
3788  mov bx, ax /* copy AX into BX */
+
3789  shl eax, 16 /* shift 2 bytes of EAX left */
+
3790  mov ax, bx /* copy BX into AX */
+
3791  movd mm1, eax /* copy EAX into MM1 */
+
3792  movd mm2, eax /* copy EAX into MM2 */
+
3793  punpckldq mm1, mm2 /* fill higher words of MM1 with Cmin */
+
3794  /* ** Duplicate Nmin in 4 words of MM2 ** */
+
3795  mov ax, WORD PTR Nmin /* load Nmin into AX */
+
3796  mov bx, ax /* copy AX into BX */
+
3797  shl eax, 16 /* shift 2 bytes of EAX left */
+
3798  mov ax, bx /* copy BX into AX */
+
3799  movd mm2, eax /* copy EAX into MM2 */
+
3800  movd mm3, eax /* copy EAX into MM3 */
+
3801  punpckldq mm2, mm3 /* fill higher words of MM2 with Nmin */
+
3802  pxor mm7, mm7 /* zero MM7 register */
+
3803  mov eax, Src1 /* load Src1 address into eax */
+
3804  mov edi, Dest /* load Dest address into edi */
+
3805  mov ecx, SrcLength /* load loop counter (SIZE) into ecx */
+
3806  shr ecx, 3 /* counter/8 (MMX loads 8 bytes at a time) */
+
3807  align 16 /* 16 byte alignment of the loop entry */
+
3808 L1031:
+
3809  movq mm3, [eax] /* load 8 bytes from Src1 into MM3 */
+
3810  movq mm4, mm3 /* copy MM3 into MM4 */
+
3811  punpcklbw mm3, mm7 /* unpack low bytes of SrcDest into words */
+
3812  punpckhbw mm4, mm7 /* unpack high bytes of SrcDest into words */
+
3813  psubusb mm3, mm1 /* S-Cmin, low bytes */
+
3814  psubusb mm4, mm1 /* S-Cmin, high bytes */
+
3815  pmullw mm3, mm0 /* MM0*(S-Cmin), low bytes */
+
3816  pmullw mm4, mm0 /* MM0*(S-Cmin), high bytes */
+
3817  paddusb mm3, mm2 /* MM0*(S-Cmin)+Nmin, low bytes */
+
3818  paddusb mm4, mm2 /* MM0*(S-Cmin)+Nmin, high bytes */
+
3819  /* ** Take abs value of the signed words ** */
+
3820  movq mm5, mm3 /* copy mm3 into mm5 */
+
3821  movq mm6, mm4 /* copy mm4 into mm6 */
+
3822  psraw mm5, 15 /* fill mm5 words with word sign bit */
+
3823  psraw mm6, 15 /* fill mm6 words with word sign bit */
+
3824  pxor mm3, mm5 /* take 1's compliment of only neg words */
+
3825  pxor mm4, mm6 /* take 1's compliment of only neg words */
+
3826  psubsw mm3, mm5 /* add 1 to only neg words, W-(-1) or W-0 */
+
3827  psubsw mm4, mm6 /* add 1 to only neg words, W-(-1) or W-0 */
+
3828  packuswb mm3, mm4 /* pack words back into bytes with saturation */
+
3829  movq [edi], mm3 /* store result in Dest */
+
3830  add eax, 8 /* increase Src1 register pointer by 8 */
+
3831  add edi, 8 /* increase Dest register pointer by 8 */
+
3832  dec ecx /* decrease loop counter */
+
3833  jnz L1031 /* check loop termination, proceed if required */
+
3834  emms /* exit MMX state */
+
3835  popa
+
3836  }
+
3837 #else
+
3838  /* i386 and x86_64 */
+
3839  __m64 *mSrc1 = (__m64*)Src1;
+
3840  __m64 *mDest = (__m64*)Dest;
+
3841  __m64 mm0, mm1, mm2, mm3;
+
3842 
+
3843  int i;
+
3844  /* Duplicate (Nmax-Nmin)/(Cmax-Cmin) in 4 words of MM0 */
+
3845  unsigned short a = Nmax - Nmin;
+
3846  unsigned short b = Cmax - Cmin;
+
3847  if (b == 0) {
+
3848  a = 255;
+
3849  } else {
+
3850  a /= b;
+
3851  }
+
3852  i = (a<<16)|a;
+
3853  mm0 = _m_from_int(i);
+
3854  mm1 = _m_from_int(i);
+
3855  mm0 = _m_punpckldq(mm0, mm1); /* fill higher words of MM0 with AX */
+
3856  /* Duplicate Cmin in 4 words of MM1 */
+
3857  i = (Cmin<<16)|(short)Cmin;
+
3858  mm1 = _m_from_int(i);
+
3859  mm2 = _m_from_int(i);
+
3860  mm1 = _m_punpckldq(mm1, mm2); /* fill higher words of MM1 with Cmin */
+
3861  /* Duplicate Nmin in 4 words of MM2 */
+
3862  i = (Nmin<<16)|(short)Nmin;
+
3863  mm2 = _m_from_int(i);
+
3864  mm3 = _m_from_int(i);
+
3865  mm2 = _m_punpckldq(mm2, mm3); /* fill higher words of MM2 with Nmin */
+
3866  __m64 mm7 = _m_from_int(0); /* zero mm0 register */
+
3867  for (i = 0; i < SrcLength/8; i++) {
+
3868  __m64 mm3, mm4, mm5, mm6;
+
3869  mm3 = _m_punpcklbw(*mSrc1, mm7); /* unpack low bytes of Src1 into words */
+
3870  mm4 = _m_punpckhbw(*mSrc1, mm7); /* unpack high bytes of Src1 into words */
+
3871  mm3 = _m_psubusb(mm3, mm1); /* S-Cmin, low bytes */
+
3872  mm4 = _m_psubusb(mm4, mm1); /* S-Cmin, high bytes */
+
3873  mm3 = _m_pmullw(mm3, mm0); /* MM0*(S-Cmin), low bytes */
+
3874  mm4 = _m_pmullw(mm4, mm0); /* MM0*(S-Cmin), high bytes */
+
3875  mm3 = _m_paddusb(mm3, mm2); /* MM0*(S-Cmin)+Nmin, low bytes */
+
3876  mm4 = _m_paddusb(mm4, mm2); /* MM0*(S-Cmin)+Nmin, high bytes */
+
3877  /* Take abs value of the signed words */
+
3878  mm5 = _m_psrawi(mm3, 15); /* fill mm5 words with word sign bit */
+
3879  mm6 = _m_psrawi(mm4, 15); /* fill mm6 words with word sign bit */
+
3880  mm3 = _m_pxor(mm3, mm5); /* take 1's compliment of only neg. words */
+
3881  mm4 = _m_pxor(mm4, mm6); /* take 1's compliment of only neg. words */
+
3882  mm3 = _m_psubsw(mm3, mm5); /* add 1 to only neg. words, W-(-1) or W-0 */
+
3883  mm4 = _m_psubsw(mm4, mm6); /* add 1 to only neg. words, W-(-1) or W-0 */
+
3884  *mDest = _m_packuswb(mm3, mm4); /* pack words back into bytes with saturation */
+
3885  mSrc1++;
+
3886  mDest++;
+
3887  }
+
3888  _m_empty(); /* clean MMX state */
+
3889 #endif
+
3890  return (0);
+
3891 #else
+
3892  return (-1);
+
3893 #endif
+
3894 }
+
3895 
+
3909 int SDL_imageFilterNormalizeLinear(unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin, int Cmax, int Nmin,
+
3910  int Nmax)
+
3911 {
+
3912  unsigned int i, istart;
+
3913  unsigned char *cursrc;
+
3914  unsigned char *curdest;
+
3915  int dN, dC, factor;
+
3916  int result;
+
3917 
+
3918  /* Validate input parameters */
+
3919  if ((Src == NULL) || (Dest == NULL))
+
3920  return(-1);
+
3921  if (length == 0)
+
3922  return(0);
+
3923 
+
3924  if ((SDL_imageFilterMMXdetect()) && (length > 7)) {
+
3925 
+
3926  SDL_imageFilterNormalizeLinearMMX(Src, Dest, length, Cmin, Cmax, Nmin, Nmax);
+
3927 
+
3928  /* Check for unaligned bytes */
+
3929  if ((length & 7) > 0) {
+
3930  /* Setup to process unaligned bytes */
+
3931  istart = length & 0xfffffff8;
+
3932  cursrc = &Src[istart];
+
3933  curdest = &Dest[istart];
+
3934  } else {
+
3935  /* No unaligned bytes - we are done */
+
3936  return (0);
+
3937  }
+
3938  } else {
+
3939  /* Setup to process whole image */
+
3940  istart = 0;
+
3941  cursrc = Src;
+
3942  curdest = Dest;
+
3943  }
+
3944 
+
3945  /* C routine to process image */
+
3946  dC = Cmax - Cmin;
+
3947  if (dC == 0)
+
3948  return (0);
+
3949  dN = Nmax - Nmin;
+
3950  factor = dN / dC;
+
3951  for (i = istart; i < length; i++) {
+
3952  result = factor * ((int) (*cursrc) - Cmin) + Nmin;
+
3953  if (result > 255)
+
3954  result = 255;
+
3955  *curdest = (unsigned char) result;
+
3956  /* Advance pointers */
+
3957  cursrc++;
+
3958  curdest++;
+
3959  }
+
3960 
+
3961  return (0);
+
3962 }
+
3963 
+
3964 /* ------------------------------------------------------------------------------------ */
+
3965 
+
3980 int SDL_imageFilterConvolveKernel3x3Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
3981  signed short *Kernel, unsigned char Divisor)
+
3982 {
+
3983  /* Validate input parameters */
+
3984  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
3985  return(-1);
+
3986 
+
3987  if ((columns < 3) || (rows < 3) || (Divisor == 0))
+
3988  return (-1);
+
3989 
+
3990  if ((SDL_imageFilterMMXdetect())) {
+
3991 //#ifdef USE_MMX
+
3992 #if defined(USE_MMX) && defined(i386)
+
3993 #if !defined(GCC__)
+
3994  __asm
+
3995  {
+
3996  pusha
+
3997  pxor mm0, mm0 /* zero MM0 */
+
3998  xor ebx, ebx /* zero EBX */
+
3999  mov bl, Divisor /* load Divisor into BL */
+
4000  mov edx, Kernel /* load Kernel address into EDX */
+
4001  movq mm5, [edx] /* MM5 = {0,K2,K1,K0} */
+
4002  add edx, 8 /* second row |K0 K1 K2 0| */
+
4003  movq mm6, [edx] /* MM6 = {0,K5,K4,K3} K = |K3 K4 K5 0| */
+
4004  add edx, 8 /* third row |K6 K7 K8 0| */
+
4005  movq mm7, [edx] /* MM7 = {0,K8,K7,K6} */
+
4006  /* ---, */
+
4007  mov eax, columns /* load columns into EAX */
+
4008  mov esi, Src /* ESI = Src row 0 address */
+
4009  mov edi, Dest /* load Dest address to EDI */
+
4010  add edi, eax /* EDI = EDI + columns */
+
4011  inc edi /* 1 byte offset from the left edge */
+
4012  mov edx, rows /* initialize ROWS counter */
+
4013  sub edx, 2 /* do not use first and last row */
+
4014  /* ---, */
+
4015 L10320:
+
4016  mov ecx, eax /* initialize COLUMS counter */
+
4017  sub ecx, 2 /* do not use first and last column */
+
4018  align 16 /* 16 byte alignment of the loop entry */
+
4019 L10322:
+
4020  /* ---, */
+
4021  movq mm1, [esi] /* load 8 bytes of the image first row */
+
4022  add esi, eax /* move one row below */
+
4023  movq mm2, [esi] /* load 8 bytes of the image second row */
+
4024  add esi, eax /* move one row below */
+
4025  movq mm3, [esi] /* load 8 bytes of the image third row */
+
4026  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4027  punpcklbw mm2, mm0 /* unpack first 4 bytes into words */
+
4028  punpcklbw mm3, mm0 /* unpack first 4 bytes into words */
+
4029  pmullw mm1, mm5 /* multiply words first row image*Kernel */
+
4030  pmullw mm2, mm6 /* multiply words second row image*Kernel */
+
4031  pmullw mm3, mm7 /* multiply words third row image*Kernel */
+
4032  paddsw mm1, mm2 /* add 4 words of the first and second rows */
+
4033  paddsw mm1, mm3 /* add 4 words of the third row and result */
+
4034  movq mm2, mm1 /* copy MM1 into MM2 */
+
4035  psrlq mm1, 32 /* shift 2 left words to the right */
+
4036  paddsw mm1, mm2 /* add 2 left and 2 right result words */
+
4037  movq mm3, mm1 /* copy MM1 into MM3 */
+
4038  psrlq mm1, 16 /* shift 1 left word to the right */
+
4039  paddsw mm1, mm3 /* add 1 left and 1 right result words */
+
4040  /* --, */
+
4041  movd mm2, eax /* save EAX in MM2 */
+
4042  movd mm3, edx /* save EDX in MM3 */
+
4043  movd eax, mm1 /* copy MM1 into EAX */
+
4044  psraw mm1, 15 /* spread sign bit of the result */
+
4045  movd edx, mm1 /* fill EDX with a sign bit */
+
4046  idiv bx /* IDIV - VERY EXPENSIVE */
+
4047  movd mm1, eax /* move result of division into MM1 */
+
4048  packuswb mm1, mm0 /* pack division result with saturation */
+
4049  movd eax, mm1 /* copy saturated result into EAX */
+
4050  mov [edi], al /* copy a byte result into Dest */
+
4051  movd edx, mm3 /* restore saved EDX */
+
4052  movd eax, mm2 /* restore saved EAX */
+
4053  /* --, */
+
4054  sub esi, eax /* move two rows up */
+
4055  sub esi, eax /* */
+
4056  inc esi /* move Src pointer to the next pixel */
+
4057  inc edi /* move Dest pointer to the next pixel */
+
4058  /* ---, */
+
4059  dec ecx /* decrease loop counter COLUMNS */
+
4060  jnz L10322 /* check loop termination, proceed if required */
+
4061  add esi, 2 /* move to the next row in Src */
+
4062  add edi, 2 /* move to the next row in Dest */
+
4063  dec edx /* decrease loop counter ROWS */
+
4064  jnz L10320 /* check loop termination, proceed if required */
+
4065  /* ---, */
+
4066  emms /* exit MMX state */
+
4067  popa
+
4068  }
+
4069 #else
+
4070  asm volatile
+
4071  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
4072  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
4073  "mov %5, %%bl \n\t" /* load Divisor into BL */
+
4074  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
4075  "movq (%%edx), %%mm5 \n\t" /* MM5 = {0,K2,K1,K0} */
+
4076  "add $8, %%edx \n\t" /* second row |K0 K1 K2 0| */
+
4077  "movq (%%edx), %%mm6 \n\t" /* MM6 = {0,K5,K4,K3} K = |K3 K4 K5 0| */
+
4078  "add $8, %%edx \n\t" /* third row |K6 K7 K8 0| */
+
4079  "movq (%%edx), %%mm7 \n\t" /* MM7 = {0,K8,K7,K6} */
+
4080  /* --- */
+
4081  "mov %3, %%eax \n\t" /* load columns into EAX */
+
4082  "mov %1, %%esi \n\t" /* ESI = Src row 0 address */
+
4083  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
4084  "add %%eax, %%edi \n\t" /* EDI = EDI + columns */
+
4085  "inc %%edi \n\t" /* 1 byte offset from the left edge */
+
4086  "mov %2, %%edx \n\t" /* initialize ROWS counter */
+
4087  "sub $2, %%edx \n\t" /* do not use first and last row */
+
4088  /* --- */
+
4089  ".L10320: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMS counter */
+
4090  "sub $2, %%ecx \n\t" /* do not use first and last column */
+
4091  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
4092  ".L10322: \n\t"
+
4093  /* --- */
+
4094  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the image first row */
+
4095  "add %%eax, %%esi \n\t" /* move one row below */
+
4096  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes of the image second row */
+
4097  "add %%eax, %%esi \n\t" /* move one row below */
+
4098  "movq (%%esi), %%mm3 \n\t" /* load 8 bytes of the image third row */
+
4099  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4100  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack first 4 bytes into words */
+
4101  "punpcklbw %%mm0, %%mm3 \n\t" /* unpack first 4 bytes into words */
+
4102  "pmullw %%mm5, %%mm1 \n\t" /* multiply words first row image*Kernel */
+
4103  "pmullw %%mm6, %%mm2 \n\t" /* multiply words second row image*Kernel */
+
4104  "pmullw %%mm7, %%mm3 \n\t" /* multiply words third row image*Kernel */
+
4105  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the first and second rows */
+
4106  "paddsw %%mm3, %%mm1 \n\t" /* add 4 words of the third row and result */
+
4107  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4108  "psrlq $32, %%mm1 \n\t" /* shift 2 left words to the right */
+
4109  "paddsw %%mm2, %%mm1 \n\t" /* add 2 left and 2 right result words */
+
4110  "movq %%mm1, %%mm3 \n\t" /* copy MM1 into MM3 */
+
4111  "psrlq $16, %%mm1 \n\t" /* shift 1 left word to the right */
+
4112  "paddsw %%mm3, %%mm1 \n\t" /* add 1 left and 1 right result words */
+
4113  /* -- */
+
4114  "movd %%eax, %%mm2 \n\t" /* save EAX in MM2 */
+
4115  "movd %%edx, %%mm3 \n\t" /* save EDX in MM3 */
+
4116  "movd %%mm1, %%eax \n\t" /* copy MM1 into EAX */
+
4117  "psraw $15, %%mm1 \n\t" /* spread sign bit of the result */
+
4118  "movd %%mm1, %%edx \n\t" /* fill EDX with a sign bit */
+
4119  "idivw %%bx \n\t" /* IDIV - VERY EXPENSIVE */
+
4120  "movd %%eax, %%mm1 \n\t" /* move result of division into MM1 */
+
4121  "packuswb %%mm0, %%mm1 \n\t" /* pack division result with saturation */
+
4122  "movd %%mm1, %%eax \n\t" /* copy saturated result into EAX */
+
4123  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
4124  "movd %%mm3, %%edx \n\t" /* restore saved EDX */
+
4125  "movd %%mm2, %%eax \n\t" /* restore saved EAX */
+
4126  /* -- */
+
4127  "sub %%eax, %%esi \n\t" /* move two rows up */
+
4128  "sub %%eax, %%esi \n\t" /* */
+
4129  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
4130  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
4131  /* --- */
+
4132  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
4133  "jnz .L10322 \n\t" /* check loop termination, proceed if required */
+
4134  "add $2, %%esi \n\t" /* move to the next row in Src */
+
4135  "add $2, %%edi \n\t" /* move to the next row in Dest */
+
4136  "dec %%edx \n\t" /* decrease loop counter ROWS */
+
4137  "jnz .L10320 \n\t" /* check loop termination, proceed if required */
+
4138  /* --- */
+
4139  "emms \n\t" /* exit MMX state */
+
4140  "popa \n\t":"=m" (Dest) /* %0 */
+
4141  :"m"(Src), /* %1 */
+
4142  "m"(rows), /* %2 */
+
4143  "m"(columns), /* %3 */
+
4144  "m"(Kernel), /* %4 */
+
4145  "m"(Divisor) /* %5 */
+
4146  );
+
4147 #endif
+
4148 #endif
+
4149  return (0);
+
4150  } else {
+
4151  /* No non-MMX implementation yet */
+
4152  return (-1);
+
4153  }
+
4154 }
+
4155 
+
4170 int SDL_imageFilterConvolveKernel5x5Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
4171  signed short *Kernel, unsigned char Divisor)
+
4172 {
+
4173  /* Validate input parameters */
+
4174  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
4175  return(-1);
+
4176 
+
4177  if ((columns < 5) || (rows < 5) || (Divisor == 0))
+
4178  return (-1);
+
4179 
+
4180  if ((SDL_imageFilterMMXdetect())) {
+
4181 //#ifdef USE_MMX
+
4182 #if defined(USE_MMX) && defined(i386)
+
4183 #if !defined(GCC__)
+
4184  __asm
+
4185  {
+
4186  pusha
+
4187  pxor mm0, mm0 /* zero MM0 */
+
4188  xor ebx, ebx /* zero EBX */
+
4189  mov bl, Divisor /* load Divisor into BL */
+
4190  movd mm5, ebx /* copy Divisor into MM5 */
+
4191  mov edx, Kernel /* load Kernel address into EDX */
+
4192  mov esi, Src /* load Src address to ESI */
+
4193  mov edi, Dest /* load Dest address to EDI */
+
4194  add edi, 2 /* 2 column offset from the left edge */
+
4195  mov eax, columns /* load columns into EAX */
+
4196  shl eax, 1 /* EAX = columns * 2 */
+
4197  add edi, eax /* 2 row offset from the top edge */
+
4198  shr eax, 1 /* EAX = columns */
+
4199  mov ebx, rows /* initialize ROWS counter */
+
4200  sub ebx, 4 /* do not use first 2 and last 2 rows */
+
4201  /* ---, */
+
4202 L10330:
+
4203  mov ecx, eax /* initialize COLUMNS counter */
+
4204  sub ecx, 4 /* do not use first 2 and last 2 columns */
+
4205  align 16 /* 16 byte alignment of the loop entry */
+
4206 L10332:
+
4207  pxor mm7, mm7 /* zero MM7 (accumulator) */
+
4208  movd mm6, esi /* save ESI in MM6 */
+
4209  /* --- 1 */
+
4210  movq mm1, [esi] /* load 8 bytes of the Src */
+
4211  movq mm2, mm1 /* copy MM1 into MM2 */
+
4212  add esi, eax /* move Src pointer 1 row below */
+
4213  movq mm3, [edx] /* load 4 words of Kernel */
+
4214  add edx, 8 /* move pointer to other 4 words */
+
4215  movq mm4, [edx] /* load 4 words of Kernel */
+
4216  add edx, 8 /* move pointer to other 4 words */
+
4217  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4218  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4219  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4220  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4221  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4222  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4223  /* --- 2 */
+
4224  movq mm1, [esi] /* load 8 bytes of the Src */
+
4225  movq mm2, mm1 /* copy MM1 into MM2 */
+
4226  add esi, eax /* move Src pointer 1 row below */
+
4227  movq mm3, [edx] /* load 4 words of Kernel */
+
4228  add edx, 8 /* move pointer to other 4 words */
+
4229  movq mm4, [edx] /* load 4 words of Kernel */
+
4230  add edx, 8 /* move pointer to other 4 words */
+
4231  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4232  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4233  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4234  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4235  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4236  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4237  /* --- 3 */
+
4238  movq mm1, [esi] /* load 8 bytes of the Src */
+
4239  movq mm2, mm1 /* copy MM1 into MM2 */
+
4240  add esi, eax /* move Src pointer 1 row below */
+
4241  movq mm3, [edx] /* load 4 words of Kernel */
+
4242  add edx, 8 /* move pointer to other 4 words */
+
4243  movq mm4, [edx] /* load 4 words of Kernel */
+
4244  add edx, 8 /* move pointer to other 4 words */
+
4245  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4246  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4247  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4248  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4249  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4250  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4251  /* --- 4 */
+
4252  movq mm1, [esi] /* load 8 bytes of the Src */
+
4253  movq mm2, mm1 /* copy MM1 into MM2 */
+
4254  add esi, eax /* move Src pointer 1 row below */
+
4255  movq mm3, [edx] /* load 4 words of Kernel */
+
4256  add edx, 8 /* move pointer to other 4 words */
+
4257  movq mm4, [edx] /* load 4 words of Kernel */
+
4258  add edx, 8 /* move pointer to other 4 words */
+
4259  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4260  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4261  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4262  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4263  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4264  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4265  /* --- 5 */
+
4266  movq mm1, [esi] /* load 8 bytes of the Src */
+
4267  movq mm2, mm1 /* copy MM1 into MM2 */
+
4268  movq mm3, [edx] /* load 4 words of Kernel */
+
4269  add edx, 8 /* move pointer to other 4 words */
+
4270  movq mm4, [edx] /* load 4 words of Kernel */
+
4271  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4272  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4273  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4274  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4275  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4276  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4277  /* ---, */
+
4278  movq mm3, mm7 /* copy MM7 into MM3 */
+
4279  psrlq mm7, 32 /* shift 2 left words to the right */
+
4280  paddsw mm7, mm3 /* add 2 left and 2 right result words */
+
4281  movq mm2, mm7 /* copy MM7 into MM2 */
+
4282  psrlq mm7, 16 /* shift 1 left word to the right */
+
4283  paddsw mm7, mm2 /* add 1 left and 1 right result words */
+
4284  /* ---, */
+
4285  movd mm1, eax /* save EDX in MM1 */
+
4286  movd mm2, ebx /* save EDX in MM2 */
+
4287  movd mm3, edx /* save EDX in MM3 */
+
4288  movd eax, mm7 /* load summation result into EAX */
+
4289  psraw mm7, 15 /* spread sign bit of the result */
+
4290  movd ebx, mm5 /* load Divisor into EBX */
+
4291  movd edx, mm7 /* fill EDX with a sign bit */
+
4292  idiv bx /* IDIV - VERY EXPENSIVE */
+
4293  movd mm7, eax /* move result of division into MM7 */
+
4294  packuswb mm7, mm0 /* pack division result with saturation */
+
4295  movd eax, mm7 /* copy saturated result into EAX */
+
4296  mov [edi], al /* copy a byte result into Dest */
+
4297  movd edx, mm3 /* restore saved EDX */
+
4298  movd ebx, mm2 /* restore saved EBX */
+
4299  movd eax, mm1 /* restore saved EAX */
+
4300  /* --, */
+
4301  movd esi, mm6 /* move Src pointer to the top pixel */
+
4302  sub edx, 72 /* EDX = Kernel address */
+
4303  inc esi /* move Src pointer to the next pixel */
+
4304  inc edi /* move Dest pointer to the next pixel */
+
4305  /* ---, */
+
4306  dec ecx /* decrease loop counter COLUMNS */
+
4307  jnz L10332 /* check loop termination, proceed if required */
+
4308  add esi, 4 /* move to the next row in Src */
+
4309  add edi, 4 /* move to the next row in Dest */
+
4310  dec ebx /* decrease loop counter ROWS */
+
4311  jnz L10330 /* check loop termination, proceed if required */
+
4312  /* ---, */
+
4313  emms /* exit MMX state */
+
4314  popa
+
4315  }
+
4316 #else
+
4317  asm volatile
+
4318  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
4319  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
4320  "mov %5, %%bl \n\t" /* load Divisor into BL */
+
4321  "movd %%ebx, %%mm5 \n\t" /* copy Divisor into MM5 */
+
4322  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
4323  "mov %1, %%esi \n\t" /* load Src address to ESI */
+
4324  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
4325  "add $2, %%edi \n\t" /* 2 column offset from the left edge */
+
4326  "mov %3, %%eax \n\t" /* load columns into EAX */
+
4327  "shl $1, %%eax \n\t" /* EAX = columns * 2 */
+
4328  "add %%eax, %%edi \n\t" /* 2 row offset from the top edge */
+
4329  "shr $1, %%eax \n\t" /* EAX = columns */
+
4330  "mov %2, %%ebx \n\t" /* initialize ROWS counter */
+
4331  "sub $4, %%ebx \n\t" /* do not use first 2 and last 2 rows */
+
4332  /* --- */
+
4333  ".L10330: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMNS counter */
+
4334  "sub $4, %%ecx \n\t" /* do not use first 2 and last 2 columns */
+
4335  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
4336  ".L10332: \n\t" "pxor %%mm7, %%mm7 \n\t" /* zero MM7 (accumulator) */
+
4337  "movd %%esi, %%mm6 \n\t" /* save ESI in MM6 */
+
4338  /* --- 1 */
+
4339  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4340  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4341  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4342  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4343  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4344  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4345  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4346  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4347  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4348  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4349  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4350  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4351  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4352  /* --- 2 */
+
4353  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4354  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4355  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4356  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4357  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4358  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4359  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4360  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4361  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4362  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4363  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4364  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4365  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4366  /* --- 3 */
+
4367  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4368  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4369  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4370  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4371  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4372  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4373  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4374  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4375  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4376  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4377  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4378  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4379  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4380  /* --- 4 */
+
4381  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4382  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4383  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4384  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4385  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4386  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4387  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4388  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4389  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4390  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4391  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4392  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4393  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4394  /* --- 5 */
+
4395  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4396  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4397  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4398  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4399  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4400  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4401  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4402  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4403  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4404  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4405  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4406  /* --- */
+
4407  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
4408  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
4409  "paddsw %%mm3, %%mm7 \n\t" /* add 2 left and 2 right result words */
+
4410  "movq %%mm7, %%mm2 \n\t" /* copy MM7 into MM2 */
+
4411  "psrlq $16, %%mm7 \n\t" /* shift 1 left word to the right */
+
4412  "paddsw %%mm2, %%mm7 \n\t" /* add 1 left and 1 right result words */
+
4413  /* --- */
+
4414  "movd %%eax, %%mm1 \n\t" /* save EDX in MM1 */
+
4415  "movd %%ebx, %%mm2 \n\t" /* save EDX in MM2 */
+
4416  "movd %%edx, %%mm3 \n\t" /* save EDX in MM3 */
+
4417  "movd %%mm7, %%eax \n\t" /* load summation result into EAX */
+
4418  "psraw $15, %%mm7 \n\t" /* spread sign bit of the result */
+
4419  "movd %%mm5, %%ebx \n\t" /* load Divisor into EBX */
+
4420  "movd %%mm7, %%edx \n\t" /* fill EDX with a sign bit */
+
4421  "idivw %%bx \n\t" /* IDIV - VERY EXPENSIVE */
+
4422  "movd %%eax, %%mm7 \n\t" /* move result of division into MM7 */
+
4423  "packuswb %%mm0, %%mm7 \n\t" /* pack division result with saturation */
+
4424  "movd %%mm7, %%eax \n\t" /* copy saturated result into EAX */
+
4425  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
4426  "movd %%mm3, %%edx \n\t" /* restore saved EDX */
+
4427  "movd %%mm2, %%ebx \n\t" /* restore saved EBX */
+
4428  "movd %%mm1, %%eax \n\t" /* restore saved EAX */
+
4429  /* -- */
+
4430  "movd %%mm6, %%esi \n\t" /* move Src pointer to the top pixel */
+
4431  "sub $72, %%edx \n\t" /* EDX = Kernel address */
+
4432  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
4433  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
4434  /* --- */
+
4435  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
4436  "jnz .L10332 \n\t" /* check loop termination, proceed if required */
+
4437  "add $4, %%esi \n\t" /* move to the next row in Src */
+
4438  "add $4, %%edi \n\t" /* move to the next row in Dest */
+
4439  "dec %%ebx \n\t" /* decrease loop counter ROWS */
+
4440  "jnz .L10330 \n\t" /* check loop termination, proceed if required */
+
4441  /* --- */
+
4442  "emms \n\t" /* exit MMX state */
+
4443  "popa \n\t":"=m" (Dest) /* %0 */
+
4444  :"m"(Src), /* %1 */
+
4445  "m"(rows), /* %2 */
+
4446  "m"(columns), /* %3 */
+
4447  "m"(Kernel), /* %4 */
+
4448  "m"(Divisor) /* %5 */
+
4449  );
+
4450 #endif
+
4451 #endif
+
4452  return (0);
+
4453  } else {
+
4454  /* No non-MMX implementation yet */
+
4455  return (-1);
+
4456  }
+
4457 }
+
4458 
+
4473 int SDL_imageFilterConvolveKernel7x7Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
4474  signed short *Kernel, unsigned char Divisor)
+
4475 {
+
4476  /* Validate input parameters */
+
4477  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
4478  return(-1);
+
4479 
+
4480  if ((columns < 7) || (rows < 7) || (Divisor == 0))
+
4481  return (-1);
+
4482 
+
4483  if ((SDL_imageFilterMMXdetect())) {
+
4484 //#ifdef USE_MMX
+
4485 #if defined(USE_MMX) && defined(i386)
+
4486 #if !defined(GCC__)
+
4487  __asm
+
4488  {
+
4489  pusha
+
4490  pxor mm0, mm0 /* zero MM0 */
+
4491  xor ebx, ebx /* zero EBX */
+
4492  mov bl, Divisor /* load Divisor into BL */
+
4493  movd mm5, ebx /* copy Divisor into MM5 */
+
4494  mov edx, Kernel /* load Kernel address into EDX */
+
4495  mov esi, Src /* load Src address to ESI */
+
4496  mov edi, Dest /* load Dest address to EDI */
+
4497  add edi, 3 /* 3 column offset from the left edge */
+
4498  mov eax, columns /* load columns into EAX */
+
4499  add edi, eax /* 3 row offset from the top edge */
+
4500  add edi, eax
+
4501  add edi, eax
+
4502  mov ebx, rows /* initialize ROWS counter */
+
4503  sub ebx, 6 /* do not use first 3 and last 3 rows */
+
4504  /* ---, */
+
4505 L10340:
+
4506  mov ecx, eax /* initialize COLUMNS counter */
+
4507  sub ecx, 6 /* do not use first 3 and last 3 columns */
+
4508  align 16 /* 16 byte alignment of the loop entry */
+
4509 L10342:
+
4510  pxor mm7, mm7 /* zero MM7 (accumulator) */
+
4511  movd mm6, esi /* save ESI in MM6 */
+
4512  /* --- 1 */
+
4513  movq mm1, [esi] /* load 8 bytes of the Src */
+
4514  movq mm2, mm1 /* copy MM1 into MM2 */
+
4515  add esi, eax /* move Src pointer 1 row below */
+
4516  movq mm3, [edx] /* load 4 words of Kernel */
+
4517  add edx, 8 /* move pointer to other 4 words */
+
4518  movq mm4, [edx] /* load 4 words of Kernel */
+
4519  add edx, 8 /* move pointer to other 4 words */
+
4520  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4521  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4522  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4523  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4524  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4525  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4526  /* --- 2 */
+
4527  movq mm1, [esi] /* load 8 bytes of the Src */
+
4528  movq mm2, mm1 /* copy MM1 into MM2 */
+
4529  add esi, eax /* move Src pointer 1 row below */
+
4530  movq mm3, [edx] /* load 4 words of Kernel */
+
4531  add edx, 8 /* move pointer to other 4 words */
+
4532  movq mm4, [edx] /* load 4 words of Kernel */
+
4533  add edx, 8 /* move pointer to other 4 words */
+
4534  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4535  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4536  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4537  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4538  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4539  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4540  /* --- 3 */
+
4541  movq mm1, [esi] /* load 8 bytes of the Src */
+
4542  movq mm2, mm1 /* copy MM1 into MM2 */
+
4543  add esi, eax /* move Src pointer 1 row below */
+
4544  movq mm3, [edx] /* load 4 words of Kernel */
+
4545  add edx, 8 /* move pointer to other 4 words */
+
4546  movq mm4, [edx] /* load 4 words of Kernel */
+
4547  add edx, 8 /* move pointer to other 4 words */
+
4548  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4549  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4550  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4551  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4552  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4553  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4554  /* --- 4 */
+
4555  movq mm1, [esi] /* load 8 bytes of the Src */
+
4556  movq mm2, mm1 /* copy MM1 into MM2 */
+
4557  add esi, eax /* move Src pointer 1 row below */
+
4558  movq mm3, [edx] /* load 4 words of Kernel */
+
4559  add edx, 8 /* move pointer to other 4 words */
+
4560  movq mm4, [edx] /* load 4 words of Kernel */
+
4561  add edx, 8 /* move pointer to other 4 words */
+
4562  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4563  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4564  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4565  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4566  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4567  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4568  /* --- 5 */
+
4569  movq mm1, [esi] /* load 8 bytes of the Src */
+
4570  movq mm2, mm1 /* copy MM1 into MM2 */
+
4571  add esi, eax /* move Src pointer 1 row below */
+
4572  movq mm3, [edx] /* load 4 words of Kernel */
+
4573  add edx, 8 /* move pointer to other 4 words */
+
4574  movq mm4, [edx] /* load 4 words of Kernel */
+
4575  add edx, 8 /* move pointer to other 4 words */
+
4576  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4577  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4578  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4579  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4580  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4581  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4582  /* --- 6 */
+
4583  movq mm1, [esi] /* load 8 bytes of the Src */
+
4584  movq mm2, mm1 /* copy MM1 into MM2 */
+
4585  add esi, eax /* move Src pointer 1 row below */
+
4586  movq mm3, [edx] /* load 4 words of Kernel */
+
4587  add edx, 8 /* move pointer to other 4 words */
+
4588  movq mm4, [edx] /* load 4 words of Kernel */
+
4589  add edx, 8 /* move pointer to other 4 words */
+
4590  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4591  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4592  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4593  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4594  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4595  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4596  /* --- 7 */
+
4597  movq mm1, [esi] /* load 8 bytes of the Src */
+
4598  movq mm2, mm1 /* copy MM1 into MM2 */
+
4599  movq mm3, [edx] /* load 4 words of Kernel */
+
4600  add edx, 8 /* move pointer to other 4 words */
+
4601  movq mm4, [edx] /* load 4 words of Kernel */
+
4602  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4603  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4604  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
4605  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
4606  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4607  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4608  /* ---, */
+
4609  movq mm3, mm7 /* copy MM7 into MM3 */
+
4610  psrlq mm7, 32 /* shift 2 left words to the right */
+
4611  paddsw mm7, mm3 /* add 2 left and 2 right result words */
+
4612  movq mm2, mm7 /* copy MM7 into MM2 */
+
4613  psrlq mm7, 16 /* shift 1 left word to the right */
+
4614  paddsw mm7, mm2 /* add 1 left and 1 right result words */
+
4615  /* ---, */
+
4616  movd mm1, eax /* save EDX in MM1 */
+
4617  movd mm2, ebx /* save EDX in MM2 */
+
4618  movd mm3, edx /* save EDX in MM3 */
+
4619  movd eax, mm7 /* load summation result into EAX */
+
4620  psraw mm7, 15 /* spread sign bit of the result */
+
4621  movd ebx, mm5 /* load Divisor into EBX */
+
4622  movd edx, mm7 /* fill EDX with a sign bit */
+
4623  idiv bx /* IDIV - VERY EXPENSIVE */
+
4624  movd mm7, eax /* move result of division into MM7 */
+
4625  packuswb mm7, mm0 /* pack division result with saturation */
+
4626  movd eax, mm7 /* copy saturated result into EAX */
+
4627  mov [edi], al /* copy a byte result into Dest */
+
4628  movd edx, mm3 /* restore saved EDX */
+
4629  movd ebx, mm2 /* restore saved EBX */
+
4630  movd eax, mm1 /* restore saved EAX */
+
4631  /* --, */
+
4632  movd esi, mm6 /* move Src pointer to the top pixel */
+
4633  sub edx, 104 /* EDX = Kernel address */
+
4634  inc esi /* move Src pointer to the next pixel */
+
4635  inc edi /* move Dest pointer to the next pixel */
+
4636  /* ---, */
+
4637  dec ecx /* decrease loop counter COLUMNS */
+
4638  jnz L10342 /* check loop termination, proceed if required */
+
4639  add esi, 6 /* move to the next row in Src */
+
4640  add edi, 6 /* move to the next row in Dest */
+
4641  dec ebx /* decrease loop counter ROWS */
+
4642  jnz L10340 /* check loop termination, proceed if required */
+
4643  /* ---, */
+
4644  emms /* exit MMX state */
+
4645  popa
+
4646  }
+
4647 #else
+
4648  asm volatile
+
4649  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
4650  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
4651  "mov %5, %%bl \n\t" /* load Divisor into BL */
+
4652  "movd %%ebx, %%mm5 \n\t" /* copy Divisor into MM5 */
+
4653  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
4654  "mov %1, %%esi \n\t" /* load Src address to ESI */
+
4655  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
4656  "add $3, %%edi \n\t" /* 3 column offset from the left edge */
+
4657  "mov %3, %%eax \n\t" /* load columns into EAX */
+
4658  "add %%eax, %%edi \n\t" /* 3 row offset from the top edge */
+
4659  "add %%eax, %%edi \n\t" "add %%eax, %%edi \n\t" "mov %2, %%ebx \n\t" /* initialize ROWS counter */
+
4660  "sub $6, %%ebx \n\t" /* do not use first 3 and last 3 rows */
+
4661  /* --- */
+
4662  ".L10340: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMNS counter */
+
4663  "sub $6, %%ecx \n\t" /* do not use first 3 and last 3 columns */
+
4664  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
4665  ".L10342: \n\t" "pxor %%mm7, %%mm7 \n\t" /* zero MM7 (accumulator) */
+
4666  "movd %%esi, %%mm6 \n\t" /* save ESI in MM6 */
+
4667  /* --- 1 */
+
4668  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4669  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4670  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4671  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4672  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4673  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4674  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4675  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4676  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4677  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4678  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4679  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4680  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4681  /* --- 2 */
+
4682  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4683  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4684  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4685  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4686  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4687  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4688  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4689  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4690  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4691  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4692  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4693  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4694  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4695  /* --- 3 */
+
4696  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4697  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4698  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4699  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4700  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4701  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4702  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4703  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4704  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4705  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4706  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4707  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4708  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4709  /* --- 4 */
+
4710  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4711  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4712  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4713  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4714  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4715  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4716  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4717  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4718  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4719  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4720  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4721  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4722  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4723  /* --- 5 */
+
4724  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4725  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4726  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4727  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4728  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4729  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4730  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4731  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4732  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4733  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4734  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4735  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4736  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4737  /* --- 6 */
+
4738  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4739  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4740  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
4741  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4742  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4743  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4744  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4745  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4746  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4747  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4748  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4749  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4750  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4751  /* --- 7 */
+
4752  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
4753  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
4754  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
4755  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
4756  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
4757  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
4758  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
4759  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
4760  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
4761  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
4762  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
4763  /* --- */
+
4764  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
4765  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
4766  "paddsw %%mm3, %%mm7 \n\t" /* add 2 left and 2 right result words */
+
4767  "movq %%mm7, %%mm2 \n\t" /* copy MM7 into MM2 */
+
4768  "psrlq $16, %%mm7 \n\t" /* shift 1 left word to the right */
+
4769  "paddsw %%mm2, %%mm7 \n\t" /* add 1 left and 1 right result words */
+
4770  /* --- */
+
4771  "movd %%eax, %%mm1 \n\t" /* save EDX in MM1 */
+
4772  "movd %%ebx, %%mm2 \n\t" /* save EDX in MM2 */
+
4773  "movd %%edx, %%mm3 \n\t" /* save EDX in MM3 */
+
4774  "movd %%mm7, %%eax \n\t" /* load summation result into EAX */
+
4775  "psraw $15, %%mm7 \n\t" /* spread sign bit of the result */
+
4776  "movd %%mm5, %%ebx \n\t" /* load Divisor into EBX */
+
4777  "movd %%mm7, %%edx \n\t" /* fill EDX with a sign bit */
+
4778  "idivw %%bx \n\t" /* IDIV - VERY EXPENSIVE */
+
4779  "movd %%eax, %%mm7 \n\t" /* move result of division into MM7 */
+
4780  "packuswb %%mm0, %%mm7 \n\t" /* pack division result with saturation */
+
4781  "movd %%mm7, %%eax \n\t" /* copy saturated result into EAX */
+
4782  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
4783  "movd %%mm3, %%edx \n\t" /* restore saved EDX */
+
4784  "movd %%mm2, %%ebx \n\t" /* restore saved EBX */
+
4785  "movd %%mm1, %%eax \n\t" /* restore saved EAX */
+
4786  /* -- */
+
4787  "movd %%mm6, %%esi \n\t" /* move Src pointer to the top pixel */
+
4788  "sub $104, %%edx \n\t" /* EDX = Kernel address */
+
4789  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
4790  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
4791  /* --- */
+
4792  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
4793  "jnz .L10342 \n\t" /* check loop termination, proceed if required */
+
4794  "add $6, %%esi \n\t" /* move to the next row in Src */
+
4795  "add $6, %%edi \n\t" /* move to the next row in Dest */
+
4796  "dec %%ebx \n\t" /* decrease loop counter ROWS */
+
4797  "jnz .L10340 \n\t" /* check loop termination, proceed if required */
+
4798  /* --- */
+
4799  "emms \n\t" /* exit MMX state */
+
4800  "popa \n\t":"=m" (Dest) /* %0 */
+
4801  :"m"(Src), /* %1 */
+
4802  "m"(rows), /* %2 */
+
4803  "m"(columns), /* %3 */
+
4804  "m"(Kernel), /* %4 */
+
4805  "m"(Divisor) /* %5 */
+
4806  );
+
4807 #endif
+
4808 #endif
+
4809  return (0);
+
4810  } else {
+
4811  /* No non-MMX implementation yet */
+
4812  return (-1);
+
4813  }
+
4814 }
+
4815 
+
4830 int SDL_imageFilterConvolveKernel9x9Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
4831  signed short *Kernel, unsigned char Divisor)
+
4832 {
+
4833  /* Validate input parameters */
+
4834  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
4835  return(-1);
+
4836 
+
4837  if ((columns < 9) || (rows < 9) || (Divisor == 0))
+
4838  return (-1);
+
4839 
+
4840  if ((SDL_imageFilterMMXdetect())) {
+
4841 //#ifdef USE_MMX
+
4842 #if defined(USE_MMX) && defined(i386)
+
4843 #if !defined(GCC__)
+
4844  __asm
+
4845  {
+
4846  pusha
+
4847  pxor mm0, mm0 /* zero MM0 */
+
4848  xor ebx, ebx /* zero EBX */
+
4849  mov bl, Divisor /* load Divisor into BL */
+
4850  movd mm5, ebx /* copy Divisor into MM5 */
+
4851  mov edx, Kernel /* load Kernel address into EDX */
+
4852  mov esi, Src /* load Src address to ESI */
+
4853  mov edi, Dest /* load Dest address to EDI */
+
4854  add edi, 4 /* 4 column offset from the left edge */
+
4855  mov eax, columns /* load columns into EAX */
+
4856  add edi, eax /* 4 row offset from the top edge */
+
4857  add edi, eax
+
4858  add edi, eax
+
4859  add edi, eax
+
4860  mov ebx, rows /* initialize ROWS counter */
+
4861  sub ebx, 8 /* do not use first 4 and last 4 rows */
+
4862  /* ---, */
+
4863 L10350:
+
4864  mov ecx, eax /* initialize COLUMNS counter */
+
4865  sub ecx, 8 /* do not use first 4 and last 4 columns */
+
4866  align 16 /* 16 byte alignment of the loop entry */
+
4867 L10352:
+
4868  pxor mm7, mm7 /* zero MM7 (accumulator) */
+
4869  movd mm6, esi /* save ESI in MM6 */
+
4870  /* --- 1 */
+
4871  movq mm1, [esi] /* load 8 bytes of the Src */
+
4872  movq mm2, mm1 /* copy MM1 into MM2 */
+
4873  inc esi /* move pointer to the next 8 bytes of Src */
+
4874  movq mm3, [edx] /* load 4 words of Kernel */
+
4875  add edx, 8 /* move pointer to other 4 words */
+
4876  movq mm4, [edx] /* load 4 words of Kernel */
+
4877  add edx, 8 /* move pointer to other 4 words */
+
4878  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4879  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4880  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4881  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
4882  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4883  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4884  movq mm1, [esi] /* load 8 bytes of the Src */
+
4885  dec esi
+
4886  add esi, eax /* move Src pointer 1 row below */
+
4887  movq mm3, [edx] /* load 4 words of Kernel */
+
4888  add edx, 8 /* move pointer to other 4 words */
+
4889  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4890  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4891  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4892  /* --- 2 */
+
4893  movq mm1, [esi] /* load 8 bytes of the Src */
+
4894  movq mm2, mm1 /* copy MM1 into MM2 */
+
4895  inc esi /* move pointer to the next 8 bytes of Src */
+
4896  movq mm3, [edx] /* load 4 words of Kernel */
+
4897  add edx, 8 /* move pointer to other 4 words */
+
4898  movq mm4, [edx] /* load 4 words of Kernel */
+
4899  add edx, 8 /* move pointer to other 4 words */
+
4900  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4901  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4902  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4903  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
4904  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4905  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4906  movq mm1, [esi] /* load 8 bytes of the Src */
+
4907  dec esi
+
4908  add esi, eax /* move Src pointer 1 row below */
+
4909  movq mm3, [edx] /* load 4 words of Kernel */
+
4910  add edx, 8 /* move pointer to other 4 words */
+
4911  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4912  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4913  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4914  /* --- 3 */
+
4915  movq mm1, [esi] /* load 8 bytes of the Src */
+
4916  movq mm2, mm1 /* copy MM1 into MM2 */
+
4917  inc esi /* move pointer to the next 8 bytes of Src */
+
4918  movq mm3, [edx] /* load 4 words of Kernel */
+
4919  add edx, 8 /* move pointer to other 4 words */
+
4920  movq mm4, [edx] /* load 4 words of Kernel */
+
4921  add edx, 8 /* move pointer to other 4 words */
+
4922  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4923  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4924  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4925  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
4926  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4927  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4928  movq mm1, [esi] /* load 8 bytes of the Src */
+
4929  dec esi
+
4930  add esi, eax /* move Src pointer 1 row below */
+
4931  movq mm3, [edx] /* load 4 words of Kernel */
+
4932  add edx, 8 /* move pointer to other 4 words */
+
4933  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4934  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4935  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4936  /* --- 4 */
+
4937  movq mm1, [esi] /* load 8 bytes of the Src */
+
4938  movq mm2, mm1 /* copy MM1 into MM2 */
+
4939  inc esi /* move pointer to the next 8 bytes of Src */
+
4940  movq mm3, [edx] /* load 4 words of Kernel */
+
4941  add edx, 8 /* move pointer to other 4 words */
+
4942  movq mm4, [edx] /* load 4 words of Kernel */
+
4943  add edx, 8 /* move pointer to other 4 words */
+
4944  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4945  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4946  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4947  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
4948  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4949  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4950  movq mm1, [esi] /* load 8 bytes of the Src */
+
4951  dec esi
+
4952  add esi, eax /* move Src pointer 1 row below */
+
4953  movq mm3, [edx] /* load 4 words of Kernel */
+
4954  add edx, 8 /* move pointer to other 4 words */
+
4955  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4956  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4957  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4958  /* --- 5 */
+
4959  movq mm1, [esi] /* load 8 bytes of the Src */
+
4960  movq mm2, mm1 /* copy MM1 into MM2 */
+
4961  inc esi /* move pointer to the next 8 bytes of Src */
+
4962  movq mm3, [edx] /* load 4 words of Kernel */
+
4963  add edx, 8 /* move pointer to other 4 words */
+
4964  movq mm4, [edx] /* load 4 words of Kernel */
+
4965  add edx, 8 /* move pointer to other 4 words */
+
4966  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4967  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4968  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4969  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
4970  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4971  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4972  movq mm1, [esi] /* load 8 bytes of the Src */
+
4973  dec esi
+
4974  add esi, eax /* move Src pointer 1 row below */
+
4975  movq mm3, [edx] /* load 4 words of Kernel */
+
4976  add edx, 8 /* move pointer to other 4 words */
+
4977  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4978  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4979  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4980  /* --- 6 */
+
4981  movq mm1, [esi] /* load 8 bytes of the Src */
+
4982  movq mm2, mm1 /* copy MM1 into MM2 */
+
4983  inc esi /* move pointer to the next 8 bytes of Src */
+
4984  movq mm3, [edx] /* load 4 words of Kernel */
+
4985  add edx, 8 /* move pointer to other 4 words */
+
4986  movq mm4, [edx] /* load 4 words of Kernel */
+
4987  add edx, 8 /* move pointer to other 4 words */
+
4988  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
4989  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
4990  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
4991  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
4992  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
4993  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
4994  movq mm1, [esi] /* load 8 bytes of the Src */
+
4995  dec esi
+
4996  add esi, eax /* move Src pointer 1 row below */
+
4997  movq mm3, [edx] /* load 4 words of Kernel */
+
4998  add edx, 8 /* move pointer to other 4 words */
+
4999  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5000  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5001  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5002  /* --- 7 */
+
5003  movq mm1, [esi] /* load 8 bytes of the Src */
+
5004  movq mm2, mm1 /* copy MM1 into MM2 */
+
5005  inc esi /* move pointer to the next 8 bytes of Src */
+
5006  movq mm3, [edx] /* load 4 words of Kernel */
+
5007  add edx, 8 /* move pointer to other 4 words */
+
5008  movq mm4, [edx] /* load 4 words of Kernel */
+
5009  add edx, 8 /* move pointer to other 4 words */
+
5010  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5011  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5012  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5013  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
5014  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5015  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5016  movq mm1, [esi] /* load 8 bytes of the Src */
+
5017  dec esi
+
5018  add esi, eax /* move Src pointer 1 row below */
+
5019  movq mm3, [edx] /* load 4 words of Kernel */
+
5020  add edx, 8 /* move pointer to other 4 words */
+
5021  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5022  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5023  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5024  /* --- 8 */
+
5025  movq mm1, [esi] /* load 8 bytes of the Src */
+
5026  movq mm2, mm1 /* copy MM1 into MM2 */
+
5027  inc esi /* move pointer to the next 8 bytes of Src */
+
5028  movq mm3, [edx] /* load 4 words of Kernel */
+
5029  add edx, 8 /* move pointer to other 4 words */
+
5030  movq mm4, [edx] /* load 4 words of Kernel */
+
5031  add edx, 8 /* move pointer to other 4 words */
+
5032  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5033  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5034  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5035  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
5036  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5037  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5038  movq mm1, [esi] /* load 8 bytes of the Src */
+
5039  dec esi
+
5040  add esi, eax /* move Src pointer 1 row below */
+
5041  movq mm3, [edx] /* load 4 words of Kernel */
+
5042  add edx, 8 /* move pointer to other 4 words */
+
5043  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5044  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5045  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5046  /* --- 9 */
+
5047  movq mm1, [esi] /* load 8 bytes of the Src */
+
5048  movq mm2, mm1 /* copy MM1 into MM2 */
+
5049  inc esi /* move pointer to the next 8 bytes of Src */
+
5050  movq mm3, [edx] /* load 4 words of Kernel */
+
5051  add edx, 8 /* move pointer to other 4 words */
+
5052  movq mm4, [edx] /* load 4 words of Kernel */
+
5053  add edx, 8 /* move pointer to other 4 words */
+
5054  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5055  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5056  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5057  pmullw mm2, mm4 /* mult. 4 high words of Src and Kernel */
+
5058  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5059  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5060  movq mm1, [esi] /* load 8 bytes of the Src */
+
5061  movq mm3, [edx] /* load 4 words of Kernel */
+
5062  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5063  pmullw mm1, mm3 /* mult. 4 low words of Src and Kernel */
+
5064  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5065  /* ---, */
+
5066  movq mm3, mm7 /* copy MM7 into MM3 */
+
5067  psrlq mm7, 32 /* shift 2 left words to the right */
+
5068  paddsw mm7, mm3 /* add 2 left and 2 right result words */
+
5069  movq mm2, mm7 /* copy MM7 into MM2 */
+
5070  psrlq mm7, 16 /* shift 1 left word to the right */
+
5071  paddsw mm7, mm2 /* add 1 left and 1 right result words */
+
5072  /* ---, */
+
5073  movd mm1, eax /* save EDX in MM1 */
+
5074  movd mm2, ebx /* save EDX in MM2 */
+
5075  movd mm3, edx /* save EDX in MM3 */
+
5076  movd eax, mm7 /* load summation result into EAX */
+
5077  psraw mm7, 15 /* spread sign bit of the result */
+
5078  movd ebx, mm5 /* load Divisor into EBX */
+
5079  movd edx, mm7 /* fill EDX with a sign bit */
+
5080  idiv bx /* IDIV - VERY EXPENSIVE */
+
5081  movd mm7, eax /* move result of division into MM7 */
+
5082  packuswb mm7, mm0 /* pack division result with saturation */
+
5083  movd eax, mm7 /* copy saturated result into EAX */
+
5084  mov [edi], al /* copy a byte result into Dest */
+
5085  movd edx, mm3 /* restore saved EDX */
+
5086  movd ebx, mm2 /* restore saved EBX */
+
5087  movd eax, mm1 /* restore saved EAX */
+
5088  /* --, */
+
5089  movd esi, mm6 /* move Src pointer to the top pixel */
+
5090  sub edx, 208 /* EDX = Kernel address */
+
5091  inc esi /* move Src pointer to the next pixel */
+
5092  inc edi /* move Dest pointer to the next pixel */
+
5093  /* ---, */
+
5094  dec ecx /* decrease loop counter COLUMNS */
+
5095  jnz L10352 /* check loop termination, proceed if required */
+
5096  add esi, 8 /* move to the next row in Src */
+
5097  add edi, 8 /* move to the next row in Dest */
+
5098  dec ebx /* decrease loop counter ROWS */
+
5099  jnz L10350 /* check loop termination, proceed if required */
+
5100  /* ---, */
+
5101  emms /* exit MMX state */
+
5102  popa
+
5103  }
+
5104 #else
+
5105  asm volatile
+
5106  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
5107  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
5108  "mov %5, %%bl \n\t" /* load Divisor into BL */
+
5109  "movd %%ebx, %%mm5 \n\t" /* copy Divisor into MM5 */
+
5110  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
5111  "mov %1, %%esi \n\t" /* load Src address to ESI */
+
5112  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
5113  "add $4, %%edi \n\t" /* 4 column offset from the left edge */
+
5114  "mov %3, %%eax \n\t" /* load columns into EAX */
+
5115  "add %%eax, %%edi \n\t" /* 4 row offset from the top edge */
+
5116  "add %%eax, %%edi \n\t" "add %%eax, %%edi \n\t" "add %%eax, %%edi \n\t" "mov %2, %%ebx \n\t" /* initialize ROWS counter */
+
5117  "sub $8, %%ebx \n\t" /* do not use first 4 and last 4 rows */
+
5118  /* --- */
+
5119  ".L10350: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMNS counter */
+
5120  "sub $8, %%ecx \n\t" /* do not use first 4 and last 4 columns */
+
5121  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
5122  ".L10352: \n\t" "pxor %%mm7, %%mm7 \n\t" /* zero MM7 (accumulator) */
+
5123  "movd %%esi, %%mm6 \n\t" /* save ESI in MM6 */
+
5124  /* --- 1 */
+
5125  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5126  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5127  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5128  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5129  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5130  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5131  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5132  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5133  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5134  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5135  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5136  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5137  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5138  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5139  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5140  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5141  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5142  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5143  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5144  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5145  /* --- 2 */
+
5146  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5147  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5148  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5149  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5150  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5151  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5152  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5153  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5154  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5155  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5156  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5157  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5158  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5159  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5160  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5161  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5162  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5163  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5164  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5165  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5166  /* --- 3 */
+
5167  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5168  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5169  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5170  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5171  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5172  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5173  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5174  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5175  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5176  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5177  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5178  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5179  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5180  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5181  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5182  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5183  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5184  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5185  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5186  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5187  /* --- 4 */
+
5188  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5189  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5190  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5191  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5192  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5193  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5194  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5195  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5196  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5197  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5198  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5199  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5200  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5201  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5202  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5203  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5204  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5205  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5206  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5207  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5208  /* --- 5 */
+
5209  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5210  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5211  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5212  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5213  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5214  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5215  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5216  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5217  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5218  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5219  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5220  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5221  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5222  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5223  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5224  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5225  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5226  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5227  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5228  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5229  /* --- 6 */
+
5230  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5231  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5232  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5233  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5234  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5235  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5236  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5237  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5238  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5239  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5240  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5241  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5242  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5243  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5244  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5245  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5246  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5247  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5248  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5249  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5250  /* --- 7 */
+
5251  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5252  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5253  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5254  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5255  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5256  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5257  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5258  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5259  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5260  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5261  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5262  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5263  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5264  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5265  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5266  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5267  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5268  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5269  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5270  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5271  /* --- 8 */
+
5272  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5273  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5274  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5275  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5276  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5277  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5278  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5279  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5280  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5281  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5282  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5283  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5284  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5285  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5286  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5287  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5288  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5289  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5290  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5291  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5292  /* --- 9 */
+
5293  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5294  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5295  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
5296  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5297  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5298  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5299  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5300  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5301  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5302  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5303  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5304  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5305  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5306  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5307  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5308  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5309  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5310  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5311  /* --- */
+
5312  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
5313  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
5314  "paddsw %%mm3, %%mm7 \n\t" /* add 2 left and 2 right result words */
+
5315  "movq %%mm7, %%mm2 \n\t" /* copy MM7 into MM2 */
+
5316  "psrlq $16, %%mm7 \n\t" /* shift 1 left word to the right */
+
5317  "paddsw %%mm2, %%mm7 \n\t" /* add 1 left and 1 right result words */
+
5318  /* --- */
+
5319  "movd %%eax, %%mm1 \n\t" /* save EDX in MM1 */
+
5320  "movd %%ebx, %%mm2 \n\t" /* save EDX in MM2 */
+
5321  "movd %%edx, %%mm3 \n\t" /* save EDX in MM3 */
+
5322  "movd %%mm7, %%eax \n\t" /* load summation result into EAX */
+
5323  "psraw $15, %%mm7 \n\t" /* spread sign bit of the result */
+
5324  "movd %%mm5, %%ebx \n\t" /* load Divisor into EBX */
+
5325  "movd %%mm7, %%edx \n\t" /* fill EDX with a sign bit */
+
5326  "idivw %%bx \n\t" /* IDIV - VERY EXPENSIVE */
+
5327  "movd %%eax, %%mm7 \n\t" /* move result of division into MM7 */
+
5328  "packuswb %%mm0, %%mm7 \n\t" /* pack division result with saturation */
+
5329  "movd %%mm7, %%eax \n\t" /* copy saturated result into EAX */
+
5330  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
5331  "movd %%mm3, %%edx \n\t" /* restore saved EDX */
+
5332  "movd %%mm2, %%ebx \n\t" /* restore saved EBX */
+
5333  "movd %%mm1, %%eax \n\t" /* restore saved EAX */
+
5334  /* -- */
+
5335  "movd %%mm6, %%esi \n\t" /* move Src pointer to the top pixel */
+
5336  "sub $208, %%edx \n\t" /* EDX = Kernel address */
+
5337  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
5338  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
5339  /* --- */
+
5340  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
5341  "jnz .L10352 \n\t" /* check loop termination, proceed if required */
+
5342  "add $8, %%esi \n\t" /* move to the next row in Src */
+
5343  "add $8, %%edi \n\t" /* move to the next row in Dest */
+
5344  "dec %%ebx \n\t" /* decrease loop counter ROWS */
+
5345  "jnz .L10350 \n\t" /* check loop termination, proceed if required */
+
5346  /* --- */
+
5347  "emms \n\t" /* exit MMX state */
+
5348  "popa \n\t":"=m" (Dest) /* %0 */
+
5349  :"m"(Src), /* %1 */
+
5350  "m"(rows), /* %2 */
+
5351  "m"(columns), /* %3 */
+
5352  "m"(Kernel), /* %4 */
+
5353  "m"(Divisor) /* %5 */
+
5354  );
+
5355 #endif
+
5356 #endif
+
5357  return (0);
+
5358  } else {
+
5359  /* No non-MMX implementation yet */
+
5360  return (-1);
+
5361  }
+
5362 }
+
5363 
+
5378 int SDL_imageFilterConvolveKernel3x3ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
5379  signed short *Kernel, unsigned char NRightShift)
+
5380 {
+
5381  /* Validate input parameters */
+
5382  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
5383  return(-1);
+
5384 
+
5385  if ((columns < 3) || (rows < 3) || (NRightShift > 7))
+
5386  return (-1);
+
5387 
+
5388  if ((SDL_imageFilterMMXdetect())) {
+
5389 //#ifdef USE_MMX
+
5390 #if defined(USE_MMX) && defined(i386)
+
5391 #if !defined(GCC__)
+
5392  __asm
+
5393  {
+
5394  pusha
+
5395  pxor mm0, mm0 /* zero MM0 */
+
5396  xor ebx, ebx /* zero EBX */
+
5397  mov bl, NRightShift /* load NRightShift into BL */
+
5398  movd mm4, ebx /* copy NRightShift into MM4 */
+
5399  mov edx, Kernel /* load Kernel address into EDX */
+
5400  movq mm5, [edx] /* MM5 = {0,K2,K1,K0} */
+
5401  add edx, 8 /* second row |K0 K1 K2 0| */
+
5402  movq mm6, [edx] /* MM6 = {0,K5,K4,K3} K = |K3 K4 K5 0| */
+
5403  add edx, 8 /* third row |K6 K7 K8 0| */
+
5404  movq mm7, [edx] /* MM7 = {0,K8,K7,K6} */
+
5405  /* ---, */
+
5406  mov eax, columns /* load columns into EAX */
+
5407  mov esi, Src /* ESI = Src row 0 address */
+
5408  mov edi, Dest /* load Dest address to EDI */
+
5409  add edi, eax /* EDI = EDI + columns */
+
5410  inc edi /* 1 byte offset from the left edge */
+
5411  mov edx, rows /* initialize ROWS counter */
+
5412  sub edx, 2 /* do not use first and last row */
+
5413  /* ---, */
+
5414 L10360:
+
5415  mov ecx, eax /* initialize COLUMS counter */
+
5416  sub ecx, 2 /* do not use first and last column */
+
5417  align 16 /* 16 byte alignment of the loop entry */
+
5418 L10362:
+
5419  /* ---, */
+
5420  movq mm1, [esi] /* load 8 bytes of the image first row */
+
5421  add esi, eax /* move one row below */
+
5422  movq mm2, [esi] /* load 8 bytes of the image second row */
+
5423  add esi, eax /* move one row below */
+
5424  movq mm3, [esi] /* load 8 bytes of the image third row */
+
5425  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5426  punpcklbw mm2, mm0 /* unpack first 4 bytes into words */
+
5427  punpcklbw mm3, mm0 /* unpack first 4 bytes into words */
+
5428  psrlw mm1, mm4 /* shift right each pixel NshiftRight times */
+
5429  psrlw mm2, mm4 /* shift right each pixel NshiftRight times */
+
5430  psrlw mm3, mm4 /* shift right each pixel NshiftRight times */
+
5431  pmullw mm1, mm5 /* multiply words first row image*Kernel */
+
5432  pmullw mm2, mm6 /* multiply words second row image*Kernel */
+
5433  pmullw mm3, mm7 /* multiply words third row image*Kernel */
+
5434  paddsw mm1, mm2 /* add 4 words of the first and second rows */
+
5435  paddsw mm1, mm3 /* add 4 words of the third row and result */
+
5436  movq mm2, mm1 /* copy MM1 into MM2 */
+
5437  psrlq mm1, 32 /* shift 2 left words to the right */
+
5438  paddsw mm1, mm2 /* add 2 left and 2 right result words */
+
5439  movq mm3, mm1 /* copy MM1 into MM3 */
+
5440  psrlq mm1, 16 /* shift 1 left word to the right */
+
5441  paddsw mm1, mm3 /* add 1 left and 1 right result words */
+
5442  packuswb mm1, mm0 /* pack shift result with saturation */
+
5443  movd ebx, mm1 /* copy saturated result into EBX */
+
5444  mov [edi], bl /* copy a byte result into Dest */
+
5445  /* --, */
+
5446  sub esi, eax /* move two rows up */
+
5447  sub esi, eax
+
5448  inc esi /* move Src pointer to the next pixel */
+
5449  inc edi /* move Dest pointer to the next pixel */
+
5450  /* ---, */
+
5451  dec ecx /* decrease loop counter COLUMNS */
+
5452  jnz L10362 /* check loop termination, proceed if required */
+
5453  add esi, 2 /* move to the next row in Src */
+
5454  add edi, 2 /* move to the next row in Dest */
+
5455  dec edx /* decrease loop counter ROWS */
+
5456  jnz L10360 /* check loop termination, proceed if required */
+
5457  /* ---, */
+
5458  emms /* exit MMX state */
+
5459  popa
+
5460  }
+
5461 #else
+
5462  asm volatile
+
5463  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
5464  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
5465  "mov %5, %%bl \n\t" /* load NRightShift into BL */
+
5466  "movd %%ebx, %%mm4 \n\t" /* copy NRightShift into MM4 */
+
5467  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
5468  "movq (%%edx), %%mm5 \n\t" /* MM5 = {0,K2,K1,K0} */
+
5469  "add $8, %%edx \n\t" /* second row |K0 K1 K2 0| */
+
5470  "movq (%%edx), %%mm6 \n\t" /* MM6 = {0,K5,K4,K3} K = |K3 K4 K5 0| */
+
5471  "add $8, %%edx \n\t" /* third row |K6 K7 K8 0| */
+
5472  "movq (%%edx), %%mm7 \n\t" /* MM7 = {0,K8,K7,K6} */
+
5473  /* --- */
+
5474  "mov %3, %%eax \n\t" /* load columns into EAX */
+
5475  "mov %1, %%esi \n\t" /* ESI = Src row 0 address */
+
5476  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
5477  "add %%eax, %%edi \n\t" /* EDI = EDI + columns */
+
5478  "inc %%edi \n\t" /* 1 byte offset from the left edge */
+
5479  "mov %2, %%edx \n\t" /* initialize ROWS counter */
+
5480  "sub $2, %%edx \n\t" /* do not use first and last row */
+
5481  /* --- */
+
5482  ".L10360: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMS counter */
+
5483  "sub $2, %%ecx \n\t" /* do not use first and last column */
+
5484  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
5485  ".L10362: \n\t"
+
5486  /* --- */
+
5487  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the image first row */
+
5488  "add %%eax, %%esi \n\t" /* move one row below */
+
5489  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes of the image second row */
+
5490  "add %%eax, %%esi \n\t" /* move one row below */
+
5491  "movq (%%esi), %%mm3 \n\t" /* load 8 bytes of the image third row */
+
5492  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5493  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack first 4 bytes into words */
+
5494  "punpcklbw %%mm0, %%mm3 \n\t" /* unpack first 4 bytes into words */
+
5495  "psrlw %%mm4, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
5496  "psrlw %%mm4, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
5497  "psrlw %%mm4, %%mm3 \n\t" /* shift right each pixel NshiftRight times */
+
5498  "pmullw %%mm5, %%mm1 \n\t" /* multiply words first row image*Kernel */
+
5499  "pmullw %%mm6, %%mm2 \n\t" /* multiply words second row image*Kernel */
+
5500  "pmullw %%mm7, %%mm3 \n\t" /* multiply words third row image*Kernel */
+
5501  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the first and second rows */
+
5502  "paddsw %%mm3, %%mm1 \n\t" /* add 4 words of the third row and result */
+
5503  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5504  "psrlq $32, %%mm1 \n\t" /* shift 2 left words to the right */
+
5505  "paddsw %%mm2, %%mm1 \n\t" /* add 2 left and 2 right result words */
+
5506  "movq %%mm1, %%mm3 \n\t" /* copy MM1 into MM3 */
+
5507  "psrlq $16, %%mm1 \n\t" /* shift 1 left word to the right */
+
5508  "paddsw %%mm3, %%mm1 \n\t" /* add 1 left and 1 right result words */
+
5509  "packuswb %%mm0, %%mm1 \n\t" /* pack shift result with saturation */
+
5510  "movd %%mm1, %%ebx \n\t" /* copy saturated result into EBX */
+
5511  "mov %%bl, (%%edi) \n\t" /* copy a byte result into Dest */
+
5512  /* -- */
+
5513  "sub %%eax, %%esi \n\t" /* move two rows up */
+
5514  "sub %%eax, %%esi \n\t" "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
5515  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
5516  /* --- */
+
5517  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
5518  "jnz .L10362 \n\t" /* check loop termination, proceed if required */
+
5519  "add $2, %%esi \n\t" /* move to the next row in Src */
+
5520  "add $2, %%edi \n\t" /* move to the next row in Dest */
+
5521  "dec %%edx \n\t" /* decrease loop counter ROWS */
+
5522  "jnz .L10360 \n\t" /* check loop termination, proceed if required */
+
5523  /* --- */
+
5524  "emms \n\t" /* exit MMX state */
+
5525  "popa \n\t":"=m" (Dest) /* %0 */
+
5526  :"m"(Src), /* %1 */
+
5527  "m"(rows), /* %2 */
+
5528  "m"(columns), /* %3 */
+
5529  "m"(Kernel), /* %4 */
+
5530  "m"(NRightShift) /* %5 */
+
5531  );
+
5532 #endif
+
5533 #endif
+
5534  return (0);
+
5535  } else {
+
5536  /* No non-MMX implementation yet */
+
5537  return (-1);
+
5538  }
+
5539 }
+
5540 
+
5555 int SDL_imageFilterConvolveKernel5x5ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
5556  signed short *Kernel, unsigned char NRightShift)
+
5557 {
+
5558  /* Validate input parameters */
+
5559  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
5560  return(-1);
+
5561 
+
5562  if ((columns < 5) || (rows < 5) || (NRightShift > 7))
+
5563  return (-1);
+
5564 
+
5565  if ((SDL_imageFilterMMXdetect())) {
+
5566 //#ifdef USE_MMX
+
5567 #if defined(USE_MMX) && defined(i386)
+
5568 #if !defined(GCC__)
+
5569  __asm
+
5570  {
+
5571  pusha
+
5572  pxor mm0, mm0 /* zero MM0 */
+
5573  xor ebx, ebx /* zero EBX */
+
5574  mov bl, NRightShift /* load NRightShift into BL */
+
5575  movd mm5, ebx /* copy NRightShift into MM5 */
+
5576  mov edx, Kernel /* load Kernel address into EDX */
+
5577  mov esi, Src /* load Src address to ESI */
+
5578  mov edi, Dest /* load Dest address to EDI */
+
5579  add edi, 2 /* 2 column offset from the left edge */
+
5580  mov eax, columns /* load columns into EAX */
+
5581  shl eax, 1 /* EAX = columns * 2 */
+
5582  add edi, eax /* 2 row offset from the top edge */
+
5583  shr eax, 1 /* EAX = columns */
+
5584  mov ebx, rows /* initialize ROWS counter */
+
5585  sub ebx, 4 /* do not use first 2 and last 2 rows */
+
5586  /* ---, */
+
5587 L10370:
+
5588  mov ecx, eax /* initialize COLUMNS counter */
+
5589  sub ecx, 4 /* do not use first 2 and last 2 columns */
+
5590  align 16 /* 16 byte alignment of the loop entry */
+
5591 L10372:
+
5592  pxor mm7, mm7 /* zero MM7 (accumulator) */
+
5593  movd mm6, esi /* save ESI in MM6 */
+
5594  /* --- 1 */
+
5595  movq mm1, [esi] /* load 8 bytes of the Src */
+
5596  movq mm2, mm1 /* copy MM1 into MM2 */
+
5597  add esi, eax /* move Src pointer 1 row below */
+
5598  movq mm3, [edx] /* load 4 words of Kernel */
+
5599  add edx, 8 /* move pointer to other 4 words */
+
5600  movq mm4, [edx] /* load 4 words of Kernel */
+
5601  add edx, 8 /* move pointer to other 4 words */
+
5602  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5603  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5604  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5605  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5606  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5607  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5608  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5609  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5610  /* --- 2 */
+
5611  movq mm1, [esi] /* load 8 bytes of the Src */
+
5612  movq mm2, mm1 /* copy MM1 into MM2 */
+
5613  add esi, eax /* move Src pointer 1 row below */
+
5614  movq mm3, [edx] /* load 4 words of Kernel */
+
5615  add edx, 8 /* move pointer to other 4 words */
+
5616  movq mm4, [edx] /* load 4 words of Kernel */
+
5617  add edx, 8 /* move pointer to other 4 words */
+
5618  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5619  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5620  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5621  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5622  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5623  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5624  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5625  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5626  /* --- 3 */
+
5627  movq mm1, [esi] /* load 8 bytes of the Src */
+
5628  movq mm2, mm1 /* copy MM1 into MM2 */
+
5629  add esi, eax /* move Src pointer 1 row below */
+
5630  movq mm3, [edx] /* load 4 words of Kernel */
+
5631  add edx, 8 /* move pointer to other 4 words */
+
5632  movq mm4, [edx] /* load 4 words of Kernel */
+
5633  add edx, 8 /* move pointer to other 4 words */
+
5634  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5635  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5636  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5637  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5638  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5639  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5640  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5641  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5642  /* --- 4 */
+
5643  movq mm1, [esi] /* load 8 bytes of the Src */
+
5644  movq mm2, mm1 /* copy MM1 into MM2 */
+
5645  add esi, eax /* move Src pointer 1 row below */
+
5646  movq mm3, [edx] /* load 4 words of Kernel */
+
5647  add edx, 8 /* move pointer to other 4 words */
+
5648  movq mm4, [edx] /* load 4 words of Kernel */
+
5649  add edx, 8 /* move pointer to other 4 words */
+
5650  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5651  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5652  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5653  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5654  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5655  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5656  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5657  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5658  /* --- 5 */
+
5659  movq mm1, [esi] /* load 8 bytes of the Src */
+
5660  movq mm2, mm1 /* copy MM1 into MM2 */
+
5661  movq mm3, [edx] /* load 4 words of Kernel */
+
5662  add edx, 8 /* move pointer to other 4 words */
+
5663  movq mm4, [edx] /* load 4 words of Kernel */
+
5664  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5665  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5666  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5667  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5668  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5669  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5670  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5671  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5672  /* ---, */
+
5673  movq mm3, mm7 /* copy MM7 into MM3 */
+
5674  psrlq mm7, 32 /* shift 2 left words to the right */
+
5675  paddsw mm7, mm3 /* add 2 left and 2 right result words */
+
5676  movq mm2, mm7 /* copy MM7 into MM2 */
+
5677  psrlq mm7, 16 /* shift 1 left word to the right */
+
5678  paddsw mm7, mm2 /* add 1 left and 1 right result words */
+
5679  movd mm1, eax /* save EAX in MM1 */
+
5680  packuswb mm7, mm0 /* pack division result with saturation */
+
5681  movd eax, mm7 /* copy saturated result into EAX */
+
5682  mov [edi], al /* copy a byte result into Dest */
+
5683  movd eax, mm1 /* restore saved EAX */
+
5684  /* --, */
+
5685  movd esi, mm6 /* move Src pointer to the top pixel */
+
5686  sub edx, 72 /* EDX = Kernel address */
+
5687  inc esi /* move Src pointer to the next pixel */
+
5688  inc edi /* move Dest pointer to the next pixel */
+
5689  /* ---, */
+
5690  dec ecx /* decrease loop counter COLUMNS */
+
5691  jnz L10372 /* check loop termination, proceed if required */
+
5692  add esi, 4 /* move to the next row in Src */
+
5693  add edi, 4 /* move to the next row in Dest */
+
5694  dec ebx /* decrease loop counter ROWS */
+
5695  jnz L10370 /* check loop termination, proceed if required */
+
5696  /* ---, */
+
5697  emms /* exit MMX state */
+
5698  popa
+
5699  }
+
5700 #else
+
5701  asm volatile
+
5702  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
5703  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
5704  "mov %5, %%bl \n\t" /* load NRightShift into BL */
+
5705  "movd %%ebx, %%mm5 \n\t" /* copy NRightShift into MM5 */
+
5706  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
5707  "mov %1, %%esi \n\t" /* load Src address to ESI */
+
5708  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
5709  "add $2, %%edi \n\t" /* 2 column offset from the left edge */
+
5710  "mov %3, %%eax \n\t" /* load columns into EAX */
+
5711  "shl $1, %%eax \n\t" /* EAX = columns * 2 */
+
5712  "add %%eax, %%edi \n\t" /* 2 row offset from the top edge */
+
5713  "shr $1, %%eax \n\t" /* EAX = columns */
+
5714  "mov %2, %%ebx \n\t" /* initialize ROWS counter */
+
5715  "sub $4, %%ebx \n\t" /* do not use first 2 and last 2 rows */
+
5716  /* --- */
+
5717  ".L10370: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMNS counter */
+
5718  "sub $4, %%ecx \n\t" /* do not use first 2 and last 2 columns */
+
5719  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
5720  ".L10372: \n\t" "pxor %%mm7, %%mm7 \n\t" /* zero MM7 (accumulator) */
+
5721  "movd %%esi, %%mm6 \n\t" /* save ESI in MM6 */
+
5722  /* --- 1 */
+
5723  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5724  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5725  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5726  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5727  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5728  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5729  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5730  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5731  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5732  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
5733  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
5734  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5735  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5736  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5737  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5738  /* --- 2 */
+
5739  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5740  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5741  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5742  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5743  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5744  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5745  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5746  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5747  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5748  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
5749  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
5750  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5751  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5752  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5753  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5754  /* --- 3 */
+
5755  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5756  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5757  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5758  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5759  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5760  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5761  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5762  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5763  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5764  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
5765  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
5766  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5767  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5768  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5769  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5770  /* --- 4 */
+
5771  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5772  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5773  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
5774  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5775  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5776  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5777  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5778  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5779  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5780  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
5781  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
5782  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5783  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5784  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5785  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5786  /* --- 5 */
+
5787  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
5788  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
5789  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
5790  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
5791  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
5792  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
5793  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
5794  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
5795  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
5796  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
5797  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
5798  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
5799  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
5800  /* --- */
+
5801  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
5802  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
5803  "paddsw %%mm3, %%mm7 \n\t" /* add 2 left and 2 right result words */
+
5804  "movq %%mm7, %%mm2 \n\t" /* copy MM7 into MM2 */
+
5805  "psrlq $16, %%mm7 \n\t" /* shift 1 left word to the right */
+
5806  "paddsw %%mm2, %%mm7 \n\t" /* add 1 left and 1 right result words */
+
5807  "movd %%eax, %%mm1 \n\t" /* save EAX in MM1 */
+
5808  "packuswb %%mm0, %%mm7 \n\t" /* pack division result with saturation */
+
5809  "movd %%mm7, %%eax \n\t" /* copy saturated result into EAX */
+
5810  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
5811  "movd %%mm1, %%eax \n\t" /* restore saved EAX */
+
5812  /* -- */
+
5813  "movd %%mm6, %%esi \n\t" /* move Src pointer to the top pixel */
+
5814  "sub $72, %%edx \n\t" /* EDX = Kernel address */
+
5815  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
5816  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
5817  /* --- */
+
5818  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
5819  "jnz .L10372 \n\t" /* check loop termination, proceed if required */
+
5820  "add $4, %%esi \n\t" /* move to the next row in Src */
+
5821  "add $4, %%edi \n\t" /* move to the next row in Dest */
+
5822  "dec %%ebx \n\t" /* decrease loop counter ROWS */
+
5823  "jnz .L10370 \n\t" /* check loop termination, proceed if required */
+
5824  /* --- */
+
5825  "emms \n\t" /* exit MMX state */
+
5826  "popa \n\t":"=m" (Dest) /* %0 */
+
5827  :"m"(Src), /* %1 */
+
5828  "m"(rows), /* %2 */
+
5829  "m"(columns), /* %3 */
+
5830  "m"(Kernel), /* %4 */
+
5831  "m"(NRightShift) /* %5 */
+
5832  );
+
5833 #endif
+
5834 #endif
+
5835  return (0);
+
5836  } else {
+
5837  /* No non-MMX implementation yet */
+
5838  return (-1);
+
5839  }
+
5840 }
+
5841 
+
5856 int SDL_imageFilterConvolveKernel7x7ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
5857  signed short *Kernel, unsigned char NRightShift)
+
5858 {
+
5859  /* Validate input parameters */
+
5860  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
5861  return(-1);
+
5862 
+
5863  if ((columns < 7) || (rows < 7) || (NRightShift > 7))
+
5864  return (-1);
+
5865 
+
5866  if ((SDL_imageFilterMMXdetect())) {
+
5867 //#ifdef USE_MMX
+
5868 #if defined(USE_MMX) && defined(i386)
+
5869 #if !defined(GCC__)
+
5870  __asm
+
5871  {
+
5872  pusha
+
5873  pxor mm0, mm0 /* zero MM0 */
+
5874  xor ebx, ebx /* zero EBX */
+
5875  mov bl, NRightShift /* load NRightShift into BL */
+
5876  movd mm5, ebx /* copy NRightShift into MM5 */
+
5877  mov edx, Kernel /* load Kernel address into EDX */
+
5878  mov esi, Src /* load Src address to ESI */
+
5879  mov edi, Dest /* load Dest address to EDI */
+
5880  add edi, 3 /* 3 column offset from the left edge */
+
5881  mov eax, columns /* load columns into EAX */
+
5882  add edi, eax /* 3 row offset from the top edge */
+
5883  add edi, eax
+
5884  add edi, eax
+
5885  mov ebx, rows /* initialize ROWS counter */
+
5886  sub ebx, 6 /* do not use first 3 and last 3 rows */
+
5887  /* ---, */
+
5888 L10380:
+
5889  mov ecx, eax /* initialize COLUMNS counter */
+
5890  sub ecx, 6 /* do not use first 3 and last 3 columns */
+
5891  align 16 /* 16 byte alignment of the loop entry */
+
5892 L10382:
+
5893  pxor mm7, mm7 /* zero MM7 (accumulator) */
+
5894  movd mm6, esi /* save ESI in MM6 */
+
5895  /* --- 1 */
+
5896  movq mm1, [esi] /* load 8 bytes of the Src */
+
5897  movq mm2, mm1 /* copy MM1 into MM2 */
+
5898  add esi, eax /* move Src pointer 1 row below */
+
5899  movq mm3, [edx] /* load 4 words of Kernel */
+
5900  add edx, 8 /* move pointer to other 4 words */
+
5901  movq mm4, [edx] /* load 4 words of Kernel */
+
5902  add edx, 8 /* move pointer to other 4 words */
+
5903  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5904  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5905  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5906  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5907  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5908  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5909  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5910  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5911  /* --- 2 */
+
5912  movq mm1, [esi] /* load 8 bytes of the Src */
+
5913  movq mm2, mm1 /* copy MM1 into MM2 */
+
5914  add esi, eax /* move Src pointer 1 row below */
+
5915  movq mm3, [edx] /* load 4 words of Kernel */
+
5916  add edx, 8 /* move pointer to other 4 words */
+
5917  movq mm4, [edx] /* load 4 words of Kernel */
+
5918  add edx, 8 /* move pointer to other 4 words */
+
5919  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5920  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5921  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5922  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5923  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5924  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5925  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5926  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5927  /* --- 3 */
+
5928  movq mm1, [esi] /* load 8 bytes of the Src */
+
5929  movq mm2, mm1 /* copy MM1 into MM2 */
+
5930  add esi, eax /* move Src pointer 1 row below */
+
5931  movq mm3, [edx] /* load 4 words of Kernel */
+
5932  add edx, 8 /* move pointer to other 4 words */
+
5933  movq mm4, [edx] /* load 4 words of Kernel */
+
5934  add edx, 8 /* move pointer to other 4 words */
+
5935  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5936  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5937  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5938  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5939  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5940  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5941  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5942  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5943  /* --- 4 */
+
5944  movq mm1, [esi] /* load 8 bytes of the Src */
+
5945  movq mm2, mm1 /* copy MM1 into MM2 */
+
5946  add esi, eax /* move Src pointer 1 row below */
+
5947  movq mm3, [edx] /* load 4 words of Kernel */
+
5948  add edx, 8 /* move pointer to other 4 words */
+
5949  movq mm4, [edx] /* load 4 words of Kernel */
+
5950  add edx, 8 /* move pointer to other 4 words */
+
5951  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5952  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5953  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5954  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5955  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5956  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5957  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5958  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5959  /* --- 5 */
+
5960  movq mm1, [esi] /* load 8 bytes of the Src */
+
5961  movq mm2, mm1 /* copy MM1 into MM2 */
+
5962  add esi, eax /* move Src pointer 1 row below */
+
5963  movq mm3, [edx] /* load 4 words of Kernel */
+
5964  add edx, 8 /* move pointer to other 4 words */
+
5965  movq mm4, [edx] /* load 4 words of Kernel */
+
5966  add edx, 8 /* move pointer to other 4 words */
+
5967  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5968  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5969  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5970  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5971  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5972  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5973  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5974  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5975  /* --- 6 */
+
5976  movq mm1, [esi] /* load 8 bytes of the Src */
+
5977  movq mm2, mm1 /* copy MM1 into MM2 */
+
5978  add esi, eax /* move Src pointer 1 row below */
+
5979  movq mm3, [edx] /* load 4 words of Kernel */
+
5980  add edx, 8 /* move pointer to other 4 words */
+
5981  movq mm4, [edx] /* load 4 words of Kernel */
+
5982  add edx, 8 /* move pointer to other 4 words */
+
5983  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5984  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5985  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
5986  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
5987  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
5988  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
5989  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
5990  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
5991  /* --- 7 */
+
5992  movq mm1, [esi] /* load 8 bytes of the Src */
+
5993  movq mm2, mm1 /* copy MM1 into MM2 */
+
5994  movq mm3, [edx] /* load 4 words of Kernel */
+
5995  add edx, 8 /* move pointer to other 4 words */
+
5996  movq mm4, [edx] /* load 4 words of Kernel */
+
5997  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
5998  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
5999  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6000  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6001  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6002  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6003  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6004  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6005  /* ---, */
+
6006  movq mm3, mm7 /* copy MM7 into MM3 */
+
6007  psrlq mm7, 32 /* shift 2 left words to the right */
+
6008  paddsw mm7, mm3 /* add 2 left and 2 right result words */
+
6009  movq mm2, mm7 /* copy MM7 into MM2 */
+
6010  psrlq mm7, 16 /* shift 1 left word to the right */
+
6011  paddsw mm7, mm2 /* add 1 left and 1 right result words */
+
6012  movd mm1, eax /* save EAX in MM1 */
+
6013  packuswb mm7, mm0 /* pack division result with saturation */
+
6014  movd eax, mm7 /* copy saturated result into EAX */
+
6015  mov [edi], al /* copy a byte result into Dest */
+
6016  movd eax, mm1 /* restore saved EAX */
+
6017  /* --, */
+
6018  movd esi, mm6 /* move Src pointer to the top pixel */
+
6019  sub edx, 104 /* EDX = Kernel address */
+
6020  inc esi /* move Src pointer to the next pixel */
+
6021  inc edi /* move Dest pointer to the next pixel */
+
6022  /* ---, */
+
6023  dec ecx /* decrease loop counter COLUMNS */
+
6024  jnz L10382 /* check loop termination, proceed if required */
+
6025  add esi, 6 /* move to the next row in Src */
+
6026  add edi, 6 /* move to the next row in Dest */
+
6027  dec ebx /* decrease loop counter ROWS */
+
6028  jnz L10380 /* check loop termination, proceed if required */
+
6029  /* ---, */
+
6030  emms /* exit MMX state */
+
6031  popa
+
6032  }
+
6033 #else
+
6034  asm volatile
+
6035  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
6036  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
6037  "mov %5, %%bl \n\t" /* load NRightShift into BL */
+
6038  "movd %%ebx, %%mm5 \n\t" /* copy NRightShift into MM5 */
+
6039  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
6040  "mov %1, %%esi \n\t" /* load Src address to ESI */
+
6041  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
6042  "add $3, %%edi \n\t" /* 3 column offset from the left edge */
+
6043  "mov %3, %%eax \n\t" /* load columns into EAX */
+
6044  "add %%eax, %%edi \n\t" /* 3 row offset from the top edge */
+
6045  "add %%eax, %%edi \n\t" "add %%eax, %%edi \n\t" "mov %2, %%ebx \n\t" /* initialize ROWS counter */
+
6046  "sub $6, %%ebx \n\t" /* do not use first 3 and last 3 rows */
+
6047  /* --- */
+
6048  ".L10380: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMNS counter */
+
6049  "sub $6, %%ecx \n\t" /* do not use first 3 and last 3 columns */
+
6050  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
6051  ".L10382: \n\t" "pxor %%mm7, %%mm7 \n\t" /* zero MM7 (accumulator) */
+
6052  "movd %%esi, %%mm6 \n\t" /* save ESI in MM6 */
+
6053  /* --- 1 */
+
6054  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6055  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6056  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6057  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6058  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6059  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6060  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6061  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6062  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6063  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6064  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6065  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6066  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6067  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6068  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6069  /* --- 2 */
+
6070  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6071  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6072  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6073  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6074  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6075  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6076  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6077  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6078  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6079  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6080  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6081  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6082  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6083  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6084  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6085  /* --- 3 */
+
6086  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6087  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6088  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6089  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6090  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6091  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6092  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6093  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6094  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6095  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6096  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6097  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6098  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6099  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6100  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6101  /* --- 4 */
+
6102  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6103  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6104  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6105  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6106  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6107  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6108  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6109  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6110  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6111  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6112  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6113  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6114  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6115  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6116  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6117  /* --- 5 */
+
6118  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6119  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6120  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6121  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6122  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6123  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6124  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6125  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6126  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6127  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6128  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6129  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6130  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6131  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6132  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6133  /* --- 6 */
+
6134  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6135  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6136  "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6137  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6138  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6139  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6140  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6141  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6142  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6143  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6144  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6145  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6146  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6147  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6148  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6149  /* --- 7 */
+
6150  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6151  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6152  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6153  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6154  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6155  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6156  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6157  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6158  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6159  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6160  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6161  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6162  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6163  /* --- */
+
6164  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
6165  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
6166  "paddsw %%mm3, %%mm7 \n\t" /* add 2 left and 2 right result words */
+
6167  "movq %%mm7, %%mm2 \n\t" /* copy MM7 into MM2 */
+
6168  "psrlq $16, %%mm7 \n\t" /* shift 1 left word to the right */
+
6169  "paddsw %%mm2, %%mm7 \n\t" /* add 1 left and 1 right result words */
+
6170  "movd %%eax, %%mm1 \n\t" /* save EAX in MM1 */
+
6171  "packuswb %%mm0, %%mm7 \n\t" /* pack division result with saturation */
+
6172  "movd %%mm7, %%eax \n\t" /* copy saturated result into EAX */
+
6173  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
6174  "movd %%mm1, %%eax \n\t" /* restore saved EAX */
+
6175  /* -- */
+
6176  "movd %%mm6, %%esi \n\t" /* move Src pointer to the top pixel */
+
6177  "sub $104, %%edx \n\t" /* EDX = Kernel address */
+
6178  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
6179  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
6180  /* --- */
+
6181  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
6182  "jnz .L10382 \n\t" /* check loop termination, proceed if required */
+
6183  "add $6, %%esi \n\t" /* move to the next row in Src */
+
6184  "add $6, %%edi \n\t" /* move to the next row in Dest */
+
6185  "dec %%ebx \n\t" /* decrease loop counter ROWS */
+
6186  "jnz .L10380 \n\t" /* check loop termination, proceed if required */
+
6187  /* --- */
+
6188  "emms \n\t" /* exit MMX state */
+
6189  "popa \n\t":"=m" (Dest) /* %0 */
+
6190  :"m"(Src), /* %1 */
+
6191  "m"(rows), /* %2 */
+
6192  "m"(columns), /* %3 */
+
6193  "m"(Kernel), /* %4 */
+
6194  "m"(NRightShift) /* %5 */
+
6195  );
+
6196 #endif
+
6197 #endif
+
6198  return (0);
+
6199  } else {
+
6200  /* No non-MMX implementation yet */
+
6201  return (-1);
+
6202  }
+
6203 }
+
6204 
+
6219 int SDL_imageFilterConvolveKernel9x9ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
6220  signed short *Kernel, unsigned char NRightShift)
+
6221 {
+
6222  /* Validate input parameters */
+
6223  if ((Src == NULL) || (Dest == NULL) || (Kernel == NULL))
+
6224  return(-1);
+
6225 
+
6226  if ((columns < 9) || (rows < 9) || (NRightShift > 7))
+
6227  return (-1);
+
6228 
+
6229  if ((SDL_imageFilterMMXdetect())) {
+
6230 //#ifdef USE_MMX
+
6231 #if defined(USE_MMX) && defined(i386)
+
6232 #if !defined(GCC__)
+
6233  __asm
+
6234  {
+
6235  pusha
+
6236  pxor mm0, mm0 /* zero MM0 */
+
6237  xor ebx, ebx /* zero EBX */
+
6238  mov bl, NRightShift /* load NRightShift into BL */
+
6239  movd mm5, ebx /* copy NRightShift into MM5 */
+
6240  mov edx, Kernel /* load Kernel address into EDX */
+
6241  mov esi, Src /* load Src address to ESI */
+
6242  mov edi, Dest /* load Dest address to EDI */
+
6243  add edi, 4 /* 4 column offset from the left edge */
+
6244  mov eax, columns /* load columns into EAX */
+
6245  add edi, eax /* 4 row offset from the top edge */
+
6246  add edi, eax
+
6247  add edi, eax
+
6248  add edi, eax
+
6249  mov ebx, rows /* initialize ROWS counter */
+
6250  sub ebx, 8 /* do not use first 4 and last 4 rows */
+
6251  /* ---, */
+
6252 L10390:
+
6253  mov ecx, eax /* initialize COLUMNS counter */
+
6254  sub ecx, 8 /* do not use first 4 and last 4 columns */
+
6255  align 16 /* 16 byte alignment of the loop entry */
+
6256 L10392:
+
6257  pxor mm7, mm7 /* zero MM7 (accumulator) */
+
6258  movd mm6, esi /* save ESI in MM6 */
+
6259  /* --- 1 */
+
6260  movq mm1, [esi] /* load 8 bytes of the Src */
+
6261  movq mm2, mm1 /* copy MM1 into MM2 */
+
6262  inc esi /* move pointer to the next 8 bytes of Src */
+
6263  movq mm3, [edx] /* load 4 words of Kernel */
+
6264  add edx, 8 /* move pointer to other 4 words */
+
6265  movq mm4, [edx] /* load 4 words of Kernel */
+
6266  add edx, 8 /* move pointer to other 4 words */
+
6267  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6268  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6269  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6270  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6271  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6272  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6273  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6274  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6275  movq mm1, [esi] /* load 8 bytes of the Src */
+
6276  dec esi
+
6277  add esi, eax /* move Src pointer 1 row below */
+
6278  movq mm3, [edx] /* load 4 words of Kernel */
+
6279  add edx, 8 /* move pointer to other 4 words */
+
6280  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6281  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6282  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6283  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6284  /* --- 2 */
+
6285  movq mm1, [esi] /* load 8 bytes of the Src */
+
6286  movq mm2, mm1 /* copy MM1 into MM2 */
+
6287  inc esi /* move pointer to the next 8 bytes of Src */
+
6288  movq mm3, [edx] /* load 4 words of Kernel */
+
6289  add edx, 8 /* move pointer to other 4 words */
+
6290  movq mm4, [edx] /* load 4 words of Kernel */
+
6291  add edx, 8 /* move pointer to other 4 words */
+
6292  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6293  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6294  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6295  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6296  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6297  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6298  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6299  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6300  movq mm1, [esi] /* load 8 bytes of the Src */
+
6301  dec esi
+
6302  add esi, eax /* move Src pointer 1 row below */
+
6303  movq mm3, [edx] /* load 4 words of Kernel */
+
6304  add edx, 8 /* move pointer to other 4 words */
+
6305  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6306  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6307  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6308  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6309  /* --- 3 */
+
6310  movq mm1, [esi] /* load 8 bytes of the Src */
+
6311  movq mm2, mm1 /* copy MM1 into MM2 */
+
6312  inc esi /* move pointer to the next 8 bytes of Src */
+
6313  movq mm3, [edx] /* load 4 words of Kernel */
+
6314  add edx, 8 /* move pointer to other 4 words */
+
6315  movq mm4, [edx] /* load 4 words of Kernel */
+
6316  add edx, 8 /* move pointer to other 4 words */
+
6317  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6318  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6319  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6320  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6321  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6322  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6323  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6324  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6325  movq mm1, [esi] /* load 8 bytes of the Src */
+
6326  dec esi
+
6327  add esi, eax /* move Src pointer 1 row below */
+
6328  movq mm3, [edx] /* load 4 words of Kernel */
+
6329  add edx, 8 /* move pointer to other 4 words */
+
6330  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6331  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6332  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6333  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6334  /* --- 4 */
+
6335  movq mm1, [esi] /* load 8 bytes of the Src */
+
6336  movq mm2, mm1 /* copy MM1 into MM2 */
+
6337  inc esi /* move pointer to the next 8 bytes of Src */
+
6338  movq mm3, [edx] /* load 4 words of Kernel */
+
6339  add edx, 8 /* move pointer to other 4 words */
+
6340  movq mm4, [edx] /* load 4 words of Kernel */
+
6341  add edx, 8 /* move pointer to other 4 words */
+
6342  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6343  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6344  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6345  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6346  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6347  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6348  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6349  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6350  movq mm1, [esi] /* load 8 bytes of the Src */
+
6351  dec esi
+
6352  add esi, eax /* move Src pointer 1 row below */
+
6353  movq mm3, [edx] /* load 4 words of Kernel */
+
6354  add edx, 8 /* move pointer to other 4 words */
+
6355  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6356  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6357  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6358  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6359  /* --- 5 */
+
6360  movq mm1, [esi] /* load 8 bytes of the Src */
+
6361  movq mm2, mm1 /* copy MM1 into MM2 */
+
6362  inc esi /* move pointer to the next 8 bytes of Src */
+
6363  movq mm3, [edx] /* load 4 words of Kernel */
+
6364  add edx, 8 /* move pointer to other 4 words */
+
6365  movq mm4, [edx] /* load 4 words of Kernel */
+
6366  add edx, 8 /* move pointer to other 4 words */
+
6367  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6368  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6369  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6370  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6371  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6372  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6373  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6374  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6375  movq mm1, [esi] /* load 8 bytes of the Src */
+
6376  dec esi
+
6377  add esi, eax /* move Src pointer 1 row below */
+
6378  movq mm3, [edx] /* load 4 words of Kernel */
+
6379  add edx, 8 /* move pointer to other 4 words */
+
6380  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6381  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6382  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6383  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6384  /* --- 6 */
+
6385  movq mm1, [esi] /* load 8 bytes of the Src */
+
6386  movq mm2, mm1 /* copy MM1 into MM2 */
+
6387  inc esi /* move pointer to the next 8 bytes of Src */
+
6388  movq mm3, [edx] /* load 4 words of Kernel */
+
6389  add edx, 8 /* move pointer to other 4 words */
+
6390  movq mm4, [edx] /* load 4 words of Kernel */
+
6391  add edx, 8 /* move pointer to other 4 words */
+
6392  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6393  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6394  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6395  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6396  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6397  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6398  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6399  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6400  movq mm1, [esi] /* load 8 bytes of the Src */
+
6401  dec esi
+
6402  add esi, eax /* move Src pointer 1 row below */
+
6403  movq mm3, [edx] /* load 4 words of Kernel */
+
6404  add edx, 8 /* move pointer to other 4 words */
+
6405  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6406  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6407  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6408  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6409  /* --- 7 */
+
6410  movq mm1, [esi] /* load 8 bytes of the Src */
+
6411  movq mm2, mm1 /* copy MM1 into MM2 */
+
6412  inc esi /* move pointer to the next 8 bytes of Src */
+
6413  movq mm3, [edx] /* load 4 words of Kernel */
+
6414  add edx, 8 /* move pointer to other 4 words */
+
6415  movq mm4, [edx] /* load 4 words of Kernel */
+
6416  add edx, 8 /* move pointer to other 4 words */
+
6417  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6418  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6419  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6420  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6421  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6422  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6423  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6424  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6425  movq mm1, [esi] /* load 8 bytes of the Src */
+
6426  dec esi
+
6427  add esi, eax /* move Src pointer 1 row below */
+
6428  movq mm3, [edx] /* load 4 words of Kernel */
+
6429  add edx, 8 /* move pointer to other 4 words */
+
6430  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6431  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6432  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6433  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6434  /* --- 8 */
+
6435  movq mm1, [esi] /* load 8 bytes of the Src */
+
6436  movq mm2, mm1 /* copy MM1 into MM2 */
+
6437  inc esi /* move pointer to the next 8 bytes of Src */
+
6438  movq mm3, [edx] /* load 4 words of Kernel */
+
6439  add edx, 8 /* move pointer to other 4 words */
+
6440  movq mm4, [edx] /* load 4 words of Kernel */
+
6441  add edx, 8 /* move pointer to other 4 words */
+
6442  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6443  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6444  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6445  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6446  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6447  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6448  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6449  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6450  movq mm1, [esi] /* load 8 bytes of the Src */
+
6451  dec esi
+
6452  add esi, eax /* move Src pointer 1 row below */
+
6453  movq mm3, [edx] /* load 4 words of Kernel */
+
6454  add edx, 8 /* move pointer to other 4 words */
+
6455  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6456  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6457  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6458  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6459  /* --- 9 */
+
6460  movq mm1, [esi] /* load 8 bytes of the Src */
+
6461  movq mm2, mm1 /* copy MM1 into MM2 */
+
6462  inc esi /* move pointer to the next 8 bytes of Src */
+
6463  movq mm3, [edx] /* load 4 words of Kernel */
+
6464  add edx, 8 /* move pointer to other 4 words */
+
6465  movq mm4, [edx] /* load 4 words of Kernel */
+
6466  add edx, 8 /* move pointer to other 4 words */
+
6467  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6468  punpckhbw mm2, mm0 /* unpack second 4 bytes into words */
+
6469  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6470  psrlw mm2, mm5 /* shift right each pixel NshiftRight times */
+
6471  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6472  pmullw mm2, mm4 /* mult 4 high words of Src and Kernel */
+
6473  paddsw mm1, mm2 /* add 4 words of the high and low bytes */
+
6474  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6475  movq mm1, [esi] /* load 8 bytes of the Src */
+
6476  movq mm3, [edx] /* load 4 words of Kernel */
+
6477  punpcklbw mm1, mm0 /* unpack first 4 bytes into words */
+
6478  psrlw mm1, mm5 /* shift right each pixel NshiftRight times */
+
6479  pmullw mm1, mm3 /* mult 4 low words of Src and Kernel */
+
6480  paddsw mm7, mm1 /* add MM1 to accumulator MM7 */
+
6481  /* ---, */
+
6482  movq mm3, mm7 /* copy MM7 into MM3 */
+
6483  psrlq mm7, 32 /* shift 2 left words to the right */
+
6484  paddsw mm7, mm3 /* add 2 left and 2 right result words */
+
6485  movq mm2, mm7 /* copy MM7 into MM2 */
+
6486  psrlq mm7, 16 /* shift 1 left word to the right */
+
6487  paddsw mm7, mm2 /* add 1 left and 1 right result words */
+
6488  movd mm1, eax /* save EAX in MM1 */
+
6489  packuswb mm7, mm0 /* pack division result with saturation */
+
6490  movd eax, mm7 /* copy saturated result into EAX */
+
6491  mov [edi], al /* copy a byte result into Dest */
+
6492  movd eax, mm1 /* restore saved EAX */
+
6493  /* --, */
+
6494  movd esi, mm6 /* move Src pointer to the top pixel */
+
6495  sub edx, 208 /* EDX = Kernel address */
+
6496  inc esi /* move Src pointer to the next pixel */
+
6497  inc edi /* move Dest pointer to the next pixel */
+
6498  /* ---, */
+
6499  dec ecx /* decrease loop counter COLUMNS */
+
6500  jnz L10392 /* check loop termination, proceed if required */
+
6501  add esi, 8 /* move to the next row in Src */
+
6502  add edi, 8 /* move to the next row in Dest */
+
6503  dec ebx /* decrease loop counter ROWS */
+
6504  jnz L10390 /* check loop termination, proceed if required */
+
6505  /* ---, */
+
6506  emms /* exit MMX state */
+
6507  popa
+
6508  }
+
6509 #else
+
6510  asm volatile
+
6511  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
6512  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
6513  "mov %5, %%bl \n\t" /* load NRightShift into BL */
+
6514  "movd %%ebx, %%mm5 \n\t" /* copy NRightShift into MM5 */
+
6515  "mov %4, %%edx \n\t" /* load Kernel address into EDX */
+
6516  "mov %1, %%esi \n\t" /* load Src address to ESI */
+
6517  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
6518  "add $4, %%edi \n\t" /* 4 column offset from the left edge */
+
6519  "mov %3, %%eax \n\t" /* load columns into EAX */
+
6520  "add %%eax, %%edi \n\t" /* 4 row offset from the top edge */
+
6521  "add %%eax, %%edi \n\t" "add %%eax, %%edi \n\t" "add %%eax, %%edi \n\t" "mov %2, %%ebx \n\t" /* initialize ROWS counter */
+
6522  "sub $8, %%ebx \n\t" /* do not use first 4 and last 4 rows */
+
6523  /* --- */
+
6524  ".L10390: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMNS counter */
+
6525  "sub $8, %%ecx \n\t" /* do not use first 4 and last 4 columns */
+
6526  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
6527  ".L10392: \n\t" "pxor %%mm7, %%mm7 \n\t" /* zero MM7 (accumulator) */
+
6528  "movd %%esi, %%mm6 \n\t" /* save ESI in MM6 */
+
6529  /* --- 1 */
+
6530  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6531  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6532  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6533  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6534  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6535  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6536  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6537  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6538  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6539  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6540  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6541  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6542  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6543  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6544  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6545  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6546  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6547  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6548  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6549  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6550  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6551  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6552  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6553  /* --- 2 */
+
6554  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6555  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6556  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6557  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6558  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6559  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6560  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6561  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6562  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6563  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6564  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6565  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6566  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6567  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6568  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6569  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6570  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6571  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6572  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6573  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6574  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6575  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6576  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6577  /* --- 3 */
+
6578  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6579  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6580  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6581  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6582  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6583  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6584  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6585  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6586  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6587  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6588  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6589  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6590  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6591  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6592  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6593  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6594  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6595  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6596  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6597  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6598  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6599  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6600  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6601  /* --- 4 */
+
6602  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6603  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6604  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6605  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6606  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6607  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6608  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6609  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6610  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6611  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6612  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6613  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6614  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6615  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6616  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6617  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6618  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6619  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6620  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6621  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6622  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6623  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6624  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6625  /* --- 5 */
+
6626  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6627  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6628  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6629  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6630  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6631  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6632  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6633  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6634  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6635  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6636  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6637  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6638  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6639  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6640  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6641  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6642  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6643  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6644  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6645  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6646  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6647  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6648  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6649  /* --- 6 */
+
6650  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6651  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6652  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6653  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6654  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6655  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6656  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6657  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6658  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6659  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6660  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6661  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6662  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6663  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6664  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6665  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6666  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6667  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6668  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6669  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6670  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6671  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6672  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6673  /* --- 7 */
+
6674  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6675  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6676  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6677  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6678  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6679  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6680  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6681  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6682  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6683  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6684  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6685  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6686  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6687  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6688  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6689  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6690  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6691  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6692  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6693  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6694  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6695  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6696  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6697  /* --- 8 */
+
6698  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6699  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6700  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6701  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6702  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6703  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6704  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6705  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6706  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6707  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6708  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6709  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6710  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6711  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6712  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6713  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6714  "dec %%esi \n\t" "add %%eax, %%esi \n\t" /* move Src pointer 1 row below */
+
6715  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6716  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6717  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6718  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6719  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6720  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6721  /* --- 9 */
+
6722  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6723  "movq %%mm1, %%mm2 \n\t" /* copy MM1 into MM2 */
+
6724  "inc %%esi \n\t" /* move pointer to the next 8 bytes of Src */
+
6725  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6726  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6727  "movq (%%edx), %%mm4 \n\t" /* load 4 words of Kernel */
+
6728  "add $8, %%edx \n\t" /* move pointer to other 4 words */
+
6729  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6730  "punpckhbw %%mm0, %%mm2 \n\t" /* unpack second 4 bytes into words */
+
6731  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6732  "psrlw %%mm5, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
6733  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6734  "pmullw %%mm4, %%mm2 \n\t" /* mult. 4 high words of Src and Kernel */
+
6735  "paddsw %%mm2, %%mm1 \n\t" /* add 4 words of the high and low bytes */
+
6736  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6737  "movq (%%esi), %%mm1 \n\t" /* load 8 bytes of the Src */
+
6738  "movq (%%edx), %%mm3 \n\t" /* load 4 words of Kernel */
+
6739  "punpcklbw %%mm0, %%mm1 \n\t" /* unpack first 4 bytes into words */
+
6740  "psrlw %%mm5, %%mm1 \n\t" /* shift right each pixel NshiftRight times */
+
6741  "pmullw %%mm3, %%mm1 \n\t" /* mult. 4 low words of Src and Kernel */
+
6742  "paddsw %%mm1, %%mm7 \n\t" /* add MM1 to accumulator MM7 */
+
6743  /* --- */
+
6744  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
6745  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
6746  "paddsw %%mm3, %%mm7 \n\t" /* add 2 left and 2 right result words */
+
6747  "movq %%mm7, %%mm2 \n\t" /* copy MM7 into MM2 */
+
6748  "psrlq $16, %%mm7 \n\t" /* shift 1 left word to the right */
+
6749  "paddsw %%mm2, %%mm7 \n\t" /* add 1 left and 1 right result words */
+
6750  "movd %%eax, %%mm1 \n\t" /* save EAX in MM1 */
+
6751  "packuswb %%mm0, %%mm7 \n\t" /* pack division result with saturation */
+
6752  "movd %%mm7, %%eax \n\t" /* copy saturated result into EAX */
+
6753  "mov %%al, (%%edi) \n\t" /* copy a byte result into Dest */
+
6754  "movd %%mm1, %%eax \n\t" /* restore saved EAX */
+
6755  /* -- */
+
6756  "movd %%mm6, %%esi \n\t" /* move Src pointer to the top pixel */
+
6757  "sub $208, %%edx \n\t" /* EDX = Kernel address */
+
6758  "inc %%esi \n\t" /* move Src pointer to the next pixel */
+
6759  "inc %%edi \n\t" /* move Dest pointer to the next pixel */
+
6760  /* --- */
+
6761  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
6762  "jnz .L10392 \n\t" /* check loop termination, proceed if required */
+
6763  "add $8, %%esi \n\t" /* move to the next row in Src */
+
6764  "add $8, %%edi \n\t" /* move to the next row in Dest */
+
6765  "dec %%ebx \n\t" /* decrease loop counter ROWS */
+
6766  "jnz .L10390 \n\t" /* check loop termination, proceed if required */
+
6767  /* --- */
+
6768  "emms \n\t" /* exit MMX state */
+
6769  "popa \n\t":"=m" (Dest) /* %0 */
+
6770  :"m"(Src), /* %1 */
+
6771  "m"(rows), /* %2 */
+
6772  "m"(columns), /* %3 */
+
6773  "m"(Kernel), /* %4 */
+
6774  "m"(NRightShift) /* %5 */
+
6775  );
+
6776 #endif
+
6777 #endif
+
6778  return (0);
+
6779  } else {
+
6780  /* No non-MMX implementation yet */
+
6781  return (-1);
+
6782  }
+
6783 }
+
6784 
+
6785 /* ------------------------------------------------------------------------------------ */
+
6786 
+
6799 int SDL_imageFilterSobelX(unsigned char *Src, unsigned char *Dest, int rows, int columns)
+
6800 {
+
6801  /* Validate input parameters */
+
6802  if ((Src == NULL) || (Dest == NULL))
+
6803  return(-1);
+
6804 
+
6805  if ((columns < 8) || (rows < 3))
+
6806  return (-1);
+
6807 
+
6808  if ((SDL_imageFilterMMXdetect())) {
+
6809 //#ifdef USE_MMX
+
6810 #if defined(USE_MMX) && defined(i386)
+
6811 #if !defined(GCC__)
+
6812  __asm
+
6813  {
+
6814  pusha
+
6815  pxor mm0, mm0 /* zero MM0 */
+
6816  mov eax, columns /* load columns into EAX */
+
6817  /* ---, */
+
6818  mov esi, Src /* ESI = Src row 0 address */
+
6819  mov edi, Dest /* load Dest address to EDI */
+
6820  add edi, eax /* EDI = EDI + columns */
+
6821  inc edi /* 1 byte offset from the left edge */
+
6822  mov edx, rows /* initialize ROWS counter */
+
6823  sub edx, 2 /* do not use first and last rows */
+
6824  /* ---, */
+
6825 L10400:
+
6826  mov ecx, eax /* initialize COLUMS counter */
+
6827  shr ecx, 3 /* EBX/8 (MMX loads 8 bytes at a time) */
+
6828  mov ebx, esi /* save ESI in EBX */
+
6829  movd mm1, edi /* save EDI in MM1 */
+
6830  align 16 /* 16 byte alignment of the loop entry */
+
6831 L10402:
+
6832  /* ---, */
+
6833  movq mm4, [esi] /* load 8 bytes from Src */
+
6834  movq mm5, mm4 /* save MM4 in MM5 */
+
6835  add esi, 2 /* move ESI pointer 2 bytes right */
+
6836  punpcklbw mm4, mm0 /* unpack 4 low bytes into words */
+
6837  punpckhbw mm5, mm0 /* unpack 4 high bytes into words */
+
6838  movq mm6, [esi] /* load 8 bytes from Src */
+
6839  movq mm7, mm6 /* save MM6 in MM7 */
+
6840  sub esi, 2 /* move ESI pointer back 2 bytes left */
+
6841  punpcklbw mm6, mm0 /* unpack 4 low bytes into words */
+
6842  punpckhbw mm7, mm0 /* unpack 4 high bytes into words */
+
6843  add esi, eax /* move to the next row of Src */
+
6844  movq mm2, [esi] /* load 8 bytes from Src */
+
6845  movq mm3, mm2 /* save MM2 in MM3 */
+
6846  add esi, 2 /* move ESI pointer 2 bytes right */
+
6847  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
6848  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
6849  paddw mm4, mm2 /* add 4 low bytes to accumolator MM4 */
+
6850  paddw mm5, mm3 /* add 4 high bytes to accumolator MM5 */
+
6851  paddw mm4, mm2 /* add 4 low bytes to accumolator MM4 */
+
6852  paddw mm5, mm3 /* add 4 high bytes to accumolator MM5 */
+
6853  movq mm2, [esi] /* load 8 bytes from Src */
+
6854  movq mm3, mm2 /* save MM2 in MM3 */
+
6855  sub esi, 2 /* move ESI pointer back 2 bytes left */
+
6856  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
6857  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
6858  paddw mm6, mm2 /* add 4 low bytes to accumolator MM6 */
+
6859  paddw mm7, mm3 /* add 4 high bytes to accumolator MM7 */
+
6860  paddw mm6, mm2 /* add 4 low bytes to accumolator MM6 */
+
6861  paddw mm7, mm3 /* add 4 high bytes to accumolator MM7 */
+
6862  add esi, eax /* move to the next row of Src */
+
6863  movq mm2, [esi] /* load 8 bytes from Src */
+
6864  movq mm3, mm2 /* save MM2 in MM3 */
+
6865  add esi, 2 /* move ESI pointer 2 bytes right */
+
6866  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
6867  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
6868  paddw mm4, mm2 /* add 4 low bytes to accumolator MM4 */
+
6869  paddw mm5, mm3 /* add 4 high bytes to accumolator MM5 */
+
6870  movq mm2, [esi] /* load 8 bytes from Src */
+
6871  movq mm3, mm2 /* save MM2 in MM3 */
+
6872  sub esi, 2 /* move ESI pointer back 2 bytes left */
+
6873  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
6874  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
6875  paddw mm6, mm2 /* add 4 low bytes to accumolator MM6 */
+
6876  paddw mm7, mm3 /* add 4 high bytes to accumolator MM7 */
+
6877  /* ---, */
+
6878  movq mm2, mm4 /* copy MM4 into MM2 */
+
6879  psrlq mm4, 32 /* shift 2 left words to the right */
+
6880  psubw mm4, mm2 /* MM4 = MM4 - MM2 */
+
6881  movq mm3, mm6 /* copy MM6 into MM3 */
+
6882  psrlq mm6, 32 /* shift 2 left words to the right */
+
6883  psubw mm6, mm3 /* MM6 = MM6 - MM3 */
+
6884  punpckldq mm4, mm6 /* combine 2 words of MM6 and 2 words of MM4 */
+
6885  movq mm2, mm5 /* copy MM6 into MM2 */
+
6886  psrlq mm5, 32 /* shift 2 left words to the right */
+
6887  psubw mm5, mm2 /* MM5 = MM5 - MM2 */
+
6888  movq mm3, mm7 /* copy MM7 into MM3 */
+
6889  psrlq mm7, 32 /* shift 2 left words to the right */
+
6890  psubw mm7, mm3 /* MM7 = MM7 - MM3 */
+
6891  punpckldq mm5, mm7 /* combine 2 words of MM7 and 2 words of MM5 */
+
6892  /* Take abs values of MM4 and MM5 */
+
6893  movq mm6, mm4 /* copy MM4 into MM6 */
+
6894  movq mm7, mm5 /* copy MM5 into MM7 */
+
6895  psraw mm6, 15 /* fill MM6 words with word sign bit */
+
6896  psraw mm7, 15 /* fill MM7 words with word sign bit */
+
6897  pxor mm4, mm6 /* take 1's compliment of only neg words */
+
6898  pxor mm5, mm7 /* take 1's compliment of only neg words */
+
6899  psubsw mm4, mm6 /* add 1 to only neg words, W-(-1) or W-0 */
+
6900  psubsw mm5, mm7 /* add 1 to only neg words, W-(-1) or W-0 */
+
6901  packuswb mm4, mm5 /* combine and pack/saturate MM5 and MM4 */
+
6902  movq [edi], mm4 /* store result in Dest */
+
6903  /* ---, */
+
6904  sub esi, eax /* move to the current top row in Src */
+
6905  sub esi, eax
+
6906  add esi, 8 /* move Src pointer to the next 8 pixels */
+
6907  add edi, 8 /* move Dest pointer to the next 8 pixels */
+
6908  /* ---, */
+
6909  dec ecx /* decrease loop counter COLUMNS */
+
6910  jnz L10402 /* check loop termination, proceed if required */
+
6911  mov esi, ebx /* restore most left current row Src address */
+
6912  movd edi, mm1 /* restore most left current row Dest address */
+
6913  add esi, eax /* move to the next row in Src */
+
6914  add edi, eax /* move to the next row in Dest */
+
6915  dec edx /* decrease loop counter ROWS */
+
6916  jnz L10400 /* check loop termination, proceed if required */
+
6917  /* ---, */
+
6918  emms /* exit MMX state */
+
6919  popa
+
6920  }
+
6921 #else
+
6922  asm volatile
+
6923  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
6924  "mov %3, %%eax \n\t" /* load columns into EAX */
+
6925  /* --- */
+
6926  "mov %1, %%esi \n\t" /* ESI = Src row 0 address */
+
6927  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
6928  "add %%eax, %%edi \n\t" /* EDI = EDI + columns */
+
6929  "inc %%edi \n\t" /* 1 byte offset from the left edge */
+
6930  "mov %2, %%edx \n\t" /* initialize ROWS counter */
+
6931  "sub $2, %%edx \n\t" /* do not use first and last rows */
+
6932  /* --- */
+
6933  ".L10400: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMS counter */
+
6934  "shr $3, %%ecx \n\t" /* EBX/8 (MMX loads 8 bytes at a time) */
+
6935  "mov %%esi, %%ebx \n\t" /* save ESI in EBX */
+
6936  "movd %%edi, %%mm1 \n\t" /* save EDI in MM1 */
+
6937  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
6938  ".L10402: \n\t"
+
6939  /* --- */
+
6940  "movq (%%esi), %%mm4 \n\t" /* load 8 bytes from Src */
+
6941  "movq %%mm4, %%mm5 \n\t" /* save MM4 in MM5 */
+
6942  "add $2, %%esi \n\t" /* move ESI pointer 2 bytes right */
+
6943  "punpcklbw %%mm0, %%mm4 \n\t" /* unpack 4 low bytes into words */
+
6944  "punpckhbw %%mm0, %%mm5 \n\t" /* unpack 4 high bytes into words */
+
6945  "movq (%%esi), %%mm6 \n\t" /* load 8 bytes from Src */
+
6946  "movq %%mm6, %%mm7 \n\t" /* save MM6 in MM7 */
+
6947  "sub $2, %%esi \n\t" /* move ESI pointer back 2 bytes left */
+
6948  "punpcklbw %%mm0, %%mm6 \n\t" /* unpack 4 low bytes into words */
+
6949  "punpckhbw %%mm0, %%mm7 \n\t" /* unpack 4 high bytes into words */
+
6950  "add %%eax, %%esi \n\t" /* move to the next row of Src */
+
6951  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
6952  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
6953  "add $2, %%esi \n\t" /* move ESI pointer 2 bytes right */
+
6954  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
6955  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
6956  "paddw %%mm2, %%mm4 \n\t" /* add 4 low bytes to accumolator MM4 */
+
6957  "paddw %%mm3, %%mm5 \n\t" /* add 4 high bytes to accumolator MM5 */
+
6958  "paddw %%mm2, %%mm4 \n\t" /* add 4 low bytes to accumolator MM4 */
+
6959  "paddw %%mm3, %%mm5 \n\t" /* add 4 high bytes to accumolator MM5 */
+
6960  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
6961  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
6962  "sub $2, %%esi \n\t" /* move ESI pointer back 2 bytes left */
+
6963  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
6964  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
6965  "paddw %%mm2, %%mm6 \n\t" /* add 4 low bytes to accumolator MM6 */
+
6966  "paddw %%mm3, %%mm7 \n\t" /* add 4 high bytes to accumolator MM7 */
+
6967  "paddw %%mm2, %%mm6 \n\t" /* add 4 low bytes to accumolator MM6 */
+
6968  "paddw %%mm3, %%mm7 \n\t" /* add 4 high bytes to accumolator MM7 */
+
6969  "add %%eax, %%esi \n\t" /* move to the next row of Src */
+
6970  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
6971  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
6972  "add $2, %%esi \n\t" /* move ESI pointer 2 bytes right */
+
6973  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
6974  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
6975  "paddw %%mm2, %%mm4 \n\t" /* add 4 low bytes to accumolator MM4 */
+
6976  "paddw %%mm3, %%mm5 \n\t" /* add 4 high bytes to accumolator MM5 */
+
6977  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
6978  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
6979  "sub $2, %%esi \n\t" /* move ESI pointer back 2 bytes left */
+
6980  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
6981  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
6982  "paddw %%mm2, %%mm6 \n\t" /* add 4 low bytes to accumolator MM6 */
+
6983  "paddw %%mm3, %%mm7 \n\t" /* add 4 high bytes to accumolator MM7 */
+
6984  /* --- */
+
6985  "movq %%mm4, %%mm2 \n\t" /* copy MM4 into MM2 */
+
6986  "psrlq $32, %%mm4 \n\t" /* shift 2 left words to the right */
+
6987  "psubw %%mm2, %%mm4 \n\t" /* MM4 = MM4 - MM2 */
+
6988  "movq %%mm6, %%mm3 \n\t" /* copy MM6 into MM3 */
+
6989  "psrlq $32, %%mm6 \n\t" /* shift 2 left words to the right */
+
6990  "psubw %%mm3, %%mm6 \n\t" /* MM6 = MM6 - MM3 */
+
6991  "punpckldq %%mm6, %%mm4 \n\t" /* combine 2 words of MM6 and 2 words of MM4 */
+
6992  "movq %%mm5, %%mm2 \n\t" /* copy MM6 into MM2 */
+
6993  "psrlq $32, %%mm5 \n\t" /* shift 2 left words to the right */
+
6994  "psubw %%mm2, %%mm5 \n\t" /* MM5 = MM5 - MM2 */
+
6995  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
6996  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
6997  "psubw %%mm3, %%mm7 \n\t" /* MM7 = MM7 - MM3 */
+
6998  "punpckldq %%mm7, %%mm5 \n\t" /* combine 2 words of MM7 and 2 words of MM5 */
+
6999  /* Take abs values of MM4 and MM5 */
+
7000  "movq %%mm4, %%mm6 \n\t" /* copy MM4 into MM6 */
+
7001  "movq %%mm5, %%mm7 \n\t" /* copy MM5 into MM7 */
+
7002  "psraw $15, %%mm6 \n\t" /* fill MM6 words with word sign bit */
+
7003  "psraw $15, %%mm7 \n\t" /* fill MM7 words with word sign bit */
+
7004  "pxor %%mm6, %%mm4 \n\t" /* take 1's compliment of only neg. words */
+
7005  "pxor %%mm7, %%mm5 \n\t" /* take 1's compliment of only neg. words */
+
7006  "psubsw %%mm6, %%mm4 \n\t" /* add 1 to only neg. words, W-(-1) or W-0 */
+
7007  "psubsw %%mm7, %%mm5 \n\t" /* add 1 to only neg. words, W-(-1) or W-0 */
+
7008  "packuswb %%mm5, %%mm4 \n\t" /* combine and pack/saturate MM5 and MM4 */
+
7009  "movq %%mm4, (%%edi) \n\t" /* store result in Dest */
+
7010  /* --- */
+
7011  "sub %%eax, %%esi \n\t" /* move to the current top row in Src */
+
7012  "sub %%eax, %%esi \n\t" "add $8, %%esi \n\t" /* move Src pointer to the next 8 pixels */
+
7013  "add $8, %%edi \n\t" /* move Dest pointer to the next 8 pixels */
+
7014  /* --- */
+
7015  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
7016  "jnz .L10402 \n\t" /* check loop termination, proceed if required */
+
7017  "mov %%ebx, %%esi \n\t" /* restore most left current row Src address */
+
7018  "movd %%mm1, %%edi \n\t" /* restore most left current row Dest address */
+
7019  "add %%eax, %%esi \n\t" /* move to the next row in Src */
+
7020  "add %%eax, %%edi \n\t" /* move to the next row in Dest */
+
7021  "dec %%edx \n\t" /* decrease loop counter ROWS */
+
7022  "jnz .L10400 \n\t" /* check loop termination, proceed if required */
+
7023  /* --- */
+
7024  "emms \n\t" /* exit MMX state */
+
7025  "popa \n\t":"=m" (Dest) /* %0 */
+
7026  :"m"(Src), /* %1 */
+
7027  "m"(rows), /* %2 */
+
7028  "m"(columns) /* %3 */
+
7029  );
+
7030 #endif
+
7031 #endif
+
7032  return (0);
+
7033  } else {
+
7034  /* No non-MMX implementation yet */
+
7035  return (-1);
+
7036  }
+
7037 }
+
7038 
+
7052 int SDL_imageFilterSobelXShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns,
+
7053  unsigned char NRightShift)
+
7054 {
+
7055  /* Validate input parameters */
+
7056  if ((Src == NULL) || (Dest == NULL))
+
7057  return(-1);
+
7058  if ((columns < 8) || (rows < 3) || (NRightShift > 7))
+
7059  return (-1);
+
7060 
+
7061  if ((SDL_imageFilterMMXdetect())) {
+
7062 //#ifdef USE_MMX
+
7063 #if defined(USE_MMX) && defined(i386)
+
7064 #if !defined(GCC__)
+
7065  __asm
+
7066  {
+
7067  pusha
+
7068  pxor mm0, mm0 /* zero MM0 */
+
7069  mov eax, columns /* load columns into EAX */
+
7070  xor ebx, ebx /* zero EBX */
+
7071  mov bl, NRightShift /* load NRightShift into BL */
+
7072  movd mm1, ebx /* copy NRightShift into MM1 */
+
7073  /* ---, */
+
7074  mov esi, Src /* ESI = Src row 0 address */
+
7075  mov edi, Dest /* load Dest address to EDI */
+
7076  add edi, eax /* EDI = EDI + columns */
+
7077  inc edi /* 1 byte offset from the left edge */
+
7078  /* initialize ROWS counter */
+
7079  sub rows, 2 /* do not use first and last rows */
+
7080  /* ---, */
+
7081 L10410:
+
7082  mov ecx, eax /* initialize COLUMS counter */
+
7083  shr ecx, 3 /* EBX/8 (MMX loads 8 bytes at a time) */
+
7084  mov ebx, esi /* save ESI in EBX */
+
7085  mov edx, edi /* save EDI in EDX */
+
7086  align 16 /* 16 byte alignment of the loop entry */
+
7087 L10412:
+
7088  /* ---, */
+
7089  movq mm4, [esi] /* load 8 bytes from Src */
+
7090  movq mm5, mm4 /* save MM4 in MM5 */
+
7091  add esi, 2 /* move ESI pointer 2 bytes right */
+
7092  punpcklbw mm4, mm0 /* unpack 4 low bytes into words */
+
7093  punpckhbw mm5, mm0 /* unpack 4 high bytes into words */
+
7094  psrlw mm4, mm1 /* shift right each pixel NshiftRight times */
+
7095  psrlw mm5, mm1 /* shift right each pixel NshiftRight times */
+
7096  movq mm6, [esi] /* load 8 bytes from Src */
+
7097  movq mm7, mm6 /* save MM6 in MM7 */
+
7098  sub esi, 2 /* move ESI pointer back 2 bytes left */
+
7099  punpcklbw mm6, mm0 /* unpack 4 low bytes into words */
+
7100  punpckhbw mm7, mm0 /* unpack 4 high bytes into words */
+
7101  psrlw mm6, mm1 /* shift right each pixel NshiftRight times */
+
7102  psrlw mm7, mm1 /* shift right each pixel NshiftRight times */
+
7103  add esi, eax /* move to the next row of Src */
+
7104  movq mm2, [esi] /* load 8 bytes from Src */
+
7105  movq mm3, mm2 /* save MM2 in MM3 */
+
7106  add esi, 2 /* move ESI pointer 2 bytes right */
+
7107  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
7108  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
7109  psrlw mm2, mm1 /* shift right each pixel NshiftRight times */
+
7110  psrlw mm3, mm1 /* shift right each pixel NshiftRight times */
+
7111  paddw mm4, mm2 /* add 4 low bytes to accumolator MM4 */
+
7112  paddw mm5, mm3 /* add 4 high bytes to accumolator MM5 */
+
7113  paddw mm4, mm2 /* add 4 low bytes to accumolator MM4 */
+
7114  paddw mm5, mm3 /* add 4 high bytes to accumolator MM5 */
+
7115  movq mm2, [esi] /* load 8 bytes from Src */
+
7116  movq mm3, mm2 /* save MM2 in MM3 */
+
7117  sub esi, 2 /* move ESI pointer back 2 bytes left */
+
7118  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
7119  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
7120  psrlw mm2, mm1 /* shift right each pixel NshiftRight times */
+
7121  psrlw mm3, mm1 /* shift right each pixel NshiftRight times */
+
7122  paddw mm6, mm2 /* add 4 low bytes to accumolator MM6 */
+
7123  paddw mm7, mm3 /* add 4 high bytes to accumolator MM7 */
+
7124  paddw mm6, mm2 /* add 4 low bytes to accumolator MM6 */
+
7125  paddw mm7, mm3 /* add 4 high bytes to accumolator MM7 */
+
7126  add esi, eax /* move to the next row of Src */
+
7127  movq mm2, [esi] /* load 8 bytes from Src */
+
7128  movq mm3, mm2 /* save MM2 in MM3 */
+
7129  add esi, 2 /* move ESI pointer 2 bytes right */
+
7130  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
7131  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
7132  psrlw mm2, mm1 /* shift right each pixel NshiftRight times */
+
7133  psrlw mm3, mm1 /* shift right each pixel NshiftRight times */
+
7134  paddw mm4, mm2 /* add 4 low bytes to accumolator MM4 */
+
7135  paddw mm5, mm3 /* add 4 high bytes to accumolator MM5 */
+
7136  movq mm2, [esi] /* load 8 bytes from Src */
+
7137  movq mm3, mm2 /* save MM2 in MM3 */
+
7138  sub esi, 2 /* move ESI pointer back 2 bytes left */
+
7139  punpcklbw mm2, mm0 /* unpack 4 low bytes into words */
+
7140  punpckhbw mm3, mm0 /* unpack 4 high bytes into words */
+
7141  psrlw mm2, mm1 /* shift right each pixel NshiftRight times */
+
7142  psrlw mm3, mm1 /* shift right each pixel NshiftRight times */
+
7143  paddw mm6, mm2 /* add 4 low bytes to accumolator MM6 */
+
7144  paddw mm7, mm3 /* add 4 high bytes to accumolator MM7 */
+
7145  /* ---, */
+
7146  movq mm2, mm4 /* copy MM4 into MM2 */
+
7147  psrlq mm4, 32 /* shift 2 left words to the right */
+
7148  psubw mm4, mm2 /* MM4 = MM4 - MM2 */
+
7149  movq mm3, mm6 /* copy MM6 into MM3 */
+
7150  psrlq mm6, 32 /* shift 2 left words to the right */
+
7151  psubw mm6, mm3 /* MM6 = MM6 - MM3 */
+
7152  punpckldq mm4, mm6 /* combine 2 words of MM6 and 2 words of MM4 */
+
7153  movq mm2, mm5 /* copy MM6 into MM2 */
+
7154  psrlq mm5, 32 /* shift 2 left words to the right */
+
7155  psubw mm5, mm2 /* MM5 = MM5 - MM2 */
+
7156  movq mm3, mm7 /* copy MM7 into MM3 */
+
7157  psrlq mm7, 32 /* shift 2 left words to the right */
+
7158  psubw mm7, mm3 /* MM7 = MM7 - MM3 */
+
7159  punpckldq mm5, mm7 /* combine 2 words of MM7 and 2 words of MM5 */
+
7160  /* Take abs values of MM4 and MM5 */
+
7161  movq mm6, mm4 /* copy MM4 into MM6 */
+
7162  movq mm7, mm5 /* copy MM5 into MM7 */
+
7163  psraw mm6, 15 /* fill MM6 words with word sign bit */
+
7164  psraw mm7, 15 /* fill MM7 words with word sign bit */
+
7165  pxor mm4, mm6 /* take 1's compliment of only neg words */
+
7166  pxor mm5, mm7 /* take 1's compliment of only neg words */
+
7167  psubsw mm4, mm6 /* add 1 to only neg words, W-(-1) or W-0 */
+
7168  psubsw mm5, mm7 /* add 1 to only neg words, W-(-1) or W-0 */
+
7169  packuswb mm4, mm5 /* combine and pack/saturate MM5 and MM4 */
+
7170  movq [edi], mm4 /* store result in Dest */
+
7171  /* ---, */
+
7172  sub esi, eax /* move to the current top row in Src */
+
7173  sub esi, eax
+
7174  add esi, 8 /* move Src pointer to the next 8 pixels */
+
7175  add edi, 8 /* move Dest pointer to the next 8 pixels */
+
7176  /* ---, */
+
7177  dec ecx /* decrease loop counter COLUMNS */
+
7178  jnz L10412 /* check loop termination, proceed if required */
+
7179  mov esi, ebx /* restore most left current row Src address */
+
7180  mov edi, edx /* restore most left current row Dest address */
+
7181  add esi, eax /* move to the next row in Src */
+
7182  add edi, eax /* move to the next row in Dest */
+
7183  dec rows /* decrease loop counter ROWS */
+
7184  jnz L10410 /* check loop termination, proceed if required */
+
7185  /* ---, */
+
7186  emms /* exit MMX state */
+
7187  popa
+
7188  }
+
7189 #else
+
7190  asm volatile
+
7191  ("pusha \n\t" "pxor %%mm0, %%mm0 \n\t" /* zero MM0 */
+
7192  "mov %3, %%eax \n\t" /* load columns into EAX */
+
7193  "xor %%ebx, %%ebx \n\t" /* zero EBX */
+
7194  "mov %4, %%bl \n\t" /* load NRightShift into BL */
+
7195  "movd %%ebx, %%mm1 \n\t" /* copy NRightShift into MM1 */
+
7196  /* --- */
+
7197  "mov %1, %%esi \n\t" /* ESI = Src row 0 address */
+
7198  "mov %0, %%edi \n\t" /* load Dest address to EDI */
+
7199  "add %%eax, %%edi \n\t" /* EDI = EDI + columns */
+
7200  "inc %%edi \n\t" /* 1 byte offset from the left edge */
+
7201  /* initialize ROWS counter */
+
7202  "subl $2, %2 \n\t" /* do not use first and last rows */
+
7203  /* --- */
+
7204  ".L10410: \n\t" "mov %%eax, %%ecx \n\t" /* initialize COLUMS counter */
+
7205  "shr $3, %%ecx \n\t" /* EBX/8 (MMX loads 8 bytes at a time) */
+
7206  "mov %%esi, %%ebx \n\t" /* save ESI in EBX */
+
7207  "mov %%edi, %%edx \n\t" /* save EDI in EDX */
+
7208  ".align 16 \n\t" /* 16 byte alignment of the loop entry */
+
7209  ".L10412: \n\t"
+
7210  /* --- */
+
7211  "movq (%%esi), %%mm4 \n\t" /* load 8 bytes from Src */
+
7212  "movq %%mm4, %%mm5 \n\t" /* save MM4 in MM5 */
+
7213  "add $2, %%esi \n\t" /* move ESI pointer 2 bytes right */
+
7214  "punpcklbw %%mm0, %%mm4 \n\t" /* unpack 4 low bytes into words */
+
7215  "punpckhbw %%mm0, %%mm5 \n\t" /* unpack 4 high bytes into words */
+
7216  "psrlw %%mm1, %%mm4 \n\t" /* shift right each pixel NshiftRight times */
+
7217  "psrlw %%mm1, %%mm5 \n\t" /* shift right each pixel NshiftRight times */
+
7218  "movq (%%esi), %%mm6 \n\t" /* load 8 bytes from Src */
+
7219  "movq %%mm6, %%mm7 \n\t" /* save MM6 in MM7 */
+
7220  "sub $2, %%esi \n\t" /* move ESI pointer back 2 bytes left */
+
7221  "punpcklbw %%mm0, %%mm6 \n\t" /* unpack 4 low bytes into words */
+
7222  "punpckhbw %%mm0, %%mm7 \n\t" /* unpack 4 high bytes into words */
+
7223  "psrlw %%mm1, %%mm6 \n\t" /* shift right each pixel NshiftRight times */
+
7224  "psrlw %%mm1, %%mm7 \n\t" /* shift right each pixel NshiftRight times */
+
7225  "add %%eax, %%esi \n\t" /* move to the next row of Src */
+
7226  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
7227  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
7228  "add $2, %%esi \n\t" /* move ESI pointer 2 bytes right */
+
7229  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
7230  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
7231  "psrlw %%mm1, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
7232  "psrlw %%mm1, %%mm3 \n\t" /* shift right each pixel NshiftRight times */
+
7233  "paddw %%mm2, %%mm4 \n\t" /* add 4 low bytes to accumolator MM4 */
+
7234  "paddw %%mm3, %%mm5 \n\t" /* add 4 high bytes to accumolator MM5 */
+
7235  "paddw %%mm2, %%mm4 \n\t" /* add 4 low bytes to accumolator MM4 */
+
7236  "paddw %%mm3, %%mm5 \n\t" /* add 4 high bytes to accumolator MM5 */
+
7237  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
7238  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
7239  "sub $2, %%esi \n\t" /* move ESI pointer back 2 bytes left */
+
7240  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
7241  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
7242  "psrlw %%mm1, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
7243  "psrlw %%mm1, %%mm3 \n\t" /* shift right each pixel NshiftRight times */
+
7244  "paddw %%mm2, %%mm6 \n\t" /* add 4 low bytes to accumolator MM6 */
+
7245  "paddw %%mm3, %%mm7 \n\t" /* add 4 high bytes to accumolator MM7 */
+
7246  "paddw %%mm2, %%mm6 \n\t" /* add 4 low bytes to accumolator MM6 */
+
7247  "paddw %%mm3, %%mm7 \n\t" /* add 4 high bytes to accumolator MM7 */
+
7248  "add %%eax, %%esi \n\t" /* move to the next row of Src */
+
7249  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
7250  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
7251  "add $2, %%esi \n\t" /* move ESI pointer 2 bytes right */
+
7252  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
7253  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
7254  "psrlw %%mm1, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
7255  "psrlw %%mm1, %%mm3 \n\t" /* shift right each pixel NshiftRight times */
+
7256  "paddw %%mm2, %%mm4 \n\t" /* add 4 low bytes to accumolator MM4 */
+
7257  "paddw %%mm3, %%mm5 \n\t" /* add 4 high bytes to accumolator MM5 */
+
7258  "movq (%%esi), %%mm2 \n\t" /* load 8 bytes from Src */
+
7259  "movq %%mm2, %%mm3 \n\t" /* save MM2 in MM3 */
+
7260  "sub $2, %%esi \n\t" /* move ESI pointer back 2 bytes left */
+
7261  "punpcklbw %%mm0, %%mm2 \n\t" /* unpack 4 low bytes into words */
+
7262  "punpckhbw %%mm0, %%mm3 \n\t" /* unpack 4 high bytes into words */
+
7263  "psrlw %%mm1, %%mm2 \n\t" /* shift right each pixel NshiftRight times */
+
7264  "psrlw %%mm1, %%mm3 \n\t" /* shift right each pixel NshiftRight times */
+
7265  "paddw %%mm2, %%mm6 \n\t" /* add 4 low bytes to accumolator MM6 */
+
7266  "paddw %%mm3, %%mm7 \n\t" /* add 4 high bytes to accumolator MM7 */
+
7267  /* --- */
+
7268  "movq %%mm4, %%mm2 \n\t" /* copy MM4 into MM2 */
+
7269  "psrlq $32, %%mm4 \n\t" /* shift 2 left words to the right */
+
7270  "psubw %%mm2, %%mm4 \n\t" /* MM4 = MM4 - MM2 */
+
7271  "movq %%mm6, %%mm3 \n\t" /* copy MM6 into MM3 */
+
7272  "psrlq $32, %%mm6 \n\t" /* shift 2 left words to the right */
+
7273  "psubw %%mm3, %%mm6 \n\t" /* MM6 = MM6 - MM3 */
+
7274  "punpckldq %%mm6, %%mm4 \n\t" /* combine 2 words of MM6 and 2 words of MM4 */
+
7275  "movq %%mm5, %%mm2 \n\t" /* copy MM6 into MM2 */
+
7276  "psrlq $32, %%mm5 \n\t" /* shift 2 left words to the right */
+
7277  "psubw %%mm2, %%mm5 \n\t" /* MM5 = MM5 - MM2 */
+
7278  "movq %%mm7, %%mm3 \n\t" /* copy MM7 into MM3 */
+
7279  "psrlq $32, %%mm7 \n\t" /* shift 2 left words to the right */
+
7280  "psubw %%mm3, %%mm7 \n\t" /* MM7 = MM7 - MM3 */
+
7281  "punpckldq %%mm7, %%mm5 \n\t" /* combine 2 words of MM7 and 2 words of MM5 */
+
7282  /* Take abs values of MM4 and MM5 */
+
7283  "movq %%mm4, %%mm6 \n\t" /* copy MM4 into MM6 */
+
7284  "movq %%mm5, %%mm7 \n\t" /* copy MM5 into MM7 */
+
7285  "psraw $15, %%mm6 \n\t" /* fill MM6 words with word sign bit */
+
7286  "psraw $15, %%mm7 \n\t" /* fill MM7 words with word sign bit */
+
7287  "pxor %%mm6, %%mm4 \n\t" /* take 1's compliment of only neg. words */
+
7288  "pxor %%mm7, %%mm5 \n\t" /* take 1's compliment of only neg. words */
+
7289  "psubsw %%mm6, %%mm4 \n\t" /* add 1 to only neg. words, W-(-1) or W-0 */
+
7290  "psubsw %%mm7, %%mm5 \n\t" /* add 1 to only neg. words, W-(-1) or W-0 */
+
7291  "packuswb %%mm5, %%mm4 \n\t" /* combine and pack/saturate MM5 and MM4 */
+
7292  "movq %%mm4, (%%edi) \n\t" /* store result in Dest */
+
7293  /* --- */
+
7294  "sub %%eax, %%esi \n\t" /* move to the current top row in Src */
+
7295  "sub %%eax, %%esi \n\t" "add $8, %%esi \n\t" /* move Src pointer to the next 8 pixels */
+
7296  "add $8, %%edi \n\t" /* move Dest pointer to the next 8 pixels */
+
7297  /* --- */
+
7298  "dec %%ecx \n\t" /* decrease loop counter COLUMNS */
+
7299  "jnz .L10412 \n\t" /* check loop termination, proceed if required */
+
7300  "mov %%ebx, %%esi \n\t" /* restore most left current row Src address */
+
7301  "mov %%edx, %%edi \n\t" /* restore most left current row Dest address */
+
7302  "add %%eax, %%esi \n\t" /* move to the next row in Src */
+
7303  "add %%eax, %%edi \n\t" /* move to the next row in Dest */
+
7304  "decl %2 \n\t" /* decrease loop counter ROWS */
+
7305  "jnz .L10410 \n\t" /* check loop termination, proceed if required */
+
7306  /* --- */
+
7307  "emms \n\t" /* exit MMX state */
+
7308  "popa \n\t":"=m" (Dest) /* %0 */
+
7309  :"m"(Src), /* %1 */
+
7310  "m"(rows), /* %2 */
+
7311  "m"(columns), /* %3 */
+
7312  "m"(NRightShift) /* %4 */
+
7313  );
+
7314 #endif
+
7315 #endif
+
7316  return (0);
+
7317  } else {
+
7318  /* No non-MMX implementation yet */
+
7319  return (-1);
+
7320  }
+
7321 }
+
7322 
+ +
7327 {
+
7328 #ifdef USE_MMX
+
7329 #if !defined(GCC__)
+
7330  __asm
+
7331  { /* --- stack alignment --- */
+
7332  mov ebx, esp /* load ESP into EBX */
+
7333  sub ebx, 4 /* reserve space on stack for old value of ESP */
+
7334  and ebx, -32 /* align EBX along a 32 byte boundary */
+
7335  mov [ebx], esp /* save old value of ESP in stack, behind the bndry */
+
7336  mov esp, ebx /* align ESP along a 32 byte boundary */
+
7337  }
+
7338 #else
+
7339  asm volatile
+
7340  ( /* --- stack alignment --- */
+
7341  "mov %%esp, %%ebx \n\t" /* load ESP into EBX */
+
7342  "sub $4, %%ebx \n\t" /* reserve space on stack for old value of ESP */
+
7343  "and $-32, %%ebx \n\t" /* align EBX along a 32 byte boundary */
+
7344  "mov %%esp, (%%ebx) \n\t" /* save old value of ESP in stack, behind the bndry */
+
7345  "mov %%ebx, %%esp \n\t" /* align ESP along a 32 byte boundary */
+
7346  ::);
+
7347 #endif
+
7348 #endif
+
7349 }
+
7350 
+ +
7355 {
+
7356 #ifdef USE_MMX
+
7357 #if !defined(GCC__)
+
7358  __asm
+
7359  { /* --- restoring old stack --- */
+
7360  mov ebx, [esp] /* load old value of ESP */
+
7361  mov esp, ebx /* restore old value of ESP */
+
7362  }
+
7363 #else
+
7364  asm volatile
+
7365  ( /* --- restoring old stack --- */
+
7366  "mov (%%esp), %%ebx \n\t" /* load old value of ESP */
+
7367  "mov %%ebx, %%esp \n\t" /* restore old value of ESP */
+
7368  ::);
+
7369 #endif
+
7370 #endif
+
7371 }
+
int SDL_imageFilterShiftLeftByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftLeftByte: D = (S << N)
+
int SDL_imageFilterSobelXShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns, unsigned char NRightShift)
Filter using SobelXShiftRight: Dij = saturation255( ... )
+
void SDL_imageFilterMMXon()
Enable MMX check for filter functions and use MMX code if available.
+
int SDL_imageFilterAddUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C)
+
int SDL_imageFilterConvolveKernel3x3ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
Filter using ConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
+
int SDL_imageFilterDiv(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Div: D = S1 / S2.
+
int SDL_imageFilterConvolveKernel5x5Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
Filter using ConvolveKernel5x5Divide: Dij = saturation0and255( ... )
+
int SDL_imageFilterMean(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Mean: D = S1/2 + S2/2.
+
int SDL_imageFilterClipToRange(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char Tmin, unsigned char Tmax)
Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.
+
int SDL_imageFilterSubByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using SubByte: D = saturation0(S - C)
+
int SDL_imageFilterShiftRight(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftRight: D = saturation0(S >> N)
+
int SDL_imageFilterConvolveKernel7x7Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
Filter using ConvolveKernel7x7Divide: Dij = saturation0and255( ... )
+
int SDL_imageFilterSubUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)
+
int SDL_imageFilterConvolveKernel9x9Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
Filter using ConvolveKernel9x9Divide: Dij = saturation0and255( ... )
+
int SDL_imageFilterMultDivby4(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using MultDivby4: D = saturation255(S1/2 * S2/2)
+
int SDL_imageFilterMultNorASM(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int SrcLength)
Internal ASM Filter using MultNor: D = S1 * S2.
+
#define SWAP_32(x)
Swaps the byte order in a 32bit integer (LSB becomes MSB, etc.).
+
int SDL_imageFilterBinarizeUsingThreshold(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char T)
Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0.
+
int SDL_imageFilterMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using MultByByte: D = saturation255(S * C)
+
int SDL_imageFilterMultNor(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using MultNor: D = S1 * S2.
+
int SDL_imageFilterAbsDiff(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using AbsDiff: D = | S1 - S2 |.
+
int SDL_imageFilterBitOr(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using BitOr: D = S1 | S2.
+
int SDL_imageFilterAdd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Add: D = saturation255(S1 + S2)
+
int SDL_imageFilterMultDivby2(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using MultDivby2: D = saturation255(S1/2 * S2)
+
void SDL_imageFilterMMXoff()
Disable MMX check for filter functions and and force to use non-MMX C based code. ...
+
int SDL_imageFilterBitAnd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using BitAnd: D = S1 & S2.
+
int SDL_imageFilterShiftRightUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N)
+
int SDL_imageFilterShiftLeft(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter ShiftLeft: D = saturation255(S << N)
+
int SDL_imageFilterMult(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Mult: D = saturation255(S1 * S2)
+
int SDL_imageFilterSub(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Sub: D = saturation0(S1 - S2)
+
int SDL_imageFilterAddByteToHalf(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using AddByteToHalf: D = saturation255(S/2 + C)
+
int SDL_imageFilterSobelX(unsigned char *Src, unsigned char *Dest, int rows, int columns)
Filter using SobelX: Dij = saturation255( ... )
+
int SDL_imageFilterNormalizeLinear(unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin, int Cmax, int Nmin, int Nmax)
Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin) ...
+
int SDL_imageFilterMMXdetect(void)
MMX detection routine (with override flag).
+ +
int SDL_imageFilterShiftLeftUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftLeftUint: D = ((uint)S << N)
+
int SDL_imageFilterSubByteMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned char C)
Internal MMX Filter using SubByte: D = saturation0(S - C)
+
int SDL_imageFilterConvolveKernel7x7ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
Filter using ConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
+
int SDL_imageFilterBitNegation(unsigned char *Src1, unsigned char *Dest, unsigned int length)
Filter using BitNegation: D = !S.
+
int SDL_imageFilterConvolveKernel5x5ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
Filter using ConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
+
int SDL_imageFilterShiftRightAndMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N, unsigned char C)
Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C)
+
int SDL_imageFilterAddByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using AddByte: D = saturation255(S + C)
+
int SDL_imageFilterConvolveKernel3x3Divide(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char Divisor)
Filter using ConvolveKernel3x3Divide: Dij = saturation0and255( ... )
+
void SDL_imageFilterRestoreStack(void)
Restore previously aligned stack.
+
void SDL_imageFilterAlignStack(void)
Align stack to 32 byte boundary,.
+
int SDL_imageFilterConvolveKernel9x9ShiftRight(unsigned char *Src, unsigned char *Dest, int rows, int columns, signed short *Kernel, unsigned char NRightShift)
Filter using ConvolveKernel9x9ShiftRight: Dij = saturation255( ... )
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html new file mode 100755 index 000000000..c98c31f35 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html @@ -0,0 +1,1671 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.h File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Macros

#define SDL2_IMAGEFILTER_SCOPE   extern
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMMXdetect (void)
 MMX detection routine (with override flag). More...
 
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXoff (void)
 Disable MMX check for filter functions and and force to use non-MMX C based code. More...
 
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXon (void)
 Enable MMX check for filter functions and use MMX code if available. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAdd (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Add: D = saturation255(S1 + S2) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMean (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Mean: D = S1/2 + S2/2. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSub (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Sub: D = saturation0(S1 - S2) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAbsDiff (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using AbsDiff: D = | S1 - S2 |. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMult (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Mult: D = saturation255(S1 * S2) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultNor (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultNor: D = S1 * S2. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby2 (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultDivby2: D = saturation255(S1/2 * S2) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby4 (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultDivby4: D = saturation255(S1/2 * S2/2) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitAnd (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using BitAnd: D = S1 & S2. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitOr (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using BitOr: D = S1 | S2. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterDiv (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Div: D = S1 / S2. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitNegation (unsigned char *Src1, unsigned char *Dest, unsigned int length)
 Filter using BitNegation: D = !S. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using AddByte: D = saturation255(S + C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
 Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByteToHalf (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using AddByteToHalf: D = saturation255(S/2 + C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using SubByte: D = saturation0(S - C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
 Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRight (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftRight: D = saturation0(S >> N) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultByByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using MultByByte: D = saturation255(S * C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightAndMultByByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N, unsigned char C)
 Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftLeftByte: D = (S << N) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftLeftUint: D = ((uint)S << N) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeft (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter ShiftLeft: D = saturation255(S << N) More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBinarizeUsingThreshold (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char T)
 Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterClipToRange (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char Tmin, unsigned char Tmax)
 Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax. More...
 
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterNormalizeLinear (unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin, int Cmax, int Nmin, int Nmax)
 Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin) More...
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define SDL2_IMAGEFILTER_SCOPE   extern
+
+ +

Definition at line 50 of file SDL2_imageFilter.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAbsDiff (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using AbsDiff: D = | S1 - S2 |.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 542 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAdd (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Add: D = saturation255(S1 + S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 173 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using AddByte: D = saturation255(S + C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant value to add (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1791 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByteToHalf (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using AddByteToHalf: D = saturation255(S/2 + C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to add (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2068 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned int C 
)
+
+ +

Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to add (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1919 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBinarizeUsingThreshold (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char T 
)
+
+ +

Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0.

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
TThe threshold boundary (inclusive).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3534 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitAnd (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using BitAnd: D = S1 & S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1278 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitNegation (unsigned char * Src1,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using BitNegation: D = !S.

+
Parameters
+ + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1671 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitOr (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using BitOr: D = S1 | S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1392 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterClipToRange (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char Tmin,
unsigned char Tmax 
)
+
+ +

Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.

+
Parameters
+ + + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
TminLower (inclusive) boundary of the clipping range.
TmaxUpper (inclusive) boundary of the clipping range.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3691 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterDiv (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Div: D = S1 / S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1549 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMean (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Mean: D = S1/2 + S2/2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 308 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMMXdetect (void )
+
+ +

MMX detection routine (with override flag).

+
Returns
1 of MMX was detected, 0 otherwise.
+ +

Definition at line 80 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXoff (void )
+
+ +

Disable MMX check for filter functions and and force to use non-MMX C based code.

+ +

Definition at line 93 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + +
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXon (void )
+
+ +

Enable MMX check for filter functions and use MMX code if available.

+ +

Definition at line 101 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMult (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Mult: D = saturation255(S1 * S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 729 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultByByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using MultByByte: D = saturation255(S * C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
CConstant to multiply with (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2790 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby2 (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using MultDivby2: D = saturation255(S1/2 * S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1000 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby4 (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using MultDivby4: D = saturation255(S1/2 * S2/2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 1141 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultNor (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using MultNor: D = S1 * S2.

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 862 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterNormalizeLinear (unsigned char * Src,
unsigned char * Dest,
unsigned int length,
int Cmin,
int Cmax,
int Nmin,
int Nmax 
)
+
+ +

Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)

+
Parameters
+ + + + + + + + +
SrcPointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CminNormalization constant.
CmaxNormalization constant.
NminNormalization constant.
NmaxNormalization constant.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3909 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeft (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter ShiftLeft: D = saturation255(S << N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3393 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftLeftByte: D = (S << N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3093 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftLeftUint: D = ((uint)S << N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 32.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 3210 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRight (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftRight: D = saturation0(S >> N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2476 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightAndMultByByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N,
unsigned char C 
)
+
+ +

Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C)

+
Parameters
+ + + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
CConstant to multiply with (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2943 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char N 
)
+
+ +

Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 32.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2594 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSub (unsigned char * Src1,
unsigned char * Src2,
unsigned char * Dest,
unsigned int length 
)
+
+ +

Filter using Sub: D = saturation0(S1 - S2)

+
Parameters
+ + + + + +
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 422 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubByte (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned char C 
)
+
+ +

Filter using SubByte: D = saturation0(S - C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
CConstant to subtract (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2196 of file SDL2_imageFilter.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubUint (unsigned char * Src1,
unsigned char * Dest,
unsigned int length,
unsigned int C 
)
+
+ +

Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)

+
Parameters
+ + + + + +
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to subtract (C).
+
+
+
Returns
Returns 0 for success or -1 for error.
+ +

Definition at line 2325 of file SDL2_imageFilter.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h_source.html new file mode 100755 index 000000000..e063ac959 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h_source.html @@ -0,0 +1,255 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.h Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_imageFilter.h
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_imageFilter.h: byte-image "filter" routines
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #ifndef _SDL2_imageFilter_h
+
31 #define _SDL2_imageFilter_h
+
32 
+
33 /* Set up for C function definitions, even when using C++ */
+
34 #ifdef __cplusplus
+
35 extern "C" {
+
36 #endif
+
37 
+
38  /* ---- Function Prototypes */
+
39 
+
40 #ifdef _MSC_VER
+
41 # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT)
+
42 # define SDL2_IMAGEFILTER_SCOPE __declspec(dllexport)
+
43 # else
+
44 # ifdef LIBSDL2_GFX_DLL_IMPORT
+
45 # define SDL2_IMAGEFILTER_SCOPE __declspec(dllimport)
+
46 # endif
+
47 # endif
+
48 #endif
+
49 #ifndef SDL2_IMAGEFILTER_SCOPE
+
50 # define SDL2_IMAGEFILTER_SCOPE extern
+
51 #endif
+
52 
+
53  /* Comments: */
+
54  /* 1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. */
+
55  /* 2.) Data that is not within an 8 byte boundary is processed using the C routine. */
+
56  /* 3.) Convolution routines do not have C routines at this time. */
+
57 
+
58  // Detect MMX capability in CPU
+ +
60 
+
61  // Force use of MMX off (or turn possible use back on)
+ + +
64 
+
65  //
+
66  // All routines return:
+
67  // 0 OK
+
68  // -1 Error (internal error, parameter error)
+
69  //
+
70 
+
71  // SDL_imageFilterAdd: D = saturation255(S1 + S2)
+
72  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAdd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
73 
+
74  // SDL_imageFilterMean: D = S1/2 + S2/2
+
75  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMean(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
76 
+
77  // SDL_imageFilterSub: D = saturation0(S1 - S2)
+
78  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSub(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
79 
+
80  // SDL_imageFilterAbsDiff: D = | S1 - S2 |
+
81  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAbsDiff(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
82 
+
83  // SDL_imageFilterMult: D = saturation(S1 * S2)
+
84  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMult(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
85 
+
86  // SDL_imageFilterMultNor: D = S1 * S2 (non-MMX)
+
87  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultNor(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
88 
+
89  // SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
+
90  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby2(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest,
+
91  unsigned int length);
+
92 
+
93  // SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
+
94  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby4(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest,
+
95  unsigned int length);
+
96 
+
97  // SDL_imageFilterBitAnd: D = S1 & S2
+
98  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitAnd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
99 
+
100  // SDL_imageFilterBitOr: D = S1 | S2
+
101  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitOr(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
102 
+
103  // SDL_imageFilterDiv: D = S1 / S2 (non-MMX)
+
104  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterDiv(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length);
+
105 
+
106  // SDL_imageFilterBitNegation: D = !S
+
107  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitNegation(unsigned char *Src1, unsigned char *Dest, unsigned int length);
+
108 
+
109  // SDL_imageFilterAddByte: D = saturation255(S + C)
+
110  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C);
+
111 
+
112  // SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
+
113  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C);
+
114 
+
115  // SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
+
116  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByteToHalf(unsigned char *Src1, unsigned char *Dest, unsigned int length,
+
117  unsigned char C);
+
118 
+
119  // SDL_imageFilterSubByte: D = saturation0(S - C)
+
120  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C);
+
121 
+
122  // SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
+
123  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C);
+
124 
+
125  // SDL_imageFilterShiftRight: D = saturation0(S >> N)
+
126  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRight(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N);
+
127 
+
128  // SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
+
129  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N);
+
130 
+
131  // SDL_imageFilterMultByByte: D = saturation255(S * C)
+
132  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C);
+
133 
+
134  // SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
+
135  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightAndMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length,
+
136  unsigned char N, unsigned char C);
+
137 
+
138  // SDL_imageFilterShiftLeftByte: D = (S << N)
+
139  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftByte(unsigned char *Src1, unsigned char *Dest, unsigned int length,
+
140  unsigned char N);
+
141 
+
142  // SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
+
143  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftUint(unsigned char *Src1, unsigned char *Dest, unsigned int length,
+
144  unsigned char N);
+
145 
+
146  // SDL_imageFilterShiftLeft: D = saturation255(S << N)
+
147  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeft(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N);
+
148 
+
149  // SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
+
150  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBinarizeUsingThreshold(unsigned char *Src1, unsigned char *Dest, unsigned int length,
+
151  unsigned char T);
+
152 
+
153  // SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
+
154  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterClipToRange(unsigned char *Src1, unsigned char *Dest, unsigned int length,
+
155  unsigned char Tmin, unsigned char Tmax);
+
156 
+
157  // SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
+
158  SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterNormalizeLinear(unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin,
+
159  int Cmax, int Nmin, int Nmax);
+
160 
+
161  /* Ends C function definitions when using C++ */
+
162 #ifdef __cplusplus
+
163 }
+
164 #endif
+
165 
+
166 #endif /* _SDL_imageFilter_h */
+
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXoff(void)
Disable MMX check for filter functions and and force to use non-MMX C based code. ...
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultNor(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using MultNor: D = S1 * S2.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using MultByByte: D = saturation255(S * C)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitNegation(unsigned char *Src1, unsigned char *Dest, unsigned int length)
Filter using BitNegation: D = !S.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeft(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter ShiftLeft: D = saturation255(S << N)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMean(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Mean: D = S1/2 + S2/2.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftLeftByte: D = (S << N)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitOr(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using BitOr: D = S1 | S2.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAdd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Add: D = saturation255(S1 + S2)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using SubByte: D = saturation0(S - C)
+
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXon(void)
Enable MMX check for filter functions and use MMX code if available.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby4(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using MultDivby4: D = saturation255(S1/2 * S2/2)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightAndMultByByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N, unsigned char C)
Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByte(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using AddByte: D = saturation255(S + C)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAbsDiff(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using AbsDiff: D = | S1 - S2 |.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftLeftUint: D = ((uint)S << N)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterClipToRange(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char Tmin, unsigned char Tmax)
Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterDiv(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Div: D = S1 / S2.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByteToHalf(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
Filter using AddByteToHalf: D = saturation255(S/2 + C)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby2(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using MultDivby2: D = saturation255(S1/2 * S2)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMMXdetect(void)
MMX detection routine (with override flag).
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRight(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
Filter using ShiftRight: D = saturation0(S >> N)
+
#define SDL2_IMAGEFILTER_SCOPE
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSub(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Sub: D = saturation0(S1 - S2)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitAnd(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using BitAnd: D = S1 & S2.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBinarizeUsingThreshold(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char T)
Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0.
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMult(unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
Filter using Mult: D = saturation255(S1 * S2)
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterNormalizeLinear(unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin, int Cmax, int Nmin, int Nmax)
Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin) ...
+
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubUint(unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8c.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8c.html new file mode 100755 index 000000000..4d5080127 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8c.html @@ -0,0 +1,1190 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.c File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.c File Reference
+
+
+
#include <stdlib.h>
+#include <string.h>
+#include "SDL2_rotozoom.h"
+
+

Go to the source code of this file.

+ + + + + + + + +

+Data Structures

struct  tColorRGBA
 A 32 bit RGBA pixel. More...
 
struct  tColorY
 A 8bit Y/palette pixel. More...
 
+ + + + + + + + + + +

+Macros

#define MAX(a, b)    (((a) > (b)) ? (a) : (b))
 Returns maximum of two numbers a and b. More...
 
#define GUARD_ROWS   (2)
 Number of guard rows added to destination surfaces. More...
 
#define VALUE_LIMIT   0.001
 Lower limit of absolute zoom factor or rotation degrees. More...
 
+ + + + + + + +

+Typedefs

typedef struct tColorRGBA tColorRGBA
 A 32 bit RGBA pixel. More...
 
typedef struct tColorY tColorY
 A 8bit Y/palette pixel. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Uint32 _colorkey (SDL_Surface *src)
 Returns colorkey info for a surface. More...
 
int _shrinkSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst, int factorx, int factory)
 Internal 32 bit integer-factor averaging Shrinker. More...
 
int _shrinkSurfaceY (SDL_Surface *src, SDL_Surface *dst, int factorx, int factory)
 Internal 8 bit integer-factor averaging shrinker. More...
 
int _zoomSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy, int smooth)
 Internal 32 bit Zoomer with optional anti-aliasing by bilinear interpolation. More...
 
int _zoomSurfaceY (SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy)
 Internal 8 bit Zoomer without smoothing. More...
 
void _transformSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth)
 Internal 32 bit rotozoomer with optional anti-aliasing. More...
 
void transformSurfaceY (SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
 Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing. More...
 
SDL_Surface * rotateSurface90Degrees (SDL_Surface *src, int numClockwiseTurns)
 Rotates a 8/16/24/32 bit surface in increments of 90 degrees. More...
 
void _rotozoomSurfaceSizeTrig (int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight, double *canglezoom, double *sanglezoom)
 Internal target surface sizing function for rotozooms with trig result return. More...
 
void rotozoomSurfaceSizeXY (int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight)
 Returns the size of the resulting target surface for a rotozoomSurfaceXY() call. More...
 
void rotozoomSurfaceSize (int width, int height, double angle, double zoom, int *dstwidth, int *dstheight)
 Returns the size of the resulting target surface for a rotozoomSurface() call. More...
 
SDL_Surface * rotozoomSurface (SDL_Surface *src, double angle, double zoom, int smooth)
 Rotates and zooms a surface and optional anti-aliasing. More...
 
SDL_Surface * rotozoomSurfaceXY (SDL_Surface *src, double angle, double zoomx, double zoomy, int smooth)
 Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. More...
 
void zoomSurfaceSize (int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
 Calculates the size of the target surface for a zoomSurface() call. More...
 
SDL_Surface * zoomSurface (SDL_Surface *src, double zoomx, double zoomy, int smooth)
 Zoom a surface by independent horizontal and vertical factors with optional smoothing. More...
 
SDL_Surface * shrinkSurface (SDL_Surface *src, int factorx, int factory)
 Shrink a surface by an integer ratio using averaging. More...
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define GUARD_ROWS   (2)
+
+ +

Number of guard rows added to destination surfaces.

+

This is a simple but effective workaround for observed issues. These rows allocate extra memory and are then hidden from the surface. Rows are added to the end of destination surfaces when they are allocated. This catches any potential overflows which seem to happen with just the right src image dimensions and scale/rotation and can lead to a situation where the program can segfault.

+ +

Definition at line 73 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
#define MAX( a,
 
)   (((a) > (b)) ? (a) : (b))
+
+ +

Returns maximum of two numbers a and b.

+ +

Definition at line 61 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + +
#define VALUE_LIMIT   0.001
+
+ +

Lower limit of absolute zoom factor or rotation degrees.

+ +

Definition at line 78 of file SDL2_rotozoom.c.

+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef struct tColorRGBA tColorRGBA
+
+ +

A 32 bit RGBA pixel.

+ +
+
+ +
+
+ + + + +
typedef struct tColorY tColorY
+
+ +

A 8bit Y/palette pixel.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
Uint32 _colorkey (SDL_Surface * src)
+
+ +

Returns colorkey info for a surface.

+ +

Definition at line 83 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void _rotozoomSurfaceSizeTrig (int width,
int height,
double angle,
double zoomx,
double zoomy,
int * dstwidth,
int * dstheight,
double * canglezoom,
double * sanglezoom 
)
+
+ +

Internal target surface sizing function for rotozooms with trig result return.

+
Parameters
+ + + + + + + + + + +
widthThe source surface width.
heightThe source surface height.
angleThe angle to rotate in degrees.
zoomxThe horizontal scaling factor.
zoomyThe vertical scaling factor.
dstwidthThe calculated width of the destination surface.
dstheightThe calculated height of the destination surface.
canglezoomThe sine of the angle adjusted by the zoom factor.
sanglezoomThe cosine of the angle adjusted by the zoom factor.
+
+
+ +

Definition at line 954 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _shrinkSurfaceRGBA (SDL_Surface * src,
SDL_Surface * dst,
int factorx,
int factory 
)
+
+ +

Internal 32 bit integer-factor averaging Shrinker.

+

Shrinks 32 bit RGBA/ABGR 'src' surface to 'dst' surface. Averages color and alpha values values of src pixels to calculate dst pixels. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions.

+
Parameters
+ + + + + +
srcThe surface to shrink (input).
dstThe shrunken surface (output).
factorxThe horizontal shrinking ratio.
factoryThe vertical shrinking ratio.
+
+
+
Returns
0 for success or -1 for error.
+ +

Definition at line 106 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _shrinkSurfaceY (SDL_Surface * src,
SDL_Surface * dst,
int factorx,
int factory 
)
+
+ +

Internal 8 bit integer-factor averaging shrinker.

+

Shrinks 8bit Y 'src' surface to 'dst' surface. Averages color (brightness) values values of src pixels to calculate dst pixels. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions.

+
Parameters
+ + + + + +
srcThe surface to shrink (input).
dstThe shrunken surface (output).
factorxThe horizontal shrinking ratio.
factoryThe vertical shrinking ratio.
+
+
+
Returns
0 for success or -1 for error.
+ +

Definition at line 194 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void _transformSurfaceRGBA (SDL_Surface * src,
SDL_Surface * dst,
int cx,
int cy,
int isin,
int icos,
int flipx,
int flipy,
int smooth 
)
+
+ +

Internal 32 bit rotozoomer with optional anti-aliasing.

+

Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control parameters by scanning the destination surface and applying optionally anti-aliasing by bilinear interpolation. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions.

+
Parameters
+ + + + + + + + + + +
srcSource surface.
dstDestination surface.
cxHorizontal center coordinate.
cyVertical center coordinate.
isinInteger version of sine of angle.
icosInteger version of cosine of angle.
flipxFlag indicating horizontal mirroring should be applied.
flipyFlag indicating vertical mirroring should be applied.
smoothFlag indicating anti-aliasing should be used.
+
+
+ +

Definition at line 629 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _zoomSurfaceRGBA (SDL_Surface * src,
SDL_Surface * dst,
int flipx,
int flipy,
int smooth 
)
+
+ +

Internal 32 bit Zoomer with optional anti-aliasing by bilinear interpolation.

+

Zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions.

+
Parameters
+ + + + + + +
srcThe surface to zoom (input).
dstThe zoomed surface (output).
flipxFlag indicating if the image should be horizontally flipped.
flipyFlag indicating if the image should be vertically flipped.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
0 for success or -1 for error.
+ +

Definition at line 277 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int _zoomSurfaceY (SDL_Surface * src,
SDL_Surface * dst,
int flipx,
int flipy 
)
+
+ +

Internal 8 bit Zoomer without smoothing.

+

Zooms 8bit palette/Y 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions.

+
Parameters
+ + + + + +
srcThe surface to zoom (input).
dstThe zoomed surface (output).
flipxFlag indicating if the image should be horizontally flipped.
flipyFlag indicating if the image should be vertically flipped.
+
+
+
Returns
0 for success or -1 for error.
+ +

Definition at line 510 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
SDL_Surface* rotateSurface90Degrees (SDL_Surface * src,
int numClockwiseTurns 
)
+
+ +

Rotates a 8/16/24/32 bit surface in increments of 90 degrees.

+

Specialized 90 degree rotator which rotates a 'src' surface in 90 degree increments clockwise returning a new surface. Faster than rotozoomer since no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit. (code contributed by J. Schiller, improved by C. Allport and A. Schiffler)

+
Parameters
+ + + +
srcSource surface to rotate.
numClockwiseTurnsNumber of clockwise 90 degree turns to apply to the source.
+
+
+
Returns
The new, rotated surface; or NULL for surfaces with incorrect input format.
+ +

Definition at line 803 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL_Surface* rotozoomSurface (SDL_Surface * src,
double angle,
double zoom,
int smooth 
)
+
+ +

Rotates and zooms a surface and optional anti-aliasing.

+

Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.

+
Parameters
+ + + + + +
srcThe surface to rotozoom.
angleThe angle to rotate in degrees.
zoomThe scaling factor.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
The new rotozoomed surface.
+ +

Definition at line 1035 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void rotozoomSurfaceSize (int width,
int height,
double angle,
double zoom,
int * dstwidth,
int * dstheight 
)
+
+ +

Returns the size of the resulting target surface for a rotozoomSurface() call.

+
Parameters
+ + + + + + + +
widthThe source surface width.
heightThe source surface height.
angleThe angle to rotate in degrees.
zoomThe scaling factor.
dstwidthThe calculated width of the rotozoomed destination surface.
dstheightThe calculated height of the rotozoomed destination surface.
+
+
+ +

Definition at line 1013 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void rotozoomSurfaceSizeXY (int width,
int height,
double angle,
double zoomx,
double zoomy,
int * dstwidth,
int * dstheight 
)
+
+ +

Returns the size of the resulting target surface for a rotozoomSurfaceXY() call.

+
Parameters
+ + + + + + + + +
widthThe source surface width.
heightThe source surface height.
angleThe angle to rotate in degrees.
zoomxThe horizontal scaling factor.
zoomyThe vertical scaling factor.
dstwidthThe calculated width of the rotozoomed destination surface.
dstheightThe calculated height of the rotozoomed destination surface.
+
+
+ +

Definition at line 996 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL_Surface* rotozoomSurfaceXY (SDL_Surface * src,
double angle,
double zoomx,
double zoomy,
int smooth 
)
+
+ +

Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.

+

Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.

+
Parameters
+ + + + + + +
srcThe surface to rotozoom.
angleThe angle to rotate in degrees.
zoomxThe horizontal scaling factor.
zoomyThe vertical scaling factor.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
The new rotozoomed surface.
+ +

Definition at line 1056 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
SDL_Surface* shrinkSurface (SDL_Surface * src,
int factorx,
int factory 
)
+
+ +

Shrink a surface by an integer ratio using averaging.

+

Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface. 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size, 3=1/3 the size, etc.) The destination surface is antialiased by averaging the source box RGBA or Y information. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. The input surface is not modified. The output surface is newly allocated.

+
Parameters
+ + + + +
srcThe surface to shrink.
factorxThe horizontal shrinking ratio.
factoryThe vertical shrinking ratio.
+
+
+
Returns
The new, shrunken surface.
+ +

Definition at line 1512 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void transformSurfaceY (SDL_Surface * src,
SDL_Surface * dst,
int cx,
int cy,
int isin,
int icos,
int flipx,
int flipy 
)
+
+ +

Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing.

+

Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control parameters by scanning the destination surface. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions.

+
Parameters
+ + + + + + + + + +
srcSource surface.
dstDestination surface.
cxHorizontal center coordinate.
cyVertical center coordinate.
isinInteger version of sine of angle.
icosInteger version of cosine of angle.
flipxFlag indicating horizontal mirroring should be applied.
flipyFlag indicating vertical mirroring should be applied.
+
+
+ +

Definition at line 746 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL_Surface* zoomSurface (SDL_Surface * src,
double zoomx,
double zoomy,
int smooth 
)
+
+ +

Zoom a surface by independent horizontal and vertical factors with optional smoothing.

+

Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is on then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. If zoom factors are negative, the image is flipped on the axes.

+
Parameters
+ + + + + +
srcThe surface to zoom.
zoomxThe horizontal zoom factor.
zoomyThe vertical zoom factor.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
The new, zoomed surface.
+ +

Definition at line 1361 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void zoomSurfaceSize (int width,
int height,
double zoomx,
double zoomy,
int * dstwidth,
int * dstheight 
)
+
+ +

Calculates the size of the target surface for a zoomSurface() call.

+

The minimum size of the target surface is 1. The input factors can be positive or negative.

+
Parameters
+ + + + + + + +
widthThe width of the source surface to zoom.
heightThe height of the source surface to zoom.
zoomxThe horizontal zoom factor.
zoomyThe vertical zoom factor.
dstwidthPointer to an integer to store the calculated width of the zoomed target surface.
dstheightPointer to an integer to store the calculated height of the zoomed target surface.
+
+
+ +

Definition at line 1311 of file SDL2_rotozoom.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8c_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8c_source.html new file mode 100755 index 000000000..97f86e863 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8c_source.html @@ -0,0 +1,1506 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.c Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.c
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #ifdef WIN32
+
31 #include <windows.h>
+
32 #endif
+
33 
+
34 #include <stdlib.h>
+
35 #include <string.h>
+
36 
+
37 #include "SDL2_rotozoom.h"
+
38 
+
39 /* ---- Internally used structures */
+
40 
+
44 typedef struct tColorRGBA {
+
45  Uint8 r;
+
46  Uint8 g;
+
47  Uint8 b;
+
48  Uint8 a;
+
49 } tColorRGBA;
+
50 
+
54 typedef struct tColorY {
+
55  Uint8 y;
+
56 } tColorY;
+
57 
+
61 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
+
62 
+
73 #define GUARD_ROWS (2)
+
74 
+
78 #define VALUE_LIMIT 0.001
+
79 
+
83 Uint32 _colorkey(SDL_Surface *src)
+
84 {
+
85  Uint32 key = 0;
+
86  SDL_GetColorKey(src, &key);
+
87  return key;
+
88 }
+
89 
+
90 
+
106 int _shrinkSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int factorx, int factory)
+
107 {
+
108  int x, y, dx, dy, dgap, ra, ga, ba, aa;
+
109  int n_average;
+
110  tColorRGBA *sp, *osp, *oosp;
+
111  tColorRGBA *dp;
+
112 
+
113  /*
+
114  * Averaging integer shrink
+
115  */
+
116 
+
117  /* Precalculate division factor */
+
118  n_average = factorx*factory;
+
119 
+
120  /*
+
121  * Scan destination
+
122  */
+
123  sp = (tColorRGBA *) src->pixels;
+
124 
+
125  dp = (tColorRGBA *) dst->pixels;
+
126  dgap = dst->pitch - dst->w * 4;
+
127 
+
128  for (y = 0; y < dst->h; y++) {
+
129 
+
130  osp=sp;
+
131  for (x = 0; x < dst->w; x++) {
+
132 
+
133  /* Trace out source box and accumulate */
+
134  oosp=sp;
+
135  ra=ga=ba=aa=0;
+
136  for (dy=0; dy < factory; dy++) {
+
137  for (dx=0; dx < factorx; dx++) {
+
138  ra += sp->r;
+
139  ga += sp->g;
+
140  ba += sp->b;
+
141  aa += sp->a;
+
142 
+
143  sp++;
+
144  }
+
145  /* src dx loop */
+
146  sp = (tColorRGBA *)((Uint8*)sp + (src->pitch - 4*factorx)); // next y
+
147  }
+
148  /* src dy loop */
+
149 
+
150  /* next box-x */
+
151  sp = (tColorRGBA *)((Uint8*)oosp + 4*factorx);
+
152 
+
153  /* Store result in destination */
+
154  dp->r = ra/n_average;
+
155  dp->g = ga/n_average;
+
156  dp->b = ba/n_average;
+
157  dp->a = aa/n_average;
+
158 
+
159  /*
+
160  * Advance destination pointer
+
161  */
+
162  dp++;
+
163  }
+
164  /* dst x loop */
+
165 
+
166  /* next box-y */
+
167  sp = (tColorRGBA *)((Uint8*)osp + src->pitch*factory);
+
168 
+
169  /*
+
170  * Advance destination pointers
+
171  */
+
172  dp = (tColorRGBA *) ((Uint8 *) dp + dgap);
+
173  }
+
174  /* dst y loop */
+
175 
+
176  return (0);
+
177 }
+
178 
+
194 int _shrinkSurfaceY(SDL_Surface * src, SDL_Surface * dst, int factorx, int factory)
+
195 {
+
196  int x, y, dx, dy, dgap, a;
+
197  int n_average;
+
198  Uint8 *sp, *osp, *oosp;
+
199  Uint8 *dp;
+
200 
+
201  /*
+
202  * Averaging integer shrink
+
203  */
+
204 
+
205  /* Precalculate division factor */
+
206  n_average = factorx*factory;
+
207 
+
208  /*
+
209  * Scan destination
+
210  */
+
211  sp = (Uint8 *) src->pixels;
+
212 
+
213  dp = (Uint8 *) dst->pixels;
+
214  dgap = dst->pitch - dst->w;
+
215 
+
216  for (y = 0; y < dst->h; y++) {
+
217 
+
218  osp=sp;
+
219  for (x = 0; x < dst->w; x++) {
+
220 
+
221  /* Trace out source box and accumulate */
+
222  oosp=sp;
+
223  a=0;
+
224  for (dy=0; dy < factory; dy++) {
+
225  for (dx=0; dx < factorx; dx++) {
+
226  a += (*sp);
+
227  /* next x */
+
228  sp++;
+
229  }
+
230  /* end src dx loop */
+
231  /* next y */
+
232  sp = (Uint8 *)((Uint8*)sp + (src->pitch - factorx));
+
233  }
+
234  /* end src dy loop */
+
235 
+
236  /* next box-x */
+
237  sp = (Uint8 *)((Uint8*)oosp + factorx);
+
238 
+
239  /* Store result in destination */
+
240  *dp = a/n_average;
+
241 
+
242  /*
+
243  * Advance destination pointer
+
244  */
+
245  dp++;
+
246  }
+
247  /* end dst x loop */
+
248 
+
249  /* next box-y */
+
250  sp = (Uint8 *)((Uint8*)osp + src->pitch*factory);
+
251 
+
252  /*
+
253  * Advance destination pointers
+
254  */
+
255  dp = (Uint8 *)((Uint8 *)dp + dgap);
+
256  }
+
257  /* end dst y loop */
+
258 
+
259  return (0);
+
260 }
+
261 
+
277 int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int flipy, int smooth)
+
278 {
+
279  int x, y, sx, sy, ssx, ssy, *sax, *say, *csax, *csay, *salast, csx, csy, ex, ey, cx, cy, sstep, sstepx, sstepy;
+
280  tColorRGBA *c00, *c01, *c10, *c11;
+
281  tColorRGBA *sp, *csp, *dp;
+
282  int spixelgap, spixelw, spixelh, dgap, t1, t2;
+
283 
+
284  /*
+
285  * Allocate memory for row/column increments
+
286  */
+
287  if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) {
+
288  return (-1);
+
289  }
+
290  if ((say = (int *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) {
+
291  free(sax);
+
292  return (-1);
+
293  }
+
294 
+
295  /*
+
296  * Precalculate row increments
+
297  */
+
298  spixelw = (src->w - 1);
+
299  spixelh = (src->h - 1);
+
300  if (smooth) {
+
301  sx = (int) (65536.0 * (float) spixelw / (float) (dst->w - 1));
+
302  sy = (int) (65536.0 * (float) spixelh / (float) (dst->h - 1));
+
303  } else {
+
304  sx = (int) (65536.0 * (float) (src->w) / (float) (dst->w));
+
305  sy = (int) (65536.0 * (float) (src->h) / (float) (dst->h));
+
306  }
+
307 
+
308  /* Maximum scaled source size */
+
309  ssx = (src->w << 16) - 1;
+
310  ssy = (src->h << 16) - 1;
+
311 
+
312  /* Precalculate horizontal row increments */
+
313  csx = 0;
+
314  csax = sax;
+
315  for (x = 0; x <= dst->w; x++) {
+
316  *csax = csx;
+
317  csax++;
+
318  csx += sx;
+
319 
+
320  /* Guard from overflows */
+
321  if (csx > ssx) {
+
322  csx = ssx;
+
323  }
+
324  }
+
325 
+
326  /* Precalculate vertical row increments */
+
327  csy = 0;
+
328  csay = say;
+
329  for (y = 0; y <= dst->h; y++) {
+
330  *csay = csy;
+
331  csay++;
+
332  csy += sy;
+
333 
+
334  /* Guard from overflows */
+
335  if (csy > ssy) {
+
336  csy = ssy;
+
337  }
+
338  }
+
339 
+
340  sp = (tColorRGBA *) src->pixels;
+
341  dp = (tColorRGBA *) dst->pixels;
+
342  dgap = dst->pitch - dst->w * 4;
+
343  spixelgap = src->pitch/4;
+
344 
+
345  if (flipx) sp += spixelw;
+
346  if (flipy) sp += (spixelgap * spixelh);
+
347 
+
348  /*
+
349  * Switch between interpolating and non-interpolating code
+
350  */
+
351  if (smooth) {
+
352 
+
353  /*
+
354  * Interpolating Zoom
+
355  */
+
356  csay = say;
+
357  for (y = 0; y < dst->h; y++) {
+
358  csp = sp;
+
359  csax = sax;
+
360  for (x = 0; x < dst->w; x++) {
+
361  /*
+
362  * Setup color source pointers
+
363  */
+
364  ex = (*csax & 0xffff);
+
365  ey = (*csay & 0xffff);
+
366  cx = (*csax >> 16);
+
367  cy = (*csay >> 16);
+
368  sstepx = cx < spixelw;
+
369  sstepy = cy < spixelh;
+
370  c00 = sp;
+
371  c01 = sp;
+
372  c10 = sp;
+
373  if (sstepy) {
+
374  if (flipy) {
+
375  c10 -= spixelgap;
+
376  } else {
+
377  c10 += spixelgap;
+
378  }
+
379  }
+
380  c11 = c10;
+
381  if (sstepx) {
+
382  if (flipx) {
+
383  c01--;
+
384  c11--;
+
385  } else {
+
386  c01++;
+
387  c11++;
+
388  }
+
389  }
+
390 
+
391  /*
+
392  * Draw and interpolate colors
+
393  */
+
394  t1 = ((((c01->r - c00->r) * ex) >> 16) + c00->r) & 0xff;
+
395  t2 = ((((c11->r - c10->r) * ex) >> 16) + c10->r) & 0xff;
+
396  dp->r = (((t2 - t1) * ey) >> 16) + t1;
+
397  t1 = ((((c01->g - c00->g) * ex) >> 16) + c00->g) & 0xff;
+
398  t2 = ((((c11->g - c10->g) * ex) >> 16) + c10->g) & 0xff;
+
399  dp->g = (((t2 - t1) * ey) >> 16) + t1;
+
400  t1 = ((((c01->b - c00->b) * ex) >> 16) + c00->b) & 0xff;
+
401  t2 = ((((c11->b - c10->b) * ex) >> 16) + c10->b) & 0xff;
+
402  dp->b = (((t2 - t1) * ey) >> 16) + t1;
+
403  t1 = ((((c01->a - c00->a) * ex) >> 16) + c00->a) & 0xff;
+
404  t2 = ((((c11->a - c10->a) * ex) >> 16) + c10->a) & 0xff;
+
405  dp->a = (((t2 - t1) * ey) >> 16) + t1;
+
406  /*
+
407  * Advance source pointer x
+
408  */
+
409  salast = csax;
+
410  csax++;
+
411  sstep = (*csax >> 16) - (*salast >> 16);
+
412  if (flipx) {
+
413  sp -= sstep;
+
414  } else {
+
415  sp += sstep;
+
416  }
+
417 
+
418  /*
+
419  * Advance destination pointer x
+
420  */
+
421  dp++;
+
422  }
+
423  /*
+
424  * Advance source pointer y
+
425  */
+
426  salast = csay;
+
427  csay++;
+
428  sstep = (*csay >> 16) - (*salast >> 16);
+
429  sstep *= spixelgap;
+
430  if (flipy) {
+
431  sp = csp - sstep;
+
432  } else {
+
433  sp = csp + sstep;
+
434  }
+
435 
+
436  /*
+
437  * Advance destination pointer y
+
438  */
+
439  dp = (tColorRGBA *) ((Uint8 *) dp + dgap);
+
440  }
+
441  } else {
+
442  /*
+
443  * Non-Interpolating Zoom
+
444  */
+
445  csay = say;
+
446  for (y = 0; y < dst->h; y++) {
+
447  csp = sp;
+
448  csax = sax;
+
449  for (x = 0; x < dst->w; x++) {
+
450  /*
+
451  * Draw
+
452  */
+
453  *dp = *sp;
+
454 
+
455  /*
+
456  * Advance source pointer x
+
457  */
+
458  salast = csax;
+
459  csax++;
+
460  sstep = (*csax >> 16) - (*salast >> 16);
+
461  if (flipx) sstep = -sstep;
+
462  sp += sstep;
+
463 
+
464  /*
+
465  * Advance destination pointer x
+
466  */
+
467  dp++;
+
468  }
+
469  /*
+
470  * Advance source pointer y
+
471  */
+
472  salast = csay;
+
473  csay++;
+
474  sstep = (*csay >> 16) - (*salast >> 16);
+
475  sstep *= spixelgap;
+
476  if (flipy) sstep = -sstep;
+
477  sp = csp + sstep;
+
478 
+
479  /*
+
480  * Advance destination pointer y
+
481  */
+
482  dp = (tColorRGBA *) ((Uint8 *) dp + dgap);
+
483  }
+
484  }
+
485 
+
486  /*
+
487  * Remove temp arrays
+
488  */
+
489  free(sax);
+
490  free(say);
+
491 
+
492  return (0);
+
493 }
+
494 
+
510 int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int flipy)
+
511 {
+
512  int x, y;
+
513  Uint32 *sax, *say, *csax, *csay;
+
514  int csx, csy;
+
515  Uint8 *sp, *dp, *csp;
+
516  int dgap;
+
517 
+
518  /*
+
519  * Allocate memory for row increments
+
520  */
+
521  if ((sax = (Uint32 *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) {
+
522  return (-1);
+
523  }
+
524  if ((say = (Uint32 *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) {
+
525  free(sax);
+
526  return (-1);
+
527  }
+
528 
+
529  /*
+
530  * Pointer setup
+
531  */
+
532  sp = csp = (Uint8 *) src->pixels;
+
533  dp = (Uint8 *) dst->pixels;
+
534  dgap = dst->pitch - dst->w;
+
535 
+
536  if (flipx) csp += (src->w-1);
+
537  if (flipy) csp = ( (Uint8*)csp + src->pitch*(src->h-1) );
+
538 
+
539  /*
+
540  * Precalculate row increments
+
541  */
+
542  csx = 0;
+
543  csax = sax;
+
544  for (x = 0; x < dst->w; x++) {
+
545  csx += src->w;
+
546  *csax = 0;
+
547  while (csx >= dst->w) {
+
548  csx -= dst->w;
+
549  (*csax)++;
+
550  }
+
551  (*csax) = (*csax) * (flipx ? -1 : 1);
+
552  csax++;
+
553  }
+
554  csy = 0;
+
555  csay = say;
+
556  for (y = 0; y < dst->h; y++) {
+
557  csy += src->h;
+
558  *csay = 0;
+
559  while (csy >= dst->h) {
+
560  csy -= dst->h;
+
561  (*csay)++;
+
562  }
+
563  (*csay) = (*csay) * (flipy ? -1 : 1);
+
564  csay++;
+
565  }
+
566 
+
567  /*
+
568  * Draw
+
569  */
+
570  csay = say;
+
571  for (y = 0; y < dst->h; y++) {
+
572  csax = sax;
+
573  sp = csp;
+
574  for (x = 0; x < dst->w; x++) {
+
575  /*
+
576  * Draw
+
577  */
+
578  *dp = *sp;
+
579  /*
+
580  * Advance source pointers
+
581  */
+
582  sp += (*csax);
+
583  csax++;
+
584  /*
+
585  * Advance destination pointer
+
586  */
+
587  dp++;
+
588  }
+
589  /*
+
590  * Advance source pointer (for row)
+
591  */
+
592  csp += ((*csay) * src->pitch);
+
593  csay++;
+
594 
+
595  /*
+
596  * Advance destination pointers
+
597  */
+
598  dp += dgap;
+
599  }
+
600 
+
601  /*
+
602  * Remove temp arrays
+
603  */
+
604  free(sax);
+
605  free(say);
+
606 
+
607  return (0);
+
608 }
+
609 
+
629 void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth)
+
630 {
+
631  int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh;
+
632  tColorRGBA c00, c01, c10, c11, cswap;
+
633  tColorRGBA *pc, *sp;
+
634  int gap;
+
635 
+
636  /*
+
637  * Variable setup
+
638  */
+
639  xd = ((src->w - dst->w) << 15);
+
640  yd = ((src->h - dst->h) << 15);
+
641  ax = (cx << 16) - (icos * cx);
+
642  ay = (cy << 16) - (isin * cx);
+
643  sw = src->w - 1;
+
644  sh = src->h - 1;
+
645  pc = (tColorRGBA*) dst->pixels;
+
646  gap = dst->pitch - dst->w * 4;
+
647 
+
648  /*
+
649  * Switch between interpolating and non-interpolating code
+
650  */
+
651  if (smooth) {
+
652  for (y = 0; y < dst->h; y++) {
+
653  dy = cy - y;
+
654  sdx = (ax + (isin * dy)) + xd;
+
655  sdy = (ay - (icos * dy)) + yd;
+
656  for (x = 0; x < dst->w; x++) {
+
657  dx = (sdx >> 16);
+
658  dy = (sdy >> 16);
+
659  if (flipx) dx = sw - dx;
+
660  if (flipy) dy = sh - dy;
+
661  if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) {
+
662  sp = (tColorRGBA *)src->pixels;;
+
663  sp += ((src->pitch/4) * dy);
+
664  sp += dx;
+
665  c00 = *sp;
+
666  sp += 1;
+
667  c01 = *sp;
+
668  sp += (src->pitch/4);
+
669  c11 = *sp;
+
670  sp -= 1;
+
671  c10 = *sp;
+
672  if (flipx) {
+
673  cswap = c00; c00=c01; c01=cswap;
+
674  cswap = c10; c10=c11; c11=cswap;
+
675  }
+
676  if (flipy) {
+
677  cswap = c00; c00=c10; c10=cswap;
+
678  cswap = c01; c01=c11; c11=cswap;
+
679  }
+
680  /*
+
681  * Interpolate colors
+
682  */
+
683  ex = (sdx & 0xffff);
+
684  ey = (sdy & 0xffff);
+
685  t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff;
+
686  t2 = ((((c11.r - c10.r) * ex) >> 16) + c10.r) & 0xff;
+
687  pc->r = (((t2 - t1) * ey) >> 16) + t1;
+
688  t1 = ((((c01.g - c00.g) * ex) >> 16) + c00.g) & 0xff;
+
689  t2 = ((((c11.g - c10.g) * ex) >> 16) + c10.g) & 0xff;
+
690  pc->g = (((t2 - t1) * ey) >> 16) + t1;
+
691  t1 = ((((c01.b - c00.b) * ex) >> 16) + c00.b) & 0xff;
+
692  t2 = ((((c11.b - c10.b) * ex) >> 16) + c10.b) & 0xff;
+
693  pc->b = (((t2 - t1) * ey) >> 16) + t1;
+
694  t1 = ((((c01.a - c00.a) * ex) >> 16) + c00.a) & 0xff;
+
695  t2 = ((((c11.a - c10.a) * ex) >> 16) + c10.a) & 0xff;
+
696  pc->a = (((t2 - t1) * ey) >> 16) + t1;
+
697  }
+
698  sdx += icos;
+
699  sdy += isin;
+
700  pc++;
+
701  }
+
702  pc = (tColorRGBA *) ((Uint8 *) pc + gap);
+
703  }
+
704  } else {
+
705  for (y = 0; y < dst->h; y++) {
+
706  dy = cy - y;
+
707  sdx = (ax + (isin * dy)) + xd;
+
708  sdy = (ay - (icos * dy)) + yd;
+
709  for (x = 0; x < dst->w; x++) {
+
710  dx = (short) (sdx >> 16);
+
711  dy = (short) (sdy >> 16);
+
712  if (flipx) dx = (src->w-1)-dx;
+
713  if (flipy) dy = (src->h-1)-dy;
+
714  if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) {
+
715  sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy);
+
716  sp += dx;
+
717  *pc = *sp;
+
718  }
+
719  sdx += icos;
+
720  sdy += isin;
+
721  pc++;
+
722  }
+
723  pc = (tColorRGBA *) ((Uint8 *) pc + gap);
+
724  }
+
725  }
+
726 }
+
727 
+
746 void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
+
747 {
+
748  int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay;
+
749  tColorY *pc, *sp;
+
750  int gap;
+
751 
+
752  /*
+
753  * Variable setup
+
754  */
+
755  xd = ((src->w - dst->w) << 15);
+
756  yd = ((src->h - dst->h) << 15);
+
757  ax = (cx << 16) - (icos * cx);
+
758  ay = (cy << 16) - (isin * cx);
+
759  pc = (tColorY*) dst->pixels;
+
760  gap = dst->pitch - dst->w;
+
761  /*
+
762  * Clear surface to colorkey
+
763  */
+
764  memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h);
+
765  /*
+
766  * Iterate through destination surface
+
767  */
+
768  for (y = 0; y < dst->h; y++) {
+
769  dy = cy - y;
+
770  sdx = (ax + (isin * dy)) + xd;
+
771  sdy = (ay - (icos * dy)) + yd;
+
772  for (x = 0; x < dst->w; x++) {
+
773  dx = (short) (sdx >> 16);
+
774  dy = (short) (sdy >> 16);
+
775  if (flipx) dx = (src->w-1)-dx;
+
776  if (flipy) dy = (src->h-1)-dy;
+
777  if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) {
+
778  sp = (tColorY *) (src->pixels);
+
779  sp += (src->pitch * dy + dx);
+
780  *pc = *sp;
+
781  }
+
782  sdx += icos;
+
783  sdy += isin;
+
784  pc++;
+
785  }
+
786  pc += gap;
+
787  }
+
788 }
+
789 
+
803 SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
+
804 {
+
805  int row, col, newWidth, newHeight;
+
806  int bpp, bpr;
+
807  SDL_Surface* dst;
+
808  Uint8* srcBuf;
+
809  Uint8* dstBuf;
+
810  int normalizedClockwiseTurns;
+
811 
+
812  /* Has to be a valid surface pointer and be a Nbit surface where n is divisible by 8 */
+
813  if (!src ||
+
814  !src->format) {
+
815  SDL_SetError("NULL source surface or source surface format");
+
816  return NULL;
+
817  }
+
818 
+
819  if ((src->format->BitsPerPixel % 8) != 0) {
+
820  SDL_SetError("Invalid source surface bit depth");
+
821  return NULL;
+
822  }
+
823 
+
824  /* normalize numClockwiseTurns */
+
825  normalizedClockwiseTurns = (numClockwiseTurns % 4);
+
826  if (normalizedClockwiseTurns < 0) {
+
827  normalizedClockwiseTurns += 4;
+
828  }
+
829 
+
830  /* If turns are even, our new width/height will be the same as the source surface */
+
831  if (normalizedClockwiseTurns % 2) {
+
832  newWidth = src->h;
+
833  newHeight = src->w;
+
834  } else {
+
835  newWidth = src->w;
+
836  newHeight = src->h;
+
837  }
+
838 
+
839  dst = SDL_CreateRGBSurface( src->flags, newWidth, newHeight, src->format->BitsPerPixel,
+
840  src->format->Rmask,
+
841  src->format->Gmask,
+
842  src->format->Bmask,
+
843  src->format->Amask);
+
844  if(!dst) {
+
845  SDL_SetError("Could not create destination surface");
+
846  return NULL;
+
847  }
+
848 
+
849  if (SDL_MUSTLOCK(src)) {
+
850  SDL_LockSurface(src);
+
851  }
+
852  if (SDL_MUSTLOCK(dst)) {
+
853  SDL_LockSurface(dst);
+
854  }
+
855 
+
856  /* Calculate byte-per-pixel */
+
857  bpp = src->format->BitsPerPixel / 8;
+
858 
+
859  switch(normalizedClockwiseTurns) {
+
860  case 0: /* Make a copy of the surface */
+
861  {
+
862  /* Unfortunately SDL_BlitSurface cannot be used to make a copy of the surface
+
863  since it does not preserve alpha. */
+
864 
+
865  if (src->pitch == dst->pitch) {
+
866  /* If the pitch is the same for both surfaces, the memory can be copied all at once. */
+
867  memcpy(dst->pixels, src->pixels, (src->h * src->pitch));
+
868  }
+
869  else
+
870  {
+
871  /* If the pitch differs, copy each row separately */
+
872  srcBuf = (Uint8*)(src->pixels);
+
873  dstBuf = (Uint8*)(dst->pixels);
+
874  bpr = src->w * bpp;
+
875  for (row = 0; row < src->h; row++) {
+
876  memcpy(dstBuf, srcBuf, bpr);
+
877  srcBuf += src->pitch;
+
878  dstBuf += dst->pitch;
+
879  }
+
880  }
+
881  }
+
882  break;
+
883 
+
884  /* rotate clockwise */
+
885  case 1: /* rotated 90 degrees clockwise */
+
886  {
+
887  for (row = 0; row < src->h; ++row) {
+
888  srcBuf = (Uint8*)(src->pixels) + (row * src->pitch);
+
889  dstBuf = (Uint8*)(dst->pixels) + (dst->w - row - 1) * bpp;
+
890  for (col = 0; col < src->w; ++col) {
+
891  memcpy (dstBuf, srcBuf, bpp);
+
892  srcBuf += bpp;
+
893  dstBuf += dst->pitch;
+
894  }
+
895  }
+
896  }
+
897  break;
+
898 
+
899  case 2: /* rotated 180 degrees clockwise */
+
900  {
+
901  for (row = 0; row < src->h; ++row) {
+
902  srcBuf = (Uint8*)(src->pixels) + (row * src->pitch);
+
903  dstBuf = (Uint8*)(dst->pixels) + ((dst->h - row - 1) * dst->pitch) + (dst->w - 1) * bpp;
+
904  for (col = 0; col < src->w; ++col) {
+
905  memcpy (dstBuf, srcBuf, bpp);
+
906  srcBuf += bpp;
+
907  dstBuf -= bpp;
+
908  }
+
909  }
+
910  }
+
911  break;
+
912 
+
913  case 3: /* rotated 270 degrees clockwise */
+
914  {
+
915  for (row = 0; row < src->h; ++row) {
+
916  srcBuf = (Uint8*)(src->pixels) + (row * src->pitch);
+
917  dstBuf = (Uint8*)(dst->pixels) + (row * bpp) + (dst->h * dst->pitch);
+
918  for (col = 0; col < src->w; ++col) {
+
919  memcpy (dstBuf, srcBuf, bpp);
+
920  srcBuf += bpp;
+
921  dstBuf -= dst->pitch;
+
922  }
+
923  }
+
924  }
+
925  break;
+
926  }
+
927  /* end switch */
+
928 
+
929  if (SDL_MUSTLOCK(src)) {
+
930  SDL_UnlockSurface(src);
+
931  }
+
932  if (SDL_MUSTLOCK(dst)) {
+
933  SDL_UnlockSurface(dst);
+
934  }
+
935 
+
936  return dst;
+
937 }
+
938 
+
939 
+
954 void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoomx, double zoomy,
+
955  int *dstwidth, int *dstheight,
+
956  double *canglezoom, double *sanglezoom)
+
957 {
+
958  double x, y, cx, cy, sx, sy;
+
959  double radangle;
+
960  int dstwidthhalf, dstheighthalf;
+
961 
+
962  /*
+
963  * Determine destination width and height by rotating a centered source box
+
964  */
+
965  radangle = angle * (M_PI / 180.0);
+
966  *sanglezoom = sin(radangle);
+
967  *canglezoom = cos(radangle);
+
968  *sanglezoom *= zoomx;
+
969  *canglezoom *= zoomx;
+
970  x = (double)(width / 2);
+
971  y = (double)(height / 2);
+
972  cx = *canglezoom * x;
+
973  cy = *canglezoom * y;
+
974  sx = *sanglezoom * x;
+
975  sy = *sanglezoom * y;
+
976 
+
977  dstwidthhalf = MAX((int)
+
978  ceil(MAX(MAX(MAX(fabs(cx + sy), fabs(cx - sy)), fabs(-cx + sy)), fabs(-cx - sy))), 1);
+
979  dstheighthalf = MAX((int)
+
980  ceil(MAX(MAX(MAX(fabs(sx + cy), fabs(sx - cy)), fabs(-sx + cy)), fabs(-sx - cy))), 1);
+
981  *dstwidth = 2 * dstwidthhalf;
+
982  *dstheight = 2 * dstheighthalf;
+
983 }
+
984 
+
996 void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight)
+
997 {
+
998  double dummy_sanglezoom, dummy_canglezoom;
+
999 
+
1000  _rotozoomSurfaceSizeTrig(width, height, angle, zoomx, zoomy, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom);
+
1001 }
+
1002 
+
1013 void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight)
+
1014 {
+
1015  double dummy_sanglezoom, dummy_canglezoom;
+
1016 
+
1017  _rotozoomSurfaceSizeTrig(width, height, angle, zoom, zoom, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom);
+
1018 }
+
1019 
+
1035 SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth)
+
1036 {
+
1037  return rotozoomSurfaceXY(src, angle, zoom, zoom, smooth);
+
1038 }
+
1039 
+
1056 SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth)
+
1057 {
+
1058  SDL_Surface *rz_src;
+
1059  SDL_Surface *rz_dst;
+
1060  double zoominv;
+
1061  double sanglezoom, canglezoom, sanglezoominv, canglezoominv;
+
1062  int dstwidthhalf, dstwidth, dstheighthalf, dstheight;
+
1063  int is32bit;
+
1064  int i, src_converted;
+
1065  int flipx,flipy;
+
1066 
+
1067  /*
+
1068  * Sanity check
+
1069  */
+
1070  if (src == NULL) {
+
1071  return (NULL);
+
1072  }
+
1073 
+
1074  /*
+
1075  * Determine if source surface is 32bit or 8bit
+
1076  */
+
1077  is32bit = (src->format->BitsPerPixel == 32);
+
1078  if ((is32bit) || (src->format->BitsPerPixel == 8)) {
+
1079  /*
+
1080  * Use source surface 'as is'
+
1081  */
+
1082  rz_src = src;
+
1083  src_converted = 0;
+
1084  } else {
+
1085  /*
+
1086  * New source surface is 32bit with a defined RGBA ordering
+
1087  */
+
1088  rz_src =
+
1089  SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
+
1090 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
+
1091  0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
+
1092 #else
+
1093  0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff
+
1094 #endif
+
1095  );
+
1096 
+
1097  SDL_BlitSurface(src, NULL, rz_src, NULL);
+
1098 
+
1099  src_converted = 1;
+
1100  is32bit = 1;
+
1101  }
+
1102 
+
1103  /*
+
1104  * Sanity check zoom factor
+
1105  */
+
1106  flipx = (zoomx<0.0);
+
1107  if (flipx) zoomx=-zoomx;
+
1108  flipy = (zoomy<0.0);
+
1109  if (flipy) zoomy=-zoomy;
+
1110  if (zoomx < VALUE_LIMIT) zoomx = VALUE_LIMIT;
+
1111  if (zoomy < VALUE_LIMIT) zoomy = VALUE_LIMIT;
+
1112  zoominv = 65536.0 / (zoomx * zoomx);
+
1113 
+
1114  /*
+
1115  * Check if we have a rotozoom or just a zoom
+
1116  */
+
1117  if (fabs(angle) > VALUE_LIMIT) {
+
1118 
+
1119  /*
+
1120  * Angle!=0: full rotozoom
+
1121  */
+
1122  /*
+
1123  * -----------------------
+
1124  */
+
1125 
+
1126  /* Determine target size */
+
1127  _rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, zoomx, zoomy, &dstwidth, &dstheight, &canglezoom, &sanglezoom);
+
1128 
+
1129  /*
+
1130  * Calculate target factors from sin/cos and zoom
+
1131  */
+
1132  sanglezoominv = sanglezoom;
+
1133  canglezoominv = canglezoom;
+
1134  sanglezoominv *= zoominv;
+
1135  canglezoominv *= zoominv;
+
1136 
+
1137  /* Calculate half size */
+
1138  dstwidthhalf = dstwidth / 2;
+
1139  dstheighthalf = dstheight / 2;
+
1140 
+
1141  /*
+
1142  * Alloc space to completely contain the rotated surface
+
1143  */
+
1144  rz_dst = NULL;
+
1145  if (is32bit) {
+
1146  /*
+
1147  * Target surface is 32bit with source RGBA/ABGR ordering
+
1148  */
+
1149  rz_dst =
+
1150  SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
+
1151  rz_src->format->Rmask, rz_src->format->Gmask,
+
1152  rz_src->format->Bmask, rz_src->format->Amask);
+
1153  } else {
+
1154  /*
+
1155  * Target surface is 8bit
+
1156  */
+
1157  rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
+
1158  }
+
1159 
+
1160  /* Check target */
+
1161  if (rz_dst == NULL)
+
1162  return NULL;
+
1163 
+
1164  /* Adjust for guard rows */
+
1165  rz_dst->h = dstheight;
+
1166 
+
1167  /*
+
1168  * Lock source surface
+
1169  */
+
1170  if (SDL_MUSTLOCK(rz_src)) {
+
1171  SDL_LockSurface(rz_src);
+
1172  }
+
1173 
+
1174  /*
+
1175  * Check which kind of surface we have
+
1176  */
+
1177  if (is32bit) {
+
1178  /*
+
1179  * Call the 32bit transformation routine to do the rotation (using alpha)
+
1180  */
+
1181  _transformSurfaceRGBA(rz_src, rz_dst, dstwidthhalf, dstheighthalf,
+
1182  (int) (sanglezoominv), (int) (canglezoominv),
+
1183  flipx, flipy,
+
1184  smooth);
+
1185  } else {
+
1186  /*
+
1187  * Copy palette and colorkey info
+
1188  */
+
1189  for (i = 0; i < rz_src->format->palette->ncolors; i++) {
+
1190  rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
+
1191  }
+
1192  rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
+
1193  /*
+
1194  * Call the 8bit transformation routine to do the rotation
+
1195  */
+
1196  transformSurfaceY(rz_src, rz_dst, dstwidthhalf, dstheighthalf,
+
1197  (int) (sanglezoominv), (int) (canglezoominv),
+
1198  flipx, flipy);
+
1199  }
+
1200  /*
+
1201  * Unlock source surface
+
1202  */
+
1203  if (SDL_MUSTLOCK(rz_src)) {
+
1204  SDL_UnlockSurface(rz_src);
+
1205  }
+
1206 
+
1207  } else {
+
1208 
+
1209  /*
+
1210  * Angle=0: Just a zoom
+
1211  */
+
1212  /*
+
1213  * --------------------
+
1214  */
+
1215 
+
1216  /*
+
1217  * Calculate target size
+
1218  */
+
1219  zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight);
+
1220 
+
1221  /*
+
1222  * Alloc space to completely contain the zoomed surface
+
1223  */
+
1224  rz_dst = NULL;
+
1225  if (is32bit) {
+
1226  /*
+
1227  * Target surface is 32bit with source RGBA/ABGR ordering
+
1228  */
+
1229  rz_dst =
+
1230  SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
+
1231  rz_src->format->Rmask, rz_src->format->Gmask,
+
1232  rz_src->format->Bmask, rz_src->format->Amask);
+
1233  } else {
+
1234  /*
+
1235  * Target surface is 8bit
+
1236  */
+
1237  rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
+
1238  }
+
1239 
+
1240  /* Check target */
+
1241  if (rz_dst == NULL)
+
1242  return NULL;
+
1243 
+
1244  /* Adjust for guard rows */
+
1245  rz_dst->h = dstheight;
+
1246 
+
1247  /*
+
1248  * Lock source surface
+
1249  */
+
1250  if (SDL_MUSTLOCK(rz_src)) {
+
1251  SDL_LockSurface(rz_src);
+
1252  }
+
1253 
+
1254  /*
+
1255  * Check which kind of surface we have
+
1256  */
+
1257  if (is32bit) {
+
1258  /*
+
1259  * Call the 32bit transformation routine to do the zooming (using alpha)
+
1260  */
+
1261  _zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth);
+
1262 
+
1263  } else {
+
1264  /*
+
1265  * Copy palette and colorkey info
+
1266  */
+
1267  for (i = 0; i < rz_src->format->palette->ncolors; i++) {
+
1268  rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
+
1269  }
+
1270  rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
+
1271 
+
1272  /*
+
1273  * Call the 8bit transformation routine to do the zooming
+
1274  */
+
1275  _zoomSurfaceY(rz_src, rz_dst, flipx, flipy);
+
1276  }
+
1277 
+
1278  /*
+
1279  * Unlock source surface
+
1280  */
+
1281  if (SDL_MUSTLOCK(rz_src)) {
+
1282  SDL_UnlockSurface(rz_src);
+
1283  }
+
1284  }
+
1285 
+
1286  /*
+
1287  * Cleanup temp surface
+
1288  */
+
1289  if (src_converted) {
+
1290  SDL_FreeSurface(rz_src);
+
1291  }
+
1292 
+
1293  /*
+
1294  * Return destination surface
+
1295  */
+
1296  return (rz_dst);
+
1297 }
+
1298 
+
1311 void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
+
1312 {
+
1313  /*
+
1314  * Make zoom factors positive
+
1315  */
+
1316  int flipx, flipy;
+
1317  flipx = (zoomx<0.0);
+
1318  if (flipx) zoomx = -zoomx;
+
1319  flipy = (zoomy<0.0);
+
1320  if (flipy) zoomy = -zoomy;
+
1321 
+
1322  /*
+
1323  * Sanity check zoom factors
+
1324  */
+
1325  if (zoomx < VALUE_LIMIT) {
+
1326  zoomx = VALUE_LIMIT;
+
1327  }
+
1328  if (zoomy < VALUE_LIMIT) {
+
1329  zoomy = VALUE_LIMIT;
+
1330  }
+
1331 
+
1332  /*
+
1333  * Calculate target size
+
1334  */
+
1335  *dstwidth = (int) floor(((double) width * zoomx) + 0.5);
+
1336  *dstheight = (int) floor(((double) height * zoomy) + 0.5);
+
1337  if (*dstwidth < 1) {
+
1338  *dstwidth = 1;
+
1339  }
+
1340  if (*dstheight < 1) {
+
1341  *dstheight = 1;
+
1342  }
+
1343 }
+
1344 
+
1361 SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth)
+
1362 {
+
1363  SDL_Surface *rz_src;
+
1364  SDL_Surface *rz_dst;
+
1365  int dstwidth, dstheight;
+
1366  int is32bit;
+
1367  int i, src_converted;
+
1368  int flipx, flipy;
+
1369 
+
1370  /*
+
1371  * Sanity check
+
1372  */
+
1373  if (src == NULL)
+
1374  return (NULL);
+
1375 
+
1376  /*
+
1377  * Determine if source surface is 32bit or 8bit
+
1378  */
+
1379  is32bit = (src->format->BitsPerPixel == 32);
+
1380  if ((is32bit) || (src->format->BitsPerPixel == 8)) {
+
1381  /*
+
1382  * Use source surface 'as is'
+
1383  */
+
1384  rz_src = src;
+
1385  src_converted = 0;
+
1386  } else {
+
1387  /*
+
1388  * New source surface is 32bit with a defined RGBA ordering
+
1389  */
+
1390  rz_src =
+
1391  SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
+
1392 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
+
1393  0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
+
1394 #else
+
1395  0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff
+
1396 #endif
+
1397  );
+
1398  if (rz_src == NULL) {
+
1399  return NULL;
+
1400  }
+
1401  SDL_BlitSurface(src, NULL, rz_src, NULL);
+
1402  src_converted = 1;
+
1403  is32bit = 1;
+
1404  }
+
1405 
+
1406  flipx = (zoomx<0.0);
+
1407  if (flipx) zoomx = -zoomx;
+
1408  flipy = (zoomy<0.0);
+
1409  if (flipy) zoomy = -zoomy;
+
1410 
+
1411  /* Get size if target */
+
1412  zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight);
+
1413 
+
1414  /*
+
1415  * Alloc space to completely contain the zoomed surface
+
1416  */
+
1417  rz_dst = NULL;
+
1418  if (is32bit) {
+
1419  /*
+
1420  * Target surface is 32bit with source RGBA/ABGR ordering
+
1421  */
+
1422  rz_dst =
+
1423  SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
+
1424  rz_src->format->Rmask, rz_src->format->Gmask,
+
1425  rz_src->format->Bmask, rz_src->format->Amask);
+
1426  } else {
+
1427  /*
+
1428  * Target surface is 8bit
+
1429  */
+
1430  rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
+
1431  }
+
1432 
+
1433  /* Check target */
+
1434  if (rz_dst == NULL) {
+
1435  /*
+
1436  * Cleanup temp surface
+
1437  */
+
1438  if (src_converted) {
+
1439  SDL_FreeSurface(rz_src);
+
1440  }
+
1441  return NULL;
+
1442  }
+
1443 
+
1444  /* Adjust for guard rows */
+
1445  rz_dst->h = dstheight;
+
1446 
+
1447  /*
+
1448  * Lock source surface
+
1449  */
+
1450  if (SDL_MUSTLOCK(rz_src)) {
+
1451  SDL_LockSurface(rz_src);
+
1452  }
+
1453 
+
1454  /*
+
1455  * Check which kind of surface we have
+
1456  */
+
1457  if (is32bit) {
+
1458  /*
+
1459  * Call the 32bit transformation routine to do the zooming (using alpha)
+
1460  */
+
1461  _zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth);
+
1462  } else {
+
1463  /*
+
1464  * Copy palette and colorkey info
+
1465  */
+
1466  for (i = 0; i < rz_src->format->palette->ncolors; i++) {
+
1467  rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
+
1468  }
+
1469  rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
+
1470  /*
+
1471  * Call the 8bit transformation routine to do the zooming
+
1472  */
+
1473  _zoomSurfaceY(rz_src, rz_dst, flipx, flipy);
+
1474  }
+
1475  /*
+
1476  * Unlock source surface
+
1477  */
+
1478  if (SDL_MUSTLOCK(rz_src)) {
+
1479  SDL_UnlockSurface(rz_src);
+
1480  }
+
1481 
+
1482  /*
+
1483  * Cleanup temp surface
+
1484  */
+
1485  if (src_converted) {
+
1486  SDL_FreeSurface(rz_src);
+
1487  }
+
1488 
+
1489  /*
+
1490  * Return destination surface
+
1491  */
+
1492  return (rz_dst);
+
1493 }
+
1494 
+
1511 /*@null@*/
+
1512 SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
+
1513 {
+
1514  int result;
+
1515  SDL_Surface *rz_src;
+
1516  SDL_Surface *rz_dst = NULL;
+
1517  int dstwidth, dstheight;
+
1518  int is32bit;
+
1519  int i, src_converted;
+
1520  int haveError = 0;
+
1521 
+
1522  /*
+
1523  * Sanity check
+
1524  */
+
1525  if (src == NULL) {
+
1526  return (NULL);
+
1527  }
+
1528 
+
1529  /*
+
1530  * Determine if source surface is 32bit or 8bit
+
1531  */
+
1532  is32bit = (src->format->BitsPerPixel == 32);
+
1533  if ((is32bit) || (src->format->BitsPerPixel == 8)) {
+
1534  /*
+
1535  * Use source surface 'as is'
+
1536  */
+
1537  rz_src = src;
+
1538  src_converted = 0;
+
1539  } else {
+
1540  /*
+
1541  * New source surface is 32bit with a defined RGBA ordering
+
1542  */
+
1543  rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
+
1544 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
+
1545  0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
+
1546 #else
+
1547  0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff
+
1548 #endif
+
1549  );
+
1550  if (rz_src==NULL) {
+
1551  haveError = 1;
+
1552  goto exitShrinkSurface;
+
1553  }
+
1554 
+
1555  SDL_BlitSurface(src, NULL, rz_src, NULL);
+
1556  src_converted = 1;
+
1557  is32bit = 1;
+
1558  }
+
1559 
+
1560  /*
+
1561  * Lock the surface
+
1562  */
+
1563  if (SDL_MUSTLOCK(rz_src)) {
+
1564  if (SDL_LockSurface(rz_src) < 0) {
+
1565  haveError = 1;
+
1566  goto exitShrinkSurface;
+
1567  }
+
1568  }
+
1569 
+
1570  /* Get size for target */
+
1571  dstwidth=rz_src->w/factorx;
+
1572  while (dstwidth*factorx>rz_src->w) { dstwidth--; }
+
1573  dstheight=rz_src->h/factory;
+
1574  while (dstheight*factory>rz_src->h) { dstheight--; }
+
1575 
+
1576  /*
+
1577  * Alloc space to completely contain the shrunken surface
+
1578  * (with added guard rows)
+
1579  */
+
1580  if (is32bit==1) {
+
1581  /*
+
1582  * Target surface is 32bit with source RGBA/ABGR ordering
+
1583  */
+
1584  rz_dst =
+
1585  SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
+
1586  rz_src->format->Rmask, rz_src->format->Gmask,
+
1587  rz_src->format->Bmask, rz_src->format->Amask);
+
1588  } else {
+
1589  /*
+
1590  * Target surface is 8bit
+
1591  */
+
1592  rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
+
1593  }
+
1594 
+
1595  /* Check target */
+
1596  if (rz_dst == NULL) {
+
1597  haveError = 1;
+
1598  goto exitShrinkSurface;
+
1599  }
+
1600 
+
1601  /* Adjust for guard rows */
+
1602  rz_dst->h = dstheight;
+
1603 
+
1604  /*
+
1605  * Check which kind of surface we have
+
1606  */
+
1607  if (is32bit==1) {
+
1608  /*
+
1609  * Call the 32bit transformation routine to do the shrinking (using alpha)
+
1610  */
+
1611  result = _shrinkSurfaceRGBA(rz_src, rz_dst, factorx, factory);
+
1612  if ((result!=0) || (rz_dst==NULL)) {
+
1613  haveError = 1;
+
1614  goto exitShrinkSurface;
+
1615  }
+
1616  } else {
+
1617  /*
+
1618  * Copy palette and colorkey info
+
1619  */
+
1620  for (i = 0; i < rz_src->format->palette->ncolors; i++) {
+
1621  rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
+
1622  }
+
1623  rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
+
1624  /*
+
1625  * Call the 8bit transformation routine to do the shrinking
+
1626  */
+
1627  result = _shrinkSurfaceY(rz_src, rz_dst, factorx, factory);
+
1628  if (result!=0) {
+
1629  haveError = 1;
+
1630  goto exitShrinkSurface;
+
1631  }
+
1632  }
+
1633 
+
1634 exitShrinkSurface:
+
1635  if (rz_src!=NULL) {
+
1636  /*
+
1637  * Unlock source surface
+
1638  */
+
1639  if (SDL_MUSTLOCK(rz_src)) {
+
1640  SDL_UnlockSurface(rz_src);
+
1641  }
+
1642 
+
1643  /*
+
1644  * Cleanup temp surface
+
1645  */
+
1646  if (src_converted==1) {
+
1647  SDL_FreeSurface(rz_src);
+
1648  }
+
1649  }
+
1650 
+
1651  /* Check error state; maybe need to cleanup destination */
+
1652  if (haveError==1) {
+
1653  if (rz_dst!=NULL) {
+
1654  SDL_FreeSurface(rz_dst);
+
1655  }
+
1656  rz_dst=NULL;
+
1657  }
+
1658 
+
1659  /*
+
1660  * Return destination surface
+
1661  */
+
1662  return (rz_dst);
+
1663 }
+
void transformSurfaceY(SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing.
+
SDL_Surface * rotozoomSurface(SDL_Surface *src, double angle, double zoom, int smooth)
Rotates and zooms a surface and optional anti-aliasing.
+
void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight)
Returns the size of the resulting target surface for a rotozoomSurface() call.
+
int _zoomSurfaceY(SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy)
Internal 8 bit Zoomer without smoothing.
+
struct tColorY tColorY
A 8bit Y/palette pixel.
+
void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight)
Returns the size of the resulting target surface for a rotozoomSurfaceXY() call.
+
Uint8 y
Definition: SDL2_rotozoom.c:55
+
struct tColorRGBA tColorRGBA
A 32 bit RGBA pixel.
+
SDL_Surface * rotozoomSurfaceXY(SDL_Surface *src, double angle, double zoomx, double zoomy, int smooth)
Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-...
+
#define MAX(a, b)
Returns maximum of two numbers a and b.
Definition: SDL2_rotozoom.c:61
+
Uint32 _colorkey(SDL_Surface *src)
Returns colorkey info for a surface.
Definition: SDL2_rotozoom.c:83
+
int _shrinkSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int factorx, int factory)
Internal 32 bit integer-factor averaging Shrinker.
+
int _zoomSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy, int smooth)
Internal 32 bit Zoomer with optional anti-aliasing by bilinear interpolation.
+ +
SDL_Surface * zoomSurface(SDL_Surface *src, double zoomx, double zoomy, int smooth)
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
+
void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
Calculates the size of the target surface for a zoomSurface() call.
+ +
#define GUARD_ROWS
Number of guard rows added to destination surfaces.
Definition: SDL2_rotozoom.c:73
+
void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight, double *canglezoom, double *sanglezoom)
Internal target surface sizing function for rotozooms with trig result return.
+
void _transformSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth)
Internal 32 bit rotozoomer with optional anti-aliasing.
+
#define VALUE_LIMIT
Lower limit of absolute zoom factor or rotation degrees.
Definition: SDL2_rotozoom.c:78
+
int _shrinkSurfaceY(SDL_Surface *src, SDL_Surface *dst, int factorx, int factory)
Internal 8 bit integer-factor averaging shrinker.
+
A 32 bit RGBA pixel.
Definition: SDL2_rotozoom.c:44
+
#define M_PI
+
SDL_Surface * shrinkSurface(SDL_Surface *src, int factorx, int factory)
Shrink a surface by an integer ratio using averaging.
+ +
A 8bit Y/palette pixel.
Definition: SDL2_rotozoom.c:54
+ +
SDL_Surface * rotateSurface90Degrees(SDL_Surface *src, int numClockwiseTurns)
Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
+ +
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html new file mode 100755 index 000000000..2f94cf609 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html @@ -0,0 +1,622 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.h File Reference + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+ +
+
/cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.h File Reference
+
+
+
#include <math.h>
+#include "SDL.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + +

+Macros

#define M_PI   3.1415926535897932384626433832795
 
#define SMOOTHING_OFF   0
 Disable anti-aliasing (no smoothing). More...
 
#define SMOOTHING_ON   1
 Enable anti-aliasing (smoothing). More...
 
#define SDL2_ROTOZOOM_SCOPE   extern
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

SDL2_ROTOZOOM_SCOPE SDL_Surface * rotozoomSurface (SDL_Surface *src, double angle, double zoom, int smooth)
 Rotates and zooms a surface and optional anti-aliasing. More...
 
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotozoomSurfaceXY (SDL_Surface *src, double angle, double zoomx, double zoomy, int smooth)
 Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. More...
 
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize (int width, int height, double angle, double zoom, int *dstwidth, int *dstheight)
 Returns the size of the resulting target surface for a rotozoomSurface() call. More...
 
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY (int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight)
 Returns the size of the resulting target surface for a rotozoomSurfaceXY() call. More...
 
SDL2_ROTOZOOM_SCOPE SDL_Surface * zoomSurface (SDL_Surface *src, double zoomx, double zoomy, int smooth)
 Zoom a surface by independent horizontal and vertical factors with optional smoothing. More...
 
SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize (int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
 Calculates the size of the target surface for a zoomSurface() call. More...
 
SDL2_ROTOZOOM_SCOPE SDL_Surface * shrinkSurface (SDL_Surface *src, int factorx, int factory)
 Shrink a surface by an integer ratio using averaging. More...
 
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotateSurface90Degrees (SDL_Surface *src, int numClockwiseTurns)
 Rotates a 8/16/24/32 bit surface in increments of 90 degrees. More...
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define M_PI   3.1415926535897932384626433832795
+
+ +

Definition at line 41 of file SDL2_rotozoom.h.

+ +
+
+ +
+
+ + + + +
#define SDL2_ROTOZOOM_SCOPE   extern
+
+ +

Definition at line 70 of file SDL2_rotozoom.h.

+ +
+
+ +
+
+ + + + +
#define SMOOTHING_OFF   0
+
+ +

Disable anti-aliasing (no smoothing).

+ +

Definition at line 51 of file SDL2_rotozoom.h.

+ +
+
+ +
+
+ + + + +
#define SMOOTHING_ON   1
+
+ +

Enable anti-aliasing (smoothing).

+ +

Definition at line 56 of file SDL2_rotozoom.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE SDL_Surface* rotateSurface90Degrees (SDL_Surface * src,
int numClockwiseTurns 
)
+
+ +

Rotates a 8/16/24/32 bit surface in increments of 90 degrees.

+

Specialized 90 degree rotator which rotates a 'src' surface in 90 degree increments clockwise returning a new surface. Faster than rotozoomer since no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit. (code contributed by J. Schiller, improved by C. Allport and A. Schiffler)

+
Parameters
+ + + +
srcSource surface to rotate.
numClockwiseTurnsNumber of clockwise 90 degree turns to apply to the source.
+
+
+
Returns
The new, rotated surface; or NULL for surfaces with incorrect input format.
+ +

Definition at line 803 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE SDL_Surface* rotozoomSurface (SDL_Surface * src,
double angle,
double zoom,
int smooth 
)
+
+ +

Rotates and zooms a surface and optional anti-aliasing.

+

Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.

+
Parameters
+ + + + + +
srcThe surface to rotozoom.
angleThe angle to rotate in degrees.
zoomThe scaling factor.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
The new rotozoomed surface.
+ +

Definition at line 1035 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize (int width,
int height,
double angle,
double zoom,
int * dstwidth,
int * dstheight 
)
+
+ +

Returns the size of the resulting target surface for a rotozoomSurface() call.

+
Parameters
+ + + + + + + +
widthThe source surface width.
heightThe source surface height.
angleThe angle to rotate in degrees.
zoomThe scaling factor.
dstwidthThe calculated width of the rotozoomed destination surface.
dstheightThe calculated height of the rotozoomed destination surface.
+
+
+ +

Definition at line 1013 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY (int width,
int height,
double angle,
double zoomx,
double zoomy,
int * dstwidth,
int * dstheight 
)
+
+ +

Returns the size of the resulting target surface for a rotozoomSurfaceXY() call.

+
Parameters
+ + + + + + + + +
widthThe source surface width.
heightThe source surface height.
angleThe angle to rotate in degrees.
zoomxThe horizontal scaling factor.
zoomyThe vertical scaling factor.
dstwidthThe calculated width of the rotozoomed destination surface.
dstheightThe calculated height of the rotozoomed destination surface.
+
+
+ +

Definition at line 996 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE SDL_Surface* rotozoomSurfaceXY (SDL_Surface * src,
double angle,
double zoomx,
double zoomy,
int smooth 
)
+
+ +

Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.

+

Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.

+
Parameters
+ + + + + + +
srcThe surface to rotozoom.
angleThe angle to rotate in degrees.
zoomxThe horizontal scaling factor.
zoomyThe vertical scaling factor.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
The new rotozoomed surface.
+ +

Definition at line 1056 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE SDL_Surface* shrinkSurface (SDL_Surface * src,
int factorx,
int factory 
)
+
+ +

Shrink a surface by an integer ratio using averaging.

+

Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface. 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size, 3=1/3 the size, etc.) The destination surface is antialiased by averaging the source box RGBA or Y information. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. The input surface is not modified. The output surface is newly allocated.

+
Parameters
+ + + + +
srcThe surface to shrink.
factorxThe horizontal shrinking ratio.
factoryThe vertical shrinking ratio.
+
+
+
Returns
The new, shrunken surface.
+ +

Definition at line 1512 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE SDL_Surface* zoomSurface (SDL_Surface * src,
double zoomx,
double zoomy,
int smooth 
)
+
+ +

Zoom a surface by independent horizontal and vertical factors with optional smoothing.

+

Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is on then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. If zoom factors are negative, the image is flipped on the axes.

+
Parameters
+ + + + + +
srcThe surface to zoom.
zoomxThe horizontal zoom factor.
zoomyThe vertical zoom factor.
smoothAntialiasing flag; set to SMOOTHING_ON to enable.
+
+
+
Returns
The new, zoomed surface.
+ +

Definition at line 1361 of file SDL2_rotozoom.c.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize (int width,
int height,
double zoomx,
double zoomy,
int * dstwidth,
int * dstheight 
)
+
+ +

Calculates the size of the target surface for a zoomSurface() call.

+

The minimum size of the target surface is 1. The input factors can be positive or negative.

+
Parameters
+ + + + + + + +
widthThe width of the source surface to zoom.
heightThe height of the source surface to zoom.
zoomxThe horizontal zoom factor.
zoomyThe vertical zoom factor.
dstwidthPointer to an integer to store the calculated width of the zoomed target surface.
dstheightPointer to an integer to store the calculated height of the zoomed target surface.
+
+
+ +

Definition at line 1311 of file SDL2_rotozoom.c.

+ +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h_source.html b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h_source.html new file mode 100755 index 000000000..4e497fccf --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h_source.html @@ -0,0 +1,184 @@ + + + + + + +SDL2_gfx: /cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.h Source File + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
/cygdrive/i/Sources/sdl2gfx/SDL2_rotozoom.h
+
+
+Go to the documentation of this file.
1 /*
+
2 
+
3 SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
+
4 
+
5 Copyright (C) 2012-2014 Andreas Schiffler
+
6 
+
7 This software is provided 'as-is', without any express or implied
+
8 warranty. In no event will the authors be held liable for any damages
+
9 arising from the use of this software.
+
10 
+
11 Permission is granted to anyone to use this software for any purpose,
+
12 including commercial applications, and to alter it and redistribute it
+
13 freely, subject to the following restrictions:
+
14 
+
15 1. The origin of this software must not be misrepresented; you must not
+
16 claim that you wrote the original software. If you use this software
+
17 in a product, an acknowledgment in the product documentation would be
+
18 appreciated but is not required.
+
19 
+
20 2. Altered source versions must be plainly marked as such, and must not be
+
21 misrepresented as being the original software.
+
22 
+
23 3. This notice may not be removed or altered from any source
+
24 distribution.
+
25 
+
26 Andreas Schiffler -- aschiffler at ferzkopp dot net
+
27 
+
28 */
+
29 
+
30 #ifndef _SDL2_rotozoom_h
+
31 #define _SDL2_rotozoom_h
+
32 
+
33 #include <math.h>
+
34 
+
35 /* Set up for C function definitions, even when using C++ */
+
36 #ifdef __cplusplus
+
37 extern "C" {
+
38 #endif
+
39 
+
40 #ifndef M_PI
+
41 #define M_PI 3.1415926535897932384626433832795
+
42 #endif
+
43 
+
44 #include "SDL.h"
+
45 
+
46  /* ---- Defines */
+
47 
+
51 #define SMOOTHING_OFF 0
+
52 
+
56 #define SMOOTHING_ON 1
+
57 
+
58  /* ---- Function Prototypes */
+
59 
+
60 #ifdef _MSC_VER
+
61 # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT)
+
62 # define SDL2_ROTOZOOM_SCOPE __declspec(dllexport)
+
63 # else
+
64 # ifdef LIBSDL2_GFX_DLL_IMPORT
+
65 # define SDL2_ROTOZOOM_SCOPE __declspec(dllimport)
+
66 # endif
+
67 # endif
+
68 #endif
+
69 #ifndef SDL2_ROTOZOOM_SCOPE
+
70 # define SDL2_ROTOZOOM_SCOPE extern
+
71 #endif
+
72 
+
73  /*
+
74 
+
75  Rotozoom functions
+
76 
+
77  */
+
78 
+
79  SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth);
+
80 
+ +
82  (SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth);
+
83 
+
84 
+
85  SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,
+
86  int *dstheight);
+
87 
+ +
89  (int width, int height, double angle, double zoomx, double zoomy,
+
90  int *dstwidth, int *dstheight);
+
91 
+
92  /*
+
93 
+
94  Zooming functions
+
95 
+
96  */
+
97 
+
98  SDL2_ROTOZOOM_SCOPE SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth);
+
99 
+
100  SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
+
101 
+
102  /*
+
103 
+
104  Shrinking functions
+
105 
+
106  */
+
107 
+
108  SDL2_ROTOZOOM_SCOPE SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory);
+
109 
+
110  /*
+
111 
+
112  Specialized rotation functions
+
113 
+
114  */
+
115 
+
116  SDL2_ROTOZOOM_SCOPE SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns);
+
117 
+
118  /* Ends C function definitions when using C++ */
+
119 #ifdef __cplusplus
+
120 }
+
121 #endif
+
122 
+
123 #endif /* _SDL2_rotozoom_h */
+
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotateSurface90Degrees(SDL_Surface *src, int numClockwiseTurns)
Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
+
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotozoomSurfaceXY(SDL_Surface *src, double angle, double zoomx, double zoomy, int smooth)
Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-...
+
#define SDL2_ROTOZOOM_SCOPE
Definition: SDL2_rotozoom.h:70
+
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotozoomSurface(SDL_Surface *src, double angle, double zoom, int smooth)
Rotates and zooms a surface and optional anti-aliasing.
+
SDL2_ROTOZOOM_SCOPE SDL_Surface * shrinkSurface(SDL_Surface *src, int factorx, int factory)
Shrink a surface by an integer ratio using averaging.
+
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight)
Returns the size of the resulting target surface for a rotozoomSurface() call.
+
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight)
Returns the size of the resulting target surface for a rotozoomSurfaceXY() call.
+
SDL2_ROTOZOOM_SCOPE SDL_Surface * zoomSurface(SDL_Surface *src, double zoomx, double zoomy, int smooth)
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
+
SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
Calculates the size of the target surface for a zoomSurface() call.
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/annotated.html b/thirdparty/SDL2_gfx/Docs/html/annotated.html new file mode 100755 index 000000000..0e07ab610 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/annotated.html @@ -0,0 +1,68 @@ + + + + + + +SDL2_gfx: Data Structures + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+ + + + + + +
 CFPSmanagerStructure holding the state and timing information of the framerate controller
 CSDL2_gfxBresenhamIteratorThe structure passed to the internal Bresenham iterator
 CSDL2_gfxMurphyIteratorThe structure passed to the internal Murphy iterator
 CtColorRGBAA 32 bit RGBA pixel
 CtColorYA 8bit Y/palette pixel
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/bc_s.png b/thirdparty/SDL2_gfx/Docs/html/bc_s.png new file mode 100755 index 000000000..2eba412ec --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/bc_s.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e7ed0ef70f99bb7f763a48ddd95d5990e103bb145eedfd0a76d19c122374be2 +size 676 diff --git a/thirdparty/SDL2_gfx/Docs/html/bdwn.png b/thirdparty/SDL2_gfx/Docs/html/bdwn.png new file mode 100755 index 000000000..426383024 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/bdwn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:782b30d237bdbeddfde4aed01f007264cc116b2d4be2f398a7cb74ec7a5bc58b +size 147 diff --git a/thirdparty/SDL2_gfx/Docs/html/classes.html b/thirdparty/SDL2_gfx/Docs/html/classes.html new file mode 100755 index 000000000..a0a6aa695 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/classes.html @@ -0,0 +1,71 @@ + + + + + + +SDL2_gfx: Data Structure Index + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
Data Structure Index
+
+
+
F | S | T
+ + + + + + +
  F  
+
  S  
+
SDL2_gfxMurphyIterator   tColorY   
  t  
+
FPSmanager   SDL2_gfxBresenhamIterator   
tColorRGBA   
+
F | S | T
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/closed.png b/thirdparty/SDL2_gfx/Docs/html/closed.png new file mode 100755 index 000000000..7b3198ff2 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/closed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c98c02adc57337f58c40aae15bbac05a3ccb364e5adb1d610a16452e92f17830 +size 132 diff --git a/thirdparty/SDL2_gfx/Docs/html/doxygen.css b/thirdparty/SDL2_gfx/Docs/html/doxygen.css new file mode 100755 index 000000000..b2c94ac21 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/doxygen.css @@ -0,0 +1,1454 @@ +/* The standard CSS for doxygen 1.8.10 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px 6px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah, span.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/thirdparty/SDL2_gfx/Docs/html/doxygen.png b/thirdparty/SDL2_gfx/Docs/html/doxygen.png new file mode 100755 index 000000000..1a1ed58fc --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/doxygen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6973a2aae66bbb99f2b57f2ef160182825fa5305444511ca1eca4e1b0b38528b +size 3779 diff --git a/thirdparty/SDL2_gfx/Docs/html/files.html b/thirdparty/SDL2_gfx/Docs/html/files.html new file mode 100755 index 000000000..c62ff800b --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/files.html @@ -0,0 +1,72 @@ + + + + + + +SDL2_gfx: File List + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + +
+
+
+
File List
+
+ + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/functions.html b/thirdparty/SDL2_gfx/Docs/html/functions.html new file mode 100755 index 000000000..84eea1bd5 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/functions.html @@ -0,0 +1,267 @@ + + + + + + +SDL2_gfx: Data Fields + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all struct and union fields with links to the structures/unions they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- k -

+ + +

- l -

+ + +

- o -

+ + +

- q -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- x -

+ + +

- y -

+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/functions_vars.html b/thirdparty/SDL2_gfx/Docs/html/functions_vars.html new file mode 100755 index 000000000..3e0400858 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/functions_vars.html @@ -0,0 +1,267 @@ + + + + + + +SDL2_gfx: Data Fields - Variables + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- k -

+ + +

- l -

+ + +

- o -

+ + +

- q -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- x -

+ + +

- y -

+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals.html b/thirdparty/SDL2_gfx/Docs/html/globals.html new file mode 100755 index 000000000..7d020c2c7 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals.html @@ -0,0 +1,131 @@ + + + + + + +SDL2_gfx: Globals + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- _ -

+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x61.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x61.html new file mode 100755 index 000000000..48e314b97 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x61.html @@ -0,0 +1,150 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- a -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x62.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x62.html new file mode 100755 index 000000000..21c3c2dfd --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x62.html @@ -0,0 +1,112 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- b -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x63.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x63.html new file mode 100755 index 000000000..1ddaf3a08 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x63.html @@ -0,0 +1,112 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- c -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x65.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x65.html new file mode 100755 index 000000000..c3fb2130a --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x65.html @@ -0,0 +1,107 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- e -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x66.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x66.html new file mode 100755 index 000000000..d41c8e280 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x66.html @@ -0,0 +1,148 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- f -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x67.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x67.html new file mode 100755 index 000000000..ce7c7e351 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x67.html @@ -0,0 +1,110 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- g -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x68.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x68.html new file mode 100755 index 000000000..41f8da382 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x68.html @@ -0,0 +1,107 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- h -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x6c.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x6c.html new file mode 100755 index 000000000..140195fd7 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x6c.html @@ -0,0 +1,107 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- l -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x6d.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x6d.html new file mode 100755 index 000000000..444bfea36 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x6d.html @@ -0,0 +1,103 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- m -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x70.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x70.html new file mode 100755 index 000000000..7d6bb1382 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x70.html @@ -0,0 +1,129 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- p -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x72.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x72.html new file mode 100755 index 000000000..435fecbc7 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x72.html @@ -0,0 +1,140 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- r -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x73.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x73.html new file mode 100755 index 000000000..67696c2a3 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x73.html @@ -0,0 +1,320 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- s -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x74.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x74.html new file mode 100755 index 000000000..dc1142d2e --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x74.html @@ -0,0 +1,128 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- t -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x76.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x76.html new file mode 100755 index 000000000..62ad9b3d0 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x76.html @@ -0,0 +1,110 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- v -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_0x7a.html b/thirdparty/SDL2_gfx/Docs/html/globals_0x7a.html new file mode 100755 index 000000000..f2916259b --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_0x7a.html @@ -0,0 +1,104 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+ +

- z -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_defs.html b/thirdparty/SDL2_gfx/Docs/html/globals_defs.html new file mode 100755 index 000000000..7f32da8b6 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_defs.html @@ -0,0 +1,128 @@ + + + + + + +SDL2_gfx: Globals + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func.html b/thirdparty/SDL2_gfx/Docs/html/globals_func.html new file mode 100755 index 000000000..97ce955df --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func.html @@ -0,0 +1,130 @@ + + + + + + +SDL2_gfx: Globals + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- _ -

+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x61.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x61.html new file mode 100755 index 000000000..44c349b06 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x61.html @@ -0,0 +1,143 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- a -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x62.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x62.html new file mode 100755 index 000000000..b9ecb08e6 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x62.html @@ -0,0 +1,111 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- b -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x63.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x63.html new file mode 100755 index 000000000..4f3c59363 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x63.html @@ -0,0 +1,111 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- c -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x65.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x65.html new file mode 100755 index 000000000..b6b90e018 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x65.html @@ -0,0 +1,103 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- e -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x66.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x66.html new file mode 100755 index 000000000..d927cc6a9 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x66.html @@ -0,0 +1,138 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- f -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x67.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x67.html new file mode 100755 index 000000000..171314511 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x67.html @@ -0,0 +1,103 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- g -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x68.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x68.html new file mode 100755 index 000000000..855550b7e --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x68.html @@ -0,0 +1,106 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- h -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x6c.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x6c.html new file mode 100755 index 000000000..1d6f8d04e --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x6c.html @@ -0,0 +1,106 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- l -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x70.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x70.html new file mode 100755 index 000000000..78c8b1d7f --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x70.html @@ -0,0 +1,128 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- p -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x72.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x72.html new file mode 100755 index 000000000..d7c6fe934 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x72.html @@ -0,0 +1,139 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- r -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x73.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x73.html new file mode 100755 index 000000000..6dd6a579b --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x73.html @@ -0,0 +1,289 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- s -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x74.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x74.html new file mode 100755 index 000000000..819f38d7c --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x74.html @@ -0,0 +1,121 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- t -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x76.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x76.html new file mode 100755 index 000000000..ef01bba95 --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x76.html @@ -0,0 +1,106 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- v -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_func_0x7a.html b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x7a.html new file mode 100755 index 000000000..16479f3cb --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_func_0x7a.html @@ -0,0 +1,103 @@ + + + + + +SDL2_gfx: Globals + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + + +
+
+  + +

- z -

+
+ + + + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/globals_type.html b/thirdparty/SDL2_gfx/Docs/html/globals_type.html new file mode 100755 index 000000000..196e5574b --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/globals_type.html @@ -0,0 +1,70 @@ + + + + + + +SDL2_gfx: Globals + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + + + +
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/index.html b/thirdparty/SDL2_gfx/Docs/html/index.html new file mode 100755 index 000000000..0eae1a69e --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/index.html @@ -0,0 +1,52 @@ + + + + + + +SDL2_gfx: Main Page + + + + + + +
+
+ + + + + + +
+
SDL2_gfx +  1.0.2 +
+
GraphicsprimitivesandsurfacefunctionsforSDL2
+
+
+ + + +
+
+
+
SDL2_gfx Documentation
+
+
+
+ + + + diff --git a/thirdparty/SDL2_gfx/Docs/html/jquery.js b/thirdparty/SDL2_gfx/Docs/html/jquery.js new file mode 100755 index 000000000..1f4d0b47c --- /dev/null +++ b/thirdparty/SDL2_gfx/Docs/html/jquery.js @@ -0,0 +1,68 @@ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! + * jQuery UI 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! + * jQuery UI Widget 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! + * jQuery UI Mouse 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('