
#import  "SoftFrameCtr.h"
#import  <appkit/NXColorWell.h>
#import  <appkit/color.h>
#import  "../ImageOpCtr.h"
#import  "../ImageOpr.h"
#import  "../common.h"

@implementation SoftFrameCtr

- changeAlpha:sender
{
	[colorwell setEnabled: ![sender state]];
	return self;
}

/* Local Method */
- getColors:(int *)color
{
	int i;
	float cl[3];

	if ([alphaSW state]) {
		for (i = 0; i < 3; i++)
			color[i] = 255;
		color[ALPHA] = AlphaTransp;
	}else {
		NXConvertColorToRGB([colorwell color], &cl[0], &cl[1], &cl[2]);
		for (i = 0; i < 3; i++)
			color[i] = cl[i] * 255;
		color[ALPHA] = AlphaOpaque;
	}
	return self;
}

- doit:sender
{
	int clr[4];

	[self getColors: clr];
	[imageOpCtr softFrame:[widthSL intValue]/100.0
			shape:[shape selectedTag] color:clr];
			/* This message will be delegated to imageOpr */
	return self;
}


@end
