Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Macros | Functions | Variables
wedge.c File Reference
#include <stdio.h>
#include "rle.h"
#include "qcr.h"
Include dependency graph for wedge.c:

Go to the source code of this file.

Macros

#define IMG_WIDTH   2048
 
#define IMG_HEIGHT   1536
 
#define STEPS   (16+1)
 

Functions

 main ()
 

Variables

rle_pixelraster
 
static char * color_names [3] = { "red", "green", "blue" }
 

Macro Definition Documentation

#define IMG_HEIGHT   1536

Definition at line 16 of file wedge.c.

#define IMG_WIDTH   2048

Definition at line 15 of file wedge.c.

#define STEPS   (16+1)

Definition at line 22 of file wedge.c.

Function Documentation

main ( )

Definition at line 28 of file wedge.c.

References color_names, and raster.

29 {
30  register rle_pixel * rptr;
31  register int i,j,color, val;
32 
33  raster = (rle_pixel *) malloc( (STEPS * 2 + 2) * IMG_HEIGHT /*/4*/ );
34  rptr = raster;
35 
36  init_qcr( 1 );
37 
38  for (color = 0; color < 3; color++)
39  for (j = 0; j < IMG_HEIGHT/4; j++)
40  {
41  for (i = 0; i < STEPS; i++)
42  {
43  *rptr = IMG_WIDTH / STEPS;
44  val = i * (256 / (STEPS-1));
45  if (val >= 256)
46  {
47  val = 255;
48  /* Add round-off to fill out scanline */
49  *rptr += IMG_WIDTH - (STEPS * (IMG_WIDTH / STEPS));
50  }
51  rptr++;
52  *rptr++ = val;
53  }
54  }
55 
56  /* Do first three color bars. */
57  for (color = 0; color < 3; color++)
58  {
60  color * (IMG_HEIGHT/4) );
61 
62  fprintf(stderr, "Sending color %s...\n", color_names[color] );
63  write_qcr_cmd( RED_RLE + color );
64 
65  if (write_data( raster, (STEPS * 2) * (IMG_HEIGHT / 4) ) <= 0)
66  perror("wedge: error sending data");
67  qcr_wait_srq();
68  fprintf(stderr, "...sent\n\n");
69  }
70 
71  color = 3;
73  color * (IMG_HEIGHT/4) );
74 
75  fprintf(stderr, "Sending three passes (for gray)...\n");
77 
78  if (write_data( raster, ((STEPS * 2) * (IMG_HEIGHT / 4)) * 3 ) <= 0)
79  perror("wedge: error sending data");
80  qcr_wait_srq();
81  fprintf(stderr, "...sent\n\n");
82 }
qcr_wait_srq()
Definition: qcr.c:26
#define IMG_HEIGHT
Definition: wedge.c:16
write_qcr_cmd(int cmd)
Definition: qcr.c:55
int init_qcr(short verbose)
Definition: qcr.c:104
#define THREE_PASS_RLE
Definition: qcr.h:32
write_data(char *buff, int len)
Definition: qcr.c:74
static char * color_names[3]
Definition: wedge.c:26
#define RED_RLE
Definition: qcr.h:43
#define IMG_WIDTH
Definition: wedge.c:15
#define STEPS
Definition: wedge.c:22
unsigned char rle_pixel
Definition: rle.h:56
rle_pixel * raster
Definition: wedge.c:24
void * malloc()
int i
Definition: rletorla.c:82
set_up_qcr(int x_size, int y_size, int nslice, int offset)
Definition: qcr.c:303

Variable Documentation

char* color_names[3] = { "red", "green", "blue" }
static

Definition at line 26 of file wedge.c.

Referenced by main().

rle_pixel* raster

Definition at line 24 of file wedge.c.

Referenced by main().