Go to the source code of this file.
|
#define | IS_ONE(resp_num, msg1, msg2) |
|
|
| qcr_wait_srq () |
|
| write_qcr_cmd (int cmd) |
|
| write_data (char *buff, int len) |
|
int | init_qcr (short verbose) |
|
| print_qcr_status () |
|
int | set_resolution (int fourK) |
|
| set_up_qcr (int x_size, int y_size, int nslice, int offset) |
|
| set_up_qcr_nc (xstart, ystart, xsize, ysize, fourK) |
|
| send_pixel_image (int color, char *buff, int len) |
|
| send_rle_image (int color, char *buff, int len) |
|
int | send_3pass_rle (unsigned char *buff, int len) |
|
| close_qcr () |
|
int | reset_qcr () |
|
| qcr_rd_brt_tbl (buf) |
|
| qcr_rd_brt_lvl (buf) |
|
| qcr_ld_lut12 (buf) |
|
| qcr_rd_lut12 (buf) |
|
| qcr_load_i_luts (int lut) |
|
#define IS_ONE |
( |
|
resp_num, |
|
|
|
msg1, |
|
|
|
msg2 |
|
) |
| |
Value:if (((
int)
response[resp_num + 1]) == 1) \
printf(msg1); else printf(msg2);
unsigned char response[ 8192 ]
Definition at line 162 of file qcr.c.
int init_qcr |
( |
short |
verbose | ) |
|
Definition at line 104 of file qcr.c.
113 if ((
qcr_cmd = open (
"/dev/qcrc", O_RDWR)) < 0)
115 fprintf(stderr,
"Recorder command dev not opened: error = %d\n",errno);
118 if ((
qcr_data = open (
"/dev/qcrd", O_RDWR)) < 0)
120 fprintf(stderr,
"Recorder data dev not opened: error = %d\n",errno);
124 if ((
qcr_raw = open (
"/dev/rhpib", O_RDWR)) < 0)
126 fprintf(stderr,
"/dev/rhpib not opened: error = %d\n",errno);
135 fprintf(stderr,
"Error reading response from QCR, errno = %d\n",errno);
141 fprintf(stderr,
"\n\n Matrix Camera Control, Version 0.1\n\n");
142 fprintf(stderr,
" matrix rev %s\n",
response);
147 case 0x10: command =
"M35";
break;
148 case 0x20: command =
"M120";
break;
149 case 0x40: command =
"M240";
break;
150 case 0xf0: command =
"Empty";
break;
151 default: sprintf(command,
"Unknown (%x) ",
response[0]);
break;
153 fprintf(stderr,
"Camera back: %s\n", command);
unsigned char response[ 8192 ]
Definition at line 164 of file qcr.c.
References qcr_data, response, verbose_flag, and write_qcr_cmd().
171 printf(
"Got back %d status bytes\n", len);
175 printf(
"Status data (in hex):\n");
177 for (j = 0; j < 2; j++)
179 for (i = 0; i < 16; i++)
180 printf(
"%2X ", (
int) *rp++);
188 IS_ONE(0,
"External LUTs have been loaded for RGB\n",
189 "External LUTs have not been loaded for RGB\n");
190 IS_ONE(1,
"External LUTs have been loaded for monochrome\n",
191 "External LUTs have not been loaded for monochrome\n");
192 printf(
"End of line time delay: %d\n", (
int) rp[2]);
193 IS_ONE(4,
"Automatic filter wheel operation is disabled\n",
194 "Automatic filter wheel operation is enabled\n");
195 IS_ONE(5,
"Automatic camera operation is disabled\n",
196 "Automatic camera operation is enabled\n");
198 printf(
"Start address (horiz, vert): %d, %d\n",
199 (
int)(
short)(((
short)rp[12]) << 8) | rp[13],
200 (
int)(
short)(((
short)rp[8]) << 8) | rp[9]);
202 printf(
"Image dimensions (horiz, vert): %d, %d\n",
203 (((
int) rp[10]) << 8) | rp[11],
204 (((
int) rp[6]) << 8) | rp[7] );
206 IS_ONE(15,
"Automatic calibration enabled\n",
207 "Automatic calibration disabled\n");
208 IS_ONE(16,
"End of image warble is disabled\n",
209 "End of image warble is enabled\n");
210 IS_ONE(17,
"Black jumping is disabled\n",
211 "Black jumping is enabled\n");
216 printf(
"Resolution 2K\n");
219 printf(
"Resolution 4K\n");
222 printf(
"Weird resolution: %d\n", (
int) rp[18]);
226 IS_ONE(19,
"Mode externally selected\n",
227 "Mode is not externally selected\n");
228 IS_ONE(20,
"90 degree rotation enabled\n",
229 "90 degree rotation disabled\n");
230 IS_ONE(21,
"Mirror image enabled\n",
231 "Mirror image disabled\n");
232 IS_ONE(22,
"Unbuffered raster mode enabled\n",
233 "Unbuffered raster mode disabled\n");
234 IS_ONE(23,
"Return to no filter mode is disabled\n",
235 "Return to no filter mode is enabled\n");
236 IS_ONE(24,
"Exchange of coords is selected\n",
237 "Exchange of coords is not selected\n");
238 IS_ONE(25,
"Red-repeat is enabled\n",
239 "Red-repeat is disabled\n");
240 printf(
"Frame number: %d\n", (((
int) rp[26]) << 8) | rp[27]);
241 IS_ONE(28,
"Film is in camera\n",
242 "Film is not in camera\n");
243 IS_ONE(29,
"Half frame mode enabled\n",
244 "Half frame mode disabled\n");
245 IS_ONE(30,
"Bulk back in use\n",
"" );
246 IS_ONE(31,
"180 degree rotation enabled\n",
247 "180 degree rotation not enabled\n");
unsigned char response[ 8192 ]
#define IS_ONE(resp_num, msg1, msg2)
Definition at line 565 of file qcr.c.
write_data(char *buff, int len)
qcr_load_i_luts |
( |
int |
lut | ) |
|
Definition at line 584 of file qcr.c.
587 char select_lut = lut;
write_data(char *buff, int len)
Definition at line 553 of file qcr.c.
559 perror(
"Error reading brightness levels\n" );
#define RETURN_BRIGHT_LEVELS
Definition at line 540 of file qcr.c.
546 perror(
"Error reading brightness table\n" );
#define RETURN_BRIGHT_TABLE
Definition at line 572 of file qcr.c.
578 perror(
"Error reading 12 bit LUTs\n" );
Definition at line 26 of file qcr.c.
References qcr_raw.
30 io_timeout_ctl(
qcr_raw, 90000000 );
32 if (hpib_status_wait(
qcr_raw, 1 ) == 0)
35 if ((status = hpib_spoll(
qcr_raw, 2 )) == -1)
37 fprintf(stderr,
"qcr.c: error during HPIB s-poll\n");
39 if ((status = hpib_spoll(
qcr_raw, 3 )) == -1)
41 fprintf(stderr,
"qcr.c: error during HPIB s-poll\n");
46 fprintf(stderr,
"qcr.c: HPIB timeout or error (no SRQ)\n");
Definition at line 531 of file qcr.c.
References qcr_raw.
533 fprintf(stderr,
" ** Reset QCR ** \n\n");
int send_3pass_rle |
( |
unsigned char * |
buff, |
|
|
int |
len |
|
) |
| |
Definition at line 489 of file qcr.c.
497 fprintf(stderr,
"send_3passrle_: %d bytes ... ",len);
503 fprintf(stderr,
"%d bytes sent.\n",stat);
505 fprintf(stderr,
" Error sending data, errno = %d.\n",errno);
507 return (stat == len);
write_data(char *buff, int len)
send_pixel_image |
( |
int |
color, |
|
|
char * |
buff, |
|
|
int |
len |
|
) |
| |
Definition at line 403 of file qcr.c.
424 fprintf(stderr,
"send_pixel_image: unknown color %d\n",color);
break;
428 fprintf(stderr,
"send_pixel_image: %d bytes of %s... ",len,cl);
435 fprintf(stderr,
"%d bytes sent.\n",stat);
437 fprintf(stderr,
" Error sending %s, errno = %d.\n",cl,errno);
440 return (stat == len);
write_data(char *buff, int len)
send_rle_image |
( |
int |
color, |
|
|
char * |
buff, |
|
|
int |
len |
|
) |
| |
Definition at line 443 of file qcr.c.
464 fprintf(stderr,
"send_rle_image: unknown color %d\n",color);
break;
468 fprintf(stderr,
"send_rle_image: %d bytes of %s... ",len,cl);
474 fprintf(stderr,
"%d bytes sent.\n",stat);
476 fprintf(stderr,
" Error sending %s, errno = %d.\n",cl,errno);
478 return (stat == len);
int set_resolution |
( |
int |
fourK | ) |
|
Definition at line 255 of file qcr.c.
Referenced by set_up_qcr_nc().
263 fprintf(stderr,
" Current resolution mode: %x\n",
response[18+1]);
272 printf(
"Resetting resolution to 4k, be patient.\n");
281 printf(
"Resetting resolution to 2k, be patient.\n");
unsigned char response[ 8192 ]
set_up_qcr |
( |
int |
x_size, |
|
|
int |
y_size, |
|
|
int |
nslice, |
|
|
int |
offset |
|
) |
| |
Definition at line 303 of file qcr.c.
308 short scan_start, row_start;
309 unsigned char sizes[8];
323 scan_start = (
y_size >> 1 ) - offset;
324 row_start = 0 - (
x_size >> 1 );
327 fprintf(stderr,
"-- centering %d x %d image, at (%d,%d)\n",
330 sizes[0] = (char) (row_start >> 8) & 0xff;
331 sizes[1] = (char) row_start;
333 sizes[2] = (char) (
x_size >> 8) & 0xff;
336 sizes[4] = (char) (scan_start >> 8) & 0xff;
337 sizes[5] = (char) scan_start;
339 sizes[6] = (char) (nslice >> 8) & 0xff;
340 sizes[7] = (char) nslice;
int set_resolution(int fourK)
Definition at line 354 of file qcr.c.
References qcr_data, set_resolution(), and write_qcr_cmd().
356 unsigned char sizes[8];
367 ystart = -ystart + (3072/2);
372 ystart = -ystart + (1536/2);
375 sizes[0] = (char) (
xstart >> 8) & 0xff;
376 sizes[1] = (char)
xstart & 0xff;
378 sizes[2] = (char) (
xsize >> 8) & 0xff;
379 sizes[3] = (char)
xsize;
381 sizes[4] = (char) (
ystart >> 8) & 0xff;
384 sizes[6] = (char) (
ysize >> 8) & 0xff;
385 sizes[7] = (char)
ysize;
int set_resolution(int fourK)
write_data |
( |
char * |
buff, |
|
|
int |
len |
|
) |
| |
Definition at line 74 of file qcr.c.
81 fprintf(stderr,
" write_data: burst mode on failed %d\n");
84 if (stat != len) fprintf(stderr,
" write_data: stat %d != %d (len)\n",
90 fprintf(stderr,
" write_data: burst mode off failed %d\n");
unsigned char response[ 8192 ] |