int pflip;
int pflop;
int quart;
+ int rotate;
}
luma;
void luma_init( luma *this )
{
+ memset( this, 0, sizeof( luma ) );
this->type = 0;
this->w = 720;
this->h = 576;
this->h *= 2;
}
+ if ( this->rotate )
+ {
+ int t = this->w;
+ this->w = this->h;
+ this->h = t;
+ }
+
int max = ( 1 << 16 ) - 1;
uint16_t *image = malloc( this->w * this->h * sizeof( uint16_t ) );
uint16_t *end = image + this->w * this->h;
}
}
+ if ( this->rotate )
+ {
+ uint16_t *image2 = malloc( this->w * this->h * sizeof( uint16_t ) );
+ for ( i = 0; i < this->h; i ++ )
+ {
+ p = image + i * this->w;
+ r = image2 + this->h - i - 1;
+ for ( j = 0; j < this->w; j ++ )
+ {
+ *r = *( p ++ );
+ r += this->h;
+ }
+ }
+ i = this->w;
+ this->w = this->h;
+ this->h = i;
+ free( image );
+ image = image2;
+ }
+
return image;
}
this.pflop = atoi( argv[ ++ arg ] );
else if ( !strcmp( argv[ arg ], "-quart" ) )
this.quart = atoi( argv[ ++ arg ] );
+ else if ( !strcmp( argv[ arg ], "-rotate" ) )
+ this.rotate = atoi( argv[ ++ arg ] );
else
fprintf( stderr, "ignoring %s\n", argv[ arg ] );
}