videogen.c File Reference
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  VObj

Macros

#define SCALEBITS   8
#define ONE_HALF   (1 << (SCALEBITS - 1))
#define FIX(x)   ((int) ((x) * (1L << SCALEBITS) + 0.5))
#define DEFAULT_WIDTH   352
#define DEFAULT_HEIGHT   288
#define DEFAULT_NB_PICT   50 /* 2 seconds */
#define NOISE_X   10
#define NOISE_Y   30
#define NOISE_W   26
#define FRAC_BITS   8
#define FRAC_ONE   (1 << FRAC_BITS)
#define NB_OBJS   10

Typedefs

typedef struct VObj VObj

Functions

static void rgb24_to_yuv420p (uint8_t *lum, uint8_t *cb, uint8_t *cr, uint8_t *src, int width, int height)
static void pgmyuv_save (const char *filename, int w, int h, unsigned char *rgb_tab)
static void put_pixel (int x, int y, int r, int g, int b)
static unsigned int myrnd (unsigned int *seed_ptr, int n)
static int int_cos (int a)
static void gen_image (int num, int w, int h)
int main (int argc, char **argv)

Variables

unsigned char * rgb_tab
int width
int height
int wrap
VObj objs [NB_OBJS]
unsigned int seed = 1

Macro Definition Documentation

#define DEFAULT_HEIGHT   288

Definition at line 103 of file videogen.c.

Referenced by main().

#define DEFAULT_NB_PICT   50 /* 2 seconds */

Definition at line 104 of file videogen.c.

Referenced by main().

#define DEFAULT_WIDTH   352

Definition at line 102 of file videogen.c.

Referenced by main().

#define FIX (   x)    ((int) ((x) * (1L << SCALEBITS) + 0.5))

Definition at line 30 of file videogen.c.

Referenced by rgb24_to_yuv420p().

#define FRAC_BITS   8

Definition at line 176 of file videogen.c.

Referenced by gen_image().

#define FRAC_ONE   (1 << FRAC_BITS)

Definition at line 177 of file videogen.c.

Referenced by gen_image(), and int_cos().

#define NB_OBJS   10

Definition at line 196 of file videogen.c.

Referenced by gen_image().

#define NOISE_W   26

Definition at line 174 of file videogen.c.

Referenced by gen_image().

#define NOISE_X   10

Definition at line 172 of file videogen.c.

Referenced by gen_image().

#define NOISE_Y   30

Definition at line 173 of file videogen.c.

Referenced by gen_image().

#define ONE_HALF   (1 << (SCALEBITS - 1))

Definition at line 29 of file videogen.c.

Referenced by rgb24_to_yuv420p().

#define SCALEBITS   8

Definition at line 28 of file videogen.c.

Referenced by rgb24_to_yuv420p().

Typedef Documentation

typedef struct VObj VObj

Function Documentation

static void gen_image ( int  num,
int  w,
int  h 
)
static

Definition at line 207 of file videogen.c.

Referenced by main().

static int int_cos ( int  a)
static

Definition at line 180 of file videogen.c.

Referenced by gen_image().

int main ( int  argc,
char **  argv 
)

Definition at line 271 of file videogen.c.

static unsigned int myrnd ( unsigned int *  seed_ptr,
int  n 
)
static

Definition at line 157 of file videogen.c.

Referenced by gen_image().

static void pgmyuv_save ( const char *  filename,
int  w,
int  h,
unsigned char *  rgb_tab 
)
static

Definition at line 106 of file videogen.c.

Referenced by main().

static void put_pixel ( int  x,
int  y,
int  r,
int  g,
int  b 
)
static

Definition at line 143 of file videogen.c.

Referenced by gen_image().

static void rgb24_to_yuv420p ( uint8_t *  lum,
uint8_t *  cb,
uint8_t *  cr,
uint8_t *  src,
int  width,
int  height 
)
static

Definition at line 32 of file videogen.c.

Referenced by pgmyuv_save().

Variable Documentation

int height

Definition at line 141 of file videogen.c.

VObj objs[NB_OBJS]

Definition at line 203 of file videogen.c.

unsigned char* rgb_tab

Definition at line 140 of file videogen.c.

int width

Definition at line 141 of file videogen.c.

int wrap

Definition at line 141 of file videogen.c.