Exemple #1
0
static void OnSaveControl( CONTROL_NAME )( FILE *file,uintptr_t psv )
{
	PSLIDER_INFO info = (PSLIDER_INFO)psv;
	sack_fprintf( file, "Seek Slider color=$%02X%02X%02X%02X\n"
			 , AlphaVal( info->color )
			 , RedVal( info->color )
			 , GreenVal( info->color )
			 , BlueVal( info->color )
			 );
	sack_fprintf( file, "Seek Slider back color=$%02X%02X%02X%02X\n"
			 , AlphaVal( info->backcolor )
			 , RedVal( info->backcolor )
			 , GreenVal( info->backcolor )
			 , BlueVal( info->backcolor )
			 );
	sack_fprintf( file, "Seek Slider background image=%s\n", info->image_name?info->image_name:"" );
	sack_fprintf( file, "Seek Slider is horizontal?%s\n", info->flags.bHorizontal?"Yes":"No" );
	sack_fprintf( file, "Seek Slider is draggable?%s\n", info->flags.bDragging?"Yes":"No" );
	sack_fprintf( file, "Seek Slider min value=%d\n", info->min);
	sack_fprintf( file, "Seek Slider max value=%d\n", info->max);
	sack_fprintf( file, "Seek Slider current value=%d\n", info->current);


	InterShell_SaveCommonButtonParameters( file );

}
Exemple #2
0
void BlurEx( Image dst, Image src[] , uint32_t step )
#define Blur( d, s ) BlurEx( d, s, 1 )
{
   int y, x, row;

	for( x = 0; x < 96; x+=step)//x++ )
	{
		uint32_t idx;
      uint32_t divisor = 1;
		uint8_t rvals[96];
		uint8_t gvals[96];
		uint8_t bvals[96];
      uint8_t gain[96];
		uint32_t red = 0
	, green = 0
	, blue = 0, img = 0;
		idx = 0;
		for( row = 0; row < 96; row++ )
		{
			{
				CDATA pixel;
				pixel = getpixel( src[0], x, row );
				( rvals[row] = RedVal( pixel ) );
				( bvals[row] = BlueVal( pixel ) );
				( gvals[row] = GreenVal( pixel ) );
				gain[row] = ( (gvals[row] + bvals[row] + rvals[row]) / 128 ) + 1;
				divisor += gain[row];
				red += ( rvals[row] * gain[row] );
				blue += ( bvals[row] * gain[row] );
				green += ( gvals[row] * gain[row] );
			}
		}
		for( img = 1; img <= NUM_PICS; img++ )
		{
			for( y = 0; y < 96; y++ )
			{
				{
					CDATA pixel;
					pixel = getpixel( src[img], x, y);
					red -= rvals[idx] * gain[idx];
					blue -= bvals[idx] * gain[idx];
					green -= gvals[idx] * gain[idx];
					divisor -= gain[idx];
					( rvals[idx] = RedVal( pixel ) );
					( bvals[idx] = BlueVal( pixel ) );
					( gvals[idx] = GreenVal( pixel ) );
					gain[idx] = ( ( gvals[idx] + bvals[idx] + rvals[idx]) / 128 )  + 1;
					divisor += gain[idx];
					red += ( rvals[idx] * gain[idx] );
					blue += ( bvals[idx] * gain[idx] );
					green += ( gvals[idx] * gain[idx] );
					idx++;
					if( idx >= 96 )
						idx = 0;
					plot( dst, x, y + (img-1)*96, Color( red/divisor, green/divisor, blue/divisor ) );
				}
			}
		}
	}
}