From 521c43173490ffab7b2011b3e93bc7ba1f20e847 Mon Sep 17 00:00:00 2001 From: Stanislau Tsitsianok Date: Fri, 3 Apr 2020 22:33:47 +0300 Subject: [PATCH] fixed failing tests --- Tests/images/imagedraw_ellipse_L.png | Bin 359 -> 318 bytes Tests/images/imagedraw_ellipse_RGB.png | Bin 466 -> 408 bytes Tests/images/imagedraw_ellipse_edge.png | Bin 602 -> 622 bytes Tests/images/imagedraw_ellipse_width.png | Bin 452 -> 439 bytes Tests/images/imagedraw_ellipse_width_fill.png | Bin 477 -> 465 bytes .../images/imagedraw_ellipse_width_large.png | Bin 4455 -> 4451 bytes Tests/images/imagedraw_ellipse_zero_width.png | Bin 339 -> 333 bytes Tests/test_imagedraw.py | 4 +- Tests/test_imagedraw2.py | 2 +- src/libImaging/Draw.c | 108 +++++++++--------- 10 files changed, 56 insertions(+), 58 deletions(-) diff --git a/Tests/images/imagedraw_ellipse_L.png b/Tests/images/imagedraw_ellipse_L.png index e47e6e441c16afcc1edb2f7c2a715fd36469c096..d5959cc0820251a9d76a3f3fe0a6ed60fd8dd2ad 100644 GIT binary patch delta 291 zcmV+;0o?xQ0=@!}B!2}-L_t(|obA}%4Z<)G17L$#BP(?OIkG|*;Q=9vM9x0-=TK`u zRY3XVqz}CSj^j9v<2cS~a?Aa^y)Wj>U5^|vEkBSUxk>v50HCXki2NWDjD!pbnNg57 zBmkgu<-XRy)WWYdgcyoK5o!nuLj;2>1d$A?#E57xMR>Z_Cx1lbBBV-rlSGlYN_CS| zk+4d2lhYu{Er~Ye3d?20$bQJ&lYcdS%e%sI9fKq{C3x|!Zj!4KO%UZxGF8G+sJ@9_ zC7$U>6Hy^^BU>&>VY4aS6G5T#FW-2o@EKcpx`-mo@qcq7F=n>~7JB_M}qYeN7002ovPDHLkV1ljyfiM67 delta 332 zcmV-S0ki(T0_OsdB!4bRL_t(|ob8y=4TC@oL*4FiE3p3@tiU4uXc2sHwj+8Vwe}a4 z3=by})dh&6D2k#eihf3qlDln}%N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5_yB?&-uxGs&eVpPMveE3_#%N>gTe~DWM4f D32FtN diff --git a/Tests/images/imagedraw_ellipse_width.png b/Tests/images/imagedraw_ellipse_width.png index ec0ca6731f69b8728a41a59ae2cd8ebaa0cb71c5..54cfc291ca247de31cc3033575b4993e7f704e11 100644 GIT binary patch delta 413 zcmV;O0b>5d1GfW^B!7NML_t(|obB7ea)Lk*gyD_v|IX%+3lbJ>obFkz|GQe*8M;Ow zvWx)$00000000000C?F?cLQ7Z`A19i+1|uSKr?MUH->c~rmcp~Tf%xXrmblI;jjv0 z+6o;-GOVXboiy{#-g5Z*BoNl&fq#|M^{ssD=39DDo=!5UzzY1XqYQx%{Ai93D-qkHTZ82E_!V(acfUpFF zB_J#TVF?IJP=6bi>uylwx;JLB1cW7Md2aZr70bhF-yOG8*-zkWm>e!|Ek{`E3|Da{ znG<|wxa?I-VTGQjpRQj&;M_V0d|@SrE3{j{eKL0MH;e9PYk6*1HDc+Vf9xq0uv=Nc zK6n9dSgcp(5%2EEcq>fC`-T^-{w6B`000000000002cfLlP)$?u6pK600000NkvXX Hu0mjfwqC&g delta 426 zcmdnae1v&|N`1Gdi(^Q|oVT}cuREk5(3<$=@BK*qSrWn;Z?8mVulTwDwXDQ6nKJEd zYz%N<@is8_!132F_+NSJu76;#I4<&RsBHX+70>nV$%lFQ+^=!2xK)+4mUEKOR?BB| zBKPM!^v?M|Z^JWZ-m4RCgv?M}bMk}U_jMVcXIQP-TOYXei*|0!fjtNFH?cjoJGC^C z*Z$`nLB8nVx&6B~@Ob*(n)2jnOxv!|I>h*cWwCN`S$B1o1I>Mhj$yb zJhgeSwRUOy)9N+0>YL@hp82$&N$A^&d7=}fuVrNyOb(k`k`}sm^S{;XFLx`gVK~I4 zfJD?Y{I{-XuHMtEzkjmvlrYiL1`e{*>Q%X_efYDtPMs0ipD1aiK7E`1w>1o|5uesC zDLb*hY4cf~(zw3!&LY#k?rVD+*P54h^V6og4w@D0^Jh=jUl~>+mG<=Mzy9ggOBwHk z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F3$Z>{dJpsO zDCh-cn6YvX2U?>$@HUL!QXt(@pePBZEh2D-2N#nBlU(L6@CFop_*wL_)=oA3i?6q4 zU_juYY263QJtF}R?SnGC*^g#rlO3ayyagDUc|`a=A4vqs!LQa$F8vGWvXD~1;bo2W z2#VzB%sEHTPc6NN&eHP39a>+7zOm0t8NVH?H@$ERtr~DtzT{WyEdpQv-HUrWb{sgi zMsk>cIdr6ad=kYrXcfV3@tWDT)#ZJ!7|mw}fxq*QL(O?ddSh@P?C-80EWGvm9-t7k z{rhGh8nk`zTtC~DUXbGs$19Tg*IwWF9o~H&LSt9tOd=J;u8|;Z&CoDY_hb1o1*7G4 ytXqhRg8}O|5{CBPf$yJU+hARZ{EsJUafj1Nu}e$5{e>25D$3LbS$pzQ%)bCQq-O8{ diff --git a/Tests/images/imagedraw_ellipse_zero_width.png b/Tests/images/imagedraw_ellipse_zero_width.png index f14a279f2fe2b17911e7fa8ced05c4829d5d7b0f..6661b7d999e37cf6593cc469b9055ff2c048c09c 100644 GIT binary patch delta 306 zcmcc2be3s?O1+4ui(^Q|oVT|P^A0=kusEpdKfiq0%HwgU$2`_ETbibSYidoHyN;Uy z3>voA&i%)v|LWRO*X5^IP36AaUsv3)-#7hP%w+pay`S6H zZhH0b=k-$EsiD%&V$04<4}C0rEsb}2=;n{7h1E~5I`~Gpxc>O5RVyDfUlz}ootM9C zjg;rvkoqNOxp=08{+(zZT0HM8SIP9yvz7lt=O&tIFIdyCiD_+WXnMr#EbmQ`jH#?s zL<7PcV2lI4nFrFqLI>v8GtL(Ma6l8Z;he3*(%H|< z00s@0>&o^wZr@dNaL?V;tCOai+zbi3tETcXYVU)K-xYTk`9)hteqC|HUd%7d*5K#u zNheo{cI!lB)NRVDX-&=MogTXRV|VzSkGVf0CZ}Fa_%^My{`jd?DdZ9_o0v{state = 0; + s->bufcnt = 0; + s->leftmost = a % 2; quarter_init(&s->st_o, a, b); if (w < 1 || quarter_next(&s->st_o, &s->pr, &s->py) == -1) { s->finished = 1; } else { s->finished = 0; quarter_init(&s->st_i, a - 2 * (w - 1), b - 2 * (w - 1)); - s->pl = a % 2; + s->pl = s->leftmost; } } int8_t ellipse_next(ellipse_state* s, int32_t* ret_x0, int32_t* ret_y, int32_t* ret_x1) { - switch (s->state) { - case 0: { - if (s->finished) { - return -1; - } - s->cy = s->py; - s->cl = s->pl; - s->cr = s->pr; - int32_t cx = 0, cy = 0; - int8_t next_ret; - while ((next_ret = quarter_next(&s->st_o, &cx, &cy)) != -1 && cy <= s->cy) { - } - s->pr = cx; - s->py = cy; - if (next_ret == -1) { - s->finished = 1; - } - while ((next_ret = quarter_next(&s->st_i, &cx, &cy)) != -1 && cy <= s->cy) { - s->cl = cx; - } - s->pl = next_ret == -1 ? 0 : cx; - *ret_x0 = -s->cr; - *ret_y = -s->cy; - *ret_x1 = -s->cl; - s->state = 1; - return 0; - } - case 1: { - *ret_x0 = s->cl; - *ret_y = -s->cy; - *ret_x1 = s->cr; - s->state = 2; - return 0; - } - case 2: { - *ret_x0 = -s->cr; - *ret_y = s->cy; - *ret_x1 = -s->cl; - s->state = 3; - return 0; - } - case 3: { - *ret_x0 = s->cl; - *ret_y = s->cy; - *ret_x1 = s->cr; - s->state = 0; - return 0; - } - default: { - assert(0); + if (s->bufcnt == 0) { + if (s->finished) { return -1; } + int32_t y = s->py; + int32_t l = s->pl; + int32_t r = s->pr; + int32_t cx = 0, cy = 0; + int8_t next_ret; + while ((next_ret = quarter_next(&s->st_o, &cx, &cy)) != -1 && cy <= y) { + } + if (next_ret == -1) { + s->finished = 1; + } else { + s->pr = cx; + s->py = cy; + } + while ((next_ret = quarter_next(&s->st_i, &cx, &cy)) != -1 && cy <= y) { + l = cx; + } + s->pl = next_ret == -1 ? s->leftmost : cx; + + if ((l > 0 || l < r) && y > 0) { + s->cl[s->bufcnt] = l == 0 ? 2 : l; + s->cy[s->bufcnt] = y; + s->cr[s->bufcnt] = r; + ++s->bufcnt; + } + if (y > 0) { + s->cl[s->bufcnt] = -r; + s->cy[s->bufcnt] = y; + s->cr[s->bufcnt] = -l; + ++s->bufcnt; + } + if (l > 0 || l < r) { + s->cl[s->bufcnt] = l == 0 ? 2 : l; + s->cy[s->bufcnt] = -y; + s->cr[s->bufcnt] = r; + ++s->bufcnt; + } + s->cl[s->bufcnt] = -r; + s->cy[s->bufcnt] = -y; + s->cr[s->bufcnt] = -l; + ++s->bufcnt; } + --s->bufcnt; + *ret_x0 = s->cl[s->bufcnt]; + *ret_y = s->cy[s->bufcnt]; + *ret_x1 = s->cr[s->bufcnt]; + return 0; } static int