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

preview.h File Reference

preview image More...

#include "semaphore.h"
#include "acquisition.h"

Go to the source code of this file.

Defines

#define __preview_h   1
#define IMAGE_WIDTH   preview_width
#define IMAGE_HEIGHT   preview_height
#define WORDS_PER_PACKET   1024

Enumerations

enum  imstat_status { imstat_void, imstat_running, imstat_done }

Functions

void preview_fill_buffer (unsigned char *data, int size)
 fills previewbuf with data, without drawing anything
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_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.
void init_imstat ()
 initializes the image statisics system
void ui_preview_data (unsigned char *data, unsigned long size)
 is called by preview.c whenever new data is ready for display
void ui_preview_reset (int width, int height)
 is called by preview.c whenever the preview resets itself
void ui_image_statistics_changed (struct image_statistics_struct input)
 called by prewiev.c and fisoutout.c whenever the image statistics have changed.

Variables

volatile int preview_width
volatile int preview_height
volatile int preview_max_width
volatile int preview_max_height
image_statistics_struct image_statistics
sem_t preview_sem
sem_t imstat_sem


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_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.

void ui_image_statistics_changed struct image_statistics_struct  input  ) 
 

called by prewiev.c and fisoutout.c whenever the image statistics have changed.

Parameters:
input a structure describing the current image statistics.
Returns:
void
This function is called by prewiev.c and fisoutout.c whenever the image statistics have changed. It is declared as an abstract function in preview.h and implemented here.

void ui_preview_data unsigned char *  Data,
unsigned long  sendBytes
 

is called by preview.c whenever new data is ready for display

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 funcition is called by preview.c whenever new data is ready for display. It is defnined as an abstract function in preview.h and implemented here.

void ui_preview_reset int  width,
int  height
 

is called by preview.c whenever the preview resets itself

Returns:
void
This funcition is called by preview.c whenever the preview resets itself. It is defnined as an abstract function in preview.h and implemented here.


Variable Documentation

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_height
 

The actual height of the preview image

volatile int preview_max_height
 

The maximum height of the preview image

volatile int preview_max_width
 

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
 

The actual width of the preview image


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