Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
40
Task/Color-wheel/FutureBasic/color-wheel.basic
Normal file
40
Task/Color-wheel/FutureBasic/color-wheel.basic
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
_window = 1
|
||||
begin enum output 1
|
||||
_colorwheelImageView
|
||||
end enum
|
||||
|
||||
void local fn BuildWindow
|
||||
CGRect r = fn CGRectMake( 0, 0, 400, 400 )
|
||||
window _window, @"Programmatic Color Wheel", r, NSWindowStyleMaskTitled + NSWindowStyleMaskClosable
|
||||
|
||||
r = fn CGRectMake( 20, 20, 360, 360 )
|
||||
imageview _colorwheelImageView, YES, , r, NSImageScaleProportionallyUpOrDown, NSImageAlignCenter, NSImageFrameNone, _window
|
||||
end fn
|
||||
|
||||
local fn CIImageToImageRef( ciImage as CIImageRef ) as ImageRef
|
||||
CIImageRepRef rep = fn CIImageRepWithCIImage( ciImage )
|
||||
CGSize size = fn ImageRepSize( rep )
|
||||
ImageRef image = fn ImageWithSize( size )
|
||||
ImageAddRepresentation( image, rep )
|
||||
end fn = image
|
||||
|
||||
local fn ColorWheelImage( colorSpace as CGColorSpaceRef, dither as CFNumberRef, radius as CFNumberRef, softness as CFNumberRef, lightness as CFNumberRef ) as CIImageRef
|
||||
CIFilterRef filter = fn CIFilterWithName( @"CIHueSaturationValueGradient" )
|
||||
ObjectSetValueForkey( filter, colorSpace, @"inputColorSpace" )
|
||||
ObjectSetValueForkey( filter, dither, @"inputDither" )
|
||||
ObjectSetValueForkey( filter, radius, @"inputRadius" )
|
||||
ObjectSetValueForkey( filter, softness, @"inputSoftness" )
|
||||
ObjectSetValueForkey( filter, lightness, @"inputValue" )
|
||||
CIImageRef outputCIImage = fn CIFilterOutputImage( filter )
|
||||
end fn = outputCIImage
|
||||
|
||||
local fn BuildColorWheel
|
||||
CIImageRef colorWheelCIImage = fn ColorWheelImage( fn CGColorSpaceCreateDeviceRGB, @0, @160, @0, @1 )
|
||||
ImageRef colorWheelImage = fn CIImageToImageRef( colorWheelCIImage )
|
||||
ImageViewSetImage( _colorwheelImageView, colorWheelImage )
|
||||
end fn
|
||||
|
||||
fn BuildWindow
|
||||
fn BuildColorWheel
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue