Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ImageCreateColour Class Reference

Create a number of images from the specified colour. More...

Inheritance diagram for ImageCreateColour:

Inheritance graph
[legend]
Collaboration diagram for ImageCreateColour:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ImageCreateColour ()
char * GetDescription () const
void CreateFrame (uint8_t *pixels, int width, int height, double position, double frame_delta)
int GetNumberOfFrames ()
void AddFrameCollector (GtkWidget *table, int row)
void InterpretFrameCollector ()
void AttachWidgets (GtkBin *bin)
void DetachWidgets (GtkBin *bin)
void InterpretWidgets (GtkBin *bin)
void CreateAudio (int16_t **buffer, short int *channels, int *frequency, int *samples)

Protected Attributes

GdkColor start
int frames
GtkWidget * picker
GtkWidget * frame_counter

Detailed Description

Create a number of images from the specified colour.

Definition at line 59 of file image_create.cc.


Constructor & Destructor Documentation

ImageCreateColour::ImageCreateColour  )  [inline]
 

Definition at line 68 of file image_create.cc.

References frames, and start.

00068                         : frame_counter( 0 )
00069     {
00070         start.red = start.green = start.blue = 0;
00071         frames = 25;
00072     }


Member Function Documentation

void ImageCreateColour::AddFrameCollector GtkWidget *  table,
int  row
[inline]
 

Definition at line 98 of file image_create.cc.

References frame_counter, frames, and on_time_range_changed().

Referenced by ImageCreateFromFile::AttachWidgets(), ImageCreateColourRange::AttachWidgets(), ImageCreateNoise::AttachWidgets(), and AttachWidgets().

00099     {
00100         GtkWidget * label = gtk_label_new( _( "Frames:" ) );
00101         gtk_widget_show( label );
00102 
00103         GtkObject *frame_counter_adj = gtk_adjustment_new( frames, 0, 999999, 1, 10, 10 );
00104         frame_counter = gtk_spin_button_new( GTK_ADJUSTMENT( frame_counter_adj ), 1, 0 );
00105         gtk_spin_button_set_value( GTK_SPIN_BUTTON( frame_counter ), frames );
00106         gtk_widget_show( frame_counter );
00107         gtk_widget_set_usize( frame_counter, 60, -2 );
00108         g_signal_connect( G_OBJECT( frame_counter ), "value-changed", G_CALLBACK( on_time_range_changed ), NULL );
00109 
00110         gtk_table_attach( GTK_TABLE( table ), label, 0, 1, row, row + 1, ( GtkAttachOptions ) ( GTK_FILL ), ( GtkAttachOptions ) ( 0 ), 0, 0 );
00111         gtk_table_attach( GTK_TABLE( table ), frame_counter, 1, 2, row, row + 1, ( GtkAttachOptions ) ( 0 ), ( GtkAttachOptions ) ( 0 ), 0, 0 );
00112     }

void ImageCreateColour::AttachWidgets GtkBin *  bin  )  [inline, virtual]
 

Reimplemented from GDKImageCreate.

Reimplemented in ImageCreateNoise, ImageCreateColourRange, and ImageCreateFromFile.

Definition at line 120 of file image_create.cc.

References AddFrameCollector(), picker, Repaint(), and start.

00121     {
00122         GtkWidget * table = gtk_table_new ( 2, 2, FALSE );
00123         gtk_table_set_row_spacings( GTK_TABLE( table ), 6 );
00124         gtk_table_set_col_spacings( GTK_TABLE( table ), 6 );
00125 
00126         GtkWidget *label = gtk_label_new( _( "Colour:" ) );
00127         gtk_widget_show( label );
00128 
00129         picker = gtk_color_button_new();
00130         gtk_color_button_set_color( GTK_COLOR_BUTTON( picker ), &start );
00131         gtk_widget_show( picker );
00132         g_signal_connect( G_OBJECT( picker ), "color-set", G_CALLBACK( Repaint ), 0 );
00133 
00134         AddFrameCollector( table, 0 );
00135 
00136         gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2, ( GtkAttachOptions ) ( 0 ), ( GtkAttachOptions ) ( 0 ), 0, 0 );
00137         gtk_table_attach( GTK_TABLE( table ), picker, 1, 2, 1, 2, ( GtkAttachOptions ) ( 0 ), ( GtkAttachOptions ) ( 0 ), 0, 0 );
00138 
00139         gtk_widget_show( table );
00140         gtk_container_add( GTK_CONTAINER( bin ), table );
00141     }

void ImageCreateColour::CreateAudio int16_t **  buffer,
short int *  channels,
int *  frequency,
int *  samples
[inline, virtual]
 

Implements GDKAudioImport.

Definition at line 162 of file image_create.cc.

00163     {}

void ImageCreateColour::CreateFrame uint8_t *  pixels,
int  width,
int  height,
double  position,
double  frame_delta
[inline, virtual]
 

Implements ImageCreate.

Reimplemented in ImageCreateNoise, ImageCreateColourRange, and ImageCreateFromFile.

Definition at line 79 of file image_create.cc.

References start.

00080     {
00081         if ( position == 0 )
00082         {
00083             uint8_t * p = pixels;
00084             while ( p < ( pixels + width * height * 3 ) )
00085             {
00086                 *p ++ = start.red >> 8;
00087                 *p ++ = start.green >> 8;
00088                 *p ++ = start.blue >> 8;
00089             }
00090         }
00091     }

void ImageCreateColour::DetachWidgets GtkBin *  bin  )  [inline, virtual]
 

Reimplemented from GDKImageCreate.

Reimplemented in ImageCreateNoise, ImageCreateColourRange, and ImageCreateFromFile.

Definition at line 143 of file image_create.cc.

References InterpretFrameCollector(), picker, and start.

00144     {
00145         if ( bin->child != NULL )
00146         {
00147             InterpretFrameCollector( );
00148             gtk_color_button_get_color( GTK_COLOR_BUTTON( picker ), &start );
00149             gtk_container_remove( GTK_CONTAINER( bin ), bin->child );
00150         }
00151     }

char* ImageCreateColour::GetDescription  )  const [inline, virtual]
 

Implements ImageCreate.

Reimplemented in ImageCreateNoise, ImageCreateColourRange, and ImageCreateFromFile.

Definition at line 74 of file image_create.cc.

00075     {
00076         return _( "Fixed Colour" );
00077     }

int ImageCreateColour::GetNumberOfFrames  )  [inline, virtual]
 

Implements ImageCreate.

Definition at line 93 of file image_create.cc.

References frames.

Referenced by ImageCreateFromFile::CreateFrame().

00094     {
00095         return frames;
00096     }

void ImageCreateColour::InterpretFrameCollector  )  [inline]
 

Definition at line 114 of file image_create.cc.

References frame_counter, and frames.

Referenced by ImageCreateFromFile::DetachWidgets(), ImageCreateColourRange::DetachWidgets(), ImageCreateNoise::DetachWidgets(), DetachWidgets(), ImageCreateFromFile::InterpretWidgets(), ImageCreateColourRange::InterpretWidgets(), ImageCreateNoise::InterpretWidgets(), and InterpretWidgets().

00115     {
00116         if ( frame_counter )
00117             frames = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( frame_counter ) );
00118     }

void ImageCreateColour::InterpretWidgets GtkBin *  bin  )  [inline, virtual]
 

Reimplemented from GDKImageCreate.

Reimplemented in ImageCreateNoise, ImageCreateColourRange, and ImageCreateFromFile.

Definition at line 153 of file image_create.cc.

References InterpretFrameCollector(), picker, and start.

00154     {
00155         if ( bin->child != NULL )
00156         {
00157             InterpretFrameCollector( );
00158             gtk_color_button_get_color( GTK_COLOR_BUTTON( picker ), &start );
00159         }
00160     }


Member Data Documentation

GtkWidget* ImageCreateColour::frame_counter [protected]
 

Definition at line 65 of file image_create.cc.

Referenced by AddFrameCollector(), and InterpretFrameCollector().

int ImageCreateColour::frames [protected]
 

Definition at line 63 of file image_create.cc.

Referenced by AddFrameCollector(), GetNumberOfFrames(), ImageCreateColour(), and InterpretFrameCollector().

GtkWidget* ImageCreateColour::picker [protected]
 

Definition at line 64 of file image_create.cc.

Referenced by AttachWidgets(), DetachWidgets(), and InterpretWidgets().

GdkColor ImageCreateColour::start [protected]
 

Definition at line 62 of file image_create.cc.

Referenced by ImageCreateColourRange::AttachWidgets(), AttachWidgets(), ImageCreateColourRange::CreateFrame(), CreateFrame(), ImageCreateColourRange::DetachWidgets(), DetachWidgets(), ImageCreateColour(), ImageCreateColourRange::InterpretWidgets(), and InterpretWidgets().


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 22:13:01 2007 for Kino by  doxygen 1.4.2