亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? libmng_pixels.c

?? 一款最完整的工業組態軟源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* ************************************************************************** */
/* *             For conditions of distribution and use,                    * */
/* *                see copyright notice in libmng.h                        * */
/* ************************************************************************** */
/* *                                                                        * */
/* * project   : libmng                                                     * */
/* * file      : libmng_pixels.c           copyright (c) 2000-2004 G.Juyn   * */
/* * version   : 1.0.8                                                      * */
/* *                                                                        * */
/* * purpose   : Pixel-row management routines (implementation)             * */
/* *                                                                        * */
/* * author    : G.Juyn                                                     * */
/* *                                                                        * */
/* * comment   : implementation of the pixel-row management routines        * */
/* *                                                                        * */
/* *             the dual alpha-composing for RGBA/BGRA/etc output-canvas'  * */
/* *             is based on the Note on Compositing chapter of the         * */
/* *             DOH-3 draft, noted to me by Adam M. Costello               * */
/* *                                                                        * */
/* * changes   : 0.5.1 - 05/08/2000 - G.Juyn                                * */
/* *             - changed strict-ANSI stuff                                * */
/* *             0.5.1 - 05/11/2000 - G.Juyn                                * */
/* *             - added callback error-reporting support                   * */
/* *             0.5.1 - 05/12/2000 - G.Juyn                                * */
/* *             - changed trace to macro for callback error-reporting      * */
/* *                                                                        * */
/* *             0.5.2 - 05/22/2000 - G.Juyn                                * */
/* *             - added JNG support                                        * */
/* *             0.5.2 - 05/30/2000 - G.Juyn                                * */
/* *             - fixed minor bugs 16-bit pixel-handling                   * */
/* *             - added delta-image row-processing routines                * */
/* *             0.5.2 - 06/02/2000 - G.Juyn                                * */
/* *             - fixed endian support (hopefully)                         * */
/* *             0.5.2 - 06/03/2000 - G.Juyn                                * */
/* *             - fixed makeup for Linux gcc compile                       * */
/* *             0.5.2 - 06/05/2000 - G.Juyn                                * */
/* *             - implemented app bkgd restore routines                    * */
/* *             - implemented RGBA8, ARGB8, BGRA8 & ABGR8 display routines * */
/* *             - added support for RGB8_A8 canvasstyle                    * */
/* *             0.5.2 - 06/09/2000 - G.Juyn                                * */
/* *             - fixed alpha-handling for alpha canvasstyles              * */
/* *                                                                        * */
/* *             0.5.3 - 06/16/2000 - G.Juyn                                * */
/* *             - changed progressive-display processing                   * */
/* *             0.5.3 - 06/17/2000 - G.Juyn                                * */
/* *             - changed to support delta-images                          * */
/* *             - optimized some store_xxx routines                        * */
/* *             0.5.3 - 06/20/2000 - G.Juyn                                * */
/* *             - fixed nasty bug with embedded PNG after delta-image      * */
/* *             0.5.3 - 06/24/2000 - G.Juyn                                * */
/* *             - fixed problem with 16-bit GA format                      * */
/* *             0.5.3 - 06/25/2000 - G.Juyn                                * */
/* *             - fixed problem with cheap transparency for 4-bit gray     * */
/* *             - fixed display_xxxx routines for interlaced images        * */
/* *             0.5.3 - 06/28/2000 - G.Juyn                                * */
/* *             - fixed compiler-warning for non-initialized iB variable   * */
/* *                                                                        * */
/* *             0.9.1 - 07/05/2000 - G.Juyn                                * */
/* *             - fixed mandatory BACK color to be opaque                  * */
/* *                                                                        * */
/* *             0.9.2 - 07/31/2000 - G.Juyn                                * */
/* *             - B110547 - fixed bug in interlace code                    * */
/* *             0.9.2 - 08/05/2000 - G.Juyn                                * */
/* *             - changed file-prefixes                                    * */
/* *                                                                        * */
/* *             0.9.3 - 08/20/2000 - G.Juyn                                * */
/* *             - fixed app-supplied background restore                    * */
/* *             0.9.3 - 08/26/2000 - G.Juyn                                * */
/* *             - added MAGN chunk                                         * */
/* *             0.9.3 - 09/07/2000 - G.Juyn                                * */
/* *             - added support for new filter_types                       * */
/* *             0.9.3 - 09/30/2000 - G.Juyn                                * */
/* *             - fixed MAGN rounding errors (thanks Matthias!)            * */
/* *             0.9.3 - 10/10/2000 - G.Juyn                                * */
/* *             - fixed alpha-blending for RGBA canvasstyle                * */
/* *             0.9.3 - 10/11/2000 - G.Juyn                                * */
/* *             - fixed alpha-blending for other alpha-canvasstyles        * */
/* *             0.9.3 - 10/16/2000 - G.Juyn                                * */
/* *             - added optional support for bKGD for PNG images           * */
/* *             - added support for JDAA                                   * */
/* *             0.9.3 - 10/17/2000 - G.Juyn                                * */
/* *             - fixed support for bKGD                                   * */
/* *             0.9.3 - 10/19/2000 - G.Juyn                                * */
/* *             - implemented delayed delta-processing                     * */
/* *             0.9.3 - 10/28/2000 - G.Juyn                                * */
/* *             - fixed tRNS processing for gray-image < 8-bits            * */
/* *                                                                        * */
/* *             0.9.4 - 12/16/2000 - G.Juyn                                * */
/* *             - fixed mixup of data- & function-pointers (thanks Dimitri)* */
/* *             0.9.4 -  1/18/2001 - G.Juyn                                * */
/* *             - removed "old" MAGN methods 3 & 4                         * */
/* *             - added "new" MAGN methods 3, 4 & 5                        * */
/* *             - removed test filter-methods 1 & 65                       * */
/* *                                                                        * */
/* *             1.0.1 - 04/21/2001 - G.Juyn (code by G.Kelly)              * */
/* *             - added BGRA8 canvas with premultiplied alpha              * */
/* *             1.0.1 - 04/25/2001 - G.Juyn                                * */
/* *             - moved mng_clear_cms to libmng_cms                        * */
/* *                                                                        * */
/* *             1.0.2 - 06/25/2001 - G.Juyn                                * */
/* *             - added option to turn off progressive refresh             * */
/* *                                                                        * */
/* *             1.0.4 - 11/04/2001 - G.Juyn                                * */
/* *             - fixed possible compile-problem in cleanup_rowproc        * */
/* *             1.0.4 - 06/22/2002 - G.Juyn                                * */
/* *             - B558212 - off by one error                               * */
/* *             - MNG subimage alpha composite wrong for rgba8 images      * */
/* *                                                                        * */
/* *             1.0.5 - 08/07/2002 - G.Juyn                                * */
/* *             - added test-option for PNG filter method 193 (=no filter) * */
/* *             1.0.5 - 08/15/2002 - G.Juyn                                * */
/* *             - completed PROM support                                   * */
/* *             - completed delta-image support                            * */
/* *             1.0.5 - 08/16/2002 - G.Juyn                                * */
/* *             - completed MAGN support (16-bit functions)                * */
/* *             1.0.5 - 08/19/2002 - G.Juyn                                * */
/* *             - B597134 - libmng pollutes the linker namespace           * */
/* *             1.0.5 - 09/19/2002 - G.Juyn                                * */
/* *             - optimized restore-background for bKGD cases              * */
/* *             1.0.5 - 09/20/2002 - G.Juyn                                * */
/* *             - finished support for BACK image & tiling                 * */
/* *             1.0.5 - 09/22/2002 - G.Juyn                                * */
/* *             - added bgrx8 canvas (filler byte)                         * */
/* *             1.0.5 - 09/23/2002 - G.Juyn                                * */
/* *             - added compose over/under routines for PAST processing    * */
/* *             - added flip & tile routines for PAST processing           * */
/* *                                                                        * */
/* *             1.0.6 - 03/09/2003 - G.Juyn                                * */
/* *             - hiding 12-bit JPEG stuff                                 * */
/* *             1.0.6 - 05/11/2003 - Glenn RP                              * */
/* *             - added size-optimization COMPOSE routine usage            * */
/* *             1.0.6 - 05/11/2003 - G. Juyn                               * */
/* *             - added conditionals around canvas update routines         * */
/* *             1.0.6 - 05/25/2003 - Glenn RP                              * */
/* *             - added size-optimization DIV255B8 routine usage           * */
/* *             1.0.6 - 06/09/2003 - G. R-P                                * */
/* *             - added conditionals around 8-bit magn routines            * */
/* *             1.0.6 - 07/07/2003 - G. R-P                                * */
/* *             - removed conditionals around 8-bit magn routines          * */
/* *             - added MNG_NO_16BIT_SUPPORT and MNG_NO_DELTA_PNG          * */
/* *               conditionals                                             * */
/* *             - reversed many loops to use decrementing counter          * */
/* *             - combined init functions                                  * */
/* *             - converted some switches to array references              * */
/* *             1.0.6 - 07/29/2003 - G.Juyn                                * */
/* *             - fixed duplicate for-loop                                 * */
/* *             1.0.6 - 07/29/2003 - G.R-P                                 * */
/* *             - added SKIPCHUNK conditionals around PAST chunk support   * */
/* *             - fixed "FOOTPRINT_COMPOSEIV" typo (now "FOOTPRINT_DIV")   * */
/* *             1.0.6 - 08/17/2003 - G.R-P                                 * */
/* *             - added more conditionals around "promote" functions       * */
/* *                                                                        * */
/* *             1.0.7 - 11/27/2003 - R.A                                   * */
/* *             - added CANVAS_RGB565 and CANVAS_BGR565                    * */
/* *             1.0.7 - 12/06/2003 - R.A                                   * */
/* *             - added CANVAS_RGBA565 and CANVAS_BGRA565                  * */
/* *             1.0.7 - 01/25/2004 - J.S                                   * */
/* *             - added premultiplied alpha canvas' for RGBA, ARGB, ABGR   * */
/* *             1.0.7 - 03/08/2004 - G.R-P                                 * */
/* *             - added more conditionals around 16-bit-supporting code    * */
/* *             1.0.7 - 03/09/2004 - G.Juyn                                * */
/* *             - fixed bug in promote_g8_g8 with 16bit support off        * */
/* *             1.0.7 - 03/09/2004 - G.R-P                                 * */
/* *             - more optimizations with 16bit support off                * */
/* *             1.0.7 - 03/10/2004 - G.Juyn                                * */
/* *             - fixed some warnings for 16bit optimizations              * */
/* *             1.0.7 - 03/21/2004 - G.Juyn                                * */
/* *             - fixed some 64-bit platform compiler warnings             * */
/* *                                                                        * */
/* *             1.0.8 - 06/20/2004 - G.Juyn                                * */
/* *             - some speed optimizations (thanks to John Stiles)         * */
/* *             1.0.8 - 08/01/2004 - G.Juyn                                * */
/* *             - added support for 3+byte pixelsize for JPEG's            * */
/* *                                                                        * */
/* ************************************************************************** */

#include "libmng.h"
#include "libmng_data.h"
#include "libmng_error.h"
#include "libmng_trace.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "libmng_objects.h"
#include "libmng_object_prc.h"
#include "libmng_memory.h"
#include "libmng_cms.h"
#include "libmng_filter.h"
#include "libmng_pixels.h"

#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
#pragma option -A                      /* force ANSI-C */
#endif

/* ************************************************************************** */

#ifdef MNG_INCLUDE_DISPLAY_PROCS

/* TODO: magnification & canvas-positioning/-clipping */

/* TODO: major optimization of pixel-loops by using assembler (?) */

/* ************************************************************************** */
/* *                                                                        * */
/* * Interlace tables                                                       * */
/* *                                                                        * */
/* ************************************************************************** */

MNG_LOCAL mng_uint32 const interlace_row      [7] = { 0, 0, 4, 0, 2, 0, 1 };
MNG_LOCAL mng_uint32 const interlace_rowskip  [7] = { 8, 8, 8, 4, 4, 2, 2 };
MNG_LOCAL mng_uint32 const interlace_col      [7] = { 0, 4, 0, 2, 0, 1, 0 };
MNG_LOCAL mng_uint32 const interlace_colskip  [7] = { 8, 8, 4, 4, 2, 2, 1 };
MNG_LOCAL mng_uint32 const interlace_roundoff [7] = { 7, 7, 3, 3, 1, 1, 0 };
MNG_LOCAL mng_uint32 const interlace_divider  [7] = { 3, 3, 2, 2, 1, 1, 0 };

/* ************************************************************************** */
/* *                                                                        * */
/* * Alpha composing macros                                                 * */
/* * the code below is slightly modified from the libpng package            * */
/* * the original was last optimized by Greg Roelofs & Mark Adler           * */
/* *                                                                        * */
/* ************************************************************************** */

#define MNG_COMPOSE8(RET,FG,ALPHA,BG) {                                    \
       mng_uint16 iH = (mng_uint16)((mng_uint16)(FG) * (mng_uint16)(ALPHA) \
                        + (mng_uint16)(BG)*(mng_uint16)(255 -              \
                          (mng_uint16)(ALPHA)) + (mng_uint16)128);         \
       (RET) = (mng_uint8)((iH + (iH >> 8)) >> 8); }

#define MNG_COMPOSE16(RET,FG,ALPHA,BG) {                                   \
       mng_uint32 iH = (mng_uint32)((mng_uint32)(FG) * (mng_uint32)(ALPHA) \
                        + (mng_uint32)(BG)*(mng_uint32)(65535L -           \
                          (mng_uint32)(ALPHA)) + (mng_uint32)32768L);      \
       (RET) = (mng_uint16)((iH + (iH >> 16)) >> 16); }

/* ************************************************************************** */
/* *                                                                        * */
/* * Alpha blending macros                                                  * */
/* * this code is based on Adam Costello's "Note on Compositing" from the   * */
/* * mng-list which gives the following formula:                            * */
/* *                                                                        * */
/* * top pixel       = (Rt, Gt, Bt, At)                                     * */
/* * bottom pixel    = (Rb, Gb, Bb, Ab)                                     * */
/* * composite pixel = (Rc, Gc, Bc, Ac)                                     * */
/* *                                                                        * */
/* * all values in the range 0..1                                           * */
/* *                                                                        * */
/* * Ac = 1 - (1 - At)(1 - Ab)                                              * */
/* * s = At / Ac                                                            * */
/* * t = (1 - At) Ab / Ac                                                   * */
/* * Rc = s Rt + t Rb                                                       * */
/* * Gc = s Gt + t Gb                                                       * */
/* * Bc = s Bt + t Bb                                                       * */
/* *                                                                        * */
/* * (I just hope I coded it correctly in integer arithmetic...)            * */
/* *                                                                        * */
/* ************************************************************************** */

#define MNG_BLEND8(RT, GT, BT, AT, RB, GB, BB, AB, RC, GC, BC, AC) {         \
       mng_uint32 S, T;                                                      \
       (AC) = (mng_uint8)((mng_uint32)255 -                                  \
                          ((((mng_uint32)255 - (mng_uint32)(AT)) *           \
                            ((mng_uint32)255 - (mng_uint32)(AB))   ) >> 8)); \
       S    = (mng_uint32)(((mng_uint32)(AT) << 8) /                         \
                           (mng_uint32)(AC));                                \
       T    = (mng_uint32)(((mng_uint32)255 - (mng_uint32)(AT)) *            \
                            (mng_uint32)(AB) / (mng_uint32)(AC));            \
       (RC) = (mng_uint8)((S * (mng_uint32)(RT) +                            \
                           T * (mng_uint32)(RB) + (mng_uint32)127) >> 8);    \
       (GC) = (mng_uint8)((S * (mng_uint32)(GT) +                            \
                           T * (mng_uint32)(GB) + (mng_uint32)127) >> 8);    \
       (BC) = (mng_uint8)((S * (mng_uint32)(BT) +                            \
                           T * (mng_uint32)(BB) + (mng_uint32)127) >> 8); }

#define MNG_BLEND16(RT, GT, BT, AT, RB, GB, BB, AB, RC, GC, BC, AC) {            \
       mng_uint32 S, T;                                                          \
       (AC) = (mng_uint16)((mng_uint32)65535 -                                   \
                           ((((mng_uint32)65535 - (mng_uint32)(AT)) *            \
                             ((mng_uint32)65535 - (mng_uint32)(AB))   ) >> 16)); \
       S    = (mng_uint32)(((mng_uint32)(AT) << 16) /                            \
                            (mng_uint32)(AC));                                   \
       T    = (mng_uint32)(((mng_uint32)65535 - (mng_uint32)(AT)) *              \
                            (mng_uint32)(AB) / (mng_uint32)(AC));                \
       (RC) = (mng_uint16)((S * (mng_uint32)(RT) +                               \
                            T * (mng_uint32)(RB) + (mng_uint32)32767) >> 16);    \
       (GC) = (mng_uint16)((S * (mng_uint32)(GT) +                               \
                            T * (mng_uint32)(GB) + (mng_uint32)32767) >> 16);    \

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区视频在线看| 久久综合精品国产一区二区三区| 免费不卡在线观看| 中文字幕一区在线观看| 欧美日韩一区二区不卡| 成人丝袜视频网| 久久成人精品无人区| 亚洲国产欧美在线人成| 日本一区免费视频| 日韩一区二区电影| 欧美色网一区二区| 91蜜桃在线免费视频| 成人永久免费视频| 成人中文字幕在线| 国产精品一区二区x88av| 裸体歌舞表演一区二区| 爽爽淫人综合网网站| 捆绑调教美女网站视频一区| 色狠狠色狠狠综合| 国产福利精品导航| 国产91丝袜在线观看| 国产一区二区三区不卡在线观看 | 国产精品欧美久久久久无广告| 欧美乱妇15p| 日韩欧美精品在线视频| 欧美精品精品一区| 欧美电视剧在线看免费| 久久尤物电影视频在线观看| 日韩欧美高清一区| 久久久久久久av麻豆果冻| 国产亚洲美州欧州综合国| 久久精品视频网| 又紧又大又爽精品一区二区| 中文av一区特黄| 亚洲欧美国产77777| 亚洲一二三级电影| 九九精品视频在线看| 处破女av一区二区| 欧美亚洲一区二区三区四区| 日韩三级电影网址| 国产精品女上位| 视频在线观看国产精品| 久久se这里有精品| 色综合欧美在线视频区| 3751色影院一区二区三区| 久久午夜免费电影| 亚洲国产日韩在线一区模特 | 91丝袜美女网| 在线综合+亚洲+欧美中文字幕| 精品福利av导航| 亚洲国产精品久久一线不卡| 韩日av一区二区| 欧美老肥妇做.爰bbww| 国产精品毛片久久久久久| 丝袜诱惑亚洲看片| 一本到不卡免费一区二区| 欧美一卡2卡3卡4卡| 亚洲国产精品影院| 91在线视频免费91| 欧美激情在线看| 国产一区二区三区四区在线观看 | 天使萌一区二区三区免费观看| 成人激情文学综合网| 欧美va在线播放| 石原莉奈在线亚洲三区| 色老头久久综合| 亚洲精品一二三| 一本久久综合亚洲鲁鲁五月天| 日本一区二区三区电影| 国产成人日日夜夜| 久久精品一区二区三区四区| 日韩二区在线观看| 欧美福利视频导航| 国产在线精品免费| 91毛片在线观看| 91精品国产综合久久福利| 一区视频在线播放| 国产精品香蕉一区二区三区| 欧美电影免费观看高清完整版在线| 丝袜a∨在线一区二区三区不卡| 色菇凉天天综合网| 亚洲曰韩产成在线| 欧美精品一区视频| 成人免费毛片高清视频| 中文字幕+乱码+中文字幕一区| 大陆成人av片| 依依成人综合视频| 91精品国模一区二区三区| 国产一区欧美二区| 亚洲男人的天堂网| 欧美电影免费观看完整版| 99久久99久久精品国产片果冻| 精品日韩欧美在线| 国产精品一区二区在线播放| 欧美韩国日本不卡| 在线观看亚洲成人| 韩国女主播成人在线观看| 国产精品激情偷乱一区二区∴| 欧美性猛片xxxx免费看久爱| 精品一区二区三区免费观看| 亚洲人成网站精品片在线观看| 欧美伊人久久久久久久久影院 | 久久久久国产一区二区三区四区 | 久久午夜羞羞影院免费观看| 午夜欧美大尺度福利影院在线看| 91精品国产黑色紧身裤美女| 亚洲午夜视频在线| 亚洲色图另类专区| 精品国产一区二区三区不卡| 91美女在线看| 岛国精品在线观看| 国产在线麻豆精品观看| 午夜天堂影视香蕉久久| 亚洲欧美另类综合偷拍| 国产日韩av一区| 久久先锋资源网| 久久精品一区八戒影视| 91精品国产色综合久久| 欧美日韩在线播放一区| 色综合天天综合狠狠| 一本到一区二区三区| 岛国精品在线播放| 福利电影一区二区| 国产一区在线视频| 国产白丝网站精品污在线入口| 日本不卡一区二区三区| 日本视频在线一区| 精品一区二区影视| 国产·精品毛片| av在线一区二区| 91黄色激情网站| 777亚洲妇女| 精品国产sm最大网站| 日本一区二区三区电影| 亚洲视频网在线直播| 亚洲国产精品一区二区www| 日本伊人午夜精品| 韩国av一区二区三区四区| 国产69精品一区二区亚洲孕妇| 成人性生交大片免费看视频在线| 成人免费视频视频在线观看免费 | 国产欧美视频一区二区三区| 国产精品毛片a∨一区二区三区| 亚洲精选免费视频| 日韩福利电影在线观看| 高清国产一区二区| 欧美三级三级三级爽爽爽| 日韩精品专区在线| 一区二区三区久久| 国产激情91久久精品导航| 欧美日韩一级视频| 一区二区三区在线视频观看58 | 久久精品免费在线观看| 亚洲欧美日韩电影| 国产美女主播视频一区| 欧美午夜理伦三级在线观看| 日韩欧美国产午夜精品| 亚洲已满18点击进入久久| 韩国成人精品a∨在线观看| 欧美在线|欧美| 日本一区二区在线不卡| 免费高清在线视频一区·| 99在线精品免费| 国产女人水真多18毛片18精品视频| 亚洲国产欧美日韩另类综合| www.欧美日韩国产在线| 久久天堂av综合合色蜜桃网| 日日摸夜夜添夜夜添亚洲女人| 成人免费视频国产在线观看| 欧美男男青年gay1069videost| 中文字幕日本不卡| 成人网男人的天堂| 国产精品欧美精品| 福利91精品一区二区三区| 国产亚洲欧美一级| 国产一区二区视频在线播放| 精品免费一区二区三区| 久久99深爱久久99精品| 日韩一卡二卡三卡四卡| 日韩精品一区第一页| 欧美一区二区三区在线看| 免费高清不卡av| 久久久久国产成人精品亚洲午夜| 不卡电影一区二区三区| 久久婷婷国产综合国色天香| 蜜桃视频在线一区| 久久久精品2019中文字幕之3| 国产精品一区在线| 日韩美女啊v在线免费观看| 99国产欧美久久久精品| 亚洲人妖av一区二区| 欧美亚州韩日在线看免费版国语版| 一区二区三区四区在线| 欧美一级高清片| 国产精品一区二区免费不卡| 亚洲欧美日韩久久精品| 欧美一级片免费看| 91视频一区二区三区| 麻豆成人免费电影| 精品美女被调教视频大全网站|