Expose new scaling factors in TurboJPEG API

This commit is contained in:
DRC
2012-01-28 06:49:56 +00:00
parent 030b6fc1c1
commit 5e805d2f4b
2 changed files with 16 additions and 2 deletions

View File

@@ -696,6 +696,7 @@ void usage(char *progname)
if(i!=nsf-1) printf(", ");
if(i==nsf-2) printf("or ");
}
if(i%8==0 && i!=0) printf("\n ");
}
printf(")\n");
printf("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\n");
@@ -811,7 +812,8 @@ int main(int argc, char *argv[])
{
for(j=0; j<nsf; j++)
{
if(temp1==scalingfactors[j].num && temp2==scalingfactors[j].denom)
if((double)temp1/(double)temp2
== (double)scalingfactors[j].num/(double)scalingfactors[j].denom)
{
sf=scalingfactors[j];
match=1; break;

View File

@@ -92,10 +92,22 @@ static const JXFORM_CODE xformtypes[TJ_NUMXOP]=
JXFORM_TRANSVERSE, JXFORM_ROT_90, JXFORM_ROT_180, JXFORM_ROT_270
};
#define NUMSF 4
#define NUMSF 16
static const tjscalingfactor sf[NUMSF]={
{2, 1},
{15, 8},
{7, 4},
{13, 8},
{3, 2},
{11, 8},
{5, 4},
{9, 8},
{1, 1},
{7, 8},
{3, 4},
{5, 8},
{1, 2},
{3, 8},
{1, 4},
{1, 8}
};