Exemplo n.º 1
0
void div_latex_display_file(FILE *outfile, divisor *pDiv)
{
    smallint counter;

    // First print coefficient of lambda
    if (pDiv->lambda != 1)
	fprintf(outfile, " %d \\lambda\n", pDiv->lambda);
    else
	fprintf(outfile, " \\lambda\n", pDiv->lambda);
    
    // Next print the delta's using line commands
    for (counter = 0 ; counter < line_length(pDiv->pDelta) ; counter++)
	if (line_data(pDiv->pDelta, counter) != 1)
	    fprintf(outfile, " - %d \\delta_%d\n", 
		    line_data(pDiv->pDelta, counter), counter);
	else
	    fprintf(outfile, " - \\delta_%d\n", 
		    line_data(pDiv->pDelta, counter), counter);

}
Exemplo n.º 2
0
void tga::flip_vertical(const void *from_data,void *to_data)
{
    if(!from_data || !to_data || !height)
        return;

    const int line_size=width*channels, top=line_size*(height-1);

    typedef unsigned char uchar;

    uchar *to=(uchar*)to_data;

    if(from_data==to_data)
    {
        if(!line_size)
            return;

        const int half=line_size*(height/2);
        std::vector<uchar> line_data(line_size);
        uchar *line=&line_data[0];
        uchar *from=to;
        to+=top;

        for(int offset=0;offset<half;offset+=line_size)
        {
            uchar *f=from+offset, *t=to-offset;
            memcpy(line,f,line_size);
            memcpy(f,t,line_size);
            memcpy(t,line,line_size);
        }
    }
    else
    {
        const uchar *from=(const uchar*)from_data;
        to+=top;
        for(size_t offset=0;offset<uncompressed_size;offset+=line_size)
            memcpy(to-offset,from+offset,line_size);
    }
}