FDK/Tools/Programs/public/lib/source/cffwrite/cffwrite_t2cstr.c
/* Save stem args and ops observing stack limit and possible width arg. The
   arithmetic is performed in fixed point notation so that cumulative rounding
   errors in the delta stem list can be eliminated. */
Save stem args and ops observing stack limit and possible width arg. The
arithmetic is performed in fixed point notation so that cumulative rounding
errors in the delta stem list can be eliminated.
Save stem args and ops observing stack limit and possible width arg . The arithmetic is performed in fixed point notation so that cumulative rounding errors in the delta stem list can be eliminated .
static void saveStemOp(cstrCtx h, int iBeg, int iEnd, int op, int optimize)
	{
	enum {MAX_STEMS = (T2_MAX_OP_STACK - 1)/2};
	cfwCtx g = h->g;
	int i = iBeg;
	int stems = iEnd - iBeg;
	int ops = (stems + MAX_STEMS - 1)/MAX_STEMS;
	stems = stems - (ops - 1)*MAX_STEMS;
	if (g->flags & CFW_ENABLE_CMP_TEST)
		while (ops--)
			{
			Fixed last = 0;
			while (stems--)
				{
				Stem *stem = &h->stems.array[i++];
				Fixed edge0 = float2Fixed(stem->edge0);
				Fixed edge1 = float2Fixed(stem->edge1);
				tmp_savefixed(g, edge0 - last);
				tmp_savefixed(g, edge1 - edge0);
				last = edge1;
				}
			if (ops > 0 || !optimize)
				tmp_saveop(g, op);
			stems = MAX_STEMS;
			}
	else
		while (ops--)
			{
			float last = 0;
			while (stems--)
				{
				Stem *stem = &h->stems.array[i++];
				tmp_savefixed(g, float2Fixed(stem->edge0 - last));
				tmp_savefixed(g, float2Fixed(stem->edge1 - stem->edge0));
				last = stem->edge1;
				}
			if (ops > 0 || !optimize)
				tmp_saveop(g, op);
			stems = MAX_STEMS;
			}
	}
static void saveStemOp ( cstrCtx h , int iBeg , int iEnd , int op , int optimize ) { enum { MAX_STEMS = ( T2_MAX_OP_STACK - 1 ) / 2 } ; cfwCtx g = h -> g ; int i = iBeg ; int stems = iEnd - iBeg ; int ops = ( stems + MAX_STEMS - 1 ) / MAX_STEMS ; stems = stems - ( ops - 1 ) * MAX_STEMS ; if ( g -> flags & CFW_ENABLE_CMP_TEST ) while ( ops -- ) { Fixed last = 0 ; while ( stems -- ) { Stem * stem = & h -> stems . array [ i ++ ] ; Fixed edge0 = float2Fixed ( stem -> edge0 ) ; Fixed edge1 = float2Fixed ( stem -> edge1 ) ; tmp_savefixed ( g , edge0 - last ) ; tmp_savefixed ( g , edge1 - edge0 ) ; last = edge1 ; } if ( ops > 0 || ! optimize ) tmp_saveop ( g , op ) ; stems = MAX_STEMS ; } else while ( ops -- ) { float last = 0 ; while ( stems -- ) { Stem * stem = & h -> stems . array [ i ++ ] ; tmp_savefixed ( g , float2Fixed ( stem -> edge0 - last ) ) ; tmp_savefixed ( g , float2Fixed ( stem -> edge1 - stem -> edge0 ) ) ; last = stem -> edge1 ; } if ( ops > 0 || ! optimize ) tmp_saveop ( g , op ) ; stems = MAX_STEMS ; } }
Save stem args and ops observing stack limit and possible width arg.
Save stem args and ops observing stack limit and possible width arg .
/* For testing; produces result compatible with typecomp CFF */ /* For production; produces "correct" result */