+/*
+ * luma.c -- image generator for transition_luma
+ * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
+ * Author: Charles Yates <charles.yates@pandora.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
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 ] );
}