Main Page | Class List | Directories | File List | Class Members | File Members

preview.c File Reference

preview image More...

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <stdarg.h>
#include <glib.h>
#include <math.h>
#include "preview.h"
#include "ccu.h"
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_sort.h>

Functions

void init_imstat ()
 initializes the image statisics system
void preview_set_max_dimensions (int x, int y)
 sets the maximum sizes of the preview (online display)
void preview_set_enable (int in)
 sets the preview to enabled/disbaled
void preview_readout_starts (int ccu_width, int ccu_height)
 called by the aquistion system when the readout starts
void preview_fill_buffer (unsigned char *data, int size)
 fills previewbuf with data, without drawing anything
void preview_send_data ()
 checks whether new data is available for sending to the (G)UI and sends new data in this case.
void preview_readout_finished ()
 This function is called when the readout has finished.

Variables

unsigned int * previewbuf = NULL
volatile unsigned long int preview_words_sent = 0
volatile unsigned long int preview_words_ready = 0
sem_t preview_sem
double * data
volatile int preview_width = 256
volatile int preview_height = 256
volatile int preview_max_width = 400
volatile int preview_max_height = 400
volatile int preview_enable = 1
image_statistics_struct image_statistics
sem_t imstat_sem
unsigned long preview_x
unsigned long preview_y


Detailed Description

preview image

Copyright (C) 2001-2003 Dirk Huenniger (dhun@astro.uni-bonn.de)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.


Function Documentation

void init_imstat  ) 
 

initializes the image statisics system

Returns:
void
This function initializes the image statisics system. It has to be during system initialization

void preview_fill_buffer unsigned char *  data,
int  size
 

fills previewbuf with data, without drawing anything

Parameters:
data a pointer to the data to be filled into previewbuf
size the number of bytes to be read from data
Returns:
void
This function fills previewbuf without changing or redrawing rgbbuffer. It is called by the readout thread and receives the same data as routine writing the fits file

void preview_readout_finished  ) 
 

This function is called when the readout has finished.

Returns:
void
This function is called when the readout has finished. it sends the rest of the preview to the (G)UI. Furthermore it waits until the image statistics of the image have been calculated and resets the image statistics after wards (I don't understand why).

void preview_readout_starts int  ccu_width,
int  ccu_height
 

called by the aquistion system when the readout starts

Parameters:
ccu_width the width of the image acquired
ccu_height the height of the image acquired
Returns:
void
This function is called by the aquistion system when the readout starts. It resets the preview buffer and prepares the preview system. Futhermore it resets the image statistics system.

void preview_send_data  ) 
 

checks whether new data is available for sending to the (G)UI and sends new data in this case.

Returns:
void
This function checks whether new data is available for sending to the clients and sends new data in this case. This function is called by a timer. The sending to the (G)UI is done by calling ui_preview_data.

void preview_set_enable int  in  ) 
 

sets the preview to enabled/disbaled

Parameters:
in the enable mode. 1 means enabled
Returns:
void
This function sets the maximum sizes of the preview.

void preview_set_max_dimensions int  x,
int  y
 

sets the maximum sizes of the preview (online display)

Parameters:
x the maximum size in x direction
y the maximum size in y direction
Returns:
void
This function sets the maximum sizes of the preview.


Variable Documentation

double* data
 

a float buffer to calculate some image statistics

struct image_statistics_struct image_statistics
 

The current image st

sem_t imstat_sem
 

a semaphore protecting image_statistics struct of the image staitics system (would be better to move the image statistics system to an other file)

volatile int preview_enable = 1
 

1 if the Preview Data shall be sent to the User interace

volatile int preview_height = 256
 

The actual height of the preview image

volatile int preview_max_height = 400
 

The maximum height of the preview image

volatile int preview_max_width = 400
 

The maximum width of the preview image

sem_t preview_sem
 

a semaphore protecting preview_words_sent preview_words_ready and previewbuf

volatile int preview_width = 256
 

The actual width of the preview image

volatile unsigned long int preview_words_ready = 0
 

the number of bytes of bytes that have are ready to be send to the preview

volatile unsigned long int preview_words_sent = 0
 

the number of bytes of the preview image that have allready been transferred to the gui

unsigned long preview_x
 

The current postition in the dataflow received from the CCD Controller, in the system of the frame as aquired by the CCD Controller (not in the system (smaller) preview image)

unsigned long preview_y
 

The current postition in the dataflow received from the CCD Controller, in the system of the frame as aquired by the CCD Controller (not in the system (smaller) preview image)

unsigned int* previewbuf = NULL
 

a buffer to hold preview image (16 bit grey)


Generated on Fri Dec 16 22:23:39 2005 for gboccia by  doxygen 1.4.2