Documentation
¶
Overview ¶
Package quartzcore provides Go bindings for the QuartzCore framework.
Render, compose, and animate visual elements.
Core Animation provides high frame rates and smooth animations without burdening the CPU or slowing down your app. Core Animation does most of the work of drawing each frame of an animation for you. You’re responsible for configuring the animation parameters, such as the start and end points, and Core Animation does the rest. It accelerates the rendering by handing over most of the work to dedicated graphics hardware. For more details, see [Core Animation Programming Guide](<https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004514>).
Layer Basics ¶
- CALayer: An object that manages image-based content and allows you to perform animations on that content. (CACornerMask, CAAutoresizingMask, CAEdgeAntialiasingMask, CATransform3D)
- CALayerDelegate: Methods your app can implement to respond to layer-related events.
- CAConstraint: A representation of a single layout constraint between two layers. (CAConstraintAttribute)
- CALayoutManager: Methods that allow an object to manage the layout of a layer and its sublayers.
- CAConstraintLayoutManager: An object that provides a constraint-based layout manager.
- CAAction: An interface that allows instances to respond to actions triggered by a Core Animation layer change.
Text, Shapes, and Gradients ¶
- CATextLayer: A layer that provides simple text layout and rendering of plain or attributed strings.
- CAShapeLayer: A layer that draws a cubic Bezier spline in its coordinate space.
- CAGradientLayer: A layer that draws a color gradient over its background color, filling the shape of the layer.
Animation ¶
- CAAnimation: The abstract superclass for animations in Core Animation.
- CAAnimationDelegate: Methods your app can implement to respond when animations start and stop.
- CAPropertyAnimation: An abstract subclass for creating animations that manipulate the value of layer properties.
- CABasicAnimation: An object that provides basic, single-keyframe animation capabilities for a layer property.
- CAKeyframeAnimation: An object that provides keyframe animation capabilities for a layer object.
- CASpringAnimation: An animation that applies a spring-like force to a layer’s properties.
- CATransition: An object that provides an animated transition between a layer’s states.
- CAValueFunction: An object that provides a flexible method of defining animated transformations.
Animation Groups ¶
- CAAnimationGroup: An object that allows multiple animations to be grouped and run concurrently.
- CATransaction: A mechanism for grouping multiple layer-tree operations into atomic updates to the render tree.
Animation Timing ¶
- CACurrentMediaTime(): Returns the current absolute time, in seconds.
- CAMediaTimingFunction: A function that defines the pacing of an animation as a timing curve.
- CAMediaTiming: Methods that model a hierarchical timing system, allowing objects to map time between their parent and local time.
- CADisplayLink: A timer object that allows your app to synchronize its drawing to the refresh rate of the display.
- CAMetalDisplayLink: A class your Metal app uses to register for callbacks to synchronize its animations for a display.
- CAMetalDisplayLink.Update: Stores information about a single update from a Metal display link instance.
- CAMetalDisplayLinkDelegate: A protocol your app implements to respond to callbacks from Core Animation for a Metal display link.
Particle Systems ¶
- CAEmitterLayer: A layer that emits, animates, and renders a particle system.
- CAEmitterCell: The definition of a particle emitted by a particle layer.
Advanced Layer Options ¶
- CAScrollLayer: A layer that displays scrollable content larger than its own bounds.
- CATiledLayer: A layer that provides a way to asynchronously provide tiles of the layer’s content, potentially cached at multiple levels of detail.
- CATransformLayer: Objects used to create true 3D layer hierarchies, rather than the flattened hierarchy rendering model used by other layer types.
- CAReplicatorLayer: A layer that creates a specified number of sublayer copies with varying geometric, temporal, and color transformations.
Metal and OpenGL ¶
- CAMetalLayer: A Core Animation layer that Metal can render into, typically displayed onscreen.
- CAMetalDrawable: A Metal drawable associated with a Core Animation layer.
- CAEAGLLayer: A layer that supports drawing OpenGL content in iOS and tvOS applications.
- CAEDRMetadata: Metadata describing how extended dynamic range (EDR) values should be tone mapped.
- CAOpenGLLayer: A layer that provides a layer suitable for rendering OpenGL content.
- CARenderer: A layer that allows an application to render a layer tree into a Core OpenGL context.
ProMotion ¶
- Optimizing ProMotion refresh rates for iPhone 13 Pro and iPad Pro: Provide custom animated content for ProMotion displays.
Remote Display of Layer Content ¶
- CARemoteLayerClient: A legacy class for cross-process rendering.
- CARemoteLayerServer: A legacy class for cross-process rendering.
Transforms ¶
- Transforms: Define transform matrices to apply affine transformations to layers in Core Animation. (CATransform3D)
Quartz Composer ¶
- QCCompositionLayer: A layer that loads, plays, and controls Quartz Composer compositions in a Core Animation layer hierarchy.
Key Types ¶
- CALayer - An object that manages image-based content and allows you to perform animations on that content.
- CAEmitterCell - The definition of a particle emitted by a particle layer.
- CAEmitterLayer - A layer that emits, animates, and renders a particle system.
- CAMetalLayer - A Core Animation layer that Metal can render into, typically displayed onscreen.
- CAShapeLayer - A layer that draws a cubic Bezier spline in its coordinate space.
- CASpringAnimation - An animation that applies a spring-like force to a layer’s properties.
- CAAnimation - The abstract superclass for animations in Core Animation.
- CAKeyframeAnimation - An object that provides keyframe animation capabilities for a layer object.
- CAReplicatorLayer - A layer that creates a specified number of sublayer copies with varying geometric, temporal, and color transformations.
- CATextLayer - A layer that provides simple text layout and rendering of plain or attributed strings.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- Variables
- func CACurrentMediaTime() float64
- func CAFrameRateRangeIsEqualToRange(range_ CAFrameRateRange, other CAFrameRateRange) bool
- func CATransform3DEqualToTransform(a CATransform3D, b CATransform3D) bool
- func CATransform3DGetAffineTransform(t CATransform3D) corefoundation.CGAffineTransform
- func CATransform3DIsAffine(t CATransform3D) bool
- func CATransform3DIsIdentity(t CATransform3D) bool
- func NewVoidBlock(handler VoidHandler) (objc.ID, func())
- type CAAction
- type CAActionObject
- type CAAnimation
- func (a CAAnimation) AnimationEvents() []objectivec.IObject
- func (a CAAnimation) Autorelease() CAAnimation
- func (a CAAnimation) Autoreverses() bool
- func (a CAAnimation) BeginTime() float64
- func (a CAAnimation) Delegate() CAAnimationDelegate
- func (a CAAnimation) Duration() float64
- func (a CAAnimation) EncodeWithCoder(coder foundation.INSCoder)
- func (a CAAnimation) FadeInDuration() float64
- func (a CAAnimation) FadeOutDuration() float64
- func (a CAAnimation) FillMode() CAMediaTimingFillMode
- func (a CAAnimation) Init() CAAnimation
- func (a CAAnimation) PreferredFrameRateRange() CAFrameRateRange
- func (a CAAnimation) RemovedOnCompletion() bool
- func (a CAAnimation) RepeatCount() float32
- func (a CAAnimation) RepeatDuration() float64
- func (a CAAnimation) RunActionForKeyObjectArguments(event string, anObject objectivec.IObject, dict foundation.INSDictionary)
- func (a CAAnimation) SetAnimationEvents(value []objectivec.IObject)
- func (a CAAnimation) SetAutoreverses(value bool)
- func (a CAAnimation) SetBeginTime(value float64)
- func (a CAAnimation) SetDelegate(value CAAnimationDelegate)
- func (a CAAnimation) SetDuration(value float64)
- func (a CAAnimation) SetFadeInDuration(value float64)
- func (a CAAnimation) SetFadeOutDuration(value float64)
- func (a CAAnimation) SetFillMode(value CAMediaTimingFillMode)
- func (a CAAnimation) SetPreferredFrameRateRange(value CAFrameRateRange)
- func (a CAAnimation) SetRemovedOnCompletion(value bool)
- func (a CAAnimation) SetRepeatCount(value float32)
- func (a CAAnimation) SetRepeatDuration(value float64)
- func (a CAAnimation) SetSpeed(value float32)
- func (a CAAnimation) SetTimeOffset(value float64)
- func (a CAAnimation) SetTimingFunction(value ICAMediaTimingFunction)
- func (a CAAnimation) SetUsesSceneTimeBase(value bool)
- func (a CAAnimation) SetValueForKey(value objectivec.IObject, key string)
- func (a CAAnimation) ShouldArchiveValueForKey(key string) bool
- func (a CAAnimation) Speed() float32
- func (a CAAnimation) TimeOffset() float64
- func (a CAAnimation) TimingFunction() ICAMediaTimingFunction
- func (a CAAnimation) UsesSceneTimeBase() bool
- func (a CAAnimation) ValueForKey(key string) objectivec.IObject
- type CAAnimationCalculationMode
- type CAAnimationClass
- type CAAnimationDelegate
- type CAAnimationDelegateConfig
- type CAAnimationDelegateObject
- type CAAnimationGroup
- func (a CAAnimationGroup) Animations() []CAAnimation
- func (a CAAnimationGroup) Autorelease() CAAnimationGroup
- func (a CAAnimationGroup) Init() CAAnimationGroup
- func (a CAAnimationGroup) IsRemovedOnCompletion() bool
- func (a CAAnimationGroup) SetAnimations(value []CAAnimation)
- func (a CAAnimationGroup) SetIsRemovedOnCompletion(value bool)
- type CAAnimationGroupClass
- type CAAnimationRotationMode
- type CAAutoresizingMask
- type CABasicAnimation
- func (b CABasicAnimation) Autorelease() CABasicAnimation
- func (b CABasicAnimation) BackgroundColor() coregraphics.CGColorRef
- func (b CABasicAnimation) ByValue() objectivec.IObject
- func (b CABasicAnimation) FromValue() objectivec.IObject
- func (b CABasicAnimation) Init() CABasicAnimation
- func (b CABasicAnimation) Opacity() float32
- func (b CABasicAnimation) SetBackgroundColor(value coregraphics.CGColorRef)
- func (b CABasicAnimation) SetByValue(value objectivec.IObject)
- func (b CABasicAnimation) SetFromValue(value objectivec.IObject)
- func (b CABasicAnimation) SetOpacity(value float32)
- func (b CABasicAnimation) SetToValue(value objectivec.IObject)
- func (b CABasicAnimation) SetTransform(value CATransform3D)
- func (b CABasicAnimation) ToValue() objectivec.IObject
- func (b CABasicAnimation) Transform() CATransform3D
- type CABasicAnimationClass
- type CAConstraint
- func CAConstraintFromID(id objc.ID) CAConstraint
- func NewCAConstraint() CAConstraint
- func NewConstraintWithAttributeRelativeToAttribute(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute) CAConstraint
- func NewConstraintWithAttributeRelativeToAttributeOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, ...) CAConstraint
- func NewConstraintWithAttributeRelativeToAttributeScaleOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, ...) CAConstraint
- func (c CAConstraint) Attribute() CAConstraintAttribute
- func (c CAConstraint) Autorelease() CAConstraint
- func (c CAConstraint) EncodeWithCoder(coder foundation.INSCoder)
- func (c CAConstraint) Init() CAConstraint
- func (c_ CAConstraint) InitWithAttributeRelativeToAttributeScaleOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, ...) CAConstraint
- func (c CAConstraint) Offset() float64
- func (c CAConstraint) Scale() float64
- func (c CAConstraint) SourceAttribute() CAConstraintAttribute
- func (c CAConstraint) SourceName() string
- type CAConstraintAttribute
- type CAConstraintClass
- type CAConstraintLayoutManager
- func (c CAConstraintLayoutManager) Autorelease() CAConstraintLayoutManager
- func (c CAConstraintLayoutManager) Init() CAConstraintLayoutManager
- func (c CAConstraintLayoutManager) InvalidateLayoutOfLayer(layer ICALayer)
- func (c CAConstraintLayoutManager) LayoutManager() CALayoutManager
- func (c CAConstraintLayoutManager) LayoutSublayersOfLayer(layer ICALayer)
- func (c CAConstraintLayoutManager) Name() string
- func (c CAConstraintLayoutManager) PreferredSizeOfLayer(layer ICALayer) corefoundation.CGSize
- func (c CAConstraintLayoutManager) SetLayoutManager(value CALayoutManager)
- func (c CAConstraintLayoutManager) SetName(value string)
- type CAConstraintLayoutManagerClass
- type CACornerMask
- type CADisplayLink
- func (d CADisplayLink) AddToRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
- func (d CADisplayLink) Autorelease() CADisplayLink
- func (d CADisplayLink) Duration() float64
- func (d CADisplayLink) Init() CADisplayLink
- func (d CADisplayLink) Invalidate()
- func (d CADisplayLink) MaximumFramesPerSecond() int
- func (d CADisplayLink) Paused() bool
- func (d CADisplayLink) PreferredFrameRateRange() CAFrameRateRange
- func (d CADisplayLink) RemoveFromRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
- func (d CADisplayLink) SetMaximumFramesPerSecond(value int)
- func (d CADisplayLink) SetPaused(value bool)
- func (d CADisplayLink) SetPreferredFrameRateRange(value CAFrameRateRange)
- func (d CADisplayLink) TargetTimestamp() float64
- func (d CADisplayLink) Timestamp() float64
- type CADisplayLinkClass
- type CADynamicRange
- type CAEDRMetadata
- type CAEDRMetadataClass
- func (cc CAEDRMetadataClass) Alloc() CAEDRMetadata
- func (_CAEDRMetadataClass CAEDRMetadataClass) Available() bool
- func (_CAEDRMetadataClass CAEDRMetadataClass) HDR10MetadataWithDisplayInfoContentInfoOpticalOutputScale(displayData foundation.INSData, contentData foundation.INSData, scale float32) CAEDRMetadata
- func (_CAEDRMetadataClass CAEDRMetadataClass) HDR10MetadataWithMinLuminanceMaxLuminanceOpticalOutputScale(minNits float32, maxNits float32, scale float32) CAEDRMetadata
- func (_CAEDRMetadataClass CAEDRMetadataClass) HLGMetadata() CAEDRMetadata
- func (_CAEDRMetadataClass CAEDRMetadataClass) HLGMetadataWithAmbientViewingEnvironment(data foundation.INSData) CAEDRMetadata
- type CAEdgeAntialiasingMask
- type CAEmitterCell
- func (e CAEmitterCell) AlphaRange() float32
- func (e CAEmitterCell) AlphaSpeed() float32
- func (e CAEmitterCell) Autorelease() CAEmitterCell
- func (e CAEmitterCell) Autoreverses() bool
- func (e CAEmitterCell) BeginTime() float64
- func (e CAEmitterCell) BirthRate() float32
- func (e CAEmitterCell) BlueRange() float32
- func (e CAEmitterCell) BlueSpeed() float32
- func (e CAEmitterCell) Color() coregraphics.CGColorRef
- func (e CAEmitterCell) Contents() objectivec.IObject
- func (e CAEmitterCell) ContentsRect() corefoundation.CGRect
- func (e CAEmitterCell) ContentsScale() float64
- func (e CAEmitterCell) Duration() float64
- func (e CAEmitterCell) EmissionLatitude() float64
- func (e CAEmitterCell) EmissionLongitude() float64
- func (e CAEmitterCell) EmissionRange() float64
- func (e CAEmitterCell) EmitterCells() []CAEmitterCell
- func (e CAEmitterCell) Enabled() bool
- func (e CAEmitterCell) EncodeWithCoder(coder foundation.INSCoder)
- func (e CAEmitterCell) FillMode() CAMediaTimingFillMode
- func (e CAEmitterCell) GreenRange() float32
- func (e CAEmitterCell) GreenSpeed() float32
- func (e CAEmitterCell) Init() CAEmitterCell
- func (e CAEmitterCell) Lifetime() float32
- func (e CAEmitterCell) LifetimeRange() float32
- func (e CAEmitterCell) MagnificationFilter() string
- func (e CAEmitterCell) MinificationFilter() string
- func (e CAEmitterCell) MinificationFilterBias() float32
- func (e CAEmitterCell) Name() string
- func (e CAEmitterCell) RedRange() float32
- func (e CAEmitterCell) RedSpeed() float32
- func (e CAEmitterCell) RepeatCount() float32
- func (e CAEmitterCell) RepeatDuration() float64
- func (e CAEmitterCell) Scale() float64
- func (e CAEmitterCell) ScaleRange() float64
- func (e CAEmitterCell) ScaleSpeed() float64
- func (e CAEmitterCell) SetAlphaRange(value float32)
- func (e CAEmitterCell) SetAlphaSpeed(value float32)
- func (e CAEmitterCell) SetAutoreverses(value bool)
- func (e CAEmitterCell) SetBeginTime(value float64)
- func (e CAEmitterCell) SetBirthRate(value float32)
- func (e CAEmitterCell) SetBlueRange(value float32)
- func (e CAEmitterCell) SetBlueSpeed(value float32)
- func (e CAEmitterCell) SetColor(value coregraphics.CGColorRef)
- func (e CAEmitterCell) SetContents(value objectivec.IObject)
- func (e CAEmitterCell) SetContentsRect(value corefoundation.CGRect)
- func (e CAEmitterCell) SetContentsScale(value float64)
- func (e CAEmitterCell) SetDuration(value float64)
- func (e CAEmitterCell) SetEmissionLatitude(value float64)
- func (e CAEmitterCell) SetEmissionLongitude(value float64)
- func (e CAEmitterCell) SetEmissionRange(value float64)
- func (e CAEmitterCell) SetEmitterCells(value []CAEmitterCell)
- func (e CAEmitterCell) SetEnabled(value bool)
- func (e CAEmitterCell) SetFillMode(value CAMediaTimingFillMode)
- func (e CAEmitterCell) SetGreenRange(value float32)
- func (e CAEmitterCell) SetGreenSpeed(value float32)
- func (e CAEmitterCell) SetLifetime(value float32)
- func (e CAEmitterCell) SetLifetimeRange(value float32)
- func (e CAEmitterCell) SetMagnificationFilter(value string)
- func (e CAEmitterCell) SetMinificationFilter(value string)
- func (e CAEmitterCell) SetMinificationFilterBias(value float32)
- func (e CAEmitterCell) SetName(value string)
- func (e CAEmitterCell) SetRedRange(value float32)
- func (e CAEmitterCell) SetRedSpeed(value float32)
- func (e CAEmitterCell) SetRepeatCount(value float32)
- func (e CAEmitterCell) SetRepeatDuration(value float64)
- func (e CAEmitterCell) SetScale(value float64)
- func (e CAEmitterCell) SetScaleRange(value float64)
- func (e CAEmitterCell) SetScaleSpeed(value float64)
- func (e CAEmitterCell) SetSpeed(value float32)
- func (e CAEmitterCell) SetSpin(value float64)
- func (e CAEmitterCell) SetSpinRange(value float64)
- func (e CAEmitterCell) SetStyle(value foundation.INSDictionary)
- func (e CAEmitterCell) SetTimeOffset(value float64)
- func (e CAEmitterCell) SetVelocity(value float64)
- func (e CAEmitterCell) SetVelocityRange(value float64)
- func (e CAEmitterCell) SetXAcceleration(value float64)
- func (e CAEmitterCell) SetYAcceleration(value float64)
- func (e CAEmitterCell) SetZAcceleration(value float64)
- func (e CAEmitterCell) ShouldArchiveValueForKey(key string) bool
- func (e CAEmitterCell) Speed() float32
- func (e CAEmitterCell) Spin() float64
- func (e CAEmitterCell) SpinRange() float64
- func (e CAEmitterCell) Style() foundation.INSDictionary
- func (e CAEmitterCell) TimeOffset() float64
- func (e CAEmitterCell) Velocity() float64
- func (e CAEmitterCell) VelocityRange() float64
- func (e CAEmitterCell) XAcceleration() float64
- func (e CAEmitterCell) YAcceleration() float64
- func (e CAEmitterCell) ZAcceleration() float64
- type CAEmitterCellClass
- type CAEmitterLayer
- func (e CAEmitterLayer) Autorelease() CAEmitterLayer
- func (e CAEmitterLayer) BirthRate() float32
- func (e CAEmitterLayer) EmissionRange() float64
- func (e CAEmitterLayer) EmitterCells() []CAEmitterCell
- func (e CAEmitterLayer) EmitterDepth() float64
- func (e CAEmitterLayer) EmitterMode() CAEmitterLayerEmitterMode
- func (e CAEmitterLayer) EmitterPosition() corefoundation.CGPoint
- func (e CAEmitterLayer) EmitterShape() CAEmitterLayerEmitterShape
- func (e CAEmitterLayer) EmitterSize() corefoundation.CGSize
- func (e CAEmitterLayer) EmitterZPosition() float64
- func (e CAEmitterLayer) Init() CAEmitterLayer
- func (e CAEmitterLayer) Lifetime() float32
- func (e CAEmitterLayer) Pi() objectivec.IObject
- func (e CAEmitterLayer) Point() CAEmitterLayerEmitterShape
- func (e CAEmitterLayer) PreservesDepth() bool
- func (e CAEmitterLayer) RenderMode() CAEmitterLayerRenderMode
- func (e CAEmitterLayer) Scale() float32
- func (e CAEmitterLayer) Seed() uint32
- func (e CAEmitterLayer) SetBirthRate(value float32)
- func (e CAEmitterLayer) SetEmissionRange(value float64)
- func (e CAEmitterLayer) SetEmitterCells(value []CAEmitterCell)
- func (e CAEmitterLayer) SetEmitterDepth(value float64)
- func (e CAEmitterLayer) SetEmitterMode(value CAEmitterLayerEmitterMode)
- func (e CAEmitterLayer) SetEmitterPosition(value corefoundation.CGPoint)
- func (e CAEmitterLayer) SetEmitterShape(value CAEmitterLayerEmitterShape)
- func (e CAEmitterLayer) SetEmitterSize(value corefoundation.CGSize)
- func (e CAEmitterLayer) SetEmitterZPosition(value float64)
- func (e CAEmitterLayer) SetLifetime(value float32)
- func (e CAEmitterLayer) SetPi(value objectivec.IObject)
- func (e CAEmitterLayer) SetPreservesDepth(value bool)
- func (e CAEmitterLayer) SetRenderMode(value CAEmitterLayerRenderMode)
- func (e CAEmitterLayer) SetScale(value float32)
- func (e CAEmitterLayer) SetSeed(value uint32)
- func (e CAEmitterLayer) SetSpin(value float32)
- func (e CAEmitterLayer) SetVelocity(value float32)
- func (e CAEmitterLayer) Spin() float32
- func (e CAEmitterLayer) Velocity() float32
- type CAEmitterLayerClass
- type CAEmitterLayerEmitterMode
- type CAEmitterLayerEmitterShape
- type CAEmitterLayerRenderMode
- type CAFrameRateRange
- type CAGradientLayer
- func (g CAGradientLayer) Autorelease() CAGradientLayer
- func (g CAGradientLayer) Colors() foundation.INSArray
- func (g CAGradientLayer) EndPoint() corefoundation.CGPoint
- func (g CAGradientLayer) Init() CAGradientLayer
- func (g CAGradientLayer) Locations() []foundation.NSNumber
- func (g CAGradientLayer) Pi() objectivec.IObject
- func (g CAGradientLayer) SetColors(value foundation.INSArray)
- func (g CAGradientLayer) SetEndPoint(value corefoundation.CGPoint)
- func (g CAGradientLayer) SetLocations(value []foundation.NSNumber)
- func (g CAGradientLayer) SetPi(value objectivec.IObject)
- func (g CAGradientLayer) SetStartPoint(value corefoundation.CGPoint)
- func (g CAGradientLayer) SetType(value CAGradientLayerType)
- func (g CAGradientLayer) StartPoint() corefoundation.CGPoint
- func (g CAGradientLayer) Type() CAGradientLayerType
- type CAGradientLayerClass
- type CAGradientLayerType
- type CAKeyframeAnimation
- func (k CAKeyframeAnimation) Autorelease() CAKeyframeAnimation
- func (k CAKeyframeAnimation) BiasValues() []foundation.NSNumber
- func (k CAKeyframeAnimation) CalculationMode() CAAnimationCalculationMode
- func (k CAKeyframeAnimation) ContinuityValues() []foundation.NSNumber
- func (k CAKeyframeAnimation) Init() CAKeyframeAnimation
- func (k CAKeyframeAnimation) KeyTimes() []foundation.NSNumber
- func (k CAKeyframeAnimation) Path() coregraphics.CGPathRef
- func (k CAKeyframeAnimation) RotationMode() CAAnimationRotationMode
- func (k CAKeyframeAnimation) SetBiasValues(value []foundation.NSNumber)
- func (k CAKeyframeAnimation) SetCalculationMode(value CAAnimationCalculationMode)
- func (k CAKeyframeAnimation) SetContinuityValues(value []foundation.NSNumber)
- func (k CAKeyframeAnimation) SetKeyTimes(value []foundation.NSNumber)
- func (k CAKeyframeAnimation) SetPath(value coregraphics.CGPathRef)
- func (k CAKeyframeAnimation) SetRotationMode(value CAAnimationRotationMode)
- func (k CAKeyframeAnimation) SetTensionValues(value []foundation.NSNumber)
- func (k CAKeyframeAnimation) SetTimingFunctions(value []CAMediaTimingFunction)
- func (k CAKeyframeAnimation) SetValues(value foundation.INSArray)
- func (k CAKeyframeAnimation) TensionValues() []foundation.NSNumber
- func (k CAKeyframeAnimation) TimingFunctions() []CAMediaTimingFunction
- func (k CAKeyframeAnimation) Values() foundation.INSArray
- type CAKeyframeAnimationClass
- type CALayer
- func (l CALayer) ActionForKey(event string) CAAction
- func (l CALayer) Actions() foundation.INSDictionary
- func (l CALayer) AddAnimationForKey(anim ICAAnimation, key string)
- func (l CALayer) AddConstraint(c ICAConstraint)
- func (l CALayer) AddSublayer(layer ICALayer)
- func (l CALayer) AffineTransform() corefoundation.CGAffineTransform
- func (l CALayer) AllowsEdgeAntialiasing() bool
- func (l CALayer) AllowsGroupOpacity() bool
- func (l CALayer) AnchorPoint() corefoundation.CGPoint
- func (l CALayer) AnchorPointZ() float64
- func (l CALayer) AnimationForKey(key string) ICAAnimation
- func (l CALayer) AnimationKeys() []string
- func (l CALayer) Autorelease() CALayer
- func (l CALayer) AutoresizingMask() CAAutoresizingMask
- func (l CALayer) Autoreverses() bool
- func (l CALayer) BackgroundColor() coregraphics.CGColorRef
- func (l CALayer) BackgroundFilters() foundation.INSArray
- func (l CALayer) BeginTime() float64
- func (l CALayer) BorderColor() coregraphics.CGColorRef
- func (l CALayer) BorderWidth() float64
- func (l CALayer) Bounds() corefoundation.CGRect
- func (l CALayer) CompositingFilter() objectivec.IObject
- func (l CALayer) Constraints() []CAConstraint
- func (l CALayer) ContainsPoint(p corefoundation.CGPoint) bool
- func (l CALayer) Contents() objectivec.IObject
- func (l CALayer) ContentsAreFlipped() bool
- func (l CALayer) ContentsCenter() corefoundation.CGRect
- func (l CALayer) ContentsFormat() CALayerContentsFormat
- func (l CALayer) ContentsGravity() CALayerContentsGravity
- func (l CALayer) ContentsHeadroom() float64
- func (l CALayer) ContentsRect() corefoundation.CGRect
- func (l CALayer) ContentsScale() float64
- func (l_ CALayer) ConvertPointFromLayer(p corefoundation.CGPoint, l ICALayer) corefoundation.CGPoint
- func (l_ CALayer) ConvertPointToLayer(p corefoundation.CGPoint, l ICALayer) corefoundation.CGPoint
- func (l_ CALayer) ConvertRectFromLayer(r corefoundation.CGRect, l ICALayer) corefoundation.CGRect
- func (l_ CALayer) ConvertRectToLayer(r corefoundation.CGRect, l ICALayer) corefoundation.CGRect
- func (l_ CALayer) ConvertTimeFromLayer(t float64, l ICALayer) float64
- func (l_ CALayer) ConvertTimeToLayer(t float64, l ICALayer) float64
- func (l CALayer) CornerCurve() CALayerCornerCurve
- func (l CALayer) CornerRadius() float64
- func (l CALayer) Delegate() CALayerDelegate
- func (l CALayer) Display()
- func (l CALayer) DisplayIfNeeded()
- func (l CALayer) DoubleSided() bool
- func (l CALayer) DrawInContext(ctx coregraphics.CGContextRef)
- func (l CALayer) DrawsAsynchronously() bool
- func (l CALayer) Duration() float64
- func (l CALayer) EdgeAntialiasingMask() CAEdgeAntialiasingMask
- func (l CALayer) EncodeWithCoder(coder foundation.INSCoder)
- func (l CALayer) FillMode() CAMediaTimingFillMode
- func (l CALayer) Filters() foundation.INSArray
- func (l CALayer) Frame() corefoundation.CGRect
- func (l CALayer) GeometryFlipped() bool
- func (l CALayer) Hidden() bool
- func (l CALayer) HitTest(p corefoundation.CGPoint) ICALayer
- func (l CALayer) Init() CALayer
- func (l CALayer) InitWithLayer(layer objectivec.IObject) CALayer
- func (l CALayer) InsertSublayerAbove(layer ICALayer, sibling ICALayer)
- func (l CALayer) InsertSublayerAtIndex(layer ICALayer, idx uint32)
- func (l CALayer) InsertSublayerBelow(layer ICALayer, sibling ICALayer)
- func (l CALayer) LayoutIfNeeded()
- func (l CALayer) LayoutManager() CALayoutManager
- func (l CALayer) LayoutSublayers()
- func (l CALayer) MagnificationFilter() CALayerContentsFilter
- func (l CALayer) Mask() ICALayer
- func (l CALayer) MaskedCorners() CACornerMask
- func (l CALayer) MasksToBounds() bool
- func (l CALayer) MinificationFilter() CALayerContentsFilter
- func (l CALayer) MinificationFilterBias() float32
- func (l CALayer) ModelLayer() ICALayer
- func (l CALayer) Name() string
- func (l CALayer) NeedsDisplay() bool
- func (l CALayer) NeedsDisplayOnBoundsChange() bool
- func (l CALayer) NeedsLayout() bool
- func (l CALayer) Opacity() float32
- func (l CALayer) Opaque() bool
- func (l CALayer) Position() corefoundation.CGPoint
- func (l CALayer) PreferredDynamicRange() CADynamicRange
- func (l CALayer) PreferredFrameSize() corefoundation.CGSize
- func (l CALayer) PresentationLayer() ICALayer
- func (l CALayer) RasterizationScale() float64
- func (l CALayer) RemoveAllAnimations()
- func (l CALayer) RemoveAnimationForKey(key string)
- func (l CALayer) RemoveFromSuperlayer()
- func (l CALayer) RenderInContext(ctx coregraphics.CGContextRef)
- func (l CALayer) RepeatCount() float32
- func (l CALayer) RepeatDuration() float64
- func (l CALayer) ReplaceSublayerWith(oldLayer ICALayer, newLayer ICALayer)
- func (l CALayer) ResizeSublayersWithOldSize(size corefoundation.CGSize)
- func (l CALayer) ResizeWithOldSuperlayerSize(size corefoundation.CGSize)
- func (l CALayer) ScrollPoint(p corefoundation.CGPoint)
- func (l CALayer) ScrollRectToVisible(r corefoundation.CGRect)
- func (l CALayer) SetActions(value foundation.INSDictionary)
- func (l CALayer) SetAffineTransform(m corefoundation.CGAffineTransform)
- func (l CALayer) SetAllowsEdgeAntialiasing(value bool)
- func (l CALayer) SetAllowsGroupOpacity(value bool)
- func (l CALayer) SetAnchorPoint(value corefoundation.CGPoint)
- func (l CALayer) SetAnchorPointZ(value float64)
- func (l CALayer) SetAutoresizingMask(value CAAutoresizingMask)
- func (l CALayer) SetAutoreverses(value bool)
- func (l CALayer) SetBackgroundColor(value coregraphics.CGColorRef)
- func (l CALayer) SetBackgroundFilters(value foundation.INSArray)
- func (l CALayer) SetBeginTime(value float64)
- func (l CALayer) SetBorderColor(value coregraphics.CGColorRef)
- func (l CALayer) SetBorderWidth(value float64)
- func (l CALayer) SetBounds(value corefoundation.CGRect)
- func (l CALayer) SetCompositingFilter(value objectivec.IObject)
- func (l CALayer) SetConstraints(value []CAConstraint)
- func (l CALayer) SetContents(value objectivec.IObject)
- func (l CALayer) SetContentsCenter(value corefoundation.CGRect)
- func (l CALayer) SetContentsFormat(value CALayerContentsFormat)
- func (l CALayer) SetContentsGravity(value CALayerContentsGravity)
- func (l CALayer) SetContentsHeadroom(value float64)
- func (l CALayer) SetContentsRect(value corefoundation.CGRect)
- func (l CALayer) SetContentsScale(value float64)
- func (l CALayer) SetCornerCurve(value CALayerCornerCurve)
- func (l CALayer) SetCornerRadius(value float64)
- func (l CALayer) SetDelegate(value CALayerDelegate)
- func (l CALayer) SetDoubleSided(value bool)
- func (l CALayer) SetDrawsAsynchronously(value bool)
- func (l CALayer) SetDuration(value float64)
- func (l CALayer) SetEdgeAntialiasingMask(value CAEdgeAntialiasingMask)
- func (l CALayer) SetFillMode(value CAMediaTimingFillMode)
- func (l CALayer) SetFilters(value foundation.INSArray)
- func (l CALayer) SetFrame(value corefoundation.CGRect)
- func (l CALayer) SetGeometryFlipped(value bool)
- func (l CALayer) SetHidden(value bool)
- func (l CALayer) SetLayoutManager(value CALayoutManager)
- func (l CALayer) SetMagnificationFilter(value CALayerContentsFilter)
- func (l CALayer) SetMask(value ICALayer)
- func (l CALayer) SetMaskedCorners(value CACornerMask)
- func (l CALayer) SetMasksToBounds(value bool)
- func (l CALayer) SetMinificationFilter(value CALayerContentsFilter)
- func (l CALayer) SetMinificationFilterBias(value float32)
- func (l CALayer) SetName(value string)
- func (l CALayer) SetNeedsDisplay()
- func (l CALayer) SetNeedsDisplayInRect(r corefoundation.CGRect)
- func (l CALayer) SetNeedsDisplayOnBoundsChange(value bool)
- func (l CALayer) SetNeedsLayout()
- func (l CALayer) SetOpacity(value float32)
- func (l CALayer) SetOpaque(value bool)
- func (l CALayer) SetPosition(value corefoundation.CGPoint)
- func (l CALayer) SetPreferredDynamicRange(value CADynamicRange)
- func (l CALayer) SetRasterizationScale(value float64)
- func (l CALayer) SetRepeatCount(value float32)
- func (l CALayer) SetRepeatDuration(value float64)
- func (l CALayer) SetShadowColor(value coregraphics.CGColorRef)
- func (l CALayer) SetShadowOffset(value corefoundation.CGSize)
- func (l CALayer) SetShadowOpacity(value float32)
- func (l CALayer) SetShadowPath(value coregraphics.CGPathRef)
- func (l CALayer) SetShadowRadius(value float64)
- func (l CALayer) SetShouldRasterize(value bool)
- func (l CALayer) SetSpeed(value float32)
- func (l CALayer) SetStyle(value foundation.INSDictionary)
- func (l CALayer) SetSublayerTransform(value CATransform3D)
- func (l CALayer) SetSublayers(value []CALayer)
- func (l CALayer) SetTimeOffset(value float64)
- func (l CALayer) SetToneMapMode(value uint)
- func (l CALayer) SetTransform(value CATransform3D)
- func (l CALayer) SetValueForKey(value objectivec.IObject, key string)
- func (l CALayer) SetWantsExtendedDynamicRangeContent(value bool)
- func (l CALayer) SetZPosition(value float64)
- func (l CALayer) ShadowColor() coregraphics.CGColorRef
- func (l CALayer) ShadowOffset() corefoundation.CGSize
- func (l CALayer) ShadowOpacity() float32
- func (l CALayer) ShadowPath() coregraphics.CGPathRef
- func (l CALayer) ShadowRadius() float64
- func (l CALayer) ShouldArchiveValueForKey(key string) bool
- func (l CALayer) ShouldRasterize() bool
- func (l CALayer) Speed() float32
- func (l CALayer) Style() foundation.INSDictionary
- func (l CALayer) SublayerTransform() CATransform3D
- func (l CALayer) Sublayers() []CALayer
- func (l CALayer) Superlayer() ICALayer
- func (l CALayer) TimeOffset() float64
- func (l CALayer) ToneMapMode() uint
- func (l CALayer) Transform() CATransform3D
- func (l CALayer) ValueForKey(key string) objectivec.IObject
- func (l CALayer) VisibleRect() corefoundation.CGRect
- func (l CALayer) WantsExtendedDynamicRangeContent() bool
- func (l CALayer) ZPosition() float64
- type CALayerClass
- func (cc CALayerClass) Alloc() CALayer
- func (_CALayerClass CALayerClass) CornerCurveExpansionFactor(curve CALayerCornerCurve) float64
- func (_CALayerClass CALayerClass) DefaultActionForKey(event string) CAAction
- func (_CALayerClass CALayerClass) DefaultValueForKey(key string) objectivec.IObject
- func (_CALayerClass CALayerClass) NeedsDisplayForKey(key string) bool
- type CALayerContentsFilter
- type CALayerContentsFormat
- type CALayerContentsGravity
- type CALayerCornerCurve
- type CALayerDelegate
- type CALayerDelegateConfig
- type CALayerDelegateObject
- func (o CALayerDelegateObject) ActionForLayerForKey(layer ICALayer, event string) CAAction
- func (o CALayerDelegateObject) BaseObject() objectivec.Object
- func (o CALayerDelegateObject) DisplayLayer(layer ICALayer)
- func (o CALayerDelegateObject) DrawLayerInContext(layer ICALayer, ctx coregraphics.CGContextRef)
- func (o CALayerDelegateObject) LayerWillDraw(layer ICALayer)
- func (o CALayerDelegateObject) LayoutSublayersOfLayer(layer ICALayer)
- type CALayoutManager
- type CALayoutManagerObject
- type CAMediaTiming
- type CAMediaTimingFillMode
- type CAMediaTimingFunction
- func CAMediaTimingFunctionFromID(id objc.ID) CAMediaTimingFunction
- func NewCAMediaTimingFunction() CAMediaTimingFunction
- func NewMediaTimingFunctionWithControlPoints(c1x float32, c1y float32, c2x float32, c2y float32) CAMediaTimingFunction
- func NewMediaTimingFunctionWithName(name CAMediaTimingFunctionName) CAMediaTimingFunction
- func (m CAMediaTimingFunction) Autorelease() CAMediaTimingFunction
- func (m CAMediaTimingFunction) EncodeWithCoder(coder foundation.INSCoder)
- func (m CAMediaTimingFunction) GetControlPointAtIndexValues(idx uintptr, ptr unsafe.Pointer)
- func (m CAMediaTimingFunction) Init() CAMediaTimingFunction
- func (m CAMediaTimingFunction) InitWithControlPoints(c1x float32, c1y float32, c2x float32, c2y float32) CAMediaTimingFunction
- type CAMediaTimingFunctionClass
- type CAMediaTimingFunctionName
- type CAMediaTimingObject
- func (o CAMediaTimingObject) Autoreverses() bool
- func (o CAMediaTimingObject) BaseObject() objectivec.Object
- func (o CAMediaTimingObject) BeginTime() float64
- func (o CAMediaTimingObject) Duration() float64
- func (o CAMediaTimingObject) FillMode() CAMediaTimingFillMode
- func (o CAMediaTimingObject) RepeatCount() float32
- func (o CAMediaTimingObject) RepeatDuration() float64
- func (o CAMediaTimingObject) SetAutoreverses(value bool)
- func (o CAMediaTimingObject) SetBeginTime(value float64)
- func (o CAMediaTimingObject) SetDuration(value float64)
- func (o CAMediaTimingObject) SetFillMode(value CAMediaTimingFillMode)
- func (o CAMediaTimingObject) SetRepeatCount(value float32)
- func (o CAMediaTimingObject) SetRepeatDuration(value float64)
- func (o CAMediaTimingObject) SetSpeed(value float32)
- func (o CAMediaTimingObject) SetTimeOffset(value float64)
- func (o CAMediaTimingObject) Speed() float32
- func (o CAMediaTimingObject) TimeOffset() float64
- type CAMetalDisplayLink
- func (m CAMetalDisplayLink) AddToRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
- func (m CAMetalDisplayLink) Autorelease() CAMetalDisplayLink
- func (m CAMetalDisplayLink) Delegate() CAMetalDisplayLinkDelegate
- func (m CAMetalDisplayLink) Init() CAMetalDisplayLink
- func (m CAMetalDisplayLink) InitWithMetalLayer(layer ICAMetalLayer) CAMetalDisplayLink
- func (m CAMetalDisplayLink) Invalidate()
- func (m CAMetalDisplayLink) Paused() bool
- func (m CAMetalDisplayLink) PreferredFrameLatency() float32
- func (m CAMetalDisplayLink) PreferredFrameRateRange() CAFrameRateRange
- func (m CAMetalDisplayLink) RemoveFromRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
- func (m CAMetalDisplayLink) SetDelegate(value CAMetalDisplayLinkDelegate)
- func (m CAMetalDisplayLink) SetPaused(value bool)
- func (m CAMetalDisplayLink) SetPreferredFrameLatency(value float32)
- func (m CAMetalDisplayLink) SetPreferredFrameRateRange(value CAFrameRateRange)
- type CAMetalDisplayLinkClass
- type CAMetalDisplayLinkDelegate
- type CAMetalDisplayLinkDelegateConfig
- type CAMetalDisplayLinkDelegateObject
- type CAMetalDisplayLinkUpdate
- func (m CAMetalDisplayLinkUpdate) Autorelease() CAMetalDisplayLinkUpdate
- func (m CAMetalDisplayLinkUpdate) Drawable() CAMetalDrawable
- func (m CAMetalDisplayLinkUpdate) Init() CAMetalDisplayLinkUpdate
- func (m CAMetalDisplayLinkUpdate) TargetPresentationTimestamp() float64
- func (m CAMetalDisplayLinkUpdate) TargetTimestamp() float64
- type CAMetalDisplayLinkUpdateClass
- type CAMetalDrawable
- type CAMetalDrawableObject
- type CAMetalLayer
- func (m CAMetalLayer) AllowsNextDrawableTimeout() bool
- func (m CAMetalLayer) Autorelease() CAMetalLayer
- func (m CAMetalLayer) Colorspace() coregraphics.CGColorSpaceRef
- func (m CAMetalLayer) DeveloperHUDProperties() foundation.INSDictionary
- func (m CAMetalLayer) Device() objectivec.IObject
- func (m CAMetalLayer) DisplaySyncEnabled() bool
- func (m CAMetalLayer) DrawableID() int
- func (m CAMetalLayer) DrawableSize() corefoundation.CGSize
- func (m CAMetalLayer) EDRMetadata() ICAEDRMetadata
- func (m CAMetalLayer) FramebufferOnly() bool
- func (m CAMetalLayer) Init() CAMetalLayer
- func (m CAMetalLayer) MaximumDrawableCount() uint
- func (m CAMetalLayer) NextDrawable() CAMetalDrawable
- func (m CAMetalLayer) PixelFormat() objectivec.IObject
- func (m CAMetalLayer) PreferredDevice() objectivec.IObject
- func (m CAMetalLayer) PresentedTime() float64
- func (m CAMetalLayer) PresentsWithTransaction() bool
- func (m CAMetalLayer) ResidencySet() objectivec.IObject
- func (m CAMetalLayer) SetAllowsNextDrawableTimeout(value bool)
- func (m CAMetalLayer) SetColorspace(value coregraphics.CGColorSpaceRef)
- func (m CAMetalLayer) SetDeveloperHUDProperties(value foundation.INSDictionary)
- func (m CAMetalLayer) SetDevice(value objectivec.IObject)
- func (m CAMetalLayer) SetDisplaySyncEnabled(value bool)
- func (m CAMetalLayer) SetDrawableID(value int)
- func (m CAMetalLayer) SetDrawableSize(value corefoundation.CGSize)
- func (m CAMetalLayer) SetEDRMetadata(value ICAEDRMetadata)
- func (m CAMetalLayer) SetFramebufferOnly(value bool)
- func (m CAMetalLayer) SetMaximumDrawableCount(value uint)
- func (m CAMetalLayer) SetPixelFormat(value objectivec.IObject)
- func (m CAMetalLayer) SetPresentedTime(value float64)
- func (m CAMetalLayer) SetPresentsWithTransaction(value bool)
- type CAMetalLayerClass
- type CAPropertyAnimation
- func (p CAPropertyAnimation) Additive() bool
- func (p CAPropertyAnimation) Autorelease() CAPropertyAnimation
- func (p CAPropertyAnimation) Cumulative() bool
- func (p CAPropertyAnimation) Init() CAPropertyAnimation
- func (p CAPropertyAnimation) KeyPath() string
- func (p CAPropertyAnimation) SetAdditive(value bool)
- func (p CAPropertyAnimation) SetCumulative(value bool)
- func (p CAPropertyAnimation) SetKeyPath(value string)
- func (p CAPropertyAnimation) SetValueFunction(value ICAValueFunction)
- func (p CAPropertyAnimation) ValueFunction() ICAValueFunction
- type CAPropertyAnimationClass
- type CARemoteLayerClient
- func (r CARemoteLayerClient) Autorelease() CARemoteLayerClient
- func (r CARemoteLayerClient) ClientId() uint32
- func (r CARemoteLayerClient) Init() CARemoteLayerClient
- func (r CARemoteLayerClient) InitWithServerPort(port uint32) CARemoteLayerClient
- func (r CARemoteLayerClient) Invalidate()
- func (r CARemoteLayerClient) Layer() ICALayer
- func (r CARemoteLayerClient) SetLayer(value ICALayer)
- type CARemoteLayerClientClass
- type CARemoteLayerServer
- type CARemoteLayerServerClass
- type CARenderer
- func (r_ CARenderer) AddUpdateRect(r corefoundation.CGRect)
- func (r CARenderer) Autorelease() CARenderer
- func (r CARenderer) BeginFrameAtTimeTimeStamp(t float64, ts *corevideo.CVTimeStamp)
- func (r CARenderer) Bounds() corefoundation.CGRect
- func (r CARenderer) EndFrame()
- func (r CARenderer) Init() CARenderer
- func (r CARenderer) Layer() ICALayer
- func (r CARenderer) NextFrameTime() float64
- func (r CARenderer) Render()
- func (r CARenderer) SetBounds(value corefoundation.CGRect)
- func (r CARenderer) SetDestination(tex objectivec.IObject)
- func (r CARenderer) SetLayer(value ICALayer)
- func (r CARenderer) UpdateBounds() corefoundation.CGRect
- type CARendererClass
- type CAReplicatorLayer
- func (r CAReplicatorLayer) Autorelease() CAReplicatorLayer
- func (r CAReplicatorLayer) Init() CAReplicatorLayer
- func (r CAReplicatorLayer) InstanceAlphaOffset() float32
- func (r CAReplicatorLayer) InstanceBlueOffset() float32
- func (r CAReplicatorLayer) InstanceColor() coregraphics.CGColorRef
- func (r CAReplicatorLayer) InstanceCount() int
- func (r CAReplicatorLayer) InstanceDelay() float64
- func (r CAReplicatorLayer) InstanceGreenOffset() float32
- func (r CAReplicatorLayer) InstanceRedOffset() float32
- func (r CAReplicatorLayer) InstanceTransform() CATransform3D
- func (r CAReplicatorLayer) PreservesDepth() bool
- func (r CAReplicatorLayer) SetInstanceAlphaOffset(value float32)
- func (r CAReplicatorLayer) SetInstanceBlueOffset(value float32)
- func (r CAReplicatorLayer) SetInstanceColor(value coregraphics.CGColorRef)
- func (r CAReplicatorLayer) SetInstanceCount(value int)
- func (r CAReplicatorLayer) SetInstanceDelay(value float64)
- func (r CAReplicatorLayer) SetInstanceGreenOffset(value float32)
- func (r CAReplicatorLayer) SetInstanceRedOffset(value float32)
- func (r CAReplicatorLayer) SetInstanceTransform(value CATransform3D)
- func (r CAReplicatorLayer) SetPreservesDepth(value bool)
- type CAReplicatorLayerClass
- type CAScrollLayer
- func (s CAScrollLayer) Autorelease() CAScrollLayer
- func (s CAScrollLayer) Init() CAScrollLayer
- func (s CAScrollLayer) ScrollMode() CAScrollLayerScrollMode
- func (s CAScrollLayer) ScrollToPoint(p corefoundation.CGPoint)
- func (s CAScrollLayer) ScrollToRect(r corefoundation.CGRect)
- func (s CAScrollLayer) SetScrollMode(value CAScrollLayerScrollMode)
- type CAScrollLayerClass
- type CAScrollLayerScrollMode
- type CAShapeLayer
- func (s CAShapeLayer) Autorelease() CAShapeLayer
- func (s CAShapeLayer) EvenOdd() CAShapeLayerFillRule
- func (s CAShapeLayer) FillColor() coregraphics.CGColorRef
- func (s CAShapeLayer) FillRule() CAShapeLayerFillRule
- func (s CAShapeLayer) Init() CAShapeLayer
- func (s CAShapeLayer) LineCap() CAShapeLayerLineCap
- func (s CAShapeLayer) LineDashPattern() []foundation.NSNumber
- func (s CAShapeLayer) LineDashPhase() float64
- func (s CAShapeLayer) LineJoin() CAShapeLayerLineJoin
- func (s CAShapeLayer) LineWidth() float64
- func (s CAShapeLayer) MiterLimit() float64
- func (s CAShapeLayer) Path() coregraphics.CGPathRef
- func (s CAShapeLayer) SetFillColor(value coregraphics.CGColorRef)
- func (s CAShapeLayer) SetFillRule(value CAShapeLayerFillRule)
- func (s CAShapeLayer) SetLineCap(value CAShapeLayerLineCap)
- func (s CAShapeLayer) SetLineDashPattern(value []foundation.NSNumber)
- func (s CAShapeLayer) SetLineDashPhase(value float64)
- func (s CAShapeLayer) SetLineJoin(value CAShapeLayerLineJoin)
- func (s CAShapeLayer) SetLineWidth(value float64)
- func (s CAShapeLayer) SetMiterLimit(value float64)
- func (s CAShapeLayer) SetPath(value coregraphics.CGPathRef)
- func (s CAShapeLayer) SetStrokeColor(value coregraphics.CGColorRef)
- func (s CAShapeLayer) SetStrokeEnd(value float64)
- func (s CAShapeLayer) SetStrokeStart(value float64)
- func (s CAShapeLayer) StrokeColor() coregraphics.CGColorRef
- func (s CAShapeLayer) StrokeEnd() float64
- func (s CAShapeLayer) StrokeStart() float64
- type CAShapeLayerClass
- type CAShapeLayerFillRule
- type CAShapeLayerLineCap
- type CAShapeLayerLineJoin
- type CASpringAnimation
- func (s CASpringAnimation) AllowsOverdamping() bool
- func (s CASpringAnimation) Autorelease() CASpringAnimation
- func (s CASpringAnimation) Bounce() float64
- func (s CASpringAnimation) Damping() float64
- func (s CASpringAnimation) Init() CASpringAnimation
- func (s CASpringAnimation) InitWithPerceptualDurationBounce(perceptualDuration float64, bounce float64) CASpringAnimation
- func (s CASpringAnimation) InitialVelocity() float64
- func (s CASpringAnimation) Mass() float64
- func (s CASpringAnimation) PerceptualDuration() float64
- func (s CASpringAnimation) SetAllowsOverdamping(value bool)
- func (s CASpringAnimation) SetDamping(value float64)
- func (s CASpringAnimation) SetInitialVelocity(value float64)
- func (s CASpringAnimation) SetMass(value float64)
- func (s CASpringAnimation) SetStiffness(value float64)
- func (s CASpringAnimation) SettlingDuration() float64
- func (s CASpringAnimation) Stiffness() float64
- type CASpringAnimationClass
- type CATextLayer
- func (t CATextLayer) AlignmentMode() CATextLayerAlignmentMode
- func (t CATextLayer) AllowsFontSubpixelQuantization() bool
- func (t CATextLayer) Autorelease() CATextLayer
- func (t CATextLayer) Font() corefoundation.CFTypeRef
- func (t CATextLayer) FontSize() float64
- func (t CATextLayer) ForegroundColor() coregraphics.CGColorRef
- func (t CATextLayer) Init() CATextLayer
- func (t CATextLayer) SetAlignmentMode(value CATextLayerAlignmentMode)
- func (t CATextLayer) SetAllowsFontSubpixelQuantization(value bool)
- func (t CATextLayer) SetFont(value corefoundation.CFTypeRef)
- func (t CATextLayer) SetFontSize(value float64)
- func (t CATextLayer) SetForegroundColor(value coregraphics.CGColorRef)
- func (t CATextLayer) SetTruncationMode(value CATextLayerTruncationMode)
- func (t CATextLayer) SetWrapped(value bool)
- func (t CATextLayer) TruncationMode() CATextLayerTruncationMode
- func (t CATextLayer) Wrapped() bool
- type CATextLayerAlignmentMode
- type CATextLayerClass
- type CATextLayerTruncationMode
- type CATiledLayer
- func (t CATiledLayer) Autorelease() CATiledLayer
- func (t CATiledLayer) Init() CATiledLayer
- func (t CATiledLayer) LevelsOfDetail() uintptr
- func (t CATiledLayer) LevelsOfDetailBias() uintptr
- func (t CATiledLayer) SetLevelsOfDetail(value uintptr)
- func (t CATiledLayer) SetLevelsOfDetailBias(value uintptr)
- func (t CATiledLayer) SetTileSize(value corefoundation.CGSize)
- func (t CATiledLayer) TileSize() corefoundation.CGSize
- type CATiledLayerClass
- type CATransaction
- type CATransactionClass
- func (cc CATransactionClass) Alloc() CATransaction
- func (_CATransactionClass CATransactionClass) AnimationDuration() float64
- func (_CATransactionClass CATransactionClass) AnimationTimingFunction() CAMediaTimingFunction
- func (_CATransactionClass CATransactionClass) Begin()
- func (_CATransactionClass CATransactionClass) Commit()
- func (_CATransactionClass CATransactionClass) CompletionBlock()
- func (_CATransactionClass CATransactionClass) DisableActions() bool
- func (_CATransactionClass CATransactionClass) Flush()
- func (_CATransactionClass CATransactionClass) Lock()
- func (_CATransactionClass CATransactionClass) SetAnimationDuration(dur float64)
- func (_CATransactionClass CATransactionClass) SetAnimationTimingFunction(function ICAMediaTimingFunction)
- func (_CATransactionClass CATransactionClass) SetCompletionBlock(block VoidHandler)
- func (tc CATransactionClass) SetCompletionBlockSync(ctx context.Context) error
- func (_CATransactionClass CATransactionClass) SetDisableActions(flag bool)
- func (_CATransactionClass CATransactionClass) Unlock()
- type CATransform3D
- func CATransform3DConcat(a CATransform3D, b CATransform3D) CATransform3D
- func CATransform3DInvert(t CATransform3D) CATransform3D
- func CATransform3DMakeAffineTransform(m corefoundation.CGAffineTransform) CATransform3D
- func CATransform3DMakeRotation(angle float64, x float64, y float64, z float64) CATransform3D
- func CATransform3DMakeScale(sx float64, sy float64, sz float64) CATransform3D
- func CATransform3DMakeTranslation(tx float64, ty float64, tz float64) CATransform3D
- func CATransform3DRotate(t CATransform3D, angle float64, x float64, y float64, z float64) CATransform3D
- func CATransform3DScale(t CATransform3D, sx float64, sy float64, sz float64) CATransform3D
- func CATransform3DTranslate(t CATransform3D, tx float64, ty float64, tz float64) CATransform3D
- type CATransformLayer
- type CATransformLayerClass
- type CATransition
- func (t CATransition) Autorelease() CATransition
- func (t CATransition) BackgroundColor() coregraphics.CGColorRef
- func (t CATransition) EndProgress() float32
- func (t CATransition) Filter() objectivec.IObject
- func (t CATransition) Init() CATransition
- func (t CATransition) SetBackgroundColor(value coregraphics.CGColorRef)
- func (t CATransition) SetEndProgress(value float32)
- func (t CATransition) SetFilter(value objectivec.IObject)
- func (t CATransition) SetStartProgress(value float32)
- func (t CATransition) SetSubtype(value CATransitionSubtype)
- func (t CATransition) SetType(value CATransitionType)
- func (t CATransition) StartProgress() float32
- func (t CATransition) Subtype() CATransitionSubtype
- func (t CATransition) Type() CATransitionType
- type CATransitionClass
- type CATransitionSubtype
- type CATransitionType
- type CAValueFunction
- func (v CAValueFunction) Autorelease() CAValueFunction
- func (v CAValueFunction) EncodeWithCoder(coder foundation.INSCoder)
- func (v CAValueFunction) FromValue() objectivec.IObject
- func (v CAValueFunction) Init() CAValueFunction
- func (v CAValueFunction) Name() CAValueFunctionName
- func (v CAValueFunction) Pi() float32
- func (v CAValueFunction) RotateZ() CAValueFunctionName
- func (v CAValueFunction) Scale() CAValueFunctionName
- func (v CAValueFunction) SetFromValue(value objectivec.IObject)
- func (v CAValueFunction) SetPi(value float32)
- func (v CAValueFunction) SetToValue(value objectivec.IObject)
- func (v CAValueFunction) SetValueFunction(value ICAValueFunction)
- func (v CAValueFunction) ToValue() objectivec.IObject
- func (v CAValueFunction) Translate() CAValueFunctionName
- func (v CAValueFunction) ValueFunction() ICAValueFunction
- type CAValueFunctionClass
- type CAValueFunctionName
- type ICAAnimation
- type ICAAnimationGroup
- type ICABasicAnimation
- type ICAConstraint
- type ICAConstraintLayoutManager
- type ICADisplayLink
- type ICAEDRMetadata
- type ICAEmitterCell
- type ICAEmitterLayer
- type ICAGradientLayer
- type ICAKeyframeAnimation
- type ICALayer
- type ICAMediaTimingFunction
- type ICAMetalDisplayLink
- type ICAMetalDisplayLinkUpdate
- type ICAMetalLayer
- type ICAPropertyAnimation
- type ICARemoteLayerClient
- type ICARemoteLayerServer
- type ICARenderer
- type ICAReplicatorLayer
- type ICAScrollLayer
- type ICAShapeLayer
- type ICASpringAnimation
- type ICATextLayer
- type ICATiledLayer
- type ICATransaction
- type ICATransformLayer
- type ICATransition
- type ICAValueFunction
- type VoidHandler
Constants ¶
This section is empty.
Variables ¶
var ( // KCAOnOrderIn is the identifier that represents the action taken when a layer becomes visible, either as a result being inserted into the visible layer hierarchy or the layer is no longer set as hidden. // // See: https://developer.apple.com/documentation/QuartzCore/kCAOnOrderIn KCAOnOrderIn string // KCAOnOrderOut is the identifier that represents the action taken when the layer is removed from the layer hierarchy or is hidden. // // See: https://developer.apple.com/documentation/QuartzCore/kCAOnOrderOut KCAOnOrderOut string // See: https://developer.apple.com/documentation/QuartzCore/kCARendererColorSpace KCARendererColorSpace string // See: https://developer.apple.com/documentation/QuartzCore/kCARendererMetalCommandQueue KCARendererMetalCommandQueue string // KCATransactionAnimationDuration is duration, in seconds, for animations triggered within the transaction group. // // See: https://developer.apple.com/documentation/QuartzCore/kCATransactionAnimationDuration KCATransactionAnimationDuration string // See: https://developer.apple.com/documentation/QuartzCore/kCATransactionAnimationTimingFunction KCATransactionAnimationTimingFunction string // See: https://developer.apple.com/documentation/QuartzCore/kCATransactionCompletionBlock KCATransactionCompletionBlock string // KCATransactionDisableActions is a key whose value indicates whether implicit actions for property changes made within the transaction group are suppressed. // // See: https://developer.apple.com/documentation/QuartzCore/kCATransactionDisableActions KCATransactionDisableActions string // KCATransition is the identifier that represents a transition animation. // // See: https://developer.apple.com/documentation/QuartzCore/kCATransition KCATransition string )
var CADynamicRanges struct { Automatic CADynamicRange ConstrainedHigh CADynamicRange High CADynamicRange Standard CADynamicRange }
CADynamicRanges provides typed accessors for CADynamicRange constants.
Functions ¶
func CACurrentMediaTime ¶
func CACurrentMediaTime() float64
CACurrentMediaTime returns the current absolute time, in seconds.
See: https://developer.apple.com/documentation/QuartzCore/CACurrentMediaTime()
func CAFrameRateRangeIsEqualToRange ¶
func CAFrameRateRangeIsEqualToRange(range_ CAFrameRateRange, other CAFrameRateRange) bool
CAFrameRateRangeIsEqualToRange.
See: https://developer.apple.com/documentation/QuartzCore/CAFrameRateRangeIsEqualToRange
func CATransform3DEqualToTransform ¶
func CATransform3DEqualToTransform(a CATransform3D, b CATransform3D) bool
CATransform3DEqualToTransform returns a Boolean value that indicates whether the two transforms are exactly equal.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DEqualToTransform(_:_:)
func CATransform3DGetAffineTransform ¶
func CATransform3DGetAffineTransform(t CATransform3D) corefoundation.CGAffineTransform
CATransform3DGetAffineTransform returns the affine transform represented by `t`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DGetAffineTransform(_:)
func CATransform3DIsAffine ¶
func CATransform3DIsAffine(t CATransform3D) bool
CATransform3DIsAffine returns a Boolean value that indicates whether a transform can be exactly represented by an affine transform.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DIsAffine(_:)
func CATransform3DIsIdentity ¶
func CATransform3DIsIdentity(t CATransform3D) bool
CATransform3DIsIdentity returns a Boolean value that indicates whether the transform is the identity transform.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DIsIdentity(_:)
func NewVoidBlock ¶
func NewVoidBlock(handler VoidHandler) (objc.ID, func())
NewVoidBlock wraps a Go VoidHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [CATransaction.SetCompletionBlock]
Types ¶
type CAAction ¶
type CAAction interface {
objectivec.IObject
}
An interface that allows instances to respond to actions triggered by a Core Animation layer change.
See: https://developer.apple.com/documentation/QuartzCore/CAAction
type CAActionObject ¶
type CAActionObject struct {
objectivec.Object
}
CAActionObject wraps an existing Objective-C object that conforms to the CAAction protocol.
func CAActionObjectFromID ¶
func CAActionObjectFromID(id objc.ID) CAActionObject
CAActionObjectFromID constructs a CAActionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (CAActionObject) BaseObject ¶
func (o CAActionObject) BaseObject() objectivec.Object
func (CAActionObject) RunActionForKeyObjectArguments ¶
func (o CAActionObject) RunActionForKeyObjectArguments(event string, anObject objectivec.IObject, dict foundation.INSDictionary)
Called to trigger the action specified by the identifier.
event: The identifier of the action. The identifier may be a key or key path relative to `anObject`, an arbitrary external action, or one of the action identifiers defined in CALayer.
anObject: The layer on which the action should occur.
dict: A dictionary containing parameters associated with this event. May be `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAAction/run(forKey:object:arguments:)
type CAAnimation ¶
type CAAnimation struct {
objectivec.Object
}
The abstract superclass for animations in Core Animation.
Overview ¶
CAAnimation provides the basic support for the CAMediaTiming and CAAction protocols. You do not create instance of CAAnimation: to animate Core Animation layers or SceneKit objects, create instances of the concrete subclasses CABasicAnimation, CAKeyframeAnimation, CAAnimationGroup, or CATransition.
Animating Core Animation Layers ¶
You can animate the contents of your iOS or macOS app’s user interface by attaching animations to CALayer objects. For more information, see Core Animation Programming Guide.
Animating Scene Kit Content ¶
In Scene Kit, animation objects represent not only property-based animations, but also animations of geometry data created with external 3D authoring tools and loaded from a scene file. You use the properties of the CAAnimation object representing a geometry animation to control its timing, monitor its progress, and attach actions for Scene Kit to trigger during the animation. You can attach animations to Scene Kit objects that adopt the SCNAnimatable protocol, including nodes, geometries, and materials.
In a Scene Kit app, CAAnimation objects support additional methods and properties, listed under Controlling SceneKit Animation Timing, Fading between SceneKit Animations, and Attaching SceneKit Animation Events.
Animation Attributes ¶
- CAAnimation.RemovedOnCompletion: Determines if the animation is removed from the target layer’s animations upon completion.
- CAAnimation.SetRemovedOnCompletion
- CAAnimation.TimingFunction: An optional timing function defining the pacing of the animation.
- CAAnimation.SetTimingFunction
Designating a Delegate ¶
- CAAnimation.Delegate: Specifies the receiver’s delegate object.
- CAAnimation.SetDelegate
Archiving Properties ¶
- CAAnimation.ShouldArchiveValueForKey: Specifies whether the value of the property for a given key is archived.
Controlling SceneKit Animation Timing ¶
- CAAnimation.UsesSceneTimeBase: For animations attached to SceneKit objects, a Boolean value that determines whether the animation is evaluated using the scene time or the system time.
- CAAnimation.SetUsesSceneTimeBase
Fading between SceneKit Animations ¶
- CAAnimation.FadeInDuration: For animations attached to SceneKit objects, the duration for transitioning into the animation’s effect as it begins.
- CAAnimation.SetFadeInDuration
- CAAnimation.FadeOutDuration: For animations attached to SceneKit objects, the duration for transitioning out of the animation’s effect as it ends.
- CAAnimation.SetFadeOutDuration
Attaching SceneKit Animation Events ¶
- CAAnimation.AnimationEvents: For animations attached to SceneKit objects, a list of events attached to an animation.
- CAAnimation.SetAnimationEvents
Instance Properties ¶
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation
func CAAnimationFromID ¶
func CAAnimationFromID(id objc.ID) CAAnimation
CAAnimationFromID constructs a CAAnimation from an objc.ID.
The abstract superclass for animations in Core Animation.
func NewAnimationWithSCNAnimation ¶
func NewAnimationWithSCNAnimation(animation objectivec.IObject) CAAnimation
Creates an animation from a SceneKit animation.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/init(SCNAnimation:) animation is a [scenekit.SCNAnimation].
func NewCAAnimation ¶
func NewCAAnimation() CAAnimation
NewCAAnimation creates a new CAAnimation instance.
func (CAAnimation) AnimationEvents ¶
func (a CAAnimation) AnimationEvents() []objectivec.IObject
For animations attached to SceneKit objects, a list of events attached to an animation.
Discussion ¶
An array of SCNAnimationEvent objects, each of which adds a timed action to the animation.
For example, you can create animation events that play sound effects timed to match the footsteps of an animated game character or that add new nodes to the scene when an animation completes.
To attach animations to SceneKit objects, see SCNAnimatable.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/animationEvents
func (CAAnimation) Autorelease ¶
func (a CAAnimation) Autorelease() CAAnimation
Autorelease adds the receiver to the current autorelease pool.
func (CAAnimation) Autoreverses ¶
func (a CAAnimation) Autoreverses() bool
Determines if the receiver plays in the reverse upon completion.
Discussion ¶
When true, the receiver plays backwards after playing forwards. Defaults to false.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/autoreverses
func (CAAnimation) BeginTime ¶
func (a CAAnimation) BeginTime() float64
Specifies the begin time of the receiver in relation to its parent object, if applicable.
Discussion ¶
Defaults to 0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/beginTime
func (CAAnimation) Delegate ¶
func (a CAAnimation) Delegate() CAAnimationDelegate
Specifies the receiver’s delegate object.
Discussion ¶
Defaults to `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/delegate
func (CAAnimation) Duration ¶
func (a CAAnimation) Duration() float64
Specifies the basic duration of the animation, in seconds.
Discussion ¶
Defaults to 0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/duration
func (CAAnimation) EncodeWithCoder ¶
func (a CAAnimation) EncodeWithCoder(coder foundation.INSCoder)
func (CAAnimation) FadeInDuration ¶
func (a CAAnimation) FadeInDuration() float64
For animations attached to SceneKit objects, the duration for transitioning into the animation’s effect as it begins.
Discussion ¶
Use this property to create smooth transitions between the effects of multiple animations. These transitions are especially useful for geometry animations created with external 3D authoring tools.
For example, the geometry loaded from a scene file for a game character may have associated animations for player actions such as walking and jumping. When the player jumps, if the fade duration is zero, SceneKit abruptly switches from the current frame of the walk animation to the first frame of the jump animation. If the fade duration is greater than zero, SceneKit plays both animations at once during that duration and interpolates vertex positions from one animation to the other, creating a smooth transition.
To attach animations to SceneKit objects, see SCNAnimatable.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/fadeInDuration
func (CAAnimation) FadeOutDuration ¶
func (a CAAnimation) FadeOutDuration() float64
For animations attached to SceneKit objects, the duration for transitioning out of the animation’s effect as it ends.
Discussion ¶
Use this property to create smooth transitions between the effects of multiple animations. These transitions are especially useful for geometry animations created with external 3D authoring tools.
For example, the geometry loaded from a scene file for a game character may have associated animations for player actions such as walking and jumping. When the player jumps, if the fade duration is zero, SceneKit abruptly switches from the current frame of the walk animation to the first frame of the jump animation. If the fade duration is greater than zero, SceneKit plays both animations at once during that duration and interpolates vertex positions from one animation to the other, creating a smooth transition.
To attach animations to SceneKit objects, see SCNAnimatable.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/fadeOutDuration
func (CAAnimation) FillMode ¶
func (a CAAnimation) FillMode() CAMediaTimingFillMode
Determines if the receiver’s presentation is frozen or removed once its active duration has completed.
Discussion ¶
The possible values are described in Fill Modes. The default is removed.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/fillMode
func (CAAnimation) PreferredFrameRateRange ¶
func (a CAAnimation) PreferredFrameRateRange() CAFrameRateRange
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/preferredFrameRateRange
func (CAAnimation) RemovedOnCompletion ¶
func (a CAAnimation) RemovedOnCompletion() bool
Determines if the animation is removed from the target layer’s animations upon completion.
Discussion ¶
When true, the animation is removed from the target layer’s animations once its active duration has passed. Defaults to true.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/isRemovedOnCompletion
func (CAAnimation) RepeatCount ¶
func (a CAAnimation) RepeatCount() float32
Determines the number of times the animation will repeat.
Discussion ¶
May be fractional. If the `repeatCount` is 0, it is ignored. Defaults to 0. If both [RepeatDuration] and [RepeatCount] are specified the behavior is undefined.
Setting this property to greatestFiniteMagnitude will cause the animation to repeat forever.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatCount
func (CAAnimation) RepeatDuration ¶
func (a CAAnimation) RepeatDuration() float64
Determines how many seconds the animation will repeat for.
Discussion ¶
Defaults to 0. If the `repeatDuration` is 0, it is ignored. If both [RepeatDuration] and [RepeatCount] are specified the behavior is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatDuration
func (CAAnimation) RunActionForKeyObjectArguments ¶
func (a CAAnimation) RunActionForKeyObjectArguments(event string, anObject objectivec.IObject, dict foundation.INSDictionary)
Called to trigger the action specified by the identifier.
event: The identifier of the action. The identifier may be a key or key path relative to `anObject`, an arbitrary external action, or one of the action identifiers defined in CALayer.
anObject: The layer on which the action should occur.
dict: A dictionary containing parameters associated with this event. May be `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAAction/run(forKey:object:arguments:)
func (CAAnimation) SetAnimationEvents ¶
func (a CAAnimation) SetAnimationEvents(value []objectivec.IObject)
func (CAAnimation) SetAutoreverses ¶
func (a CAAnimation) SetAutoreverses(value bool)
func (CAAnimation) SetBeginTime ¶
func (a CAAnimation) SetBeginTime(value float64)
func (CAAnimation) SetDelegate ¶
func (a CAAnimation) SetDelegate(value CAAnimationDelegate)
func (CAAnimation) SetDuration ¶
func (a CAAnimation) SetDuration(value float64)
func (CAAnimation) SetFadeInDuration ¶
func (a CAAnimation) SetFadeInDuration(value float64)
func (CAAnimation) SetFadeOutDuration ¶
func (a CAAnimation) SetFadeOutDuration(value float64)
func (CAAnimation) SetFillMode ¶
func (a CAAnimation) SetFillMode(value CAMediaTimingFillMode)
func (CAAnimation) SetPreferredFrameRateRange ¶
func (a CAAnimation) SetPreferredFrameRateRange(value CAFrameRateRange)
func (CAAnimation) SetRemovedOnCompletion ¶
func (a CAAnimation) SetRemovedOnCompletion(value bool)
func (CAAnimation) SetRepeatCount ¶
func (a CAAnimation) SetRepeatCount(value float32)
func (CAAnimation) SetRepeatDuration ¶
func (a CAAnimation) SetRepeatDuration(value float64)
func (CAAnimation) SetSpeed ¶
func (a CAAnimation) SetSpeed(value float32)
func (CAAnimation) SetTimeOffset ¶
func (a CAAnimation) SetTimeOffset(value float64)
func (CAAnimation) SetTimingFunction ¶
func (a CAAnimation) SetTimingFunction(value ICAMediaTimingFunction)
func (CAAnimation) SetUsesSceneTimeBase ¶
func (a CAAnimation) SetUsesSceneTimeBase(value bool)
func (CAAnimation) SetValueForKey ¶ added in v0.4.4
func (a CAAnimation) SetValueForKey(value objectivec.IObject, key string)
Sets the value of the property identified by the given key. [Full Topic]
func (CAAnimation) ShouldArchiveValueForKey ¶
func (a CAAnimation) ShouldArchiveValueForKey(key string) bool
Specifies whether the value of the property for a given key is archived.
key: The name of one of the receiver’s properties.
Return Value ¶
true if the specified property should be archived, otherwise false.
Discussion ¶
Called by the object’s implementation of “. The object must implement keyed archiving.
The default implementation returns true.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/shouldArchiveValue(forKey:)
func (CAAnimation) Speed ¶
func (a CAAnimation) Speed() float32
Specifies how time is mapped to receiver’s time space from the parent time space.
Discussion ¶
For example, if `speed` is 2.0 local time progresses twice as fast as parent time. Defaults to 1.0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/speed
func (CAAnimation) TimeOffset ¶
func (a CAAnimation) TimeOffset() float64
Specifies an additional time offset in active local time.
Discussion ¶
Defaults to 0. .
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/timeOffset
func (CAAnimation) TimingFunction ¶
func (a CAAnimation) TimingFunction() ICAMediaTimingFunction
An optional timing function defining the pacing of the animation.
Discussion ¶
Defaults to `nil`, indicating linear pacing.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/timingFunction
func (CAAnimation) UsesSceneTimeBase ¶
func (a CAAnimation) UsesSceneTimeBase() bool
For animations attached to SceneKit objects, a Boolean value that determines whether the animation is evaluated using the scene time or the system time.
Discussion ¶
If the value of this property is true, animation timing is governed by the currentTime property of the view, layer, or custom renderer responsible for drawing the scene. The default value is false.
To attach animations to SceneKit objects, see SCNAnimatable.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/usesSceneTimeBase
func (CAAnimation) ValueForKey ¶ added in v0.4.4
func (a CAAnimation) ValueForKey(key string) objectivec.IObject
Returns the value of the property identified by the given key. [Full Topic]
type CAAnimationCalculationMode ¶
type CAAnimationCalculationMode = string
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationCalculationMode
var ( // KCAAnimationCubic is smooth spline calculation between keyframe values. // // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationCalculationMode/cubic KCAAnimationCubic CAAnimationCalculationMode // KCAAnimationCubicPaced is cubic keyframe values are interpolated to produce an even pace throughout the animation. // // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationCalculationMode/cubicPaced KCAAnimationCubicPaced CAAnimationCalculationMode // KCAAnimationDiscrete is each keyframe value is used in turn, no interpolated values are calculated. // // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationCalculationMode/discrete KCAAnimationDiscrete CAAnimationCalculationMode // KCAAnimationLinear is simple linear calculation between keyframe values. // // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationCalculationMode/linear KCAAnimationLinear CAAnimationCalculationMode // KCAAnimationPaced is linear keyframe values are interpolated to produce an even pace throughout the animation. // // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationCalculationMode/paced KCAAnimationPaced CAAnimationCalculationMode )
type CAAnimationClass ¶
type CAAnimationClass struct {
// contains filtered or unexported fields
}
func GetCAAnimationClass ¶
func GetCAAnimationClass() CAAnimationClass
GetCAAnimationClass returns the class object for CAAnimation.
func (CAAnimationClass) Alloc ¶
func (cc CAAnimationClass) Alloc() CAAnimation
Alloc allocates memory for a new instance of the class.
func (CAAnimationClass) DefaultValueForKey ¶
func (_CAAnimationClass CAAnimationClass) DefaultValueForKey(key string) objectivec.IObject
Specifies the default value of the property with the specified key.
key: The name of one of the receiver’s properties.
Return Value ¶
The default value for the named property. Returns `nil` if no default value has been set.
Discussion ¶
If this method returns `nil` a suitable “zero” default value for the property is provided, based on the declared type of the `key`. For example, if `key` is a [CGSize] object, a size of (0.0,0.0) is returned. For a [CGRect] an empty rectangle is returned. For [CGAffineTransform] and CATransform3D, the appropriate identity matrix is returned.
Special Considerations ¶
If `key` is not a known for property of the class, the result of the method is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation/defaultValue(forKey:)
type CAAnimationDelegate ¶
type CAAnimationDelegate interface {
objectivec.IObject
}
Methods your app can implement to respond when animations start and stop.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationDelegate
type CAAnimationDelegateConfig ¶
type CAAnimationDelegateConfig struct {
// Customizing Start and Stop Times
// AnimationDidStart — Tells the delegate the animation has started.
AnimationDidStart func(anim CAAnimation)
// AnimationDidStopFinished — Tells the delegate the animation has ended.
AnimationDidStopFinished func(anim CAAnimation, flag bool)
}
CAAnimationDelegateConfig holds optional typed callbacks for CAAnimationDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type CAAnimationDelegateObject ¶
type CAAnimationDelegateObject struct {
objectivec.Object
}
CAAnimationDelegateObject wraps an existing Objective-C object that conforms to the CAAnimationDelegate protocol.
func CAAnimationDelegateObjectFromID ¶
func CAAnimationDelegateObjectFromID(id objc.ID) CAAnimationDelegateObject
CAAnimationDelegateObjectFromID constructs a CAAnimationDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func NewCAAnimationDelegate ¶
func NewCAAnimationDelegate(config CAAnimationDelegateConfig) CAAnimationDelegateObject
NewCAAnimationDelegate creates an Objective-C object implementing the CAAnimationDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned CAAnimationDelegateObject satisfies the CAAnimationDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func (CAAnimationDelegateObject) AnimationDidStart ¶
func (o CAAnimationDelegateObject) AnimationDidStart(anim ICAAnimation)
Tells the delegate the animation has started.
anim: The CAAnimation object that has started.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationDelegate/animationDidStart(_:)
func (CAAnimationDelegateObject) AnimationDidStopFinished ¶
func (o CAAnimationDelegateObject) AnimationDidStopFinished(anim ICAAnimation, flag bool)
Tells the delegate the animation has ended.
anim: The CAAnimation object that has ended.
flag: A flag indicating whether the animation has completed by reaching the end of its duration.
Discussion ¶
The animation may have ended because it has completed its active duration or because it has been removed from the layer it is attached to. `flag` is true if the animation reached the end of its duration without being removed.
func (CAAnimationDelegateObject) BaseObject ¶
func (o CAAnimationDelegateObject) BaseObject() objectivec.Object
type CAAnimationGroup ¶
type CAAnimationGroup struct {
CAAnimation
}
An object that allows multiple animations to be grouped and run concurrently.
Overview ¶
The grouped animations run in the time space specified by the CAAnimationGroup instance.
The duration of the grouped animations are not scaled to the duration of their CAAnimationGroup. Instead, the animations are clipped to the duration of the animation group. For example, a 10 second animation grouped within an animation group with a duration of 5 seconds displays only the first 5 seconds of the animation.
The following code shows how you can create a grouped animation containing opacity and scale animations to fade out a layer while expanding it. The animation starts with an opacity of `1` and a scale of `1` on all axes. As the animation’s scale increases to `(3, 3, 3)`, the opacity drops to `0` and the animated layer vanishes.
Grouped animations ¶
- CAAnimationGroup.Animations: An array of CAAnimation objects to be evaluated in the time space of the receiver.
- CAAnimationGroup.SetAnimations
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationGroup
func CAAnimationGroupFromID ¶
func CAAnimationGroupFromID(id objc.ID) CAAnimationGroup
CAAnimationGroupFromID constructs a CAAnimationGroup from an objc.ID.
An object that allows multiple animations to be grouped and run concurrently.
func NewCAAnimationGroup ¶
func NewCAAnimationGroup() CAAnimationGroup
NewCAAnimationGroup creates a new CAAnimationGroup instance.
func (CAAnimationGroup) Animations ¶
func (a CAAnimationGroup) Animations() []CAAnimation
An array of CAAnimation objects to be evaluated in the time space of the receiver.
Discussion ¶
The animations run concurrently in the receiver’s time space.
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationGroup/animations
func (CAAnimationGroup) Autorelease ¶
func (a CAAnimationGroup) Autorelease() CAAnimationGroup
Autorelease adds the receiver to the current autorelease pool.
func (CAAnimationGroup) Init ¶
func (a CAAnimationGroup) Init() CAAnimationGroup
Init initializes the instance.
func (CAAnimationGroup) IsRemovedOnCompletion ¶
func (a CAAnimationGroup) IsRemovedOnCompletion() bool
Determines if the animation is removed from the target layer’s animations upon completion.
See: https://developer.apple.com/documentation/quartzcore/caanimation/isremovedoncompletion
func (CAAnimationGroup) SetAnimations ¶
func (a CAAnimationGroup) SetAnimations(value []CAAnimation)
func (CAAnimationGroup) SetIsRemovedOnCompletion ¶
func (a CAAnimationGroup) SetIsRemovedOnCompletion(value bool)
type CAAnimationGroupClass ¶
type CAAnimationGroupClass struct {
// contains filtered or unexported fields
}
func GetCAAnimationGroupClass ¶
func GetCAAnimationGroupClass() CAAnimationGroupClass
GetCAAnimationGroupClass returns the class object for CAAnimationGroup.
func (CAAnimationGroupClass) Alloc ¶
func (cc CAAnimationGroupClass) Alloc() CAAnimationGroup
Alloc allocates memory for a new instance of the class.
type CAAnimationRotationMode ¶
type CAAnimationRotationMode = string
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationRotationMode
var ( // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationRotationMode/rotateAuto KCAAnimationRotateAuto CAAnimationRotationMode // See: https://developer.apple.com/documentation/QuartzCore/CAAnimationRotationMode/rotateAutoReverse KCAAnimationRotateAutoReverse CAAnimationRotationMode )
type CAAutoresizingMask ¶
type CAAutoresizingMask int
See: https://developer.apple.com/documentation/QuartzCore/CAAutoresizingMask
const ( // KCALayerHeightSizable: The receiver’s height is flexible. KCALayerHeightSizable CAAutoresizingMask = 16 // KCALayerMaxXMargin: The right margin between the receiver and its superview is flexible. KCALayerMaxXMargin CAAutoresizingMask = 4 // KCALayerMaxYMargin: The top margin between the receiver and its superview is flexible. KCALayerMaxYMargin CAAutoresizingMask = 32 // KCALayerMinXMargin: The left margin between the receiver and its superview is flexible. KCALayerMinXMargin CAAutoresizingMask = 1 // KCALayerMinYMargin: The bottom margin between the receiver and its superview is flexible. KCALayerMinYMargin CAAutoresizingMask = 8 // KCALayerWidthSizable: The receiver’s width is flexible. KCALayerWidthSizable CAAutoresizingMask = 2 )
func (CAAutoresizingMask) String ¶
func (e CAAutoresizingMask) String() string
type CABasicAnimation ¶
type CABasicAnimation struct {
CAPropertyAnimation
}
An object that provides basic, single-keyframe animation capabilities for a layer property.
Overview ¶
You create an instance of CABasicAnimation using the inherited [CABasicAnimation.AnimationWithKeyPath] method, specifying the key path of the property to be animated in the render tree.
For example, you can animate a layer’s scalar (i.e. containing a single value) properties such as its CABasicAnimation.Opacity. The following code fades in a layer by animating its opacity from `0` to `1`.
Non-scalar properties, such as CABasicAnimation.BackgroundColor, can also be animated. Core Animation will interpolate between the CABasicAnimation.FromValue color and the CABasicAnimation.ToValue color. The animation created in the following code fades a layer’s background color from red to blue.
If you want to animate the individual components of a non-scalar property with different values, you pass the values to CABasicAnimation.ToValue and CABasicAnimation.FromValue as arrays. The following animation moves a layer from `(0, 0)` to `(100, 100)`.
The `keyPath` can access the individual components of a property. For example, the following animation stretches a layer by animating its CABasicAnimation.Transform object’s `x` from `1` to `2`.
Setting Interpolation Values ¶
The CABasicAnimation.FromValue, CABasicAnimation.ByValue and CABasicAnimation.ToValue properties define the values being interpolated between. All are optional, and no more than two should be non-`nil`. The object type should match the type of the property being animated.
The interpolation values are used as follows:
- Both CABasicAnimation.FromValue and CABasicAnimation.ToValue are non-`nil`. Interpolates between CABasicAnimation.FromValue and CABasicAnimation.ToValue. - CABasicAnimation.FromValue and CABasicAnimation.ByValue are non-`nil`. Interpolates between CABasicAnimation.FromValue and (CABasicAnimation.FromValue + CABasicAnimation.ByValue). - CABasicAnimation.ByValue and CABasicAnimation.ToValue are non-`nil`. Interpolates between (CABasicAnimation.ToValue - CABasicAnimation.ByValue) and CABasicAnimation.ToValue. - CABasicAnimation.FromValue is non-`nil`. Interpolates between CABasicAnimation.FromValue and the current presentation value of the property. - CABasicAnimation.ToValue is non-`nil`. Interpolates between the current value of `keyPath` in the target layer’s presentation layer and CABasicAnimation.ToValue. - CABasicAnimation.ByValue is non-`nil`. Interpolates between the current value of `keyPath` in the target layer’s presentation layer and that value plus CABasicAnimation.ByValue. - All properties are `nil`. Interpolates between the previous value of `keyPath` in the target layer’s presentation layer and the current value of `keyPath` in the target layer’s presentation layer.
Interpolation values ¶
- CABasicAnimation.FromValue: Defines the value the receiver uses to start interpolation.
- CABasicAnimation.SetFromValue
- CABasicAnimation.ToValue: Defines the value the receiver uses to end interpolation.
- CABasicAnimation.SetToValue
- CABasicAnimation.ByValue: Defines the value the receiver uses to perform relative interpolation.
- CABasicAnimation.SetByValue
See: https://developer.apple.com/documentation/QuartzCore/CABasicAnimation
func CABasicAnimationFromID ¶
func CABasicAnimationFromID(id objc.ID) CABasicAnimation
CABasicAnimationFromID constructs a CABasicAnimation from an objc.ID.
An object that provides basic, single-keyframe animation capabilities for a layer property.
func NewBasicAnimationWithKeyPath ¶
func NewBasicAnimationWithKeyPath(path string) CABasicAnimation
Creates and returns an CAPropertyAnimation instance for the specified key path.
path: The key path of the property to be animated.
Return Value ¶
A new instance of CAPropertyAnimation with the key path set to `keyPath`.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/init(keyPath:)
func NewCABasicAnimation ¶
func NewCABasicAnimation() CABasicAnimation
NewCABasicAnimation creates a new CABasicAnimation instance.
func (CABasicAnimation) Autorelease ¶
func (b CABasicAnimation) Autorelease() CABasicAnimation
Autorelease adds the receiver to the current autorelease pool.
func (CABasicAnimation) BackgroundColor ¶
func (b CABasicAnimation) BackgroundColor() coregraphics.CGColorRef
The background color of the receiver. Animatable.
See: https://developer.apple.com/documentation/quartzcore/calayer/backgroundcolor
func (CABasicAnimation) ByValue ¶
func (b CABasicAnimation) ByValue() objectivec.IObject
Defines the value the receiver uses to perform relative interpolation.
Discussion ¶
See CABasicAnimation for details on how `byValue` interacts with the other interpolation values.
See: https://developer.apple.com/documentation/QuartzCore/CABasicAnimation/byValue
func (CABasicAnimation) FromValue ¶
func (b CABasicAnimation) FromValue() objectivec.IObject
Defines the value the receiver uses to start interpolation.
Discussion ¶
See CABasicAnimation for details on how `fromValue` interacts with the other interpolation values.
See: https://developer.apple.com/documentation/QuartzCore/CABasicAnimation/fromValue
func (CABasicAnimation) Init ¶
func (b CABasicAnimation) Init() CABasicAnimation
Init initializes the instance.
func (CABasicAnimation) Opacity ¶
func (b CABasicAnimation) Opacity() float32
The opacity of the receiver. Animatable.
See: https://developer.apple.com/documentation/quartzcore/calayer/opacity
func (CABasicAnimation) SetBackgroundColor ¶
func (b CABasicAnimation) SetBackgroundColor(value coregraphics.CGColorRef)
func (CABasicAnimation) SetByValue ¶
func (b CABasicAnimation) SetByValue(value objectivec.IObject)
func (CABasicAnimation) SetFromValue ¶
func (b CABasicAnimation) SetFromValue(value objectivec.IObject)
func (CABasicAnimation) SetOpacity ¶
func (b CABasicAnimation) SetOpacity(value float32)
func (CABasicAnimation) SetToValue ¶
func (b CABasicAnimation) SetToValue(value objectivec.IObject)
func (CABasicAnimation) SetTransform ¶
func (b CABasicAnimation) SetTransform(value CATransform3D)
func (CABasicAnimation) ToValue ¶
func (b CABasicAnimation) ToValue() objectivec.IObject
Defines the value the receiver uses to end interpolation.
Discussion ¶
See CABasicAnimation for details on how `toValue` interacts with the other interpolation values.
See: https://developer.apple.com/documentation/QuartzCore/CABasicAnimation/toValue
func (CABasicAnimation) Transform ¶
func (b CABasicAnimation) Transform() CATransform3D
The transform applied to the layer’s contents. Animatable.
See: https://developer.apple.com/documentation/quartzcore/calayer/transform
type CABasicAnimationClass ¶
type CABasicAnimationClass struct {
// contains filtered or unexported fields
}
func GetCABasicAnimationClass ¶
func GetCABasicAnimationClass() CABasicAnimationClass
GetCABasicAnimationClass returns the class object for CABasicAnimation.
func (CABasicAnimationClass) Alloc ¶
func (cc CABasicAnimationClass) Alloc() CABasicAnimation
Alloc allocates memory for a new instance of the class.
type CAConstraint ¶
type CAConstraint struct {
objectivec.Object
}
A representation of a single layout constraint between two layers.
Overview ¶
Each CAConstraint instance encapsulates one geometry relationship between two layers on the same axis.
Sibling layers are referenced by name, using the name property of each layer. The special name `superlayer` is used to refer to the layer’s superlayer.
For example, to specify that a layer should be horizontally centered in its superview you would use the following:
A minimum of two relationships must be specified per axis. If you specify constraints for the left and right edges of a layer, the width will vary. If you specify constraints for the left edge and the width, the right edge of the layer will move relative to the superlayer’s frame. Often you’ll specify only a single edge constraint, the layer’s size in the same axis will be used as the second relationship.
Create a New Constraint ¶
- CAConstraint.InitWithAttributeRelativeToAttributeScaleOffset: Returns an CAConstraint object with the specified parameters. Designated initializer.
Accessing Constraint Values ¶
- CAConstraint.Attribute: The attribute the constraint affects.
- CAConstraint.Offset: Offset value of the constraint attribute.
- CAConstraint.Scale: Scale factor of the constraint attribute.
- CAConstraint.SourceAttribute: The constraint attribute of the layer the receiver is calculated relative to
- CAConstraint.SourceName: Name of the layer that the constraint is calculated relative to.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint
func CAConstraintFromID ¶
func CAConstraintFromID(id objc.ID) CAConstraint
CAConstraintFromID constructs a CAConstraint from an objc.ID.
A representation of a single layout constraint between two layers.
func NewCAConstraint ¶
func NewCAConstraint() CAConstraint
NewCAConstraint creates a new CAConstraint instance.
func NewConstraintWithAttributeRelativeToAttribute ¶
func NewConstraintWithAttributeRelativeToAttribute(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute) CAConstraint
Creates and returns an CAConstraint object with the specified parameters.
attr: The attribute of the layer for which to create a new constraint.
srcId: The name of the layer that this constraint is calculated relative to.
srcAttr: The attribute of `srcLayer` the constraint is calculated relative to.
Return Value ¶
A new CAConstraint object with the specified parameters. The scale of the constraint is set to 1.0. The offset of the constraint is set to 0.0.
Discussion ¶
The value for the constraint is calculated is `srcAttr`.
func NewConstraintWithAttributeRelativeToAttributeOffset ¶
func NewConstraintWithAttributeRelativeToAttributeOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, c float64) CAConstraint
Creates and returns an CAConstraint object with the specified parameters.
attr: The attribute of the layer for which to create a new constraint.
srcId: The name of the layer that this constraint is calculated relative to.
srcAttr: The attribute of `srcLayer` the constraint is calculated relative to.
c: The offset added to the value of `srcAttr`.
Return Value ¶
A new CAConstraint object with the specified parameters. The scale of the constraint is set to 1.0.
Discussion ¶
The value for the constraint is calculated as (`srcAttr` + `offset`).
func NewConstraintWithAttributeRelativeToAttributeScaleOffset ¶
func NewConstraintWithAttributeRelativeToAttributeScaleOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, m float64, c float64) CAConstraint
Returns an CAConstraint object with the specified parameters. Designated initializer.
attr: The attribute of the layer for which to create a new constraint.
srcId: The name of the layer that this constraint is calculated relative to.
srcAttr: The attribute of `srcLayer` the constraint is calculated relative to.
m: The amount to scale the value of `srcAttr`.
c: The offset added to the value of `srcAttr`.
Return Value ¶
An initialized constraint object using the specified parameters.
Discussion ¶
The value for the constraint is calculated as (`srcAttr` * `scale`) + `offset`).
func (CAConstraint) Attribute ¶
func (c CAConstraint) Attribute() CAConstraintAttribute
The attribute the constraint affects.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint/attribute
func (CAConstraint) Autorelease ¶
func (c CAConstraint) Autorelease() CAConstraint
Autorelease adds the receiver to the current autorelease pool.
func (CAConstraint) EncodeWithCoder ¶
func (c CAConstraint) EncodeWithCoder(coder foundation.INSCoder)
func (CAConstraint) InitWithAttributeRelativeToAttributeScaleOffset ¶
func (c_ CAConstraint) InitWithAttributeRelativeToAttributeScaleOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, m float64, c float64) CAConstraint
Returns an CAConstraint object with the specified parameters. Designated initializer.
attr: The attribute of the layer for which to create a new constraint.
srcId: The name of the layer that this constraint is calculated relative to.
srcAttr: The attribute of `srcLayer` the constraint is calculated relative to.
m: The amount to scale the value of `srcAttr`.
c: The offset added to the value of `srcAttr`.
Return Value ¶
An initialized constraint object using the specified parameters.
Discussion ¶
The value for the constraint is calculated as (`srcAttr` * `scale`) + `offset`).
func (CAConstraint) Offset ¶
func (c CAConstraint) Offset() float64
Offset value of the constraint attribute.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint/offset
func (CAConstraint) Scale ¶
func (c CAConstraint) Scale() float64
Scale factor of the constraint attribute.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint/scale
func (CAConstraint) SourceAttribute ¶
func (c CAConstraint) SourceAttribute() CAConstraintAttribute
The constraint attribute of the layer the receiver is calculated relative to
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint/sourceAttribute
func (CAConstraint) SourceName ¶
func (c CAConstraint) SourceName() string
Name of the layer that the constraint is calculated relative to.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint/sourceName
type CAConstraintAttribute ¶
type CAConstraintAttribute int
See: https://developer.apple.com/documentation/QuartzCore/CAConstraintAttribute
const ( // KCAConstraintHeight: The height of a layer. KCAConstraintHeight CAConstraintAttribute = 7 // KCAConstraintMaxX: The right edge of a layer’s frame. KCAConstraintMaxX CAConstraintAttribute = 2 // KCAConstraintMaxY: The top edge of a layer’s frame. KCAConstraintMaxY CAConstraintAttribute = 6 // KCAConstraintMidX: The horizontal location of the center of a layer’s frame. KCAConstraintMidX CAConstraintAttribute = 1 // KCAConstraintMidY: The vertical location of the center of a layer’s frame. KCAConstraintMidY CAConstraintAttribute = 5 // KCAConstraintMinX: The left edge of a layer’s frame. KCAConstraintMinX CAConstraintAttribute = 0 // KCAConstraintMinY: The bottom edge of a layer’s frame. KCAConstraintMinY CAConstraintAttribute = 4 // KCAConstraintWidth: The width of a layer. KCAConstraintWidth CAConstraintAttribute = 3 )
func (CAConstraintAttribute) String ¶
func (e CAConstraintAttribute) String() string
type CAConstraintClass ¶
type CAConstraintClass struct {
// contains filtered or unexported fields
}
func GetCAConstraintClass ¶
func GetCAConstraintClass() CAConstraintClass
GetCAConstraintClass returns the class object for CAConstraint.
func (CAConstraintClass) Alloc ¶
func (cc CAConstraintClass) Alloc() CAConstraint
Alloc allocates memory for a new instance of the class.
type CAConstraintLayoutManager ¶
type CAConstraintLayoutManager struct {
objectivec.Object
}
An object that provides a constraint-based layout manager.
Overview ¶
You use the shared instance of this object by assigning it to the CAConstraintLayoutManager.LayoutManager property of any layer objects to which you have added constraints. During a layout update, Core Animation uses the layout manager to update the size and position of the sublayers based on the registered set of constraints.
Constraints let you define a set of geometric relationships between a layer and its sibling layers or between a layer and its superlayer. These relationships are expressed using constraint objects, which are instances of the CAConstraint class. When creating constraints, you can reference a layer by name using that object’s CAConstraintLayoutManager.Name property. You can also use the special name `superlayer` to refer to the layer’s superlayer.
The following example shows how you can use CAConstraintLayoutManager to create a layer containing two constrained sublayers: `leftLayer` and `rightLayer`. A series of CAConstraint objects are created so that the sublayers match their superlayer’s height and are half of its width. `leftConstraint` matches the CAConstraintAttribute.minX attribute and `rightConstraint` matches the CAConstraintAttribute.maxX attribute.
The end result is that the two sublayers are always laid out so that `leftLayer` fills the left half of `layer` and `rightLayer` fills the right half of layer.
This class is not meant to be subclassed.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraintLayoutManager
func CAConstraintLayoutManagerFromID ¶
func CAConstraintLayoutManagerFromID(id objc.ID) CAConstraintLayoutManager
CAConstraintLayoutManagerFromID constructs a CAConstraintLayoutManager from an objc.ID.
An object that provides a constraint-based layout manager.
func NewCAConstraintLayoutManager ¶
func NewCAConstraintLayoutManager() CAConstraintLayoutManager
NewCAConstraintLayoutManager creates a new CAConstraintLayoutManager instance.
func (CAConstraintLayoutManager) Autorelease ¶
func (c CAConstraintLayoutManager) Autorelease() CAConstraintLayoutManager
Autorelease adds the receiver to the current autorelease pool.
func (CAConstraintLayoutManager) Init ¶
func (c CAConstraintLayoutManager) Init() CAConstraintLayoutManager
Init initializes the instance.
func (CAConstraintLayoutManager) InvalidateLayoutOfLayer ¶
func (c CAConstraintLayoutManager) InvalidateLayoutOfLayer(layer ICALayer)
Invalidates the layout of a layer so it knows to refresh its content on the next frame.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager/invalidateLayout(of:)
func (CAConstraintLayoutManager) LayoutManager ¶
func (c CAConstraintLayoutManager) LayoutManager() CALayoutManager
The object responsible for laying out the layer’s sublayers.
See: https://developer.apple.com/documentation/quartzcore/calayer/layoutmanager
func (CAConstraintLayoutManager) LayoutSublayersOfLayer ¶
func (c CAConstraintLayoutManager) LayoutSublayersOfLayer(layer ICALayer)
Override to customize layout of sublayers whenever the layer needs redrawing.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager/layoutSublayers(of:)
func (CAConstraintLayoutManager) Name ¶
func (c CAConstraintLayoutManager) Name() string
The name of the receiver.
See: https://developer.apple.com/documentation/quartzcore/calayer/name
func (CAConstraintLayoutManager) PreferredSizeOfLayer ¶
func (c CAConstraintLayoutManager) PreferredSizeOfLayer(layer ICALayer) corefoundation.CGSize
Override to customize layer size.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager/preferredSize(of:)
func (CAConstraintLayoutManager) SetLayoutManager ¶
func (c CAConstraintLayoutManager) SetLayoutManager(value CALayoutManager)
func (CAConstraintLayoutManager) SetName ¶
func (c CAConstraintLayoutManager) SetName(value string)
type CAConstraintLayoutManagerClass ¶
type CAConstraintLayoutManagerClass struct {
// contains filtered or unexported fields
}
func GetCAConstraintLayoutManagerClass ¶
func GetCAConstraintLayoutManagerClass() CAConstraintLayoutManagerClass
GetCAConstraintLayoutManagerClass returns the class object for CAConstraintLayoutManager.
func (CAConstraintLayoutManagerClass) Alloc ¶
func (cc CAConstraintLayoutManagerClass) Alloc() CAConstraintLayoutManager
Alloc allocates memory for a new instance of the class.
type CACornerMask ¶
type CACornerMask int
See: https://developer.apple.com/documentation/QuartzCore/CACornerMask
const ( KCALayerMaxXMaxYCorner CACornerMask = 8 KCALayerMaxXMinYCorner CACornerMask = 2 KCALayerMinXMaxYCorner CACornerMask = 4 KCALayerMinXMinYCorner CACornerMask = 1 )
func (CACornerMask) String ¶
func (e CACornerMask) String() string
type CADisplayLink ¶
type CADisplayLink struct {
objectivec.Object
}
A timer object that allows your app to synchronize its drawing to the refresh rate of the display.
Overview ¶
Your app initializes a new display link by providing a target object and a selector to call when the system updates the screen. To synchronize your display loop with the display, your application adds it to a run loop using the CADisplayLink.AddToRunLoopForMode method.
Once you associate the display link with a run loop, the system calls the selector on the target when the screen’s contents need to update. The target can read the display link’s CADisplayLink.Timestamp property to retrieve the time the system displayed the previous frame. For example, an app that displays movies might use `timestamp` to calculate which video frame to display next. An app that performs its own animations might use `timestamp` to determine where and how visible objects appear in the upcoming frame.
The CADisplayLink.Duration property provides the amount of time between frames at the CADisplayLink.MaximumFramesPerSecond. To calculate the actual frame duration, use CADisplayLink.TargetTimestamp - CADisplayLink.Timestamp. You can use this value in your app to calculate the frame rate of the display, the approximate time the system displays the next frame, and to adjust the drawing behavior so that the next frame is ready in time to display.
Your app can disable notifications by setting CADisplayLink.Paused to `true`. Also, if your app can’t provide frames in the time the system provides, you may want to choose a slower frame rate. An app with a slower but consistent frame rate appears smoother to the user than an app that skips frames. You can define the number of frames per second by setting [CADisplayLink.PreferredFramesPerSecond].
When your app finishes with a display link, call CADisplayLink.Invalidate to remove it from all run loops and to disassociate it from the target.
The code listing below shows how to create a display link and add it to the current run loop. The display link invokes the step function, which prints the target timestamp with each screen update.
You shouldn’t subclass CADisplayLink.
Preferred and Actual Frame Rates ¶
You control a display link’s frame rate (the number of times the system calls the selector of its target, per second) by setting [CADisplayLink.PreferredFramesPerSecond]. However, the actual frames per second may differ from the preferred value you set; actual frame rates are always a factor of the maximum refresh rate of the device. For example, if your device’s maximum refresh rate is 60 frames per second (defined by CADisplayLink.MaximumFramesPerSecond), actual frame rates include 15, 20, 30, and 60 frames per second. If you set a display link’s preferred frame rate to a value higher than the maximum, the actual frame rate is the maximum.
In iOS 15, frame rate availability can change due to the system factoring in the system policy and user preference — including Low Power Mode, critical thermal state, and accessibility settings.
The system rounds, to the nearest factor, preferred frame rates that aren’t a divisor of the maximum frame rate. For example, setting a preferred frame rate to either 26 or 35 frames per second on a device with a maximum refresh rate of 60 frames per second yields an actual frame rate of 30 times per second.
The code listing below shows how to calculate the actual frame rate by dividing 1 by your display link’s CADisplayLink.Timestamp subtracted from its CADisplayLink.TargetTimestamp.
Configuring a Display Link ¶
- CADisplayLink.Duration: The time interval between screen refresh updates.
- CADisplayLink.PreferredFrameRateRange: A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
- CADisplayLink.SetPreferredFrameRateRange
- CADisplayLink.Paused: A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
- CADisplayLink.SetPaused
- CADisplayLink.Timestamp: The time interval that represents when the last frame displayed.
- CADisplayLink.TargetTimestamp: The time interval that represents when the next frame displays.
Scheduling a Display Link to Send Notifications ¶
- CADisplayLink.AddToRunLoopForMode: Registers the display link with a run loop.
- CADisplayLink.RemoveFromRunLoopForMode: Removes the display link from the run loop for the given mode.
- CADisplayLink.Invalidate: Removes the display link from all run loop modes.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink
func CADisplayLinkFromID ¶
func CADisplayLinkFromID(id objc.ID) CADisplayLink
CADisplayLinkFromID constructs a CADisplayLink from an objc.ID.
A timer object that allows your app to synchronize its drawing to the refresh rate of the display.
func NewCADisplayLink ¶
func NewCADisplayLink() CADisplayLink
NewCADisplayLink creates a new CADisplayLink instance.
func NewDisplayLinkWithTargetSelector ¶
func NewDisplayLinkWithTargetSelector(target objectivec.IObject, sel objc.SEL) CADisplayLink
Creates a display link for a target that calls its selector.
target: An object in your app that you want the system to notify each time it updates a display.
sel: A selector instance that represents a method for `target`.
Return Value ¶
A new CADisplayLink object.
Discussion ¶
The selector on the target must be a method with the following signature, where sender is the display link returned by this method.
The newly constructed display link retains the target.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/init(target:selector:)
func (CADisplayLink) AddToRunLoopForMode ¶
func (d CADisplayLink) AddToRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
Registers the display link with a run loop.
runloop: The run loop to associate with the display link.
mode: The mode in which to add the display link to the run loop.
Discussion ¶
You can associate a display link with multiple input modes. While the run loop is executing in a mode you specify, the display link notifies the target when the system requires new frames.
You can specify a custom mode or use one of the modes listed in RunLoop.
The run loop retains the display link. To remove the display link from all run loops, call [Invalidate].
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/add(to:forMode:)
func (CADisplayLink) Autorelease ¶
func (d CADisplayLink) Autorelease() CADisplayLink
Autorelease adds the receiver to the current autorelease pool.
func (CADisplayLink) Duration ¶
func (d CADisplayLink) Duration() float64
The time interval between screen refresh updates.
Discussion ¶
This value is in an undefined state until the system calls the target’s selector at least once.
You calculate the expected amount of time your app has to render each frame by using [TargetTimestamp]-[Timestamp]. Use [TargetTimestamp]-CACurrentMediaTime to calculate the actual amount of time.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/duration
func (CADisplayLink) Init ¶
func (d CADisplayLink) Init() CADisplayLink
Init initializes the instance.
func (CADisplayLink) Invalidate ¶
func (d CADisplayLink) Invalidate()
Removes the display link from all run loop modes.
Discussion ¶
When you remove the display link from all run loop mode, the system releases it. The display link also releases the target.
This method is thread safe, so you can call it from a thread separate to the one in which the display link runs.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/invalidate()
func (CADisplayLink) MaximumFramesPerSecond ¶
func (d CADisplayLink) MaximumFramesPerSecond() int
The maximum number of frames per second a screen can render.
See: https://developer.apple.com/documentation/UIKit/UIScreen/maximumFramesPerSecond
func (CADisplayLink) Paused ¶
func (d CADisplayLink) Paused() bool
A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
Discussion ¶
The default value is false. If true, the display link doesn’t send notifications to the target.
This property is thread safe, so you can set it from a thread separate to the one in which the display link runs.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/isPaused
func (CADisplayLink) PreferredFrameRateRange ¶
func (d CADisplayLink) PreferredFrameRateRange() CAFrameRateRange
A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
Discussion ¶
The display link makes a best attempt to invoke your app’s callback within the frequency range you set to this property. However, the system also takes into account the device’s hardware capabilities and the other tasks your game or app is running.
The system can change the available range of frame rates because it factors in system policies and a person’s preferences. For example, Low Power Mode, critical thermal state, and accessibility settings can affect the system’s frame rate.
The system typically provides a consistent frame rate by choosing one that’s a factor of the display’s maximum refresh rate. For example, a display link could invoke your callback 60 times per second for a display with a refresh rate of 60 hertz. However, the display link could invoke your callback less frequently, such as 30, 20, or 15 hertz, by setting a range with smaller values.
See Optimizing ProMotion refresh rates for iPhone 13 Pro and iPad Pro for more information.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/preferredFrameRateRange
func (CADisplayLink) RemoveFromRunLoopForMode ¶
func (d CADisplayLink) RemoveFromRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
Removes the display link from the run loop for the given mode.
runloop: The run loop you associate with the display link.
mode: The run loop mode in which the display link is running.
Discussion ¶
The run loop releases the display link if it’s no longer associated with any run modes.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/remove(from:forMode:)
func (CADisplayLink) SetMaximumFramesPerSecond ¶
func (d CADisplayLink) SetMaximumFramesPerSecond(value int)
func (CADisplayLink) SetPaused ¶
func (d CADisplayLink) SetPaused(value bool)
func (CADisplayLink) SetPreferredFrameRateRange ¶
func (d CADisplayLink) SetPreferredFrameRateRange(value CAFrameRateRange)
func (CADisplayLink) TargetTimestamp ¶
func (d CADisplayLink) TargetTimestamp() float64
The time interval that represents when the next frame displays.
Discussion ¶
You can use the target timestamp to cancel or pause long running processes that may overrun the available time between frames in order to maintain a consistent frame rate.
The following code shows how you can create a display link and register it with a run loop. The `step(“)` function attempts to sum the square roots of all numbers up to max, but with each iteration checks the current time (CACurrentMediaTime) against the [TargetTimestamp]. If the time taken to complete the calculation is later than the target timestamp, the function breaks the loop:
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/targetTimestamp
func (CADisplayLink) Timestamp ¶
func (d CADisplayLink) Timestamp() float64
The time interval that represents when the last frame displayed.
Discussion ¶
If you need to calculate what to display next, use [TargetTimestamp] instead.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink/timestamp
type CADisplayLinkClass ¶
type CADisplayLinkClass struct {
// contains filtered or unexported fields
}
func GetCADisplayLinkClass ¶
func GetCADisplayLinkClass() CADisplayLinkClass
GetCADisplayLinkClass returns the class object for CADisplayLink.
func (CADisplayLinkClass) Alloc ¶
func (cc CADisplayLinkClass) Alloc() CADisplayLink
Alloc allocates memory for a new instance of the class.
type CADynamicRange ¶
type CADynamicRange = string
See: https://developer.apple.com/documentation/QuartzCore/CALayer/DynamicRange
type CAEDRMetadata ¶
type CAEDRMetadata struct {
objectivec.Object
}
Metadata describing how extended dynamic range (EDR) values should be tone mapped.
Overview ¶
If you need specific tone-mapping behavior, set the [EDRMetadata] property of a CAMetalLayer to point to an instance of this class.
See: https://developer.apple.com/documentation/QuartzCore/CAEDRMetadata
func CAEDRMetadataFromID ¶
func CAEDRMetadataFromID(id objc.ID) CAEDRMetadata
CAEDRMetadataFromID constructs a CAEDRMetadata from an objc.ID.
Metadata describing how extended dynamic range (EDR) values should be tone mapped.
func NewCAEDRMetadata ¶
func NewCAEDRMetadata() CAEDRMetadata
NewCAEDRMetadata creates a new CAEDRMetadata instance.
func (CAEDRMetadata) Autorelease ¶
func (e CAEDRMetadata) Autorelease() CAEDRMetadata
Autorelease adds the receiver to the current autorelease pool.
func (CAEDRMetadata) EdrMetadata ¶
func (e CAEDRMetadata) EdrMetadata() ICAEDRMetadata
Metadata describing the tone mapping to apply to the extended dynamic range (EDR) values in the layer.
See: https://developer.apple.com/documentation/quartzcore/cametallayer/edrmetadata
func (CAEDRMetadata) EncodeWithCoder ¶
func (e CAEDRMetadata) EncodeWithCoder(coder foundation.INSCoder)
func (CAEDRMetadata) Init ¶
func (e CAEDRMetadata) Init() CAEDRMetadata
Init initializes the instance.
func (CAEDRMetadata) SetEdrMetadata ¶
func (e CAEDRMetadata) SetEdrMetadata(value ICAEDRMetadata)
type CAEDRMetadataClass ¶
type CAEDRMetadataClass struct {
// contains filtered or unexported fields
}
func GetCAEDRMetadataClass ¶
func GetCAEDRMetadataClass() CAEDRMetadataClass
GetCAEDRMetadataClass returns the class object for CAEDRMetadata.
func (CAEDRMetadataClass) Alloc ¶
func (cc CAEDRMetadataClass) Alloc() CAEDRMetadata
Alloc allocates memory for a new instance of the class.
func (CAEDRMetadataClass) Available ¶
func (_CAEDRMetadataClass CAEDRMetadataClass) Available() bool
See: https://developer.apple.com/documentation/QuartzCore/CAEDRMetadata/isAvailable
func (CAEDRMetadataClass) HDR10MetadataWithDisplayInfoContentInfoOpticalOutputScale ¶
func (_CAEDRMetadataClass CAEDRMetadataClass) HDR10MetadataWithDisplayInfoContentInfoOpticalOutputScale(displayData foundation.INSData, contentData foundation.INSData, scale float32) CAEDRMetadata
Creates EDR metadata for HDR10 content based on mastering display color information and content light levels.
displayData: A value of 24 bytes that contains a big-endian structure, as defined in D.2.28 (Mastering Display Colour Volume SEI message).
contentData: A value of 4 bytes that contains a big-endian structure, as defined in D.2.35 (Content Light Level Information SEI message).
scale: A scale factor relating (display-referred linear) EDR values to the optical output of the reference display.
Discussion ¶
The MDCV and CLLI message formats are defined in ISO/IEC 23008-2:2017.
The values in the drawable’s texture are assumed to be proportional to the optical output (in cd/m^2) of the reference display. For example, if the optical output scale is 100, then a value of 1.0 is assumed to be 100 nits.
func (CAEDRMetadataClass) HDR10MetadataWithMinLuminanceMaxLuminanceOpticalOutputScale ¶
func (_CAEDRMetadataClass CAEDRMetadataClass) HDR10MetadataWithMinLuminanceMaxLuminanceOpticalOutputScale(minNits float32, maxNits float32, scale float32) CAEDRMetadata
Creates EDR metadata for HDR10 content based on the luminance characteristics of a mastering display.
minNits: The minimum nits (cd/m^2) of the mastering display.
maxNits: The maximum nits (cd/m^2) of the mastering display.
scale: A scale factor relating (display-referred linear) extended range buffer values to the optical output of a reference display.
Return Value ¶
A new EDR metadata object.
Discussion ¶
Any content greater than the maximum luminance (`maxNits`) may be clamped when displayed.
The values in the drawable’s texture are assumed to be proportional to the optical output (in cd/m^2) of the reference display. For example, if the optical output scale is 100, then a value of 1.0 is assumed to be 100 nits.
If the content is in a normalized pixel format, set `opticalOutputScale` to 10000.
func (CAEDRMetadataClass) HLGMetadata ¶
func (_CAEDRMetadataClass CAEDRMetadataClass) HLGMetadata() CAEDRMetadata
Extended dynamic range (EDR) metadata for the Hybrid Log-Gamma (HLG) transfer function.
Discussion ¶
Your content should be scene referred and encoded with the ITU-R BT.2100-2 Hybrid Log Gamma (HLG) opto-electrical transfer function (OETF). The system applies the opto-optical transfer function (OOTF) based on peak display brightness and ambient lighting. If you’re rendering to a CAMetalLayer with a linear colorspace (for floating point EDR layers), you must apply the HLG inverse OETF without normalization, to provide a nominal range of `[0, 12]`.
For more information on HLG, see https://www.itu.int/rec/R-REC-BT.2100.
See: https://developer.apple.com/documentation/QuartzCore/CAEDRMetadata/hlg
func (CAEDRMetadataClass) HLGMetadataWithAmbientViewingEnvironment ¶
func (_CAEDRMetadataClass CAEDRMetadataClass) HLGMetadataWithAmbientViewingEnvironment(data foundation.INSData) CAEDRMetadata
See: https://developer.apple.com/documentation/QuartzCore/CAEDRMetadata/hlg(ambientViewingEnvironment:)
type CAEdgeAntialiasingMask ¶
type CAEdgeAntialiasingMask int
See: https://developer.apple.com/documentation/QuartzCore/CAEdgeAntialiasingMask
const ( // KCALayerBottomEdge: # Discussion KCALayerBottomEdge CAEdgeAntialiasingMask = 4 // KCALayerLeftEdge: # Discussion KCALayerLeftEdge CAEdgeAntialiasingMask = 1 // KCALayerRightEdge: # Discussion KCALayerRightEdge CAEdgeAntialiasingMask = 2 // KCALayerTopEdge: # Discussion KCALayerTopEdge CAEdgeAntialiasingMask = 8 )
func (CAEdgeAntialiasingMask) String ¶
func (e CAEdgeAntialiasingMask) String() string
type CAEmitterCell ¶
type CAEmitterCell struct {
objectivec.Object
}
The definition of a particle emitted by a particle layer.
Overview ¶
The CAEmitterCell class represents one source of particles being emitted by a CAEmitterLayer object. An emitter cell defines the direction and properties of the emitted particles. Emitter cells can have an array of sub-cells, which lets the particles themselves emit particles.
Providing Emitter Cell Content ¶
- CAEmitterCell.Contents: An object that provides the contents of the layer. Animatable.
- CAEmitterCell.SetContents
- CAEmitterCell.ContentsRect: A rectangle (in the unit coordinate space) that specifies the portion of [contents](<doc://com.apple.quartzcore/documentation/QuartzCore/CAEmitterCell/contents>) that the receiver should draw. Animatable.
- CAEmitterCell.SetContentsRect
- CAEmitterCell.EmitterCells: An optional array containing the sub-cells of this cell.
- CAEmitterCell.SetEmitterCells
Setting Emitter Cell Visual Attributes ¶
- CAEmitterCell.Enabled: A Boolean value indicating whether or not cells from this emitter are rendered.
- CAEmitterCell.SetEnabled
- CAEmitterCell.Color: The color of each emitted object. Animatable.
- CAEmitterCell.SetColor
- CAEmitterCell.RedRange: The amount by which the red color component of the cell can vary. Animatable.
- CAEmitterCell.SetRedRange
- CAEmitterCell.GreenRange: The amount by which the green color component of the cell can vary. Animatable.
- CAEmitterCell.SetGreenRange
- CAEmitterCell.BlueRange: The amount by which the blue color component of the cell can vary. Animatable.
- CAEmitterCell.SetBlueRange
- CAEmitterCell.AlphaRange: The amount by which the alpha component of the cell can vary. Animatable.
- CAEmitterCell.SetAlphaRange
- CAEmitterCell.RedSpeed: The speed, in seconds, at which the red color component changes over the lifetime of the cell. Animatable.
- CAEmitterCell.SetRedSpeed
- CAEmitterCell.GreenSpeed: The speed, in seconds, at which the green color component changes over the lifetime of the cell. Animatable.
- CAEmitterCell.SetGreenSpeed
- CAEmitterCell.BlueSpeed: The speed, in seconds, at which the blue color component changes over the lifetime of the cell. Animatable.
- CAEmitterCell.SetBlueSpeed
- CAEmitterCell.AlphaSpeed: The speed, in seconds, at which the alpha component changes over the lifetime of the cell. Animatable.
- CAEmitterCell.SetAlphaSpeed
- CAEmitterCell.MagnificationFilter: The filter used when increasing the size of the content.
- CAEmitterCell.SetMagnificationFilter
- CAEmitterCell.MinificationFilter: The filter used when reducing the size of the content.
- CAEmitterCell.SetMinificationFilter
- CAEmitterCell.MinificationFilterBias: The bias factor used by the minification filter to determine the levels of detail.
- CAEmitterCell.SetMinificationFilterBias
- CAEmitterCell.Scale: Specifies the scale factor applied to the cell. Animatable.
- CAEmitterCell.SetScale
- CAEmitterCell.ScaleRange: Specifies the range over which the scale value can vary. Animatable.
- CAEmitterCell.SetScaleRange
- CAEmitterCell.ContentsScale: The scale factor of the cell contents.
- CAEmitterCell.SetContentsScale
- CAEmitterCell.Name: The name of the cell.
- CAEmitterCell.SetName
- CAEmitterCell.Style: An optional dictionary containing additional style values that are not explicitly defined by the receiver.
- CAEmitterCell.SetStyle
Setting Emitter Cell Motion Attributes ¶
- CAEmitterCell.Spin: The rotational velocity, measured in radians per second, to apply to the cell. Animatable.
- CAEmitterCell.SetSpin
- CAEmitterCell.SpinRange: The amount by which the spin of the cell can vary over its lifetime. Animatable.
- CAEmitterCell.SetSpinRange
- CAEmitterCell.EmissionLatitude: The latitudinal orientation of the emission angle. Animatable.
- CAEmitterCell.SetEmissionLatitude
- CAEmitterCell.EmissionLongitude: The longitudinal orientation of the emission angle. Animatable.
- CAEmitterCell.SetEmissionLongitude
- CAEmitterCell.EmissionRange: The angle, in radians, defining a cone around the emission angle. Animatable.
- CAEmitterCell.SetEmissionRange
Setting Emitter Cell Temporal Attributes ¶
- CAEmitterCell.Lifetime: The lifetime of the cell, in seconds. Animatable.
- CAEmitterCell.SetLifetime
- CAEmitterCell.LifetimeRange: The mean value by which the [lifetime](<doc://com.apple.quartzcore/documentation/QuartzCore/CAEmitterCell/lifetime>) of the cell can vary. Animatable.
- CAEmitterCell.SetLifetimeRange
- CAEmitterCell.BirthRate: The number of emitted objects created every second. Animatable.
- CAEmitterCell.SetBirthRate
- CAEmitterCell.ScaleSpeed: The speed at which the scale changes over the lifetime of the cell. Animatable.
- CAEmitterCell.SetScaleSpeed
- CAEmitterCell.Velocity: The initial velocity of the cell. Animatable.
- CAEmitterCell.SetVelocity
- CAEmitterCell.VelocityRange: The amount by which the velocity of the cell can vary. Animatable.
- CAEmitterCell.SetVelocityRange
- CAEmitterCell.XAcceleration: The x component of an acceleration vector applied to cell.
- CAEmitterCell.SetXAcceleration
- CAEmitterCell.YAcceleration: The y component of an acceleration vector applied to cell.
- CAEmitterCell.SetYAcceleration
- CAEmitterCell.ZAcceleration: The z component of an acceleration vector applied to cell.
- CAEmitterCell.SetZAcceleration
Using Key-Value Coding Extensions ¶
- CAEmitterCell.ShouldArchiveValueForKey: Returns a Boolean value indicating whether the value for a given key should be archived.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell
func CAEmitterCellFromID ¶
func CAEmitterCellFromID(id objc.ID) CAEmitterCell
CAEmitterCellFromID constructs a CAEmitterCell from an objc.ID.
The definition of a particle emitted by a particle layer.
func NewCAEmitterCell ¶
func NewCAEmitterCell() CAEmitterCell
NewCAEmitterCell creates a new CAEmitterCell instance.
func (CAEmitterCell) AlphaRange ¶
func (e CAEmitterCell) AlphaRange() float32
The amount by which the alpha component of the cell can vary. Animatable.
Discussion ¶
The range specifies the mean amount by which the alpha component of the [Color] property can vary for the cell.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/alphaRange
func (CAEmitterCell) AlphaSpeed ¶
func (e CAEmitterCell) AlphaSpeed() float32
The speed, in seconds, at which the alpha component changes over the lifetime of the cell. Animatable.
Discussion ¶
The speed change is defined as the rate of change per second.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/alphaSpeed
func (CAEmitterCell) Autorelease ¶
func (e CAEmitterCell) Autorelease() CAEmitterCell
Autorelease adds the receiver to the current autorelease pool.
func (CAEmitterCell) Autoreverses ¶
func (e CAEmitterCell) Autoreverses() bool
Determines if the receiver plays in the reverse upon completion.
Discussion ¶
When true, the receiver plays backwards after playing forwards. Defaults to false.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/autoreverses
func (CAEmitterCell) BeginTime ¶
func (e CAEmitterCell) BeginTime() float64
Specifies the begin time of the receiver in relation to its parent object, if applicable.
Discussion ¶
Defaults to 0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/beginTime
func (CAEmitterCell) BirthRate ¶
func (e CAEmitterCell) BirthRate() float32
The number of emitted objects created every second. Animatable.
Discussion ¶
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/birthRate
func (CAEmitterCell) BlueRange ¶
func (e CAEmitterCell) BlueRange() float32
The amount by which the blue color component of the cell can vary. Animatable.
Discussion ¶
The range specifies the mean amount by which the blue component of the [Color] property can vary for the cell.
The default value of this property value is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/blueRange
func (CAEmitterCell) BlueSpeed ¶
func (e CAEmitterCell) BlueSpeed() float32
The speed, in seconds, at which the blue color component changes over the lifetime of the cell. Animatable.
Discussion ¶
The speed change is defined as the rate of change per second.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/blueSpeed
func (CAEmitterCell) Color ¶
func (e CAEmitterCell) Color() coregraphics.CGColorRef
The color of each emitted object. Animatable.
Discussion ¶
The specified color of the cell will vary by a random amount within the [RedRange], [GreenRange], [BlueRange] and [AlphaRange]values over the lifetime of the cell. The [RedSpeed], [GreenSpeed], [BlueSpeed], and [AlphaSpeed] determine the rate of change.
The default value of this property is a color object set to opaque white.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/color
func (CAEmitterCell) Contents ¶
func (e CAEmitterCell) Contents() objectivec.IObject
An object that provides the contents of the layer. Animatable.
Discussion ¶
A layer can set this property to a CGImage to display the image as its contents.
The default value of this property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/contents
func (CAEmitterCell) ContentsRect ¶
func (e CAEmitterCell) ContentsRect() corefoundation.CGRect
A rectangle (in the unit coordinate space) that specifies the portion of [Contents] that the receiver should draw. Animatable.
Discussion ¶
By default, this property is set to the unit rectangle (0.0,0.0,1.0,1.0), which results in all of the layer’s contents being drawn.
If pixels outside the unit rectangle are requested, the edge pixels of the contents image are extended outwards.
If you assign an empty rectangle to this property, the results are undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/contentsRect
func (CAEmitterCell) ContentsScale ¶
func (e CAEmitterCell) ContentsScale() float64
The scale factor of the cell contents.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/contentsScale
func (CAEmitterCell) Duration ¶
func (e CAEmitterCell) Duration() float64
Specifies the basic duration of the animation, in seconds.
Discussion ¶
Defaults to 0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/duration
func (CAEmitterCell) EmissionLatitude ¶
func (e CAEmitterCell) EmissionLatitude() float64
The latitudinal orientation of the emission angle. Animatable.
Discussion ¶
The emission latitude is the orientation of the emission angle from the z-axis. It is also referred to as the colatitude.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/emissionLatitude
func (CAEmitterCell) EmissionLongitude ¶
func (e CAEmitterCell) EmissionLongitude() float64
The longitudinal orientation of the emission angle. Animatable.
Discussion ¶
The emission longitude is the orientation of the emission angle in the xy-plane. it is also often referred to as the azimuth.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/emissionLongitude
func (CAEmitterCell) EmissionRange ¶
func (e CAEmitterCell) EmissionRange() float64
The angle, in radians, defining a cone around the emission angle. Animatable.
Discussion ¶
Cells are uniformly distributed across this cone.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/emissionRange
func (CAEmitterCell) EmitterCells ¶
func (e CAEmitterCell) EmitterCells() []CAEmitterCell
An optional array containing the sub-cells of this cell.
Discussion ¶
When specified, each particle emitted by the cell acts as an emitter for each of the cell’s sub-cells. The emission point is the current particle position and the emission angle is relative to the current direction of the particle.
The default value of this property is `nil`.
The following code shows how you can create a firework style effect using sub-cells. The `fireworkCell` has an emission longitude of one quarter turn anti-clockwise to emit particles upwards. It emits `trailCell` instances which have a slight [YAcceleration] that simulates gravity.
Note that the [Scale] and [Color] of `fireworkCell` are inherited by `trailCell`.
Listing 1. Creating particle trails
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/emitterCells
func (CAEmitterCell) Enabled ¶
func (e CAEmitterCell) Enabled() bool
A Boolean value indicating whether or not cells from this emitter are rendered.
Discussion ¶
The default value of this property is true.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/isEnabled
func (CAEmitterCell) EncodeWithCoder ¶
func (e CAEmitterCell) EncodeWithCoder(coder foundation.INSCoder)
func (CAEmitterCell) FillMode ¶
func (e CAEmitterCell) FillMode() CAMediaTimingFillMode
Determines if the receiver’s presentation is frozen or removed once its active duration has completed.
Discussion ¶
The possible values are described in Fill Modes. The default is removed.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/fillMode
func (CAEmitterCell) GreenRange ¶
func (e CAEmitterCell) GreenRange() float32
The amount by which the green color component of the cell can vary. Animatable.
Discussion ¶
The range specifies the mean amount by which the green component of the [Color] property can vary for the cell.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/greenRange
func (CAEmitterCell) GreenSpeed ¶
func (e CAEmitterCell) GreenSpeed() float32
The speed, in seconds, at which the green color component changes over the lifetime of the cell. Animatable.
Discussion ¶
The speed change is defined as the rate of change per second.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/greenSpeed
func (CAEmitterCell) Init ¶
func (e CAEmitterCell) Init() CAEmitterCell
Init initializes the instance.
func (CAEmitterCell) Lifetime ¶
func (e CAEmitterCell) Lifetime() float32
The lifetime of the cell, in seconds. Animatable.
Discussion ¶
The lifetime of the cell will vary by a random amount with the range specified by [LifetimeRange].
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/lifetime
func (CAEmitterCell) LifetimeRange ¶
func (e CAEmitterCell) LifetimeRange() float32
The mean value by which the [Lifetime] of the cell can vary. Animatable.
Discussion ¶
If the [LifetimeRange] is 3 seconds, and the [Lifetime] of the cell is 10 seconds, the cell’s actual lifetime will be between 7 and 13 seconds.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/lifetimeRange
func (CAEmitterCell) MagnificationFilter ¶
func (e CAEmitterCell) MagnificationFilter() string
The filter used when increasing the size of the content.
Discussion ¶
The possible values for this property are listed in Scaling Filters. The default value is linear.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/magnificationFilter
func (CAEmitterCell) MinificationFilter ¶
func (e CAEmitterCell) MinificationFilter() string
The filter used when reducing the size of the content.
Discussion ¶
The possible values for this property are listed in Scaling Filters. The default value is linear.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/minificationFilter
func (CAEmitterCell) MinificationFilterBias ¶
func (e CAEmitterCell) MinificationFilterBias() float32
The bias factor used by the minification filter to determine the levels of detail.
Discussion ¶
This value is used by the [MinificationFilter] property when it is set to `kCAFilterTrilinear`.
The default value of this property to `0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/minificationFilterBias
func (CAEmitterCell) Name ¶
func (e CAEmitterCell) Name() string
The name of the cell.
Discussion ¶
The cell name is used when constructing animation key paths that reference the cell.
For example, adding an animation to a cell’s enclosing layer with the a keypath such as `emitterCells.MyCellNameXCUIElementTypeRedRange()` would animate the `redRange` property of the cell in the layer’s emitterCells array with the name `myCellName`.
The default value of this property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/name
func (CAEmitterCell) RedRange ¶
func (e CAEmitterCell) RedRange() float32
The amount by which the red color component of the cell can vary. Animatable.
Discussion ¶
The range specifies the mean amount by which the red component of the [Color] property can vary for the cell.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/redRange
func (CAEmitterCell) RedSpeed ¶
func (e CAEmitterCell) RedSpeed() float32
The speed, in seconds, at which the red color component changes over the lifetime of the cell. Animatable.
Discussion ¶
The speed change is defined as the rate of change per second.
The default value of this property is `0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/redSpeed
func (CAEmitterCell) RepeatCount ¶
func (e CAEmitterCell) RepeatCount() float32
Determines the number of times the animation will repeat.
Discussion ¶
May be fractional. If the `repeatCount` is 0, it is ignored. Defaults to 0. If both [RepeatDuration] and [RepeatCount] are specified the behavior is undefined.
Setting this property to greatestFiniteMagnitude will cause the animation to repeat forever.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatCount
func (CAEmitterCell) RepeatDuration ¶
func (e CAEmitterCell) RepeatDuration() float64
Determines how many seconds the animation will repeat for.
Discussion ¶
Defaults to 0. If the `repeatDuration` is 0, it is ignored. If both [RepeatDuration] and [RepeatCount] are specified the behavior is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatDuration
func (CAEmitterCell) Scale ¶
func (e CAEmitterCell) Scale() float64
Specifies the scale factor applied to the cell. Animatable.
Discussion ¶
The scale of the cell will vary by a random amount within the range specified by [ScaleRange]. The [ScaleSpeed] property determines the rate of change.
The default value of this property is `1.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/scale
func (CAEmitterCell) ScaleRange ¶
func (e CAEmitterCell) ScaleRange() float64
Specifies the range over which the scale value can vary. Animatable.
Discussion ¶
The range specifies the mean amount that the [Scale] value can vary for the cell over its lifetime.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/scaleRange
func (CAEmitterCell) ScaleSpeed ¶
func (e CAEmitterCell) ScaleSpeed() float64
The speed at which the scale changes over the lifetime of the cell. Animatable.
Discussion ¶
The speed change is defined as the rate of change per second.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/scaleSpeed
func (CAEmitterCell) SetAlphaRange ¶
func (e CAEmitterCell) SetAlphaRange(value float32)
func (CAEmitterCell) SetAlphaSpeed ¶
func (e CAEmitterCell) SetAlphaSpeed(value float32)
func (CAEmitterCell) SetAutoreverses ¶
func (e CAEmitterCell) SetAutoreverses(value bool)
func (CAEmitterCell) SetBeginTime ¶
func (e CAEmitterCell) SetBeginTime(value float64)
func (CAEmitterCell) SetBirthRate ¶
func (e CAEmitterCell) SetBirthRate(value float32)
func (CAEmitterCell) SetBlueRange ¶
func (e CAEmitterCell) SetBlueRange(value float32)
func (CAEmitterCell) SetBlueSpeed ¶
func (e CAEmitterCell) SetBlueSpeed(value float32)
func (CAEmitterCell) SetColor ¶
func (e CAEmitterCell) SetColor(value coregraphics.CGColorRef)
func (CAEmitterCell) SetContents ¶
func (e CAEmitterCell) SetContents(value objectivec.IObject)
func (CAEmitterCell) SetContentsRect ¶
func (e CAEmitterCell) SetContentsRect(value corefoundation.CGRect)
func (CAEmitterCell) SetContentsScale ¶
func (e CAEmitterCell) SetContentsScale(value float64)
func (CAEmitterCell) SetDuration ¶
func (e CAEmitterCell) SetDuration(value float64)
func (CAEmitterCell) SetEmissionLatitude ¶
func (e CAEmitterCell) SetEmissionLatitude(value float64)
func (CAEmitterCell) SetEmissionLongitude ¶
func (e CAEmitterCell) SetEmissionLongitude(value float64)
func (CAEmitterCell) SetEmissionRange ¶
func (e CAEmitterCell) SetEmissionRange(value float64)
func (CAEmitterCell) SetEmitterCells ¶
func (e CAEmitterCell) SetEmitterCells(value []CAEmitterCell)
func (CAEmitterCell) SetEnabled ¶
func (e CAEmitterCell) SetEnabled(value bool)
func (CAEmitterCell) SetFillMode ¶
func (e CAEmitterCell) SetFillMode(value CAMediaTimingFillMode)
func (CAEmitterCell) SetGreenRange ¶
func (e CAEmitterCell) SetGreenRange(value float32)
func (CAEmitterCell) SetGreenSpeed ¶
func (e CAEmitterCell) SetGreenSpeed(value float32)
func (CAEmitterCell) SetLifetime ¶
func (e CAEmitterCell) SetLifetime(value float32)
func (CAEmitterCell) SetLifetimeRange ¶
func (e CAEmitterCell) SetLifetimeRange(value float32)
func (CAEmitterCell) SetMagnificationFilter ¶
func (e CAEmitterCell) SetMagnificationFilter(value string)
func (CAEmitterCell) SetMinificationFilter ¶
func (e CAEmitterCell) SetMinificationFilter(value string)
func (CAEmitterCell) SetMinificationFilterBias ¶
func (e CAEmitterCell) SetMinificationFilterBias(value float32)
func (CAEmitterCell) SetName ¶
func (e CAEmitterCell) SetName(value string)
func (CAEmitterCell) SetRedRange ¶
func (e CAEmitterCell) SetRedRange(value float32)
func (CAEmitterCell) SetRedSpeed ¶
func (e CAEmitterCell) SetRedSpeed(value float32)
func (CAEmitterCell) SetRepeatCount ¶
func (e CAEmitterCell) SetRepeatCount(value float32)
func (CAEmitterCell) SetRepeatDuration ¶
func (e CAEmitterCell) SetRepeatDuration(value float64)
func (CAEmitterCell) SetScale ¶
func (e CAEmitterCell) SetScale(value float64)
func (CAEmitterCell) SetScaleRange ¶
func (e CAEmitterCell) SetScaleRange(value float64)
func (CAEmitterCell) SetScaleSpeed ¶
func (e CAEmitterCell) SetScaleSpeed(value float64)
func (CAEmitterCell) SetSpeed ¶
func (e CAEmitterCell) SetSpeed(value float32)
func (CAEmitterCell) SetSpin ¶
func (e CAEmitterCell) SetSpin(value float64)
func (CAEmitterCell) SetSpinRange ¶
func (e CAEmitterCell) SetSpinRange(value float64)
func (CAEmitterCell) SetStyle ¶
func (e CAEmitterCell) SetStyle(value foundation.INSDictionary)
func (CAEmitterCell) SetTimeOffset ¶
func (e CAEmitterCell) SetTimeOffset(value float64)
func (CAEmitterCell) SetVelocity ¶
func (e CAEmitterCell) SetVelocity(value float64)
func (CAEmitterCell) SetVelocityRange ¶
func (e CAEmitterCell) SetVelocityRange(value float64)
func (CAEmitterCell) SetXAcceleration ¶
func (e CAEmitterCell) SetXAcceleration(value float64)
func (CAEmitterCell) SetYAcceleration ¶
func (e CAEmitterCell) SetYAcceleration(value float64)
func (CAEmitterCell) SetZAcceleration ¶
func (e CAEmitterCell) SetZAcceleration(value float64)
func (CAEmitterCell) ShouldArchiveValueForKey ¶
func (e CAEmitterCell) ShouldArchiveValueForKey(key string) bool
Returns a Boolean value indicating whether the value for a given key should be archived.
key: The name of one of the receiver’s properties.
Return Value ¶
true if the specified property should be archived, otherwise false.
Discussion ¶
The default implementation returns true. This method is called by the object’s implementation of “.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/shouldArchiveValue(forKey:)
func (CAEmitterCell) Speed ¶
func (e CAEmitterCell) Speed() float32
Specifies how time is mapped to receiver’s time space from the parent time space.
Discussion ¶
For example, if `speed` is 2.0 local time progresses twice as fast as parent time. Defaults to 1.0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/speed
func (CAEmitterCell) Spin ¶
func (e CAEmitterCell) Spin() float64
The rotational velocity, measured in radians per second, to apply to the cell. Animatable.
Discussion ¶
The spin of the cell will vary by a random amount with the range specified by [SpinRange].
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/spin
func (CAEmitterCell) SpinRange ¶
func (e CAEmitterCell) SpinRange() float64
The amount by which the spin of the cell can vary over its lifetime. Animatable.
Discussion ¶
The range specifies the mean amount the [Spin] value can vary over the cell’s lifetime.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/spinRange
func (CAEmitterCell) Style ¶
func (e CAEmitterCell) Style() foundation.INSDictionary
An optional dictionary containing additional style values that are not explicitly defined by the receiver.
Discussion ¶
This dictionary may in turn have a `style` key, forming a hierarchy of default values. In the case of hierarchical style dictionaries the shallowest value for a property is used. For example, the value for “style.someValue” takes precedence over “style.style.someValue”.
If the style dictionary doesn’t define a value for an attribute, the cell’s [DefaultValueForKey] class method is called.
The style dictionary is not consulted for the following keys: `bounds`, `frame`.
The default value of this property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/style
func (CAEmitterCell) TimeOffset ¶
func (e CAEmitterCell) TimeOffset() float64
Specifies an additional time offset in active local time.
Discussion ¶
Defaults to 0. .
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/timeOffset
func (CAEmitterCell) Velocity ¶
func (e CAEmitterCell) Velocity() float64
The initial velocity of the cell. Animatable.
Discussion ¶
The velocity of the cell will vary by a random amount within the range specified by [VelocityRange].
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/velocity
func (CAEmitterCell) VelocityRange ¶
func (e CAEmitterCell) VelocityRange() float64
The amount by which the velocity of the cell can vary. Animatable.
Discussion ¶
The range specifies the mean amount the initial [Velocity] value change.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/velocityRange
func (CAEmitterCell) XAcceleration ¶
func (e CAEmitterCell) XAcceleration() float64
The x component of an acceleration vector applied to cell.
Discussion ¶
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/xAcceleration
func (CAEmitterCell) YAcceleration ¶
func (e CAEmitterCell) YAcceleration() float64
The y component of an acceleration vector applied to cell.
Discussion ¶
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/yAcceleration
func (CAEmitterCell) ZAcceleration ¶
func (e CAEmitterCell) ZAcceleration() float64
The z component of an acceleration vector applied to cell.
Discussion ¶
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/zAcceleration
type CAEmitterCellClass ¶
type CAEmitterCellClass struct {
// contains filtered or unexported fields
}
func GetCAEmitterCellClass ¶
func GetCAEmitterCellClass() CAEmitterCellClass
GetCAEmitterCellClass returns the class object for CAEmitterCell.
func (CAEmitterCellClass) Alloc ¶
func (cc CAEmitterCellClass) Alloc() CAEmitterCell
Alloc allocates memory for a new instance of the class.
func (CAEmitterCellClass) DefaultValueForKey ¶
func (_CAEmitterCellClass CAEmitterCellClass) DefaultValueForKey(key string) objectivec.IObject
Returns the default value of the property with the specified key.
key: The name of one of the receiver’s properties.
Return Value ¶
The default value for the named property. Returns `nil` if no default value has been set.
Discussion ¶
If this method returns `nil` a suitable “zero” default value for the property is provided, based on the declared type of the `key`. For example, if `key` is a [CGSize] object, a size of (0.0,0.0) is returned. For a [CGRect] an empty rectangle is returned. For [CGAffineTransform] and CATransform3D, the appropriate identity matrix is returned.
Special Considerations ¶
If `key` is not a known for property of the class, the result of the method is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell/defaultValue(forKey:)
type CAEmitterLayer ¶
type CAEmitterLayer struct {
CALayer
}
A layer that emits, animates, and renders a particle system.
Overview ¶
The particles, defined by instances of CAEmitterCell, are drawn above the layer’s background color and border.
The following code shows how to set up a simple point (the default CAEmitterLayer.EmitterShape is point) particle emitter. It uses an image named `RadialGradient.Png()` as the cell contents and, by setting the emitter cell’s CAEmitterLayer.EmissionRange to `2` × CAEmitterLayer.Pi, the particles are emitted in all directions.
Specifying Particle Emitter Cells ¶
- CAEmitterLayer.EmitterCells: The array emitter cells attached to the layer.
- CAEmitterLayer.SetEmitterCells
Emitter Geometry ¶
- CAEmitterLayer.RenderMode: Defines how particle cells are rendered into the layer.
- CAEmitterLayer.SetRenderMode
- CAEmitterLayer.EmitterPosition: The position of the center of the particle emitter. Animatable.
- CAEmitterLayer.SetEmitterPosition
- CAEmitterLayer.EmitterShape: Specifies the emitter shape.
- CAEmitterLayer.SetEmitterShape
- CAEmitterLayer.EmitterZPosition: Specifies the center of the particle emitter shape along the z-axis. Animatable.
- CAEmitterLayer.SetEmitterZPosition
- CAEmitterLayer.EmitterDepth: Determines the depth of the emitter shape.
- CAEmitterLayer.SetEmitterDepth
- CAEmitterLayer.EmitterSize: Determines the size of the particle emitter shape. Animatable.
- CAEmitterLayer.SetEmitterSize
Emitter Cell Attribute Multipliers ¶
- CAEmitterLayer.Scale: Defines a multiplier applied to the cell-defined particle scale.
- CAEmitterLayer.SetScale
- CAEmitterLayer.Seed: Specifies the seed used to initialize the random number generator.
- CAEmitterLayer.SetSeed
- CAEmitterLayer.Spin: Defines a multiplier applied to the cell-defined particle spin. Animatable.
- CAEmitterLayer.SetSpin
- CAEmitterLayer.Velocity: Defines a multiplier applied to the cell-defined particle velocity. Animatable.
- CAEmitterLayer.SetVelocity
- CAEmitterLayer.BirthRate: Defines a multiplier that is applied to the cell-defined birth rate. Animatable
- CAEmitterLayer.SetBirthRate
- CAEmitterLayer.EmitterMode: Specifies the emitter mode.
- CAEmitterLayer.SetEmitterMode
- CAEmitterLayer.Lifetime: Defines a multiplier applied to the cell-defined lifetime range when particles are created. Animatable.
- CAEmitterLayer.SetLifetime
- CAEmitterLayer.PreservesDepth: Defines whether the layer flattens the particles into its plane.
- CAEmitterLayer.SetPreservesDepth
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer
func CAEmitterLayerFromID ¶
func CAEmitterLayerFromID(id objc.ID) CAEmitterLayer
CAEmitterLayerFromID constructs a CAEmitterLayer from an objc.ID.
A layer that emits, animates, and renders a particle system.
func NewCAEmitterLayer ¶
func NewCAEmitterLayer() CAEmitterLayer
NewCAEmitterLayer creates a new CAEmitterLayer instance.
func NewEmitterLayerWithLayer ¶
func NewEmitterLayerWithLayer(layer objectivec.IObject) CAEmitterLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CAEmitterLayer) Autorelease ¶
func (e CAEmitterLayer) Autorelease() CAEmitterLayer
Autorelease adds the receiver to the current autorelease pool.
func (CAEmitterLayer) BirthRate ¶
func (e CAEmitterLayer) BirthRate() float32
Defines a multiplier that is applied to the cell-defined birth rate. Animatable
Discussion ¶
The birth rate of each cell is multiplied by this number to give the actual number of particles created every second. Default value is `1.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/birthRate
func (CAEmitterLayer) EmissionRange ¶
func (e CAEmitterLayer) EmissionRange() float64
The angle, in radians, defining a cone around the emission angle. Animatable.
See: https://developer.apple.com/documentation/quartzcore/caemittercell/emissionrange
func (CAEmitterLayer) EmitterCells ¶
func (e CAEmitterLayer) EmitterCells() []CAEmitterCell
The array emitter cells attached to the layer.
Discussion ¶
Each object in the array must be an instance of the CAEmitterCell class.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterCells
func (CAEmitterLayer) EmitterDepth ¶
func (e CAEmitterLayer) EmitterDepth() float64
Determines the depth of the emitter shape.
Discussion ¶
How the emitter depth is applied depends on the emitter shape. See Emitter Shape for details. Depending on the value of [EmitterShape], this value may be ignored.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterDepth
func (CAEmitterLayer) EmitterMode ¶
func (e CAEmitterLayer) EmitterMode() CAEmitterLayerEmitterMode
Specifies the emitter mode.
Discussion ¶
The possible values for emitterMode are shown in Emitter Modes. The default value is volume.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterMode
func (CAEmitterLayer) EmitterPosition ¶
func (e CAEmitterLayer) EmitterPosition() corefoundation.CGPoint
The position of the center of the particle emitter. Animatable.
Discussion ¶
See Emitter Shape for details of how the `emitterPosition` relates to the possible emitter shapes.
Default is `(0.0,0.0)`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterPosition
func (CAEmitterLayer) EmitterShape ¶
func (e CAEmitterLayer) EmitterShape() CAEmitterLayerEmitterShape
Specifies the emitter shape.
Discussion ¶
The possible values for emitterMode are shown in Emitter Shape. The default value is point.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterShape
func (CAEmitterLayer) EmitterSize ¶
func (e CAEmitterLayer) EmitterSize() corefoundation.CGSize
Determines the size of the particle emitter shape. Animatable.
Discussion ¶
How the emitter size is applied depends on the emitter shape. See Emitter Shape for details. Depending on the value of [EmitterShape], this value may be ignored.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterSize
func (CAEmitterLayer) EmitterZPosition ¶
func (e CAEmitterLayer) EmitterZPosition() float64
Specifies the center of the particle emitter shape along the z-axis. Animatable.
Discussion ¶
See Emitter Shape for details of how the emitterZPosition relates to the possible emitter shapes.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/emitterZPosition
func (CAEmitterLayer) Init ¶
func (e CAEmitterLayer) Init() CAEmitterLayer
Init initializes the instance.
func (CAEmitterLayer) Lifetime ¶
func (e CAEmitterLayer) Lifetime() float32
Defines a multiplier applied to the cell-defined lifetime range when particles are created. Animatable.
Discussion ¶
Default value is `1.0`.
By setting an emitter’s [Lifetime] to `0`, you effectively stop particle emission: all new particles created have their [Lifetime] set to `0` and are never rendered.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/lifetime
func (CAEmitterLayer) Pi ¶
func (e CAEmitterLayer) Pi() objectivec.IObject
The mathematical constant pi (π), approximately equal to 3.14159.
See: https://developer.apple.com/documentation/Swift/FloatingPoint/pi
func (CAEmitterLayer) Point ¶
func (e CAEmitterLayer) Point() CAEmitterLayerEmitterShape
Particles are emitted from a single point at (
See: https://developer.apple.com/documentation/quartzcore/caemitterlayeremittershape/point
func (CAEmitterLayer) PreservesDepth ¶
func (e CAEmitterLayer) PreservesDepth() bool
Defines whether the layer flattens the particles into its plane.
Discussion ¶
If true, the layer renders its particles as if they directly inhabit the three-dimensional coordinate space of the layer’s superlayer. When enabled, the effect of the layer’s `filters`, `backgroundFilters`, and shadow related properties is undefined.
Default is false.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/preservesDepth
func (CAEmitterLayer) RenderMode ¶
func (e CAEmitterLayer) RenderMode() CAEmitterLayerRenderMode
Defines how particle cells are rendered into the layer.
Discussion ¶
The possible values for render modes are shown in Emitter Modes. The default value is unordered.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/renderMode
func (CAEmitterLayer) Scale ¶
func (e CAEmitterLayer) Scale() float32
Defines a multiplier applied to the cell-defined particle scale.
Discussion ¶
Default value is `1.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/scale
func (CAEmitterLayer) Seed ¶
func (e CAEmitterLayer) Seed() uint32
Specifies the seed used to initialize the random number generator.
Discussion ¶
Each layer has its own random number generator state. Emitter cell properties that are defined as a mean and a range, such as a cell’s `speed`, the value of the properties are uniformly distributed in the interval [M - R/2, M + R/2].
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/seed
func (CAEmitterLayer) SetBirthRate ¶
func (e CAEmitterLayer) SetBirthRate(value float32)
func (CAEmitterLayer) SetEmissionRange ¶
func (e CAEmitterLayer) SetEmissionRange(value float64)
func (CAEmitterLayer) SetEmitterCells ¶
func (e CAEmitterLayer) SetEmitterCells(value []CAEmitterCell)
func (CAEmitterLayer) SetEmitterDepth ¶
func (e CAEmitterLayer) SetEmitterDepth(value float64)
func (CAEmitterLayer) SetEmitterMode ¶
func (e CAEmitterLayer) SetEmitterMode(value CAEmitterLayerEmitterMode)
func (CAEmitterLayer) SetEmitterPosition ¶
func (e CAEmitterLayer) SetEmitterPosition(value corefoundation.CGPoint)
func (CAEmitterLayer) SetEmitterShape ¶
func (e CAEmitterLayer) SetEmitterShape(value CAEmitterLayerEmitterShape)
func (CAEmitterLayer) SetEmitterSize ¶
func (e CAEmitterLayer) SetEmitterSize(value corefoundation.CGSize)
func (CAEmitterLayer) SetEmitterZPosition ¶
func (e CAEmitterLayer) SetEmitterZPosition(value float64)
func (CAEmitterLayer) SetLifetime ¶
func (e CAEmitterLayer) SetLifetime(value float32)
func (CAEmitterLayer) SetPi ¶
func (e CAEmitterLayer) SetPi(value objectivec.IObject)
func (CAEmitterLayer) SetPreservesDepth ¶
func (e CAEmitterLayer) SetPreservesDepth(value bool)
func (CAEmitterLayer) SetRenderMode ¶
func (e CAEmitterLayer) SetRenderMode(value CAEmitterLayerRenderMode)
func (CAEmitterLayer) SetScale ¶
func (e CAEmitterLayer) SetScale(value float32)
func (CAEmitterLayer) SetSeed ¶
func (e CAEmitterLayer) SetSeed(value uint32)
func (CAEmitterLayer) SetSpin ¶
func (e CAEmitterLayer) SetSpin(value float32)
func (CAEmitterLayer) SetVelocity ¶
func (e CAEmitterLayer) SetVelocity(value float32)
func (CAEmitterLayer) Spin ¶
func (e CAEmitterLayer) Spin() float32
Defines a multiplier applied to the cell-defined particle spin. Animatable.
Discussion ¶
Default value is `1.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/spin
func (CAEmitterLayer) Velocity ¶
func (e CAEmitterLayer) Velocity() float32
Defines a multiplier applied to the cell-defined particle velocity. Animatable.
Discussion ¶
Default value is `1.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer/velocity
type CAEmitterLayerClass ¶
type CAEmitterLayerClass struct {
// contains filtered or unexported fields
}
func GetCAEmitterLayerClass ¶
func GetCAEmitterLayerClass() CAEmitterLayerClass
GetCAEmitterLayerClass returns the class object for CAEmitterLayer.
func (CAEmitterLayerClass) Alloc ¶
func (cc CAEmitterLayerClass) Alloc() CAEmitterLayer
Alloc allocates memory for a new instance of the class.
type CAEmitterLayerEmitterMode ¶
type CAEmitterLayerEmitterMode = string
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterMode
var ( // KCAEmitterLayerOutline is particles are emitted from the outline of the particle emitter. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterMode/outline KCAEmitterLayerOutline CAEmitterLayerEmitterMode // KCAEmitterLayerPoints is particles are emitted from points on the particle emitter. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterMode/points KCAEmitterLayerPoints CAEmitterLayerEmitterMode // KCAEmitterLayerSurface is particles are emitted from the surface of the particle emitter. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterMode/surface KCAEmitterLayerSurface CAEmitterLayerEmitterMode // KCAEmitterLayerVolume is particles are emitted from the a position within the particle emitter. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterMode/volume KCAEmitterLayerVolume CAEmitterLayerEmitterMode )
type CAEmitterLayerEmitterShape ¶
type CAEmitterLayerEmitterShape = string
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape
var ( // KCAEmitterLayerCircle is particles are emitted from a circle centered at (`emitterPosition.X()`, `emitterPosition.Y()`, `emitterZPosition`) of radius `emitterSize.Width()`. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape/circle KCAEmitterLayerCircle CAEmitterLayerEmitterShape // KCAEmitterLayerCuboid is particles are emitted from a cuboid (3D rectangle) with opposite corners: [emitterPosition.x - emitterSize.width/2, emitterPosition.y - emitterSize.height/2, emitterZPosition - emitterDepth/2], [emitterPosition.x + emitterSize.width/2, emitterPosition.y + emitterSize.height/2, emitterZPosition+emitterDepth/2]. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape/cuboid KCAEmitterLayerCuboid CAEmitterLayerEmitterShape // KCAEmitterLayerLine is particles are emitted along a line from (`emitterPosition.X() - emitterSize.Width()/2`, `emitterPosition.Y()`, `emitterZPosition`) to (`emitterPosition.X() + emitterSize.Width()/2`, `emitterPosition.Y()`, `emitterZPosition`). // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape/line KCAEmitterLayerLine CAEmitterLayerEmitterShape // KCAEmitterLayerPoint is particles are emitted from a single point at (`emitterPosition.X()`, `emitterPosition.Y()`, `emitterZPosition`). // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape/point KCAEmitterLayerPoint CAEmitterLayerEmitterShape // KCAEmitterLayerRectangle is particles are emitted from a rectangle with opposite corners [emitterPosition.x - emitterSize.width/2, emitterPosition.y - emitterSize.height/2, emitterZPosition], [emitterPosition.x + emitterSize.width/2, emitterPosition.y + emitterSize.height/2, emitterZPosition]. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape/rectangle KCAEmitterLayerRectangle CAEmitterLayerEmitterShape // KCAEmitterLayerSphere is particles are emitted from a sphere centered at (`emitterPosition.X()`, `emitterPosition.Y()`, `emitterZPosition`) of radius `emitterSize.Width()`. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerEmitterShape/sphere KCAEmitterLayerSphere CAEmitterLayerEmitterShape )
type CAEmitterLayerRenderMode ¶
type CAEmitterLayerRenderMode = string
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerRenderMode
var ( // KCAEmitterLayerAdditive is the particles are rendered using source-additive compositing. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerRenderMode/additive KCAEmitterLayerAdditive CAEmitterLayerRenderMode // KCAEmitterLayerBackToFront is particles are rendered from back to front, sorted by z-position. This mode uses source-over compositing. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerRenderMode/backToFront KCAEmitterLayerBackToFront CAEmitterLayerRenderMode // KCAEmitterLayerOldestFirst is particles are rendered oldest first. This mode uses source-over compositing. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerRenderMode/oldestFirst KCAEmitterLayerOldestFirst CAEmitterLayerRenderMode // KCAEmitterLayerOldestLast is particles are rendered oldest last. This mode uses source-over compositing. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerRenderMode/oldestLast KCAEmitterLayerOldestLast CAEmitterLayerRenderMode // KCAEmitterLayerUnordered is particles are rendered unordered. This mode uses source-over compositing. // // See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayerRenderMode/unordered KCAEmitterLayerUnordered CAEmitterLayerRenderMode )
type CAFrameRateRange ¶
C struct types CAFrameRateRange
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/QuartzCore/CAFrameRateRange
var ( // See: https://developer.apple.com/documentation/QuartzCore/CAFrameRateRange/default CAFrameRateRangeDefault CAFrameRateRange )
func CAFrameRateRangeMake ¶
func CAFrameRateRangeMake(minimum float32, maximum float32, preferred float32) CAFrameRateRange
CAFrameRateRangeMake.
See: https://developer.apple.com/documentation/QuartzCore/CAFrameRateRangeMake
type CAGradientLayer ¶
type CAGradientLayer struct {
CALayer
}
A layer that draws a color gradient over its background color, filling the shape of the layer.
Overview ¶
You use a gradient layer to create a color gradient containing an arbitrary number of colors. By default, the colors are spread uniformly across the layer, but you can optionally specify locations for control over the color positions through the gradient.
The following code shows how to create a gradient layer containing four colors that are evenly distributed through the gradient. Rotating the layer by 90° (CAGradientLayer.Pi ⁄ `2` radians) gives a horizontal gradient.
The following figure shows the appearance of the gradient layer.
[media-2825193]
Gradient Style Properties ¶
- CAGradientLayer.Colors: An array of [CGColorRef] objects defining the color of each gradient stop. Animatable.
- CAGradientLayer.SetColors
- CAGradientLayer.Locations: An optional array of NSNumber objects defining the location of each gradient stop. Animatable.
- CAGradientLayer.SetLocations
- CAGradientLayer.EndPoint: The end point of the gradient when drawn in the layer’s coordinate space. Animatable.
- CAGradientLayer.SetEndPoint
- CAGradientLayer.StartPoint: The start point of the gradient when drawn in the layer’s coordinate space. Animatable.
- CAGradientLayer.SetStartPoint
- CAGradientLayer.Type: Style of gradient drawn by the layer.
- CAGradientLayer.SetType
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer
func CAGradientLayerFromID ¶
func CAGradientLayerFromID(id objc.ID) CAGradientLayer
CAGradientLayerFromID constructs a CAGradientLayer from an objc.ID.
A layer that draws a color gradient over its background color, filling the shape of the layer.
func NewCAGradientLayer ¶
func NewCAGradientLayer() CAGradientLayer
NewCAGradientLayer creates a new CAGradientLayer instance.
func NewGradientLayerWithLayer ¶
func NewGradientLayerWithLayer(layer objectivec.IObject) CAGradientLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CAGradientLayer) Autorelease ¶
func (g CAGradientLayer) Autorelease() CAGradientLayer
Autorelease adds the receiver to the current autorelease pool.
func (CAGradientLayer) Colors ¶
func (g CAGradientLayer) Colors() foundation.INSArray
An array of [CGColorRef] objects defining the color of each gradient stop. Animatable.
Discussion ¶
Defaults to `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer/colors
func (CAGradientLayer) EndPoint ¶
func (g CAGradientLayer) EndPoint() corefoundation.CGPoint
The end point of the gradient when drawn in the layer’s coordinate space. Animatable.
Discussion ¶
The end point corresponds to the last stop of the gradient. The point is defined in the unit coordinate space and is then mapped to the layer’s bounds rectangle when drawn.
Default value is `(0.5,1.0)`.
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer/endPoint
func (CAGradientLayer) Init ¶
func (g CAGradientLayer) Init() CAGradientLayer
Init initializes the instance.
func (CAGradientLayer) Locations ¶
func (g CAGradientLayer) Locations() []foundation.NSNumber
An optional array of NSNumber objects defining the location of each gradient stop. Animatable.
Discussion ¶
The gradient stops are specified as values between `0` and `1`. The values must be monotonically increasing. If `nil`, the stops are spread uniformly across the range. Defaults to `nil`.
When rendered, the colors are mapped to the output color space before being interpolated.
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer/locations
func (CAGradientLayer) Pi ¶
func (g CAGradientLayer) Pi() objectivec.IObject
The mathematical constant pi (π), approximately equal to 3.14159.
See: https://developer.apple.com/documentation/Swift/FloatingPoint/pi
func (CAGradientLayer) SetColors ¶
func (g CAGradientLayer) SetColors(value foundation.INSArray)
func (CAGradientLayer) SetEndPoint ¶
func (g CAGradientLayer) SetEndPoint(value corefoundation.CGPoint)
func (CAGradientLayer) SetLocations ¶
func (g CAGradientLayer) SetLocations(value []foundation.NSNumber)
func (CAGradientLayer) SetPi ¶
func (g CAGradientLayer) SetPi(value objectivec.IObject)
func (CAGradientLayer) SetStartPoint ¶
func (g CAGradientLayer) SetStartPoint(value corefoundation.CGPoint)
func (CAGradientLayer) SetType ¶
func (g CAGradientLayer) SetType(value CAGradientLayerType)
func (CAGradientLayer) StartPoint ¶
func (g CAGradientLayer) StartPoint() corefoundation.CGPoint
The start point of the gradient when drawn in the layer’s coordinate space. Animatable.
Discussion ¶
The start point corresponds to the first stop of the gradient. The point is defined in the unit coordinate space and is then mapped to the layer’s bounds rectangle when drawn.
Default value is `(0.5,0.0)`.
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer/startPoint
func (CAGradientLayer) Type ¶
func (g CAGradientLayer) Type() CAGradientLayerType
Style of gradient drawn by the layer.
Discussion ¶
Defaults to axial.
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer/type
type CAGradientLayerClass ¶
type CAGradientLayerClass struct {
// contains filtered or unexported fields
}
func GetCAGradientLayerClass ¶
func GetCAGradientLayerClass() CAGradientLayerClass
GetCAGradientLayerClass returns the class object for CAGradientLayer.
func (CAGradientLayerClass) Alloc ¶
func (cc CAGradientLayerClass) Alloc() CAGradientLayer
Alloc allocates memory for a new instance of the class.
type CAGradientLayerType ¶
type CAGradientLayerType = string
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayerType
var ( // KCAGradientLayerAxial is an axial gradient (also called a linear gradient) varies along an axis between two defined end points. All points that lie on a line perpendicular to the axis have the same color value. // // See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayerType/axial KCAGradientLayerAxial CAGradientLayerType // See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayerType/conic KCAGradientLayerConic CAGradientLayerType // See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayerType/radial KCAGradientLayerRadial CAGradientLayerType )
type CAKeyframeAnimation ¶
type CAKeyframeAnimation struct {
CAPropertyAnimation
}
An object that provides keyframe animation capabilities for a layer object.
Overview ¶
You create a CAKeyframeAnimation object using the inherited [CAKeyframeAnimation.AnimationWithKeyPath] method, specifying the key path of the property that you want to animate on the layer. You can then specify the keyframe values to use to control the timing and animation behavior.
For most types of animations, you specify the keyframe values using the CAKeyframeAnimation.Values and CAKeyframeAnimation.KeyTimes properties. During the animation, Core Animation generates intermediate values by interpolating between the values you provide. When animating a value that is a coordinate point, such as the layer’s position, you can specify a CAKeyframeAnimation.Path for that point to follow instead of individual values. The pacing of the animation is controlled by the timing information you provide.
The following code shows how to create a keyframe animation that animates a layer’s background color from red to green to blue over a two second duration.
Providing keyframe values ¶
- CAKeyframeAnimation.Values: An array of objects that specify the keyframe values to use for the animation.
- CAKeyframeAnimation.SetValues
- CAKeyframeAnimation.Path: The path for a point-based property to follow.
- CAKeyframeAnimation.SetPath
Keyframe timing ¶
- CAKeyframeAnimation.KeyTimes: An optional array of [NSNumber] objects that define the time at which to apply a given keyframe segment.
- CAKeyframeAnimation.SetKeyTimes
- CAKeyframeAnimation.TimingFunctions: An optional array of CAMediaTimingFunction objects that define the pacing for each keyframe segment.
- CAKeyframeAnimation.SetTimingFunctions
- CAKeyframeAnimation.CalculationMode: Specifies how intermediate keyframe values are calculated by the receiver.
- CAKeyframeAnimation.SetCalculationMode
Rotation Mode Attribute ¶
- CAKeyframeAnimation.RotationMode: Determines whether objects animating along the path rotate to match the path tangent.
- CAKeyframeAnimation.SetRotationMode
Cubic Mode Attributes ¶
- CAKeyframeAnimation.TensionValues: An array of numbers that define the tightness of the curve.
- CAKeyframeAnimation.SetTensionValues
- CAKeyframeAnimation.ContinuityValues: An array of numbers that define the sharpness of the timing curve’s corners.
- CAKeyframeAnimation.SetContinuityValues
- CAKeyframeAnimation.BiasValues: An array of numbers that define the position of the curve relative to a control point.
- CAKeyframeAnimation.SetBiasValues
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation
func CAKeyframeAnimationFromID ¶
func CAKeyframeAnimationFromID(id objc.ID) CAKeyframeAnimation
CAKeyframeAnimationFromID constructs a CAKeyframeAnimation from an objc.ID.
An object that provides keyframe animation capabilities for a layer object.
func NewCAKeyframeAnimation ¶
func NewCAKeyframeAnimation() CAKeyframeAnimation
NewCAKeyframeAnimation creates a new CAKeyframeAnimation instance.
func NewKeyframeAnimationWithKeyPath ¶
func NewKeyframeAnimationWithKeyPath(path string) CAKeyframeAnimation
Creates and returns an CAPropertyAnimation instance for the specified key path.
path: The key path of the property to be animated.
Return Value ¶
A new instance of CAPropertyAnimation with the key path set to `keyPath`.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/init(keyPath:)
func (CAKeyframeAnimation) Autorelease ¶
func (k CAKeyframeAnimation) Autorelease() CAKeyframeAnimation
Autorelease adds the receiver to the current autorelease pool.
func (CAKeyframeAnimation) BiasValues ¶
func (k CAKeyframeAnimation) BiasValues() []foundation.NSNumber
An array of numbers that define the position of the curve relative to a control point.
Discussion ¶
This property is an array of NSNumber objects, used only for the cubic calculation modes. Positive values move the curve before the control point while negative values move it after the control point. The first value defines the behavior of the tangent to the first control point, the second value controls the second point’s tangents, and so on. If you do not specify a value for a given control point, the value `0` is used.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/biasValues
func (CAKeyframeAnimation) CalculationMode ¶
func (k CAKeyframeAnimation) CalculationMode() CAAnimationCalculationMode
Specifies how intermediate keyframe values are calculated by the receiver.
Discussion ¶
The possible values are described in Value calculation modes. The default value of this property is linear.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/calculationMode
func (CAKeyframeAnimation) ContinuityValues ¶
func (k CAKeyframeAnimation) ContinuityValues() []foundation.NSNumber
An array of numbers that define the sharpness of the timing curve’s corners.
Discussion ¶
This property is an array of NSNumber objects, used only for the cubic calculation modes. Positive values result in sharper corners while negative values create inverted corners. The first value defines the behavior of the tangent to the first control point, the second value controls the second point’s tangents, and so on. If you do not specify a value for a given control point, the value `0` is used.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/continuityValues
func (CAKeyframeAnimation) Init ¶
func (k CAKeyframeAnimation) Init() CAKeyframeAnimation
Init initializes the instance.
func (CAKeyframeAnimation) KeyTimes ¶
func (k CAKeyframeAnimation) KeyTimes() []foundation.NSNumber
An optional array of [NSNumber] objects that define the time at which to apply a given keyframe segment.
Discussion ¶
Each value in the array is a floating point number between `0.0` and `1.0` that defines the time point (specified as a fraction of the animation’s total duration) at which to apply the corresponding keyframe value. Each successive value in the array must be greater than, or equal to, the previous value. Usually, the number of elements in the array should match the number of elements in the [Values] property or the number of control points in the [Path] property. If they do not, the timing of your animation might not be what you expect.
The appropriate values to include in the array are dependent on the [CalculationMode] property.
- If the [CalculationMode] is set to linear or cubic, the first value in the array must be `0.0` and the last value must be `1.0`. All intermediate values represent time points between the start and end times. - If the [CalculationMode] is set to discrete, the first value in the array must be `0.0` and the last value must be `1.0`. The array should have one more entry than appears in the values array. For example, if there are two values, there should be three key times. - If the [CalculationMode] is set to paced or cubicPaced, the values in this property are ignored.
If the values in this array are invalid or inappropriate for the current calculation mode, they are ignored.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/keyTimes
func (CAKeyframeAnimation) Path ¶
func (k CAKeyframeAnimation) Path() coregraphics.CGPathRef
The path for a point-based property to follow.
Discussion ¶
For layer properties that contain a CGPoint data type, the path object you assign to this property defines the values for that property over the length of the animation. If you specify a value for this property, any data in the [Values] property is ignored.
Any timing values you specify for the animation are applied to the points used to create the path. Paths can contain points defining move-to, line-to, or curve-to segments. The end point of a line-to or curve-to segment defines the keyframe value. All other points between that end value and the previous value are then interpolated. Move-to segments do not define separate keyframe values.
How the animation proceeds along the path is dependent on the value in the [CalculationMode] property. To achieve a smooth, constant velocity animation along the path, set the [CalculationMode] property to paced or cubicPaced. To create an animation where the location value jumps from keyframe point to keyframe point (without interpolation in between), use the discrete value. To animate along the path by interpolating values between points, use the linear value.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/path
func (CAKeyframeAnimation) RotationMode ¶
func (k CAKeyframeAnimation) RotationMode() CAAnimationRotationMode
Determines whether objects animating along the path rotate to match the path tangent.
Discussion ¶
The possible values for this property are described in Rotation Mode Values. The default value of this property is `nil`, which indicates that objects should not rotate to follow the path.
The effect of setting this property to a non-`nil` value when no path object is supplied is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/rotationMode
func (CAKeyframeAnimation) SetBiasValues ¶
func (k CAKeyframeAnimation) SetBiasValues(value []foundation.NSNumber)
func (CAKeyframeAnimation) SetCalculationMode ¶
func (k CAKeyframeAnimation) SetCalculationMode(value CAAnimationCalculationMode)
func (CAKeyframeAnimation) SetContinuityValues ¶
func (k CAKeyframeAnimation) SetContinuityValues(value []foundation.NSNumber)
func (CAKeyframeAnimation) SetKeyTimes ¶
func (k CAKeyframeAnimation) SetKeyTimes(value []foundation.NSNumber)
func (CAKeyframeAnimation) SetPath ¶
func (k CAKeyframeAnimation) SetPath(value coregraphics.CGPathRef)
func (CAKeyframeAnimation) SetRotationMode ¶
func (k CAKeyframeAnimation) SetRotationMode(value CAAnimationRotationMode)
func (CAKeyframeAnimation) SetTensionValues ¶
func (k CAKeyframeAnimation) SetTensionValues(value []foundation.NSNumber)
func (CAKeyframeAnimation) SetTimingFunctions ¶
func (k CAKeyframeAnimation) SetTimingFunctions(value []CAMediaTimingFunction)
func (CAKeyframeAnimation) SetValues ¶
func (k CAKeyframeAnimation) SetValues(value foundation.INSArray)
func (CAKeyframeAnimation) TensionValues ¶
func (k CAKeyframeAnimation) TensionValues() []foundation.NSNumber
An array of numbers that define the tightness of the curve.
Discussion ¶
This property is an array of NSNumber objects, used only for the cubic calculation modes. Positive values indicate a tighter curve while negative values indicate a rounder curve. The first value defines the behavior of the tangent to the first control point, the second value controls the second point’s tangents, and so on. If you do not specify a value for a given control point, the value `0` is used.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/tensionValues
func (CAKeyframeAnimation) TimingFunctions ¶
func (k CAKeyframeAnimation) TimingFunctions() []CAMediaTimingFunction
An optional array of CAMediaTimingFunction objects that define the pacing for each keyframe segment.
Discussion ¶
You can use this array to apply ease-in, ease-out, or custom timing curves to the points that lie between two keyframe values. If the number of keyframes in the values property is , then this property should contain `-1` objects.
If you provide timing information in the [KeyTimes] property, the timing functions you specify using this property further modify the timing between those values. If you do not assign a value to the [KeyTimes] property, the timing functions modify the default timing provided by the animation object.
If you also specify a timing function in the animation object’s [TimingFunction] property, that function is applied first followed by the timing function for the specific keyframe segment.
For information on how to create a timing function, see CAMediaTimingFunction.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/timingFunctions
func (CAKeyframeAnimation) Values ¶
func (k CAKeyframeAnimation) Values() foundation.INSArray
An array of objects that specify the keyframe values to use for the animation.
Discussion ¶
The keyframe values represent the values through which the animation must proceed. The time at which a given keyframe value is applied to the layer depends on the animation timing, which is controlled by the [CalculationMode], [KeyTimes], and [TimingFunctions] properties. Values between keyframes are created using interpolation, unless the calculation mode is set to discrete.
Depending on the type of the property, you may need to wrap the values in this array with an NSNumber of NSValue object. For some Core Graphics data types, you may also need to cast them to `id` before adding them to the array.
The values in this property are used only if the value in the [Path] property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation/values
type CAKeyframeAnimationClass ¶
type CAKeyframeAnimationClass struct {
// contains filtered or unexported fields
}
func GetCAKeyframeAnimationClass ¶
func GetCAKeyframeAnimationClass() CAKeyframeAnimationClass
GetCAKeyframeAnimationClass returns the class object for CAKeyframeAnimation.
func (CAKeyframeAnimationClass) Alloc ¶
func (cc CAKeyframeAnimationClass) Alloc() CAKeyframeAnimation
Alloc allocates memory for a new instance of the class.
type CALayer ¶
type CALayer struct {
objectivec.Object
}
An object that manages image-based content and allows you to perform animations on that content.
Overview ¶
Layers are often used to provide the backing store for views but can also be used without a view to display content. A layer’s main job is to manage the visual content that you provide but the layer itself has visual attributes that can be set, such as a background color, border, and shadow. In addition to managing visual content, the layer also maintains information about the geometry of its content (such as its position, size, and transform) that is used to present that content onscreen. Modifying the properties of the layer is how you initiate animations on the layer’s content or geometry. A layer object encapsulates the duration and pacing of a layer and its animations by adopting the CAMediaTiming protocol, which defines the layer’s timing information.
If the layer object was created by a view, the view typically assigns itself as the layer’s delegate automatically, and you should not change that relationship. For layers you create yourself, you can assign a CALayer.Delegate object and use that object to provide the contents of the layer dynamically and perform other tasks. A layer may also have a layout manager object (assigned to the CALayer.LayoutManager property) to manage the layout of subviews separately.
Creating a layer ¶
- CALayer.InitWithLayer: Override to copy or initialize custom fields of the specified layer.
Accessing related layer objects ¶
- CALayer.PresentationLayer: Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen.
- CALayer.ModelLayer: Returns the model layer object associated with the receiver, if any.
Accessing the delegate ¶
- CALayer.Delegate: The layer’s delegate object.
- CALayer.SetDelegate
Providing the layer’s content ¶
- CALayer.Contents: An object that provides the contents of the layer. Animatable.
- CALayer.SetContents
- CALayer.ContentsRect: The rectangle, in the unit coordinate space, that defines the portion of the layer’s contents that should be used. Animatable.
- CALayer.SetContentsRect
- CALayer.ContentsCenter: The rectangle that defines how the layer contents are scaled if the layer’s contents are resized. Animatable.
- CALayer.SetContentsCenter
- CALayer.Display: Reloads the content of this layer.
- CALayer.DrawInContext: Draws the layer’s content using the specified graphics context.
Modifying the layer’s appearance ¶
- CALayer.ContentsGravity: A constant that specifies how the layer’s contents are positioned or scaled within its bounds.
- CALayer.SetContentsGravity
- CALayer.Opacity: The opacity of the receiver. Animatable.
- CALayer.SetOpacity
- CALayer.Hidden: A Boolean indicating whether the layer is displayed. Animatable.
- CALayer.SetHidden
- CALayer.MasksToBounds: A Boolean indicating whether sublayers are clipped to the layer’s bounds. Animatable.
- CALayer.SetMasksToBounds
- CALayer.Mask: An optional layer whose alpha channel is used to mask the layer’s content.
- CALayer.SetMask
- CALayer.DoubleSided: A Boolean indicating whether the layer displays its content when facing away from the viewer. Animatable.
- CALayer.SetDoubleSided
- CALayer.CornerRadius: The radius to use when drawing rounded corners for the layer’s background. Animatable.
- CALayer.SetCornerRadius
- CALayer.MaskedCorners
- CALayer.SetMaskedCorners
- CALayer.BorderWidth: The width of the layer’s border. Animatable.
- CALayer.SetBorderWidth
- CALayer.BorderColor: The color of the layer’s border. Animatable.
- CALayer.SetBorderColor
- CALayer.BackgroundColor: The background color of the receiver. Animatable.
- CALayer.SetBackgroundColor
- CALayer.ShadowOpacity: The opacity of the layer’s shadow. Animatable.
- CALayer.SetShadowOpacity
- CALayer.ShadowRadius: The blur radius (in points) used to render the layer’s shadow. Animatable.
- CALayer.SetShadowRadius
- CALayer.ShadowOffset: The offset (in points) of the layer’s shadow. Animatable.
- CALayer.SetShadowOffset
- CALayer.ShadowColor: The color of the layer’s shadow. Animatable.
- CALayer.SetShadowColor
- CALayer.ShadowPath: The shape of the layer’s shadow. Animatable.
- CALayer.SetShadowPath
- CALayer.Style: An optional dictionary used to store property values that aren’t explicitly defined by the layer.
- CALayer.SetStyle
- CALayer.AllowsEdgeAntialiasing: A Boolean indicating whether the layer is allowed to perform edge antialiasing.
- CALayer.SetAllowsEdgeAntialiasing
- CALayer.AllowsGroupOpacity: A Boolean indicating whether the layer is allowed to composite itself as a group separate from its parent.
- CALayer.SetAllowsGroupOpacity
Layer filters ¶
- CALayer.Filters: An array of Core Image filters to apply to the contents of the layer and its sublayers. Animatable.
- CALayer.SetFilters
- CALayer.CompositingFilter: A CoreImage filter used to composite the layer and the content behind it. Animatable.
- CALayer.SetCompositingFilter
- CALayer.BackgroundFilters: An array of Core Image filters to apply to the content immediately behind the layer. Animatable.
- CALayer.SetBackgroundFilters
- CALayer.MinificationFilter: The filter used when reducing the size of the content.
- CALayer.SetMinificationFilter
- CALayer.MinificationFilterBias: The bias factor used by the minification filter to determine the levels of detail.
- CALayer.SetMinificationFilterBias
- CALayer.MagnificationFilter: The filter used when increasing the size of the content.
- CALayer.SetMagnificationFilter
Configuring the layer’s rendering behavior ¶
- CALayer.Opaque: A Boolean value indicating whether the layer contains completely opaque content.
- CALayer.SetOpaque
- CALayer.EdgeAntialiasingMask: A bitmask defining how the edges of the receiver are rasterized.
- CALayer.SetEdgeAntialiasingMask
- CALayer.ContentsAreFlipped: Returns a Boolean indicating whether the layer content is implicitly flipped when rendered.
- CALayer.GeometryFlipped: A Boolean that indicates whether the geometry of the layer and its sublayers is flipped vertically.
- CALayer.SetGeometryFlipped
- CALayer.DrawsAsynchronously: A Boolean indicating whether drawing commands are deferred and processed asynchronously in a background thread.
- CALayer.SetDrawsAsynchronously
- CALayer.ShouldRasterize: A Boolean that indicates whether the layer is rendered as a bitmap before compositing. Animatable
- CALayer.SetShouldRasterize
- CALayer.RasterizationScale: The scale at which to rasterize content, relative to the coordinate space of the layer. Animatable
- CALayer.SetRasterizationScale
- CALayer.ContentsFormat: A hint for the desired storage format of the layer contents.
- CALayer.SetContentsFormat
- CALayer.RenderInContext: Renders the layer and its sublayers into the specified context.
Modifying the layer geometry ¶
- CALayer.Frame: The layer’s frame rectangle.
- CALayer.SetFrame
- CALayer.Bounds: The layer’s bounds rectangle. Animatable.
- CALayer.SetBounds
- CALayer.Position: The layer’s position in its superlayer’s coordinate space. Animatable.
- CALayer.SetPosition
- CALayer.ZPosition: The layer’s position on the z axis. Animatable.
- CALayer.SetZPosition
- CALayer.AnchorPointZ: The anchor point for the layer’s position along the z axis. Animatable.
- CALayer.SetAnchorPointZ
- CALayer.AnchorPoint: Defines the anchor point of the layer’s bounds rectangle. Animatable.
- CALayer.SetAnchorPoint
- CALayer.ContentsScale: The scale factor applied to the layer.
- CALayer.SetContentsScale
Managing the layer’s transform ¶
- CALayer.Transform: The transform applied to the layer’s contents. Animatable.
- CALayer.SetTransform
- CALayer.SublayerTransform: Specifies the transform to apply to sublayers when rendering. Animatable.
- CALayer.SetSublayerTransform
- CALayer.AffineTransform: Returns an affine version of the layer’s transform.
- CALayer.SetAffineTransform: Sets the layer’s transform to the specified affine transform.
Managing the layer hierarchy ¶
- CALayer.Sublayers: An array containing the layer’s sublayers.
- CALayer.SetSublayers
- CALayer.Superlayer: The superlayer of the layer.
- CALayer.AddSublayer: Appends the layer to the layer’s list of sublayers.
- CALayer.RemoveFromSuperlayer: Detaches the layer from its parent layer.
- CALayer.InsertSublayerAtIndex: Inserts the specified layer into the receiver’s list of sublayers at the specified index.
- CALayer.InsertSublayerBelow: Inserts the specified sublayer below a different sublayer that already belongs to the receiver.
- CALayer.InsertSublayerAbove: Inserts the specified sublayer above a different sublayer that already belongs to the receiver.
- CALayer.ReplaceSublayerWith: Replaces the specified sublayer with a different layer object.
Updating layer display ¶
- CALayer.SetNeedsDisplay: Marks the layer’s contents as needing to be updated.
- CALayer.SetNeedsDisplayInRect: Marks the region within the specified rectangle as needing to be updated.
- CALayer.NeedsDisplayOnBoundsChange: A Boolean indicating whether the layer contents must be updated when its bounds rectangle changes.
- CALayer.SetNeedsDisplayOnBoundsChange
- CALayer.DisplayIfNeeded: Initiates the update process for a layer if it is currently marked as needing an update.
- CALayer.NeedsDisplay: Returns a Boolean indicating whether the layer has been marked as needing an update.
Layer animations ¶
- CALayer.AddAnimationForKey: Add the specified animation object to the layer’s render tree.
- CALayer.AnimationForKey: Returns the animation object with the specified identifier.
- CALayer.RemoveAllAnimations: Remove all animations attached to the layer.
- CALayer.RemoveAnimationForKey: Remove the animation object with the specified key.
- CALayer.AnimationKeys: Returns an array of strings that identify the animations currently attached to the layer.
Managing layer resizing and layout ¶
- CALayer.LayoutManager: The object responsible for laying out the layer’s sublayers.
- CALayer.SetLayoutManager
- CALayer.SetNeedsLayout: Invalidates the layer’s layout and marks it as needing an update.
- CALayer.LayoutSublayers: Tells the layer to update its layout.
- CALayer.LayoutIfNeeded: Recalculate the receiver’s layout, if required.
- CALayer.NeedsLayout: Returns a Boolean indicating whether the layer has been marked as needing a layout update.
- CALayer.AutoresizingMask: A bitmask defining how the layer is resized when the bounds of its superlayer changes.
- CALayer.SetAutoresizingMask
- CALayer.ResizeWithOldSuperlayerSize: Informs the receiver that the size of its superlayer changed.
- CALayer.ResizeSublayersWithOldSize: Informs the receiver’s sublayers that the receiver’s size has changed.
- CALayer.PreferredFrameSize: Returns the preferred size of the layer in the coordinate space of its superlayer.
Managing layer constraints ¶
- CALayer.Constraints: The constraints used to position current layer’s sublayers.
- CALayer.SetConstraints
- CALayer.AddConstraint: Adds the specified constraint to the layer.
Getting the layer’s actions ¶
- CALayer.ActionForKey: Returns the action object assigned to the specified key.
- CALayer.Actions: A dictionary containing layer actions.
- CALayer.SetActions
Mapping between coordinate and time spaces ¶
- CALayer.ConvertPointFromLayer: Converts the point from the specified layer’s coordinate system to the receiver’s coordinate system.
- CALayer.ConvertPointToLayer: Converts the point from the receiver’s coordinate system to the specified layer’s coordinate system.
- CALayer.ConvertRectFromLayer: Converts the rectangle from the specified layer’s coordinate system to the receiver’s coordinate system.
- CALayer.ConvertRectToLayer: Converts the rectangle from the receiver’s coordinate system to the specified layer’s coordinate system.
- CALayer.ConvertTimeFromLayer: Converts the time interval from the specified layer’s time space to the receiver’s time space.
- CALayer.ConvertTimeToLayer: Converts the time interval from the receiver’s time space to the specified layer’s time space
Hit testing ¶
- CALayer.HitTest: Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.
- CALayer.ContainsPoint: Returns whether the receiver contains a specified point.
Scrolling ¶
- CALayer.VisibleRect: The visible region of the layer in its own coordinate space.
- CALayer.ScrollPoint: Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified point lies at the origin of the scroll layer.
- CALayer.ScrollRectToVisible: Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified rectangle becomes visible.
Identifying the layer ¶
- CALayer.Name: The name of the receiver.
- CALayer.SetName
Key-value coding extensions ¶
- CALayer.ShouldArchiveValueForKey: Returns a Boolean indicating whether the value of the specified key should be archived.
High dynamic range ¶
- CALayer.PreferredDynamicRange
- CALayer.SetPreferredDynamicRange
- CALayer.ContentsHeadroom
- CALayer.SetContentsHeadroom
- CALayer.WantsExtendedDynamicRangeContent
- CALayer.SetWantsExtendedDynamicRangeContent
Instance properties ¶
Instance Properties ¶
See: https://developer.apple.com/documentation/QuartzCore/CALayer
func CALayerFromID ¶
CALayerFromID constructs a CALayer from an objc.ID.
An object that manages image-based content and allows you to perform animations on that content.
func NewLayerWithLayer ¶
func NewLayerWithLayer(layer objectivec.IObject) CALayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func NewLayerWithRemoteClientId ¶
Initializes a layer with a remote client ID.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(remoteClientId:)
func (CALayer) ActionForKey ¶
Returns the action object assigned to the specified key.
event: The identifier of the action.
Return Value ¶
Returns the object that provides the action for `key`. The object must implement the CAAction protocol.
Discussion ¶
This method searches for the given action object of the layer. Actions define dynamic behaviors for a layer. For example, the animatable properties of a layer typically have corresponding action objects to initiate the actual animations. When that property changes, the layer looks for the action object associated with the property name and executes it. You can also associate custom action objects with your layer to implement app-specific actions.
This method searches for the layer’s associated actions in the following order:
- If the layer has a delegate that implements the [ActionForLayerForKey] method, the layer calls that method. The delegate must do one of the following:
- Return the action object for the given key. - Return the NSNull object if it does not handle the action.
- The layer looks in the layer’s [Actions] dictionary for a matching key/action pair. - The layer looks in the [Style] dictionary for an [Actions] dictionary for a matching key/action pair. - The layer calls the [DefaultActionForKey] class method to look for any class-defined actions.
If any of the above steps returns an instance of NSNull, it is converted to `nil` before continuing.
When an action object is invoked it receives three parameters: the name of the event, the object on which the event happened (the layer), and a dictionary of named arguments specific to each event kind.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/action(forKey:)
func (CALayer) Actions ¶
func (l CALayer) Actions() foundation.INSDictionary
A dictionary containing layer actions.
Discussion ¶
The default value of this property is `nil`. You can use this dictionary to store custom actions for your layer. The contents of this dictionary searched as part of the standard implementation of the [ActionForKey] method.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/actions
func (CALayer) AddAnimationForKey ¶
func (l CALayer) AddAnimationForKey(anim ICAAnimation, key string)
Add the specified animation object to the layer’s render tree.
anim: The animation to be added to the render tree. This object is copied by the render tree, not referenced. Therefore, subsequent modifications to the object are not propagated into the render tree.
key: A string that identifies the animation. Only one animation per unique key is added to the layer. The special key [kCATransition] is automatically used for transition animations. You may specify `nil` for this parameter. // [kCATransition]: https://developer.apple.com/documentation/QuartzCore/kCATransition
Discussion ¶
If the `duration` property of the animation is zero or negative, the duration is changed to the current value of the kCATransactionAnimationDuration transaction property (if set) or to the default value of `0.25` seconds.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/add(_:forKey:)
func (CALayer) AddConstraint ¶
func (l CALayer) AddConstraint(c ICAConstraint)
Adds the specified constraint to the layer.
c: The constraint object to add to the receiver’s array of constraint objects.
Discussion ¶
In macOS, you typically add constraints to a layer to manage the size and position of that layer’s sublayers. Before constraints can be applied, you must also assign a CAConstraintLayoutManager object to the [LayoutManager] property of the layer. For more information about managing layer-based constraints, see Core Animation Programming Guide.
iOS apps do not support layer-based constraints.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/addConstraint(_:)
func (CALayer) AddSublayer ¶
Appends the layer to the layer’s list of sublayers.
layer: The layer to be added.
Discussion ¶
If the array in the sublayers property is `nil`, calling this method creates an array for that property and adds the specified layer to it.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/addSublayer(_:)
func (CALayer) AffineTransform ¶
func (l CALayer) AffineTransform() corefoundation.CGAffineTransform
Returns an affine version of the layer’s transform.
Return Value ¶
The affine transform structure that corresponds to the value in the layer’s [Transform] property.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/affineTransform()
func (CALayer) AllowsEdgeAntialiasing ¶
A Boolean indicating whether the layer is allowed to perform edge antialiasing.
Discussion ¶
When the value is true, the layer is allowed to antialias its edges, as requested by the value in the layer’s [EdgeAntialiasingMask] property. The default value is read from the boolean [UIViewEdgeAntialiasing] property in the main bundle’s `Info.Plist()` file. If no value is found, the default value is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/allowsEdgeAntialiasing
func (CALayer) AllowsGroupOpacity ¶
A Boolean indicating whether the layer is allowed to composite itself as a group separate from its parent.
Discussion ¶
When the value is true and the layer’s opacity property value is less than `1.0`, the layer is allowed to composite itself as a group separate from its parent. This gives correct results when the layer contains multiple opaque components, but may reduce performance.
The default value is read from the boolean [UIViewGroupOpacity] property in the main bundle’s `Info.Plist()` file. If no value is found, the default value is true for apps linked against the iOS 7 SDK or later and false for apps linked against an earlier SDK.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/allowsGroupOpacity
func (CALayer) AnchorPoint ¶
func (l CALayer) AnchorPoint() corefoundation.CGPoint
Defines the anchor point of the layer’s bounds rectangle. Animatable.
Discussion ¶
You specify the value for this property using the unit coordinate space. The default value of this property is (0.5, 0.5), which represents the center of the layer’s bounds rectangle. All geometric manipulations to the view occur about the specified point. For example, applying a rotation transform to a layer with the default anchor point causes the layer to rotate around its center. Changing the anchor point to a different location would cause the layer to rotate around that new point.
For more information about the relationship between the [Frame], [Bounds], [AnchorPoint] and [Position] properties, see Core Animation Programming Guide.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/anchorPoint
func (CALayer) AnchorPointZ ¶
The anchor point for the layer’s position along the z axis. Animatable.
Discussion ¶
This property specifies the anchor point on the z axis around which geometric manipulations occur. The point is expressed as a distance (measured in points) along the z axis. The default value of this property is `0`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/anchorPointZ
func (CALayer) AnimationForKey ¶
func (l CALayer) AnimationForKey(key string) ICAAnimation
Returns the animation object with the specified identifier.
key: A string that specifies the identifier of the animation. This string corresponds to the identifier string you passed to the [AddAnimationForKey] method.
Return Value ¶
The animation object matching the identifier, or `nil` if no such animation exists.
Discussion ¶
Use this method to retrieve only animation objects already associated with a layer. Modifying any properties of the returned object results in undefined behavior.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/animation(forKey:)
func (CALayer) AnimationKeys ¶
Returns an array of strings that identify the animations currently attached to the layer.
Return Value ¶
An array of NSString objects identifying the current animations.
Discussion ¶
The order of the array matches the order in which animations will be applied to the layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/animationKeys()
func (CALayer) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (CALayer) AutoresizingMask ¶
func (l CALayer) AutoresizingMask() CAAutoresizingMask
A bitmask defining how the layer is resized when the bounds of its superlayer changes.
Discussion ¶
If your app does not use a layout manager or constraints to handle layout changes, you can assign a value to this property to adjust the layer’s size in response to changes in the superlayer’s bounds. For a list of possible values, see CAAutoresizingMask.
The default value of this property is kCALayerNotSizable.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/autoresizingMask
func (CALayer) Autoreverses ¶
Determines if the receiver plays in the reverse upon completion.
Discussion ¶
When true, the receiver plays backwards after playing forwards. Defaults to false.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/autoreverses
func (CALayer) BackgroundColor ¶
func (l CALayer) BackgroundColor() coregraphics.CGColorRef
The background color of the receiver. Animatable.
Discussion ¶
The default value of this property is `nil`.
The value of this property is retained using the Core Foundation retain/release semantics. This behavior occurs despite the fact that the property declaration appears to use the default assign semantics for object retention.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/backgroundColor
func (CALayer) BackgroundFilters ¶
func (l CALayer) BackgroundFilters() foundation.INSArray
An array of Core Image filters to apply to the content immediately behind the layer. Animatable.
Discussion ¶
Background filters affect the content behind the layer that shows through into the layer itself. Typically this content belongs to the superlayer that acts as the parent of the layer. These filters do not affect the content of the layer itself, including the layer’s background color and border.
The default value of this property is `nil`.
Changing the inputs of the CIFilter object directly after it is attached to the layer causes undefined behavior. In macOS, it is possible to modify filter parameters after attaching them to the layer but you must use the layer’s setValue(_:forKeyPath:) method to do so. In addition, you must assign a name to the filter so that you can identify it in the array. For example, to change the `inputRadius` parameter of the filter, you could use code similar to the following:
You use the layer’s [MasksToBounds] to control the extent of its background filter’s effect.
The following code shows how to create two overlapping text layers, `background` and `foreground`. A Gaussian blur filter is added to the foreground layer’s [BackgroundFilters] array and its [MasksToBounds] is set to true:
The following figure shows the result: the background layer is only blurred where it is overlapped by the foreground layer.
[media-2851423]
However, if the foreground layer’s [MasksToBounds] is set to false, the entire background layer is blurred as illustrated in the following figure.
[media-2851424]
Special Considerations ¶
This property is not supported on layers in iOS.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/backgroundFilters
func (CALayer) BeginTime ¶
Specifies the begin time of the receiver in relation to its parent object, if applicable.
Discussion ¶
Defaults to 0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/beginTime
func (CALayer) BorderColor ¶
func (l CALayer) BorderColor() coregraphics.CGColorRef
The color of the layer’s border. Animatable.
Discussion ¶
The default value of this property is an opaque black color.
The value of this property is retained using the Core Foundation retain/release semantics. This behavior occurs despite the fact that the property declaration appears to use the default assign semantics for object retention.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/borderColor
func (CALayer) BorderWidth ¶
The width of the layer’s border. Animatable.
Discussion ¶
When this value is greater than 0.0, the layer draws a border using the current [BorderColor] value. The border is drawn inset from the receiver’s bounds by the value specified in this property. It is composited above the receiver’s contents and sublayers and includes the effects of the [CornerRadius] property.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/borderWidth
func (CALayer) Bounds ¶
func (l CALayer) Bounds() corefoundation.CGRect
The layer’s bounds rectangle. Animatable.
Discussion ¶
The bounds rectangle is the origin and size of the layer in its own coordinate space. When you create a new standalone layer, the default value for this property is an empty rectangle, which you must change before using the layer. The values of each coordinate in the rectangle are measured in points.
For more information about the relationship between the [Frame], [Bounds], [AnchorPoint] and [Position] properties, see Core Animation Programming Guide.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/bounds
func (CALayer) CompositingFilter ¶
func (l CALayer) CompositingFilter() objectivec.IObject
A CoreImage filter used to composite the layer and the content behind it. Animatable.
Discussion ¶
The default value of this property is `nil`, which causes the layer to use source-over compositing. Although you can use any Core Image filter as a layer’s compositing filter, for best results, use those in the CICategoryCompositeOperation category.
In macOS, it is possible to modify the filter’s parameters after attaching it to the layer but you must use the layer’s setValue(_:forKeyPath:) method to do so. For example, to change the `inputRadius` parameter of the filter, you could use code similar to the following:
Changing the inputs of the CIFilter object directly after it is attached to the layer causes undefined behavior.
The following code shows how to create two overlapping text layers, background and foreground. Addition compositing is used to composite the foreground over the background.
The following figure shows the result: the identical background colors of the two layers are added together so that a brighter gray is produced where the layers overlap.
[media-2851428]
The following figure shows the default result when the foreground layer’s compositing filter is `nil` or CISourceOverCompositing.
[media-2851429]
Special Considerations ¶
This property is not supported on layers in iOS.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/compositingFilter
func (CALayer) Constraints ¶
func (l CALayer) Constraints() []CAConstraint
The constraints used to position current layer’s sublayers.
Discussion ¶
macOS apps can use this property to access their layer-based constraints. Before constraints can be applied, you must also assign a CAConstraintLayoutManager object to the [LayoutManager] property of the layer.
iOS apps do not support layer-based constraints.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/constraints
func (CALayer) ContainsPoint ¶
func (l CALayer) ContainsPoint(p corefoundation.CGPoint) bool
Returns whether the receiver contains a specified point.
p: A point in the receiver’s coordinate system.
Return Value ¶
true if the bounds of the layer contains the point.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contains(_:)
func (CALayer) Contents ¶
func (l CALayer) Contents() objectivec.IObject
An object that provides the contents of the layer. Animatable.
Discussion ¶
The default value of this property is `nil`.
If you are using the layer to display a static image, you can set this property to the CGImage containing the image you want to display. (In macOS 10.6 and later, you can also set the property to an NSImage object.) Assigning a value to this property causes the layer to use your image rather than create a separate backing store.
If the layer object is tied to a view object, you should avoid setting the contents of this property directly. The interplay between views and layers usually results in the view replacing the contents of this property during a subsequent update.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contents
func (CALayer) ContentsAreFlipped ¶
Returns a Boolean indicating whether the layer content is implicitly flipped when rendered.
Return Value ¶
true if the layer contents are implicitly flipped when rendered or false if they are not. This method returns false by default.
Discussion ¶
This method provides information about whether the layer’s contents are being flipped during drawing. You should not attempt to override this method and return a different value.
If the layer needs to flip its content, it returns true from this method and applies a y-flip transform to the graphics context before passing it to the layer’s [DrawInContext] method. Similarly, the layer converts any rectangles passed to its [SetNeedsDisplayInRect] into the flipped coordinate space.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsAreFlipped()
func (CALayer) ContentsCenter ¶
func (l CALayer) ContentsCenter() corefoundation.CGRect
The rectangle that defines how the layer contents are scaled if the layer’s contents are resized. Animatable.
Discussion ¶
You can use this property to subdivide the layer’s content into a 3x3 grid. The value in this property specifies the location and size of the center rectangle in that grid. If the layer’s [ContentsGravity] property is set to one of the resizing modes, resizing the layer causes scaling to occur differently in each rectangle of the grid. The center rectangle is stretched in both dimensions, the top-center and bottom-center rectangles are stretched only horizontally, the left-center and right-center rectangles are stretched only vertically, and the four corner rectangles are not stretched at all. Therefore, you can use this technique to implement stretchable backgrounds or images using a three-part or nine-part image.
The value in this property is set to the unit rectangle `(0.0,0.0) (1.0,1.0)` by default, which causes the entire image to scale in both dimensions. If you specify a rectangle that extends outside the unit rectangle, the result is undefined. The rectangle you specify is applied only after the [ContentsRect] property has been applied to the image.
The following code shows how you can create a CALayer with the button image shown in the following figure set as its contents. The corner radii of the button image are set to one quarter of the length of its side.
[media-2852114]
By setting the layer’s [ContentsCenter] to `(0.25,0.25) (0.5,0.5)`, the button’s corner radius remains unchanged, whatever size the layer is set to.
The following figure shows the layer created in the previous code resized to 400 x 400, 200 x 200 and 100 x 100 points.
[media-2852112]
The following figure shows the layer at the same sizes but without explicitly setting the layer’s [ContentsCenter]: the entire button image is scaled, including the rounded corners.
[media-2852113]
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsCenter
func (CALayer) ContentsFormat ¶
func (l CALayer) ContentsFormat() CALayerContentsFormat
A hint for the desired storage format of the layer contents.
Discussion ¶
The default value of this property is RGBA8Uint.
UIView and layer-backed NSView objects may change the value to a format appropriate for the current device.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsFormat
func (CALayer) ContentsGravity ¶
func (l CALayer) ContentsGravity() CALayerContentsGravity
A constant that specifies how the layer’s contents are positioned or scaled within its bounds.
Discussion ¶
The possible values for this property are listed in Contents Gravity Values.
The default value of this property is resize.
[Figure 1] shows four examples of the effect of setting different values for a layer’s [ContentsGravity] property.
[media-2851774]
- Contents gravity is resize - the default - Contents gravity is center - Contents gravity is [ContentsAreFlipped] `?` top : bottom - Contents gravity is [ContentsAreFlipped] `?` bottomLeft : topLeft
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsGravity
func (CALayer) ContentsHeadroom ¶
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsHeadroom
func (CALayer) ContentsRect ¶
func (l CALayer) ContentsRect() corefoundation.CGRect
The rectangle, in the unit coordinate space, that defines the portion of the layer’s contents that should be used. Animatable.
Discussion ¶
Defaults to the unit rectangle (0.0, 0.0, 1.0, 1.0).
If pixels outside the unit rectangle are requested, the edge pixels of the contents image will be extended outwards.
If an empty rectangle is provided, the results are undefined.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsRect
func (CALayer) ContentsScale ¶
The scale factor applied to the layer.
Discussion ¶
This value defines the mapping between the logical coordinate space of the layer (measured in points) and the physical coordinate space (measured in pixels). Higher scale factors indicate that each point in the layer is represented by more than one pixel at render time. For example, if the scale factor is `2.0` and the layer’s bounds are 50 x 50 points, the size of the bitmap used to present the layer’s content is 100 x 100 pixels.
The default value of this property is 1.0. For layers attached to a view, the view changes the scale factor automatically to a value that is appropriate for the current screen. For layers you create and manage yourself, you must set the value of this property yourself based on the resolution of the screen and the content you are providing. Core Animation uses the value you specify as a cue to determine how to render your content.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/contentsScale
func (CALayer) ConvertPointFromLayer ¶
func (l_ CALayer) ConvertPointFromLayer(p corefoundation.CGPoint, l ICALayer) corefoundation.CGPoint
Converts the point from the specified layer’s coordinate system to the receiver’s coordinate system.
p: A point specifying a location in the coordinate system of `l`.
l: The layer with `p` in its coordinate system. The receiver and `l` and must share a common parent layer. This parameter may be `nil`.
Return Value ¶
The point converted to the receiver’s coordinate system.
Discussion ¶
If you specify `nil` for the `l` parameter, this method returns the original point subtracted from the layer’s frame’s origin.
The following example shows code that creates two layers, `redLayer` and `yellowLayer`. `yellowLayer` is scaled so that it is half of its original size.
The following figure shows the two layers and an overlaid point (rendered as a blue cross) with a position of `(50.0, 50.0)` in the red layer’s coordinate system.
[media-2850329]
The following code shows how you can find the coordinates of that point in the yellow layer’s coordinate system.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/convert(_:from:)-8kl76
func (CALayer) ConvertPointToLayer ¶
func (l_ CALayer) ConvertPointToLayer(p corefoundation.CGPoint, l ICALayer) corefoundation.CGPoint
Converts the point from the receiver’s coordinate system to the specified layer’s coordinate system.
p: A point specifying a location in the coordinate system of `l`.
l: The layer into whose coordinate system `p` is to be converted. The receiver and `l` must share a common parent layer. This parameter may be `nil`.
Return Value ¶
The point converted to the coordinate system of `layer`.
Discussion ¶
If you specify `nil` for the `l` parameter, this method returns the original point added to the layer’s frame’s origin.
The following example shows code that creates two layers, `redLayer` and `yellowLayer`. `yellowLayer` is scaled so that it is half of its original size.
The following figure shows the two layers and an overlaid point (rendered as a blue cross) with a position of `(50.0, 50.0)` in the red layer’s coordinate system.
[media-2850332]
The following code shows how you can find the coordinates of that point in the yellow layer’s coordinate system.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/convert(_:to:)-7dcke
func (CALayer) ConvertRectFromLayer ¶
func (l_ CALayer) ConvertRectFromLayer(r corefoundation.CGRect, l ICALayer) corefoundation.CGRect
Converts the rectangle from the specified layer’s coordinate system to the receiver’s coordinate system.
r: A point specifying a location in the coordinate system of `l`.
l: The layer with `r` in its coordinate system. The receiver and `l` and must share a common parent layer. This parameter may be `nil`.
Return Value ¶
The rectangle converted to the receiver’s coordinate system.
Discussion ¶
If you specify `nil` for the `l` parameter, this method returns the original rect with an origin subtracted from the layer’s frame’s origin.
The following example shows code that creates two layers, `redLayer` and `yellowLayer`. `yellowLayer` is scaled so that it is half of its original size.
The following figure shows the two layers and an overlaid rectangle with a frame of `(50, 50, 200, 200)` in the red layer’s coordinate system.
[media-2850326]
The following code shows how you can find the coordinates of that rectangle in the yellow layer’s coordinate system.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/convert(_:from:)-4kx9l
func (CALayer) ConvertRectToLayer ¶
func (l_ CALayer) ConvertRectToLayer(r corefoundation.CGRect, l ICALayer) corefoundation.CGRect
Converts the rectangle from the receiver’s coordinate system to the specified layer’s coordinate system.
r: A point specifying a location in the coordinate system of `l`.
l: The layer into whose coordinate system `r` is to be converted. The receiver and `l` and must share a common parent layer. This parameter may be `nil`.
Return Value ¶
The rectangle converted to the coordinate system of `l`.
Discussion ¶
If you specify `nil` for the `l` parameter, this method returns the original rect with an origin added to the layer’s frame’s origin.
The following example shows code that creates two layers, `redLayer` and `yellowLayer`. `yellowLayer` is scaled so that it is half of its original size.
The following figure shows the two layers and an overlaid rectangle with a frame of `(50, 50, 200, 200)` in the red layer’s coordinate system.
[media-2850323]
The following code shows how you can find the coordinates of that rectangle in the yellow layer’s coordinate system.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/convert(_:to:)-tly5
func (CALayer) ConvertTimeFromLayer ¶
Converts the time interval from the specified layer’s time space to the receiver’s time space.
t: A point specifying a location in the coordinate system of `l`.
l: The layer with `t` in its time space. The receiver and `l` and must share a common parent layer.
Return Value ¶
The time interval converted to the receiver’s time space.
Discussion ¶
The following code shows the creation of two layers, layer and `offsetSlowMoLayer`. `offsetSlowMoLayer` has an offset time of 1 second and its [Speed] is set to `0.5`. The last line converts and prints a time interval of 0.5 seconds converted from the time space of `layer` to the time space of `offsetSlowMoLayer`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/convertTime(_:from:)
func (CALayer) ConvertTimeToLayer ¶
Converts the time interval from the receiver’s time space to the specified layer’s time space
t: A point specifying a location in the coordinate system of `l`.
l: The layer into whose time space `t` is to be converted. The receiver and `l` and must share a common parent layer.
Return Value ¶
The time interval converted to the time space of `layer`.
Discussion ¶
The following code shows the creation of two layers, `layer` and `offsetSlowMoLayer`. `offsetSlowMoLayer` has an offset time of 1 second and its [Speed] is set to `0.5`. The last line converts and prints a time interval of 0.5 seconds converted from the time space of `layer` to the time space of `offsetSlowMoLayer`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/convertTime(_:to:)
func (CALayer) CornerCurve ¶
func (l CALayer) CornerCurve() CALayerCornerCurve
See: https://developer.apple.com/documentation/QuartzCore/CALayer/cornerCurve
func (CALayer) CornerRadius ¶
The radius to use when drawing rounded corners for the layer’s background. Animatable.
Discussion ¶
Setting the radius to a value greater than `0.0` causes the layer to begin drawing rounded corners on its background. By default, the corner radius does not apply to the image in the layer’s [Contents] property; it applies only to the background color and border of the layer. However, setting the [MasksToBounds] property to true causes the content to be clipped to the rounded corners.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/cornerRadius
func (CALayer) Delegate ¶
func (l CALayer) Delegate() CALayerDelegate
The layer’s delegate object.
Discussion ¶
You can use a delegate object to provide the layer’s contents, handle the layout of any sublayers, and provide custom actions in response to layer-related changes. The object you assign to this property should implement one or more of the methods of the CALayerDelegate informal protocol. For more information about that protocol, see CALayerDelegate
In iOS, if the layer is associated with a UIView object, this property be set to the view that owns the layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/delegate
func (CALayer) Display ¶
func (l CALayer) Display()
Reloads the content of this layer.
Discussion ¶
Do not call this method directly. The layer calls this method at appropriate times to update the layer’s content. If the layer has a delegate object, this method attempts to call the delegate’s [DisplayLayer] method, which the delegate can use to update the layer’s contents. If the delegate does not implement the [DisplayLayer] method, this method creates a backing store and calls the layer’s [DrawInContext] method to fill that backing store with content. The new backing store replaces the previous contents of the layer.
Subclasses can override this method and use it to set the layer’s [Contents] property directly. You might do this if your custom layer subclass handles layer updates differently.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/display()
func (CALayer) DisplayIfNeeded ¶
func (l CALayer) DisplayIfNeeded()
Initiates the update process for a layer if it is currently marked as needing an update.
Discussion ¶
You can call this method as needed to force an update to your layer’s contents outside of the normal update cycle. Doing so is generally not needed, though. The preferred way to update a layer is to call [SetNeedsDisplay] and let the system update the layer during the next cycle.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/displayIfNeeded()
func (CALayer) DoubleSided ¶
A Boolean indicating whether the layer displays its content when facing away from the viewer. Animatable.
Discussion ¶
When the value in this property is false, the layer hides its content when it faces away from the viewer. The default value of this property is true.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/isDoubleSided
func (CALayer) DrawInContext ¶
func (l CALayer) DrawInContext(ctx coregraphics.CGContextRef)
Draws the layer’s content using the specified graphics context.
ctx: The graphics context in which to draw the content. The context may be clipped to protect valid layer content. Subclasses that wish to find the actual region to draw can call [boundingBoxOfClipPath]. // [boundingBoxOfClipPath]: https://developer.apple.com/documentation/CoreGraphics/CGContext/boundingBoxOfClipPath
Discussion ¶
The default implementation of this method does not do any drawing itself. If the layer’s delegate implements the [DrawLayerInContext] method, that method is called to do the actual drawing.
Subclasses can override this method and use it to draw the layer’s content. When drawing, all coordinates should be specified in points in the logical coordinate space.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/draw(in:)
func (CALayer) DrawsAsynchronously ¶
A Boolean indicating whether drawing commands are deferred and processed asynchronously in a background thread.
Discussion ¶
When this property is set to true, the graphics context used to draw the layer’s contents queues drawing commands and executes them on a background thread rather than executing them synchronously. Performing these commands asynchronously can improve performance in some apps. However, you should always measure the actual performance benefits before enabling this capability.
The default value for this property is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/drawsAsynchronously
func (CALayer) Duration ¶
Specifies the basic duration of the animation, in seconds.
Discussion ¶
Defaults to 0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/duration
func (CALayer) EdgeAntialiasingMask ¶
func (l CALayer) EdgeAntialiasingMask() CAEdgeAntialiasingMask
A bitmask defining how the edges of the receiver are rasterized.
Discussion ¶
This property specifies which edges of the layer are antialiased and is a combination of the constants defined in CAEdgeAntialiasingMask. You can enable or disable antialiasing for each edge (top, left, bottom, right) separately. By default antialiasing is enabled for all edges.
Typically, you would use this property to disable antialiasing for edges that abut edges of other layers, to eliminate the seams that would otherwise occur.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/edgeAntialiasingMask
func (CALayer) EncodeWithCoder ¶
func (l CALayer) EncodeWithCoder(coder foundation.INSCoder)
func (CALayer) FillMode ¶
func (l CALayer) FillMode() CAMediaTimingFillMode
Determines if the receiver’s presentation is frozen or removed once its active duration has completed.
Discussion ¶
The possible values are described in Fill Modes. The default is removed.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/fillMode
func (CALayer) Filters ¶
func (l CALayer) Filters() foundation.INSArray
An array of Core Image filters to apply to the contents of the layer and its sublayers. Animatable.
Discussion ¶
The filters you add to this property affect the content of the layer, including its border, filled background and sublayers. The default value of this property is `nil`.
Changing the inputs of the CIFilter object directly after it is attached to the layer causes undefined behavior. It is possible to modify filter parameters after attaching them to the layer but you must use the layer’s setValue(_:forKeyPath:) method to do so. In addition, you must assign a name to the filter so that you can identify it in the array. For example, to change the `inputRadius` parameter of the filter, you could use code similar to the following:
The following code shows how to create a text layer and apply a CIPointillize filter to it.
The following figure shows the result: a pointillist effect is added to the text.
[media-2851431]
Special Considerations ¶
This property is not supported on layers in iOS.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/filters
func (CALayer) Frame ¶
func (l CALayer) Frame() corefoundation.CGRect
The layer’s frame rectangle.
Discussion ¶
The frame rectangle is position and size of the layer specified in the superlayer’s coordinate space. For layers, the frame rectangle is a computed property that is derived from the values in the[Bounds], [AnchorPoint] and [Position] properties. When you assign a new value to this property, the layer changes its [Position] and [Bounds] properties to match the rectangle you specified. The values of each coordinate in the rectangle are measured in points.
Do not set the frame if the [Transform] property applies a rotation transform that is not a multiple of 90 degrees.
For more information about the relationship between the [Frame], [Bounds], [AnchorPoint] and [Position] properties, see Core Animation Programming Guide.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/frame
func (CALayer) GeometryFlipped ¶
A Boolean that indicates whether the geometry of the layer and its sublayers is flipped vertically.
Discussion ¶
If the layer is providing the backing for a layer-backed view, the view is responsible for managing the value in this property. For standalone layers, this property controls whether geometry values for the layer are interpreted using the standard or flipped coordinate system. The value of this property does not affect the rendering of the layer’s content.
The default value of this property is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/isGeometryFlipped
func (CALayer) Hidden ¶
A Boolean indicating whether the layer is displayed. Animatable.
Discussion ¶
The default value of this property is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/isHidden
func (CALayer) HitTest ¶
func (l CALayer) HitTest(p corefoundation.CGPoint) ICALayer
Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.
p: A point in the coordinate system of the receiver’s superlayer.
Return Value ¶
The layer that contains `thePoint` or `nil` if the point lies outside the receiver’s bounds rectangle.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/hitTest(_:)
func (CALayer) InitWithLayer ¶
func (l CALayer) InitWithLayer(layer objectivec.IObject) CALayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CALayer) InsertSublayerAbove ¶
Inserts the specified sublayer above a different sublayer that already belongs to the receiver.
layer: The sublayer to be inserted into the current layer.
sibling: An existing sublayer in the current layer. The layer in `aLayer` is inserted after this layer in the [Sublayers] array, and thus appears in front of it visually.
Discussion ¶
If `sublayer` is not in the receiver’s [Sublayers] array, this method raises an exception.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/insertSublayer(_:above:)
func (CALayer) InsertSublayerAtIndex ¶
Inserts the specified layer into the receiver’s list of sublayers at the specified index.
layer: The sublayer to be inserted into the current layer.
idx: The index at which to insert `aLayer`. This value must be a valid 0-based index into the [Sublayers] array.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/insertSublayer(_:at:)
func (CALayer) InsertSublayerBelow ¶
Inserts the specified sublayer below a different sublayer that already belongs to the receiver.
layer: The sublayer to be inserted into the current layer.
sibling: An existing sublayer in the current layer. The layer in `aLayer` is inserted before this layer in the [Sublayers] array, and thus appears behind it visually.
Discussion ¶
If `sublayer` is not in the receiver’s [Sublayers] array, this method raises an exception.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/insertSublayer(_:below:)
func (CALayer) LayoutIfNeeded ¶
func (l CALayer) LayoutIfNeeded()
Recalculate the receiver’s layout, if required.
Discussion ¶
When this message is received, the layer’s super layers are traversed until a ancestor layer is found that does not require layout. Then layout is performed on the entire layer-tree beneath that ancestor.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/layoutIfNeeded()
func (CALayer) LayoutManager ¶
func (l CALayer) LayoutManager() CALayoutManager
The object responsible for laying out the layer’s sublayers.
Discussion ¶
The object you assign to this property must nominally implement the CALayoutManager Informal Protocol informal protocol. If the layer’s delegate does not handle layout updates, the object assigned to this property is given a chance to update the layout of the layer’s sublayers.
In macOS, assign an instance of the CAConstraintLayoutManager class to this property if your layer uses layer-based constraints to handle layout changes.
The default value of this property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/layoutManager
func (CALayer) LayoutSublayers ¶
func (l CALayer) LayoutSublayers()
Tells the layer to update its layout.
Discussion ¶
Subclasses can override this method and use it to implement their own layout algorithm. Your implementation must set the frame of each sublayer managed by the receiver.
The default implementation of this method calls the `layoutSublayers()` method in Swift or “ method in Objective-C of the layer’s delegate object. If there is no delegate object, or the delegate does not implement that method, this method calls the `layoutSublayers()` method in Swift or “ method in Objective-C of the object in the [LayoutManager] property.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/layoutSublayers()
func (CALayer) MagnificationFilter ¶
func (l CALayer) MagnificationFilter() CALayerContentsFilter
The filter used when increasing the size of the content.
Discussion ¶
The possible values for this property are listed in Scaling Filters.
The default value of this property is linear.
[Figure 1] shows the difference between linear and nearest filtering when a 10 x 10 point image of a circle is magnified by a scale of 10.
[media-2851435]
The circle on the left uses linear and the circle on the right uses nearest.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/magnificationFilter
func (CALayer) Mask ¶
An optional layer whose alpha channel is used to mask the layer’s content.
Discussion ¶
The layer’s alpha channel determines how much of the layer’s content and background shows through. Fully or partially opaque pixels allow the underlying content to show through, but fully transparent pixels block that content.
The default value of this property is `nil`. When configuring a mask, remember to set the size and position of the mask layer to ensure it is aligned properly with the layer it masks.
Special Considerations ¶
The layer you assign to this property must not have a superlayer. If it does, the behavior is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/mask
func (CALayer) MaskedCorners ¶
func (l CALayer) MaskedCorners() CACornerMask
See: https://developer.apple.com/documentation/QuartzCore/CALayer/maskedCorners
func (CALayer) MasksToBounds ¶
A Boolean indicating whether sublayers are clipped to the layer’s bounds. Animatable.
Discussion ¶
When the value of this property is true, Core Animation creates an implicit clipping mask that matches the bounds of the layer and includes any corner radius effects. If a value for the [Mask] property is also specified, the two masks are multiplied to get the final mask value.
The default value of this property is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/masksToBounds
func (CALayer) MinificationFilter ¶
func (l CALayer) MinificationFilter() CALayerContentsFilter
The filter used when reducing the size of the content.
Discussion ¶
The possible values for this property are listed in Scaling Filters.
The default value of this property is linear.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/minificationFilter
func (CALayer) MinificationFilterBias ¶
The bias factor used by the minification filter to determine the levels of detail.
Discussion ¶
This value is used by the [MinificationFilter] when it is set to trilinear.
The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/minificationFilterBias
func (CALayer) ModelLayer ¶
Returns the model layer object associated with the receiver, if any.
Return Value ¶
A layer instance representing the underlying model layer.
Discussion ¶
Calling this method on a layer in the presentation tree returns the corresponding layer object in the model tree. This method returns a value only when a transaction involving changes to the presentation layer is in progress. If no transaction is in progress, the results of calling this method are undefined.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/model()
func (CALayer) Name ¶
The name of the receiver.
Discussion ¶
The layer name is used by some layout managers to identify a layer. The default value of this property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/name
func (CALayer) NeedsDisplay ¶
Returns a Boolean indicating whether the layer has been marked as needing an update.
Return Value ¶
true if the layer needs to be updated.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/needsDisplay()
func (CALayer) NeedsDisplayOnBoundsChange ¶
A Boolean indicating whether the layer contents must be updated when its bounds rectangle changes.
Discussion ¶
When this property is set to true, the layer automatically calls its [SetNeedsDisplay] method whenever its [Bounds] property changes. The default value of this property is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/needsDisplayOnBoundsChange
func (CALayer) NeedsLayout ¶
Returns a Boolean indicating whether the layer has been marked as needing a layout update.
Return Value ¶
true if the layer has been marked as requiring a layout update.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/needsLayout()
func (CALayer) Opacity ¶
The opacity of the receiver. Animatable.
Discussion ¶
The value of this property must be in the range `0.0` (transparent) to `1.0` (opaque). Values outside that range are clamped to the minimum or maximum. The default value of this property is `1.0`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/opacity
func (CALayer) Opaque ¶
A Boolean value indicating whether the layer contains completely opaque content.
Discussion ¶
The default value of this property is false. If your app draws completely opaque content that fills the layer’s bounds, setting this property to true lets the system optimize the rendering behavior for the layer. Specifically, when the layer creates the backing store for your drawing commands, Core Animation omits the alpha channel of that backing store. Doing so can improve the performance of compositing operations. If you set the value of this property to true, you must fill the layer’s bounds with opaque content.
Setting this property affects only the backing store managed by Core Animation. If you assign an image with an alpha channel to the layer’s [Contents] property, that image retains its alpha channel regardless of the value of this property.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/isOpaque
func (CALayer) Position ¶
func (l CALayer) Position() corefoundation.CGPoint
The layer’s position in its superlayer’s coordinate space. Animatable.
Discussion ¶
The value of this property is specified in points and is always specified relative to the value in the [AnchorPoint] property. For new standalone layers, the default position is set to (0.0, 0.0). Changing the [Frame] property also updates the value in this property.
For more information about the relationship between the [Frame], [Bounds], [AnchorPoint] and [Position] properties, see Core Animation Programming Guide.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/position
func (CALayer) PreferredDynamicRange ¶
func (l CALayer) PreferredDynamicRange() CADynamicRange
See: https://developer.apple.com/documentation/QuartzCore/CALayer/preferredDynamicRange
func (CALayer) PreferredFrameSize ¶
func (l CALayer) PreferredFrameSize() corefoundation.CGSize
Returns the preferred size of the layer in the coordinate space of its superlayer.
Return Value ¶
The layer’s preferred frame size.
Discussion ¶
In macOS, the default implementation of this method calls the `preferredSize()` method in Swift or the “ method in Objective-C of its layout manager—that is, the object in its [LayoutManager] property. If that object does not exist or does not implement that method, this method returns the size of the layer’s current [Bounds] rectangle mapped into the coordinate space of its [Superlayer].
See: https://developer.apple.com/documentation/QuartzCore/CALayer/preferredFrameSize()
func (CALayer) PresentationLayer ¶
Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen.
Return Value ¶
A copy of the current presentation layer object.
Discussion ¶
The layer object returned by this method provides a close approximation of the layer that is currently being displayed onscreen. While an animation is in progress, you can retrieve this object and use it to get the current values for those animations.
The [Sublayers], [Mask], and [Superlayer] properties of the returned layer return the corresponding objects from the presentation tree (not the model tree). This pattern also applies to any read-only layer methods. For example, the [HitTest] method of the returned object queries the layer objects in the presentation tree.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/presentation()
func (CALayer) RasterizationScale ¶
The scale at which to rasterize content, relative to the coordinate space of the layer. Animatable
Discussion ¶
When the value in the [ShouldRasterize] property is true, the layer uses this property to determine whether to scale the rasterized content (and by how much). The default value of this property is `1.0`, which indicates that the layer should be rasterized at its current size. Larger values magnify the content and smaller values shrink it.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/rasterizationScale
func (CALayer) RemoveAllAnimations ¶
func (l CALayer) RemoveAllAnimations()
Remove all animations attached to the layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/removeAllAnimations()
func (CALayer) RemoveAnimationForKey ¶
Remove the animation object with the specified key.
key: The identifier of the animation to remove.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/removeAnimation(forKey:)
func (CALayer) RemoveFromSuperlayer ¶
func (l CALayer) RemoveFromSuperlayer()
Detaches the layer from its parent layer.
Discussion ¶
You can use this method to remove a layer (and all of its sublayers) from a layer hierarchy. This method updates both the superlayer’s list of sublayers and sets this layer’s [Superlayer] property to `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/removeFromSuperlayer()
func (CALayer) RenderInContext ¶
func (l CALayer) RenderInContext(ctx coregraphics.CGContextRef)
Renders the layer and its sublayers into the specified context.
ctx: The graphics context to use to render the layer.
Discussion ¶
This method renders directly from the layer tree, ignoring any animations added to the render tree. Renders in the coordinate space of the layer.
The following code shows how you can use [RenderInContext] to create a UIImage from a CAShapeLayer with a [Path] that describes a circle. After creating the layer, the code creates a CGContext into which the circle is rendered. After rendering, UIGraphicsGetImageFromCurrentImageContext() generates the image.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/render(in:)
func (CALayer) RepeatCount ¶
Determines the number of times the animation will repeat.
Discussion ¶
May be fractional. If the `repeatCount` is 0, it is ignored. Defaults to 0. If both [RepeatDuration] and [RepeatCount] are specified the behavior is undefined.
Setting this property to greatestFiniteMagnitude will cause the animation to repeat forever.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatCount
func (CALayer) RepeatDuration ¶
Determines how many seconds the animation will repeat for.
Discussion ¶
Defaults to 0. If the `repeatDuration` is 0, it is ignored. If both [RepeatDuration] and [RepeatCount] are specified the behavior is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatDuration
func (CALayer) ReplaceSublayerWith ¶
Replaces the specified sublayer with a different layer object.
oldLayer: The layer to be replaced.
newLayer: The layer with which to replace `oldLayer`.
Discussion ¶
If `oldLayer` is not in the receiver’s [Sublayers] array, the behavior of this method is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/replaceSublayer(_:with:)
func (CALayer) ResizeSublayersWithOldSize ¶
func (l CALayer) ResizeSublayersWithOldSize(size corefoundation.CGSize)
Informs the receiver’s sublayers that the receiver’s size has changed.
size: The previous size of the current layer.
Discussion ¶
When the [AutoresizingMask] property is used for resizing and the bounds of this layer change, the layer calls this method. The default implementation calls the [ResizeWithOldSuperlayerSize] method of each sublayer to let it know its superlayer’s bounds changed. You should not need to call or override this method directly.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/resizeSublayers(withOldSize:)
func (CALayer) ResizeWithOldSuperlayerSize ¶
func (l CALayer) ResizeWithOldSuperlayerSize(size corefoundation.CGSize)
Informs the receiver that the size of its superlayer changed.
size: The previous size of the superlayer.
Discussion ¶
When the [AutoresizingMask] property is used for resizing and the bounds of a layer change, that layer calls this method on each of its sublayers. Sublayers use this method to adjust their own frame rectangles to reflect the new superlayer bounds, which can be retrieved directly from the superlayer. The old size of the superlayer is passed to this method so that the sublayer has that information for any calculations it must make.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/resize(withOldSuperlayerSize:)
func (CALayer) ScrollPoint ¶
func (l CALayer) ScrollPoint(p corefoundation.CGPoint)
Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified point lies at the origin of the scroll layer.
p: The point in the current layer that should be scrolled into position.
Discussion ¶
If the layer is not contained by a CAScrollLayer object, this method does nothing.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/scroll(_:)
func (CALayer) ScrollRectToVisible ¶
func (l CALayer) ScrollRectToVisible(r corefoundation.CGRect)
Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified rectangle becomes visible.
r: The rectangle to be made visible.
Discussion ¶
If the layer is not contained by a CAScrollLayer object, this method does nothing.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/scrollRectToVisible(_:)
func (CALayer) SetActions ¶
func (l CALayer) SetActions(value foundation.INSDictionary)
func (CALayer) SetAffineTransform ¶
func (l CALayer) SetAffineTransform(m corefoundation.CGAffineTransform)
Sets the layer’s transform to the specified affine transform.
m: The affine transform to use for the layer’s transform.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/setAffineTransform(_:)
func (CALayer) SetAllowsEdgeAntialiasing ¶
func (CALayer) SetAllowsGroupOpacity ¶
func (CALayer) SetAnchorPoint ¶
func (l CALayer) SetAnchorPoint(value corefoundation.CGPoint)
func (CALayer) SetAnchorPointZ ¶
func (CALayer) SetAutoresizingMask ¶
func (l CALayer) SetAutoresizingMask(value CAAutoresizingMask)
func (CALayer) SetAutoreverses ¶
func (CALayer) SetBackgroundColor ¶
func (l CALayer) SetBackgroundColor(value coregraphics.CGColorRef)
func (CALayer) SetBackgroundFilters ¶
func (l CALayer) SetBackgroundFilters(value foundation.INSArray)
func (CALayer) SetBeginTime ¶
func (CALayer) SetBorderColor ¶
func (l CALayer) SetBorderColor(value coregraphics.CGColorRef)
func (CALayer) SetBorderWidth ¶
func (CALayer) SetBounds ¶
func (l CALayer) SetBounds(value corefoundation.CGRect)
func (CALayer) SetCompositingFilter ¶
func (l CALayer) SetCompositingFilter(value objectivec.IObject)
func (CALayer) SetConstraints ¶
func (l CALayer) SetConstraints(value []CAConstraint)
func (CALayer) SetContents ¶
func (l CALayer) SetContents(value objectivec.IObject)
func (CALayer) SetContentsCenter ¶
func (l CALayer) SetContentsCenter(value corefoundation.CGRect)
func (CALayer) SetContentsFormat ¶
func (l CALayer) SetContentsFormat(value CALayerContentsFormat)
func (CALayer) SetContentsGravity ¶
func (l CALayer) SetContentsGravity(value CALayerContentsGravity)
func (CALayer) SetContentsHeadroom ¶
func (CALayer) SetContentsRect ¶
func (l CALayer) SetContentsRect(value corefoundation.CGRect)
func (CALayer) SetContentsScale ¶
func (CALayer) SetCornerCurve ¶
func (l CALayer) SetCornerCurve(value CALayerCornerCurve)
func (CALayer) SetCornerRadius ¶
func (CALayer) SetDelegate ¶
func (l CALayer) SetDelegate(value CALayerDelegate)
func (CALayer) SetDoubleSided ¶
func (CALayer) SetDrawsAsynchronously ¶
func (CALayer) SetDuration ¶
func (CALayer) SetEdgeAntialiasingMask ¶
func (l CALayer) SetEdgeAntialiasingMask(value CAEdgeAntialiasingMask)
func (CALayer) SetFillMode ¶
func (l CALayer) SetFillMode(value CAMediaTimingFillMode)
func (CALayer) SetFilters ¶
func (l CALayer) SetFilters(value foundation.INSArray)
func (CALayer) SetFrame ¶
func (l CALayer) SetFrame(value corefoundation.CGRect)
func (CALayer) SetGeometryFlipped ¶
func (CALayer) SetLayoutManager ¶
func (l CALayer) SetLayoutManager(value CALayoutManager)
func (CALayer) SetMagnificationFilter ¶
func (l CALayer) SetMagnificationFilter(value CALayerContentsFilter)
func (CALayer) SetMaskedCorners ¶
func (l CALayer) SetMaskedCorners(value CACornerMask)
func (CALayer) SetMasksToBounds ¶
func (CALayer) SetMinificationFilter ¶
func (l CALayer) SetMinificationFilter(value CALayerContentsFilter)
func (CALayer) SetMinificationFilterBias ¶
func (CALayer) SetNeedsDisplay ¶
func (l CALayer) SetNeedsDisplay()
Marks the layer’s contents as needing to be updated.
Discussion ¶
Calling this method causes the layer to recache its content. This results in the layer potentially calling either the [DisplayLayer] or [DrawLayerInContext] method of its delegate. The existing content in the layer’s [Contents] property is removed to make way for the new content.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/setNeedsDisplay()
func (CALayer) SetNeedsDisplayInRect ¶
func (l CALayer) SetNeedsDisplayInRect(r corefoundation.CGRect)
Marks the region within the specified rectangle as needing to be updated.
r: The rectangular region of the layer to mark as invalid. You must specify this rectangle in the layer’s own coordinate system.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/setNeedsDisplay(_:)
func (CALayer) SetNeedsDisplayOnBoundsChange ¶
func (CALayer) SetNeedsLayout ¶
func (l CALayer) SetNeedsLayout()
Invalidates the layer’s layout and marks it as needing an update.
Discussion ¶
You can call this method to indicate that the layout of a layer’s sublayers has changed and must be updated. The system typically calls this method automatically when the layer’s bounds change or when sublayers are added or removed. In macOS, if your layer’s [LayoutManager] property contains an object that implements the `invalidateLayout()` method in Swift or the “ method in Objective-C, the system calls that method too.
During the next update cycle, the system calls the [LayoutSublayers] method of any layers requiring layout updates.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/setNeedsLayout()
func (CALayer) SetOpacity ¶
func (CALayer) SetPosition ¶
func (l CALayer) SetPosition(value corefoundation.CGPoint)
func (CALayer) SetPreferredDynamicRange ¶
func (l CALayer) SetPreferredDynamicRange(value CADynamicRange)
func (CALayer) SetRasterizationScale ¶
func (CALayer) SetRepeatCount ¶
func (CALayer) SetRepeatDuration ¶
func (CALayer) SetShadowColor ¶
func (l CALayer) SetShadowColor(value coregraphics.CGColorRef)
func (CALayer) SetShadowOffset ¶
func (l CALayer) SetShadowOffset(value corefoundation.CGSize)
func (CALayer) SetShadowOpacity ¶
func (CALayer) SetShadowPath ¶
func (l CALayer) SetShadowPath(value coregraphics.CGPathRef)
func (CALayer) SetShadowRadius ¶
func (CALayer) SetShouldRasterize ¶
func (CALayer) SetStyle ¶
func (l CALayer) SetStyle(value foundation.INSDictionary)
func (CALayer) SetSublayerTransform ¶
func (l CALayer) SetSublayerTransform(value CATransform3D)
func (CALayer) SetSublayers ¶
func (CALayer) SetTimeOffset ¶
func (CALayer) SetToneMapMode ¶
func (CALayer) SetTransform ¶
func (l CALayer) SetTransform(value CATransform3D)
func (CALayer) SetValueForKey ¶ added in v0.4.4
func (l CALayer) SetValueForKey(value objectivec.IObject, key string)
Sets the value of the property identified by the given key. [Full Topic]
func (CALayer) SetWantsExtendedDynamicRangeContent ¶
func (CALayer) SetZPosition ¶
func (CALayer) ShadowColor ¶
func (l CALayer) ShadowColor() coregraphics.CGColorRef
The color of the layer’s shadow. Animatable.
Discussion ¶
The default value of this property is an opaque black color.
The value of this property is retained using the Core Foundation retain/release semantics. This behavior occurs despite the fact that the property declaration appears to use the default assign semantics for object retention.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shadowColor
func (CALayer) ShadowOffset ¶
func (l CALayer) ShadowOffset() corefoundation.CGSize
The offset (in points) of the layer’s shadow. Animatable.
Discussion ¶
The default value of this property is (`0.0`, `-3.0`).
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shadowOffset
func (CALayer) ShadowOpacity ¶
The opacity of the layer’s shadow. Animatable.
Discussion ¶
The value in this property must be in the range `0.0` (transparent) to `1.0` (opaque). The default value of this property is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shadowOpacity
func (CALayer) ShadowPath ¶
func (l CALayer) ShadowPath() coregraphics.CGPathRef
The shape of the layer’s shadow. Animatable.
Discussion ¶
The default value of this property is `nil`, which causes the layer to use a standard shadow shape. If you specify a value for this property, the layer creates its shadow using the specified path instead of the layer’s composited alpha channel. The path you provide defines the outline of the shadow. It is filled using the non-zero winding rule and the current shadow color, opacity, and blur radius.
Unlike most animatable properties, this property (as with all [CGPathRef] animatable properties) does not support implicit animation. However, the path object may be animated using any of the concrete subclasses of CAPropertyAnimation. Paths will interpolate as a linear blend of the “on-line” points; “off-line” points may be interpolated non-linearly (to preserve continuity of the curve’s derivative). If the two paths have a different number of control points or segments, the results are undefined. If the path extends outside the layer bounds it will not automatically be clipped to the layer, only if the normal layer masking rules cause that.
Specifying an explicit path usually improves rendering performance.
The value of this property is retained using the Core Foundation retain/release semantics. This behavior occurs despite the fact that the property declaration appears to use the default assign semantics for object retention.
Using Shadow Path for Special Effects ¶
You can use a layer’s shadow path to create special effects such as simulating the shadows available in Pages.
The following code shows the code required to add an elliptical shadow to the bottom of a layer to simulate the Pages effect.
[media-2851604]
The following code shows how to create a path to simulate the Pages . The left, top and right sides of the path are straight lines, and the bottom is a concave curve as illustrated in the following figure.
[media-2851608]
[media-2851607]
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shadowPath
func (CALayer) ShadowRadius ¶
The blur radius (in points) used to render the layer’s shadow. Animatable.
Discussion ¶
You specify the radius The default value of this property is 3.0.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shadowRadius
func (CALayer) ShouldArchiveValueForKey ¶
Returns a Boolean indicating whether the value of the specified key should be archived.
key: The name of one of the receiver’s properties.
Return Value ¶
true if the specified property should be archived or false if it should not.
Discussion ¶
The default implementation returns true.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shouldArchiveValue(forKey:)
func (CALayer) ShouldRasterize ¶
A Boolean that indicates whether the layer is rendered as a bitmap before compositing. Animatable
Discussion ¶
When the value of this property is true, the layer is rendered as a bitmap in its local coordinate space and then composited to the destination with any other content. Shadow effects and any filters in the [Filters] property are rasterized and included in the bitmap. However, the current opacity of the layer is not rasterized. If the rasterized bitmap requires scaling during compositing, the filters in the [MinificationFilter] and [MagnificationFilter] properties are applied as needed.
When the value of this property is false, the layer is composited directly into the destination whenever possible. The layer may still be rasterized prior to compositing if certain features of the compositing model (such as the inclusion of filters) require it.
The default value of this property is false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/shouldRasterize
func (CALayer) Speed ¶
Specifies how time is mapped to receiver’s time space from the parent time space.
Discussion ¶
For example, if `speed` is 2.0 local time progresses twice as fast as parent time. Defaults to 1.0.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/speed
func (CALayer) Style ¶
func (l CALayer) Style() foundation.INSDictionary
An optional dictionary used to store property values that aren’t explicitly defined by the layer.
Discussion ¶
This dictionary may in turn have a `style` key, forming a hierarchy of default values. In the case of hierarchical style dictionaries the shallowest value for a property is used. For example, the value for “style.someValue” takes precedence over “style.style.someValue”.
If the style dictionary does not define a value for an attribute, the receiver’s [DefaultValueForKey] method is called. The default value of this property is `nil`.
The style dictionary is not consulted for the following keys: `bounds`, `frame`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/style
func (CALayer) SublayerTransform ¶
func (l CALayer) SublayerTransform() CATransform3D
Specifies the transform to apply to sublayers when rendering. Animatable.
Discussion ¶
You typically use this property to add perspective and other viewing effects to embedded layers. You add perspective by setting the sublayer transform to the desired projection matrix. The default value of this property is the identity transform.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/sublayerTransform
func (CALayer) Sublayers ¶
An array containing the layer’s sublayers.
Discussion ¶
The sublayers are listed in back to front order. The default value of this property is `nil`.
Special Considerations ¶
When setting the [Sublayers] property to an array populated with layer objects, each layer in the array must not already have a superlayer—that is, its [Superlayer] property must currently be `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/sublayers
func (CALayer) Superlayer ¶
The superlayer of the layer.
Discussion ¶
The superlayer manages the layout of its sublayers.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/superlayer
func (CALayer) TimeOffset ¶
Specifies an additional time offset in active local time.
Discussion ¶
Defaults to 0. .
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/timeOffset
func (CALayer) ToneMapMode ¶
See: https://developer.apple.com/documentation/QuartzCore/CALayer/toneMapMode-swift.property
func (CALayer) Transform ¶
func (l CALayer) Transform() CATransform3D
The transform applied to the layer’s contents. Animatable.
Discussion ¶
This property is set to the identity transform by default. Any transformations you apply to the layer occur relative to the layer’s anchor point.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/transform
func (CALayer) ValueForKey ¶ added in v0.4.4
func (l CALayer) ValueForKey(key string) objectivec.IObject
Returns the value of the property identified by the given key. [Full Topic]
func (CALayer) VisibleRect ¶
func (l CALayer) VisibleRect() corefoundation.CGRect
The visible region of the layer in its own coordinate space.
Discussion ¶
The visible region is the area not clipped by the containing scroll layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/visibleRect
func (CALayer) WantsExtendedDynamicRangeContent ¶
See: https://developer.apple.com/documentation/QuartzCore/CALayer/wantsExtendedDynamicRangeContent
func (CALayer) ZPosition ¶
The layer’s position on the z axis. Animatable.
Discussion ¶
The default value of this property is `0`. Changing the value of this property changes the front-to-back ordering of layers onscreen. Higher values place this layer visually closer to the viewer than layers with lower values. This can affect the visibility of layers whose frame rectangles overlap.
The value of this property is measured in points. The range of this property is single-precision, floating-point `-`greatestFiniteMagnitude to greatestFiniteMagnitude.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/zPosition
type CALayerClass ¶
type CALayerClass struct {
// contains filtered or unexported fields
}
func GetCALayerClass ¶
func GetCALayerClass() CALayerClass
GetCALayerClass returns the class object for CALayer.
func (CALayerClass) Alloc ¶
func (cc CALayerClass) Alloc() CALayer
Alloc allocates memory for a new instance of the class.
func (CALayerClass) CornerCurveExpansionFactor ¶
func (_CALayerClass CALayerClass) CornerCurveExpansionFactor(curve CALayerCornerCurve) float64
See: https://developer.apple.com/documentation/QuartzCore/CALayer/cornerCurveExpansionFactor(_:)
func (CALayerClass) DefaultActionForKey ¶
func (_CALayerClass CALayerClass) DefaultActionForKey(event string) CAAction
Returns the default action for the current class.
event: The identifier of the action.
Return Value ¶
Returns a suitable action object for the given key or `nil` of no action object was associated with that key.
Discussion ¶
Classes that want to provide default actions can override this method and use it to return those actions.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/defaultAction(forKey:)
func (CALayerClass) DefaultValueForKey ¶
func (_CALayerClass CALayerClass) DefaultValueForKey(key string) objectivec.IObject
Specifies the default value associated with the specified key.
key: The name of one of the receiver’s properties.
Return Value ¶
The default value for the named property. Returns `nil` if no default value has been set.
Discussion ¶
If you define custom properties for a layer but do not set a value, this method returns a suitable “zero” default value based on the expected value of the `key`. For example, if the value for `key` is a CGSize struct, the method returns a size struct containing (0.0,0.0) wrapped in an NSValue object. For a CGRect an empty rectangle is returned. For CGAffineTransform and CATransform3D, the appropriate identity matrix is returned.
Special Considerations ¶
If `key` is not a known for property of the class, the result of the method is undefined.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/defaultValue(forKey:)
func (CALayerClass) NeedsDisplayForKey ¶
func (_CALayerClass CALayerClass) NeedsDisplayForKey(key string) bool
Returns a Boolean indicating whether changes to the specified key require the layer to be redisplayed.
key: A string that specifies an attribute of the layer.
Return Value ¶
true if the layer requires a redisplay.
Discussion ¶
Subclasses can override this method and return true if the layer should be redisplayed when the value of the specified attribute changes. Animations changing the value of the attribute also trigger redisplay.
The default implementation of this method returns false.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/needsDisplay(forKey:)
type CALayerContentsFilter ¶
type CALayerContentsFilter = string
See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFilter
var ( // KCAFilterLinear is linear interpolation filter. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFilter/linear KCAFilterLinear CALayerContentsFilter // KCAFilterNearest is nearest neighbor interpolation filter. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFilter/nearest KCAFilterNearest CALayerContentsFilter // KCAFilterTrilinear is trilinear minification filter. Enables mipmap generation. Some renderers may ignore this, or impose additional restrictions, such as source images requiring power-of-two dimensions. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFilter/trilinear KCAFilterTrilinear CALayerContentsFilter )
type CALayerContentsFormat ¶
type CALayerContentsFormat = string
See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFormat
var ( // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFormat/automatic KCAContentsFormatAutomatic CALayerContentsFormat // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFormat/gray8Uint KCAContentsFormatGray8Uint CALayerContentsFormat // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFormat/RGBA16Float KCAContentsFormatRGBA16Float CALayerContentsFormat // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsFormat/RGBA8Uint KCAContentsFormatRGBA8Uint CALayerContentsFormat )
type CALayerContentsGravity ¶
type CALayerContentsGravity = string
See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity
var ( // KCAGravityBottom is the content is horizontally centered at the bottom-edge of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/bottom KCAGravityBottom CALayerContentsGravity // KCAGravityBottomLeft is the content is positioned in the bottom-left corner of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/bottomLeft KCAGravityBottomLeft CALayerContentsGravity // KCAGravityBottomRight is the content is positioned in the bottom-right corner of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/bottomRight KCAGravityBottomRight CALayerContentsGravity // KCAGravityCenter is the content is horizontally and vertically centered in the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/center KCAGravityCenter CALayerContentsGravity // KCAGravityLeft is the content is vertically centered at the left-edge of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/left KCAGravityLeft CALayerContentsGravity // KCAGravityResize is the content is resized to fit the entire bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/resize KCAGravityResize CALayerContentsGravity // KCAGravityResizeAspect is the content is resized to fit the bounds rectangle, preserving the aspect of the content. If the content does not completely fill the bounds rectangle, the content is centered in the partial axis. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/resizeAspect KCAGravityResizeAspect CALayerContentsGravity // KCAGravityResizeAspectFill is the content is resized to completely fill the bounds rectangle, while still preserving the aspect of the content. The content is centered in the axis it exceeds. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/resizeAspectFill KCAGravityResizeAspectFill CALayerContentsGravity // KCAGravityRight is the content is vertically centered at the right-edge of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/right KCAGravityRight CALayerContentsGravity // KCAGravityTop is the content is horizontally centered at the top-edge of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/top KCAGravityTop CALayerContentsGravity // KCAGravityTopLeft is the content is positioned in the top-left corner of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/topLeft KCAGravityTopLeft CALayerContentsGravity // KCAGravityTopRight is the content is positioned in the top-right corner of the bounds rectangle. // // See: https://developer.apple.com/documentation/QuartzCore/CALayerContentsGravity/topRight KCAGravityTopRight CALayerContentsGravity )
type CALayerCornerCurve ¶
type CALayerCornerCurve = string
See: https://developer.apple.com/documentation/QuartzCore/CALayerCornerCurve
var ( // See: https://developer.apple.com/documentation/QuartzCore/CALayerCornerCurve/circular KCACornerCurveCircular CALayerCornerCurve // See: https://developer.apple.com/documentation/QuartzCore/CALayerCornerCurve/continuous KCACornerCurveContinuous CALayerCornerCurve )
type CALayerDelegate ¶
type CALayerDelegate interface {
objectivec.IObject
}
Methods your app can implement to respond to layer-related events.
See: https://developer.apple.com/documentation/QuartzCore/CALayerDelegate
type CALayerDelegateConfig ¶
type CALayerDelegateConfig struct {
// Providing the Layer’s Content
// LayerWillDraw — Notifies the delegate of an imminent draw.
LayerWillDraw func(layer CALayer)
// Other Methods
// DisplayLayer — Tells the delegate to implement the display process.
DisplayLayer func(layer CALayer)
// LayoutSublayersOfLayer — Tells the delegate a layer’s bounds have changed.
LayoutSublayersOfLayer func(layer CALayer)
}
CALayerDelegateConfig holds optional typed callbacks for CALayerDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type CALayerDelegateObject ¶
type CALayerDelegateObject struct {
objectivec.Object
}
CALayerDelegateObject wraps an existing Objective-C object that conforms to the CALayerDelegate protocol.
func CALayerDelegateObjectFromID ¶
func CALayerDelegateObjectFromID(id objc.ID) CALayerDelegateObject
CALayerDelegateObjectFromID constructs a CALayerDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func NewCALayerDelegate ¶
func NewCALayerDelegate(config CALayerDelegateConfig) CALayerDelegateObject
NewCALayerDelegate creates an Objective-C object implementing the CALayerDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned CALayerDelegateObject satisfies the CALayerDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func (CALayerDelegateObject) ActionForLayerForKey ¶
func (o CALayerDelegateObject) ActionForLayerForKey(layer ICALayer, event string) CAAction
Returns the default action of the [ActionForKey] method.
layer: The layer that is the target of the action.
event: The identifier of the action.
Return Value ¶
An object implementing the CAAction protocol or `nil` if the delegate does not specify a behavior for the specified `key`.
Discussion ¶
A layer’s delegate that implements this method returns an action for a specified key and stops any further searches (i.e. actions for the same key in the layer’s [Actions] dictionary or specified by [DefaultActionForKey] are not returned).
The following code shows how you can create a class named [LayerDelegate] that implements CALayerDelegate and sets it as a layer’s (named `sublayer`) delegate. [LayerDelegate] returns a basic animation that moves an object from left to right. The `moveSublayer()` method searches `sublayer` for an action with the key `moveRight` and, if the action is found, runs it.
See: https://developer.apple.com/documentation/QuartzCore/CALayerDelegate/action(for:forKey:)
func (CALayerDelegateObject) BaseObject ¶
func (o CALayerDelegateObject) BaseObject() objectivec.Object
func (CALayerDelegateObject) DisplayLayer ¶
func (o CALayerDelegateObject) DisplayLayer(layer ICALayer)
Tells the delegate to implement the display process.
layer: The layer whose contents need updating.
Discussion ¶
The [DisplayLayer] delegate method is called when the layer is marked for its content to be reloaded, typically initiated by the [SetNeedsDisplay] method. The typical technique for updating is to set the layer’s `contents` property.
The following code shows how you can create a class named [LayerDelegate] that implements CALayerDelegate and sets it as a layer’s (named `sublayer`) delegate. When [SetNeedsDisplay] is called on `sublayer`, the delegate’s [DisplayLayer] replaces its contents with a specified image.
See: https://developer.apple.com/documentation/QuartzCore/CALayerDelegate/display(_:)
func (CALayerDelegateObject) DrawLayerInContext ¶
func (o CALayerDelegateObject) DrawLayerInContext(layer ICALayer, ctx coregraphics.CGContextRef)
Tells the delegate to implement the display process using the layer’s context.
layer: The layer whose contents need to be drawn.
ctx: The graphics context to use for drawing. The graphics context incorporates the appropriate scale factor for drawing to the target screen.
Discussion ¶
The [DrawLayerInContext] method is called when the layer is marked for its content to be reloaded, typically with the [SetNeedsDisplay] method. It is not called if the delegate implements the [DisplayLayer] method. You can use the context to draw vectors, such as curves and lines, or images with the draw(_:in:byTiling:) method.
The following code shows how you can create a class named [LayerDelegate] that implements CALayerDelegate and sets it as a layer’s (named `sublayer`) delegate. When [SetNeedsDisplay] is called on `sublayer`, the delegate’s [DrawLayerInContext] method draws an ellipse fitting the bounding box of the layer using the boundingBoxOfClipPath function.
See: https://developer.apple.com/documentation/QuartzCore/CALayerDelegate/draw(_:in:)
func (CALayerDelegateObject) LayerWillDraw ¶
func (o CALayerDelegateObject) LayerWillDraw(layer ICALayer)
Notifies the delegate of an imminent draw.
layer: The layer whose contents will be drawn.
Discussion ¶
The [LayerWillDraw] method is called before [DrawLayerInContext]. You can use this method to configure any layer state affecting contents prior to [DrawLayerInContext] such as [ContentsFormat] and [Opaque].
See: https://developer.apple.com/documentation/QuartzCore/CALayerDelegate/layerWillDraw(_:)
func (CALayerDelegateObject) LayoutSublayersOfLayer ¶
func (o CALayerDelegateObject) LayoutSublayersOfLayer(layer ICALayer)
Tells the delegate a layer’s bounds have changed.
layer: The layer that requires layout of its sublayers.
Discussion ¶
The [LayoutSublayersOfLayer] method is called when a layer’s bounds have changed and its sublayers may need rearranging, for example by changing its frame’s size. You can implement this method if you need precise control over the layout of your layer’s sublayers.
The following code shows how you can create a class named [LayerDelegate] that implements CALayerDelegate and sets it as a layer’s (named `sublayer`) delegate. When the layer’s size changes, the delegate’s [LayoutSublayersOfLayer] iterates over all of the sublayers of `sublayer` and resizes them to fit within it.
See: https://developer.apple.com/documentation/QuartzCore/CALayerDelegate/layoutSublayers(of:)
type CALayoutManager ¶
type CALayoutManager interface {
objectivec.IObject
}
Methods that allow an object to manage the layout of a layer and its sublayers.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager
type CALayoutManagerObject ¶
type CALayoutManagerObject struct {
objectivec.Object
}
CALayoutManagerObject wraps an existing Objective-C object that conforms to the CALayoutManager protocol.
func CALayoutManagerObjectFromID ¶
func CALayoutManagerObjectFromID(id objc.ID) CALayoutManagerObject
CALayoutManagerObjectFromID constructs a CALayoutManagerObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (CALayoutManagerObject) BaseObject ¶
func (o CALayoutManagerObject) BaseObject() objectivec.Object
func (CALayoutManagerObject) InvalidateLayoutOfLayer ¶
func (o CALayoutManagerObject) InvalidateLayoutOfLayer(layer ICALayer)
Invalidates the layout of a layer so it knows to refresh its content on the next frame.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager/invalidateLayout(of:)
func (CALayoutManagerObject) LayoutSublayersOfLayer ¶
func (o CALayoutManagerObject) LayoutSublayersOfLayer(layer ICALayer)
Override to customize layout of sublayers whenever the layer needs redrawing.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager/layoutSublayers(of:)
func (CALayoutManagerObject) PreferredSizeOfLayer ¶
func (o CALayoutManagerObject) PreferredSizeOfLayer(layer ICALayer) corefoundation.CGSize
Override to customize layer size.
See: https://developer.apple.com/documentation/QuartzCore/CALayoutManager/preferredSize(of:)
type CAMediaTiming ¶
type CAMediaTiming interface {
objectivec.IObject
// Specifies the begin time of the receiver in relation to its parent object, if applicable.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/beginTime
BeginTime() float64
// Specifies an additional time offset in active local time.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/timeOffset
TimeOffset() float64
// Determines the number of times the animation will repeat.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatCount
RepeatCount() float32
// Determines how many seconds the animation will repeat for.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatDuration
RepeatDuration() float64
// Specifies the basic duration of the animation, in seconds.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/duration
Duration() float64
// Specifies how time is mapped to receiver’s time space from the parent time space.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/speed
Speed() float32
// Determines if the receiver plays in the reverse upon completion.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/autoreverses
Autoreverses() bool
// Determines if the receiver’s presentation is frozen or removed once its active duration has completed.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/fillMode
FillMode() CAMediaTimingFillMode
// Specifies the begin time of the receiver in relation to its parent object, if applicable.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/beginTime
SetBeginTime(value float64)
// Specifies an additional time offset in active local time.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/timeOffset
SetTimeOffset(value float64)
// Determines the number of times the animation will repeat.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatCount
SetRepeatCount(value float32)
// Determines how many seconds the animation will repeat for.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatDuration
SetRepeatDuration(value float64)
// Specifies the basic duration of the animation, in seconds.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/duration
SetDuration(value float64)
// Specifies how time is mapped to receiver’s time space from the parent time space.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/speed
SetSpeed(value float32)
// Determines if the receiver plays in the reverse upon completion.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/autoreverses
SetAutoreverses(value bool)
// Determines if the receiver’s presentation is frozen or removed once its active duration has completed.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/fillMode
SetFillMode(value CAMediaTimingFillMode)
}
Methods that model a hierarchical timing system, allowing objects to map time between their parent and local time.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming
type CAMediaTimingFillMode ¶
type CAMediaTimingFillMode = string
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFillMode
var ( // KCAFillModeBackwards is the receiver clamps values before zero to zero when the animation is completed. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFillMode/backwards KCAFillModeBackwards CAMediaTimingFillMode // KCAFillModeBoth is the receiver clamps values at both ends of the object’s time space. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFillMode/both KCAFillModeBoth CAMediaTimingFillMode // KCAFillModeForwards is the receiver remains visible in its final state when the animation is completed. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFillMode/forwards KCAFillModeForwards CAMediaTimingFillMode // KCAFillModeRemoved is the receiver is removed from the presentation when the animation is completed. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFillMode/removed KCAFillModeRemoved CAMediaTimingFillMode )
type CAMediaTimingFunction ¶
type CAMediaTimingFunction struct {
objectivec.Object
}
A function that defines the pacing of an animation as a timing curve.
Overview ¶
CAMediaTimingFunction represents one segment of a function that defines the pacing of an animation as a timing curve. The function maps an input time normalized to the range `[0,1]` to an output time also in the range `[0,1]`.
You can create a media timing function by supplying your own cubic Bézier curve control points using the CAMediaTimingFunction.InitWithControlPoints method or by using one of the predefined timing functions.
Creating Timing Functions ¶
- CAMediaTimingFunction.InitWithControlPoints: Returns an initialized timing function modeled as a cubic Bézier curve using the specified control points.
Accessing the Control Points ¶
- CAMediaTimingFunction.GetControlPointAtIndexValues: Returns the control point for the specified index.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunction
func CAMediaTimingFunctionFromID ¶
func CAMediaTimingFunctionFromID(id objc.ID) CAMediaTimingFunction
CAMediaTimingFunctionFromID constructs a CAMediaTimingFunction from an objc.ID.
A function that defines the pacing of an animation as a timing curve.
func NewCAMediaTimingFunction ¶
func NewCAMediaTimingFunction() CAMediaTimingFunction
NewCAMediaTimingFunction creates a new CAMediaTimingFunction instance.
func NewMediaTimingFunctionWithControlPoints ¶
func NewMediaTimingFunctionWithControlPoints(c1x float32, c1y float32, c2x float32, c2y float32) CAMediaTimingFunction
Returns an initialized timing function modeled as a cubic Bézier curve using the specified control points.
c1x: A floating point number representing the x position of the c1 control point.
c1y: A floating point number representing the y position of the c1 control point.
c2x: A floating point number representing the x position of the c2 control point.
c2y: A floating point number representing the y position of the c2 control point.
Return Value ¶
An instance of CAMediaTimingFunction with the timing function specified by the provided control points.
Discussion ¶
The end points of the Bézier curve are automatically set to (0.0,0.0) and (1.0,1.0). The control points defining the Bézier curve are: [(0.0,0.0), (`c1x`,`c1y`), (`c2x`,`c2y`), (1.0,1.0)].
func NewMediaTimingFunctionWithName ¶
func NewMediaTimingFunctionWithName(name CAMediaTimingFunctionName) CAMediaTimingFunction
Creates and returns a new instance of CAMediaTimingFunction configured with the predefined timing function specified by `name`.
name: The timing function to use as specified in [Predefined Timing Functions]. // [Predefined Timing Functions]: https://developer.apple.com/documentation/QuartzCore/predefined-timing-functions
Return Value ¶
A new instance of CAMediaTimingFunction with the timing function specified by `name`.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunction/init(name:)
func (CAMediaTimingFunction) Autorelease ¶
func (m CAMediaTimingFunction) Autorelease() CAMediaTimingFunction
Autorelease adds the receiver to the current autorelease pool.
func (CAMediaTimingFunction) EncodeWithCoder ¶
func (m CAMediaTimingFunction) EncodeWithCoder(coder foundation.INSCoder)
func (CAMediaTimingFunction) GetControlPointAtIndexValues ¶
func (m CAMediaTimingFunction) GetControlPointAtIndexValues(idx uintptr, ptr unsafe.Pointer)
Returns the control point for the specified index.
idx: An integer specifying the index of the control point to return.
ptr: A pointer to an array that, upon return, will contain the x and y values of the specified point.
Discussion ¶
The value of `index` must be between 0 and 3.
func (CAMediaTimingFunction) Init ¶
func (m CAMediaTimingFunction) Init() CAMediaTimingFunction
Init initializes the instance.
func (CAMediaTimingFunction) InitWithControlPoints ¶
func (m CAMediaTimingFunction) InitWithControlPoints(c1x float32, c1y float32, c2x float32, c2y float32) CAMediaTimingFunction
Returns an initialized timing function modeled as a cubic Bézier curve using the specified control points.
c1x: A floating point number representing the x position of the c1 control point.
c1y: A floating point number representing the y position of the c1 control point.
c2x: A floating point number representing the x position of the c2 control point.
c2y: A floating point number representing the y position of the c2 control point.
Return Value ¶
An instance of CAMediaTimingFunction with the timing function specified by the provided control points.
Discussion ¶
The end points of the Bézier curve are automatically set to (0.0,0.0) and (1.0,1.0). The control points defining the Bézier curve are: [(0.0,0.0), (`c1x`,`c1y`), (`c2x`,`c2y`), (1.0,1.0)].
type CAMediaTimingFunctionClass ¶
type CAMediaTimingFunctionClass struct {
// contains filtered or unexported fields
}
func GetCAMediaTimingFunctionClass ¶
func GetCAMediaTimingFunctionClass() CAMediaTimingFunctionClass
GetCAMediaTimingFunctionClass returns the class object for CAMediaTimingFunction.
func (CAMediaTimingFunctionClass) Alloc ¶
func (cc CAMediaTimingFunctionClass) Alloc() CAMediaTimingFunction
Alloc allocates memory for a new instance of the class.
type CAMediaTimingFunctionName ¶
type CAMediaTimingFunctionName = string
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunctionName
var ( // KCAMediaTimingFunctionDefault is the system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunctionName/default KCAMediaTimingFunctionDefault CAMediaTimingFunctionName // KCAMediaTimingFunctionEaseIn is ease-in pacing, which causes an animation to begin slowly and then speed up as it progresses. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunctionName/easeIn KCAMediaTimingFunctionEaseIn CAMediaTimingFunctionName // KCAMediaTimingFunctionEaseInEaseOut is ease-in-ease-out pacing, which causes an animation to begin slowly, accelerate through the middle of its duration, and then slow again before completing. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunctionName/easeInEaseOut KCAMediaTimingFunctionEaseInEaseOut CAMediaTimingFunctionName // KCAMediaTimingFunctionEaseOut is ease-out pacing, which causes an animation to begin quickly and then slow as it progresses. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunctionName/easeOut KCAMediaTimingFunctionEaseOut CAMediaTimingFunctionName // KCAMediaTimingFunctionLinear is linear pacing, which causes an animation to occur evenly over its duration. // // See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunctionName/linear KCAMediaTimingFunctionLinear CAMediaTimingFunctionName )
type CAMediaTimingObject ¶
type CAMediaTimingObject struct {
objectivec.Object
}
CAMediaTimingObject wraps an existing Objective-C object that conforms to the CAMediaTiming protocol.
func CAMediaTimingObjectFromID ¶
func CAMediaTimingObjectFromID(id objc.ID) CAMediaTimingObject
CAMediaTimingObjectFromID constructs a CAMediaTimingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (CAMediaTimingObject) Autoreverses ¶
func (o CAMediaTimingObject) Autoreverses() bool
Determines if the receiver plays in the reverse upon completion.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/autoreverses
func (CAMediaTimingObject) BaseObject ¶
func (o CAMediaTimingObject) BaseObject() objectivec.Object
func (CAMediaTimingObject) BeginTime ¶
func (o CAMediaTimingObject) BeginTime() float64
Specifies the begin time of the receiver in relation to its parent object, if applicable.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/beginTime
func (CAMediaTimingObject) Duration ¶
func (o CAMediaTimingObject) Duration() float64
Specifies the basic duration of the animation, in seconds.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/duration
func (CAMediaTimingObject) FillMode ¶
func (o CAMediaTimingObject) FillMode() CAMediaTimingFillMode
Determines if the receiver’s presentation is frozen or removed once its active duration has completed.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/fillMode
func (CAMediaTimingObject) RepeatCount ¶
func (o CAMediaTimingObject) RepeatCount() float32
Determines the number of times the animation will repeat.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatCount
func (CAMediaTimingObject) RepeatDuration ¶
func (o CAMediaTimingObject) RepeatDuration() float64
Determines how many seconds the animation will repeat for.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/repeatDuration
func (CAMediaTimingObject) SetAutoreverses ¶
func (o CAMediaTimingObject) SetAutoreverses(value bool)
func (CAMediaTimingObject) SetBeginTime ¶
func (o CAMediaTimingObject) SetBeginTime(value float64)
func (CAMediaTimingObject) SetDuration ¶
func (o CAMediaTimingObject) SetDuration(value float64)
func (CAMediaTimingObject) SetFillMode ¶
func (o CAMediaTimingObject) SetFillMode(value CAMediaTimingFillMode)
func (CAMediaTimingObject) SetRepeatCount ¶
func (o CAMediaTimingObject) SetRepeatCount(value float32)
func (CAMediaTimingObject) SetRepeatDuration ¶
func (o CAMediaTimingObject) SetRepeatDuration(value float64)
func (CAMediaTimingObject) SetSpeed ¶
func (o CAMediaTimingObject) SetSpeed(value float32)
func (CAMediaTimingObject) SetTimeOffset ¶
func (o CAMediaTimingObject) SetTimeOffset(value float64)
func (CAMediaTimingObject) Speed ¶
func (o CAMediaTimingObject) Speed() float32
Specifies how time is mapped to receiver’s time space from the parent time space.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/speed
func (CAMediaTimingObject) TimeOffset ¶
func (o CAMediaTimingObject) TimeOffset() float64
Specifies an additional time offset in active local time.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTiming/timeOffset
type CAMetalDisplayLink ¶
type CAMetalDisplayLink struct {
objectivec.Object
}
A class your Metal app uses to register for callbacks to synchronize its animations for a display.
Overview ¶
CAMetalDisplayLink instances are a specialized way to interact with variable-rate displays when you need more control over the timing window to render your app’s frames. Controlling the timing window and rendering delay for frames can help you achieve smoother frame rates and avoid visual artifacts.
Your app initializes a new Metal display link by providing a target CAMetalLayer. Set this instance’s CAMetalDisplayLink.Delegate property to an implementation that encodes the rendering work for Metal to perform. With a set delegate, synchronize the display with a run loop to perform rendering on by calling the CAMetalDisplayLink.AddToRunLoopForMode method.
Once you associate the display link with a run loop, the system calls the delegate’s [MetalDisplayLinkNeedsUpdate] method to request new frames. This method receives update requests based on the CAMetalDisplayLink.PreferredFrameRateRange and CAMetalDisplayLink.PreferredFrameLatency of the display link. The system makes a best effort to make callbacks at appropriate times. Your app should complete any commits to the Metal device’s MTLCommandQueue for rendering the display layer before calling present() on a drawable element.
Your app can disable notifications by setting CAMetalDisplayLink.Paused to `true`. When your app finishes with a display link, call [CAMetalDisplayLink.Invalidate]to remove it from all run loops and the target.
Creating a Display Link ¶
- CAMetalDisplayLink.InitWithMetalLayer: Creates a display link for Metal from a Core Animation layer.
Configuring a Display Link ¶
- CAMetalDisplayLink.PreferredFrameRateRange: A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
- CAMetalDisplayLink.SetPreferredFrameRateRange
- CAMetalDisplayLink.PreferredFrameLatency: The amount of time, in frames, your app requests to render a frame.
- CAMetalDisplayLink.SetPreferredFrameLatency
- CAMetalDisplayLink.Delegate: An instance of a type your app implements that responds to the system’s callbacks.
- CAMetalDisplayLink.SetDelegate
Registering for Callbacks ¶
- CAMetalDisplayLink.AddToRunLoopForMode: Registers the display link with a run loop.
Pausing Callbacks ¶
- CAMetalDisplayLink.Paused: A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
- CAMetalDisplayLink.SetPaused
Deregistering for callbacks ¶
- CAMetalDisplayLink.RemoveFromRunLoopForMode: Removes a mode’s display link from a run loop.
- CAMetalDisplayLink.Invalidate: Removes the display link from all run loops for all modes.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink
func CAMetalDisplayLinkFromID ¶
func CAMetalDisplayLinkFromID(id objc.ID) CAMetalDisplayLink
CAMetalDisplayLinkFromID constructs a CAMetalDisplayLink from an objc.ID.
A class your Metal app uses to register for callbacks to synchronize its animations for a display.
func NewCAMetalDisplayLink ¶
func NewCAMetalDisplayLink() CAMetalDisplayLink
NewCAMetalDisplayLink creates a new CAMetalDisplayLink instance.
func NewMetalDisplayLinkWithMetalLayer ¶
func NewMetalDisplayLinkWithMetalLayer(layer ICAMetalLayer) CAMetalDisplayLink
Creates a display link for Metal from a Core Animation layer.
layer: A Core Animation layer for Metal.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/init(metalLayer:)
func (CAMetalDisplayLink) AddToRunLoopForMode ¶
func (m CAMetalDisplayLink) AddToRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
Registers the display link with a run loop.
runloop: A run loop instance the method associates with the display link.
mode: A run loop mode for the display link.
Discussion ¶
You can associate the display link with any of the RunLoop modes, multiple input modes, or a custom mode. When the run loop is in `mode`, the display link notifies its delegate when the system prepares the next frame.
You can remove the display link from a run loop by calling [RemoveFromRunLoopForMode], or from all run loops with [Invalidate].
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/add(to:forMode:)
func (CAMetalDisplayLink) Autorelease ¶
func (m CAMetalDisplayLink) Autorelease() CAMetalDisplayLink
Autorelease adds the receiver to the current autorelease pool.
func (CAMetalDisplayLink) Delegate ¶
func (m CAMetalDisplayLink) Delegate() CAMetalDisplayLinkDelegate
An instance of a type your app implements that responds to the system’s callbacks.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/delegate
func (CAMetalDisplayLink) Init ¶
func (m CAMetalDisplayLink) Init() CAMetalDisplayLink
Init initializes the instance.
func (CAMetalDisplayLink) InitWithMetalLayer ¶
func (m CAMetalDisplayLink) InitWithMetalLayer(layer ICAMetalLayer) CAMetalDisplayLink
Creates a display link for Metal from a Core Animation layer.
layer: A Core Animation layer for Metal.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/init(metalLayer:)
func (CAMetalDisplayLink) Invalidate ¶
func (m CAMetalDisplayLink) Invalidate()
Removes the display link from all run loops for all modes.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/invalidate()
func (CAMetalDisplayLink) Paused ¶
func (m CAMetalDisplayLink) Paused() bool
A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
Discussion ¶
You can instruct the display link to stop sending notifications to the delegate by setting the property to true. The property defaults to false.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/isPaused
func (CAMetalDisplayLink) PreferredFrameLatency ¶
func (m CAMetalDisplayLink) PreferredFrameLatency() float32
The amount of time, in frames, your app requests to render a frame.
Discussion ¶
The final latency may be bigger if the system needs more time, such as for windowed modes on macOS.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/preferredFrameLatency
func (CAMetalDisplayLink) PreferredFrameRateRange ¶
func (m CAMetalDisplayLink) PreferredFrameRateRange() CAFrameRateRange
A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
Discussion ¶
The display link makes a best attempt to invoke your app’s callback within the frequency range you set to this property. However, the system also takes into account the device’s hardware capabilities and the other tasks your game or app is running.
The system can change the available range of frame rates because it factors in system policies and a person’s preferences. For example, Low Power Mode, critical thermal state, and accessibility settings can affect the system’s frame rate.
The system typically provides a consistent frame rate by choosing one that’s a factor of the display’s maximum refresh rate. For example, a display link could invoke your callback 60 times per second for a display with a refresh rate of 60 hertz. However, the display link could invoke your callback less frequently, such as 30, 20, or 15 hertz, by setting a range with smaller values.
See Optimizing ProMotion refresh rates for iPhone 13 Pro and iPad Pro for more information.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/preferredFrameRateRange
func (CAMetalDisplayLink) RemoveFromRunLoopForMode ¶
func (m CAMetalDisplayLink) RemoveFromRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
Removes a mode’s display link from a run loop.
runloop: A run loop the method disassociates the display link from for `mode`.
mode: A run loop mode the method disassociates the display link for `runloop`.
Discussion ¶
The run loop releases the display link if it no longer associates with any run modes.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/remove(from:forMode:)
func (CAMetalDisplayLink) SetDelegate ¶
func (m CAMetalDisplayLink) SetDelegate(value CAMetalDisplayLinkDelegate)
func (CAMetalDisplayLink) SetPaused ¶
func (m CAMetalDisplayLink) SetPaused(value bool)
func (CAMetalDisplayLink) SetPreferredFrameLatency ¶
func (m CAMetalDisplayLink) SetPreferredFrameLatency(value float32)
func (CAMetalDisplayLink) SetPreferredFrameRateRange ¶
func (m CAMetalDisplayLink) SetPreferredFrameRateRange(value CAFrameRateRange)
type CAMetalDisplayLinkClass ¶
type CAMetalDisplayLinkClass struct {
// contains filtered or unexported fields
}
func GetCAMetalDisplayLinkClass ¶
func GetCAMetalDisplayLinkClass() CAMetalDisplayLinkClass
GetCAMetalDisplayLinkClass returns the class object for CAMetalDisplayLink.
func (CAMetalDisplayLinkClass) Alloc ¶
func (cc CAMetalDisplayLinkClass) Alloc() CAMetalDisplayLink
Alloc allocates memory for a new instance of the class.
type CAMetalDisplayLinkDelegate ¶
type CAMetalDisplayLinkDelegate interface {
objectivec.IObject
// A method the system calls to notify your app when it plans to update the display.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLinkDelegate/metalDisplayLink(_:needsUpdate:)
MetalDisplayLinkNeedsUpdate(link ICAMetalDisplayLink, update ICAMetalDisplayLinkUpdate)
}
A protocol your app implements to respond to callbacks from Core Animation for a Metal display link.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLinkDelegate
type CAMetalDisplayLinkDelegateConfig ¶
type CAMetalDisplayLinkDelegateConfig struct {
// Receiving Display Updates
// MetalDisplayLinkNeedsUpdate — A method the system calls to notify your app when it plans to update the display.
MetalDisplayLinkNeedsUpdate func(link CAMetalDisplayLink, update CAMetalDisplayLinkUpdate)
}
CAMetalDisplayLinkDelegateConfig holds optional typed callbacks for CAMetalDisplayLinkDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type CAMetalDisplayLinkDelegateObject ¶
type CAMetalDisplayLinkDelegateObject struct {
objectivec.Object
}
CAMetalDisplayLinkDelegateObject wraps an existing Objective-C object that conforms to the CAMetalDisplayLinkDelegate protocol.
func CAMetalDisplayLinkDelegateObjectFromID ¶
func CAMetalDisplayLinkDelegateObjectFromID(id objc.ID) CAMetalDisplayLinkDelegateObject
CAMetalDisplayLinkDelegateObjectFromID constructs a CAMetalDisplayLinkDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func NewCAMetalDisplayLinkDelegate ¶
func NewCAMetalDisplayLinkDelegate(config CAMetalDisplayLinkDelegateConfig) CAMetalDisplayLinkDelegateObject
NewCAMetalDisplayLinkDelegate creates an Objective-C object implementing the CAMetalDisplayLinkDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned CAMetalDisplayLinkDelegateObject satisfies the CAMetalDisplayLinkDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func (CAMetalDisplayLinkDelegateObject) BaseObject ¶
func (o CAMetalDisplayLinkDelegateObject) BaseObject() objectivec.Object
func (CAMetalDisplayLinkDelegateObject) MetalDisplayLinkNeedsUpdate ¶
func (o CAMetalDisplayLinkDelegateObject) MetalDisplayLinkNeedsUpdate(link ICAMetalDisplayLink, update ICAMetalDisplayLinkUpdate)
A method the system calls to notify your app when it plans to update the display.
link: A Metal display link instance the system notifies.
update: An update instance that contains the time the system intends to update the display, a CAMetalDrawable instance, and a deadline to call its present() method. // present(): https://developer.apple.com/documentation/Metal/MTLDrawable/present()
Discussion ¶
In this method’s implementation, perform your app’s rendering on the [Layer] or [Texture] of the `update` instance’s [Drawable] property. Before calling present(), encode all your Metal commands to the `link` parameter’s MTLDevice. The GPU has additional time to complete running your commands before the frame displays on screen, determined by the value of the `link` parameter’s [PreferredFrameLatency] property.
type CAMetalDisplayLinkUpdate ¶
type CAMetalDisplayLinkUpdate struct {
objectivec.Object
}
Stores information about a single update from a Metal display link instance.
Timing the Next Animation Frame ¶
- CAMetalDisplayLinkUpdate.TargetPresentationTimestamp: The time the system estimates until the display of the next frame.
Drawing the Next Frame ¶
- CAMetalDisplayLinkUpdate.TargetTimestamp: A deadline that indicates when your app needs to finish rendering to the drawable.
- CAMetalDisplayLinkUpdate.Drawable: The Metal drawable your app uses to render the next frame.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/Update
func CAMetalDisplayLinkUpdateFromID ¶
func CAMetalDisplayLinkUpdateFromID(id objc.ID) CAMetalDisplayLinkUpdate
CAMetalDisplayLinkUpdateFromID constructs a CAMetalDisplayLinkUpdate from an objc.ID.
Stores information about a single update from a Metal display link instance.
func NewCAMetalDisplayLinkUpdate ¶
func NewCAMetalDisplayLinkUpdate() CAMetalDisplayLinkUpdate
NewCAMetalDisplayLinkUpdate creates a new CAMetalDisplayLinkUpdate instance.
func (CAMetalDisplayLinkUpdate) Autorelease ¶
func (m CAMetalDisplayLinkUpdate) Autorelease() CAMetalDisplayLinkUpdate
Autorelease adds the receiver to the current autorelease pool.
func (CAMetalDisplayLinkUpdate) Drawable ¶
func (m CAMetalDisplayLinkUpdate) Drawable() CAMetalDrawable
The Metal drawable your app uses to render the next frame.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/Update/drawable
func (CAMetalDisplayLinkUpdate) Init ¶
func (m CAMetalDisplayLinkUpdate) Init() CAMetalDisplayLinkUpdate
Init initializes the instance.
func (CAMetalDisplayLinkUpdate) TargetPresentationTimestamp ¶
func (m CAMetalDisplayLinkUpdate) TargetPresentationTimestamp() float64
The time the system estimates until the display of the next frame.
Discussion ¶
Update your animations based on the time difference between this timestamp and the previous timestamp.
func (CAMetalDisplayLinkUpdate) TargetTimestamp ¶
func (m CAMetalDisplayLinkUpdate) TargetTimestamp() float64
A deadline that indicates when your app needs to finish rendering to the drawable.
Discussion ¶
Your app needs to call the [Drawable] instance’s present() method before the deadline. GPU rendering can continue after this time, based on [PreferredFrameLatency]. For more information on timing your app’s rendering, see [MetalDisplayLinkNeedsUpdate].
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/Update/targetTimestamp
type CAMetalDisplayLinkUpdateClass ¶
type CAMetalDisplayLinkUpdateClass struct {
// contains filtered or unexported fields
}
func GetCAMetalDisplayLinkUpdateClass ¶
func GetCAMetalDisplayLinkUpdateClass() CAMetalDisplayLinkUpdateClass
GetCAMetalDisplayLinkUpdateClass returns the class object for CAMetalDisplayLinkUpdate.
func (CAMetalDisplayLinkUpdateClass) Alloc ¶
func (cc CAMetalDisplayLinkUpdateClass) Alloc() CAMetalDisplayLinkUpdate
Alloc allocates memory for a new instance of the class.
type CAMetalDrawable ¶
type CAMetalDrawable interface {
objectivec.IObject
metal.MTLDrawable
// A Metal texture object that contains the drawable’s contents.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMetalDrawable/texture
Texture() metal.MTLTexture
// The layer that owns this drawable object.
//
// See: https://developer.apple.com/documentation/QuartzCore/CAMetalDrawable/layer
Layer() ICAMetalLayer
}
A Metal drawable associated with a Core Animation layer.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDrawable
type CAMetalDrawableObject ¶
type CAMetalDrawableObject struct {
metal.MTLDrawableObject
}
CAMetalDrawableObject wraps an existing Objective-C object that conforms to the CAMetalDrawable protocol.
func CAMetalDrawableObjectFromID ¶
func CAMetalDrawableObjectFromID(id objc.ID) CAMetalDrawableObject
CAMetalDrawableObjectFromID constructs a CAMetalDrawableObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (CAMetalDrawableObject) BaseObject ¶
func (o CAMetalDrawableObject) BaseObject() objectivec.Object
func (CAMetalDrawableObject) Layer ¶
func (o CAMetalDrawableObject) Layer() ICAMetalLayer
The layer that owns this drawable object.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDrawable/layer
func (CAMetalDrawableObject) Texture ¶
func (o CAMetalDrawableObject) Texture() metal.MTLTexture
A Metal texture object that contains the drawable’s contents.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDrawable/texture
type CAMetalLayer ¶
type CAMetalLayer struct {
CALayer
}
A Core Animation layer that Metal can render into, typically displayed onscreen.
Overview ¶
Use a CAMetalLayer when you want to use Metal to render a layer’s contents; for example, to render into a view. Consider using MTKView instead, because this class automatically wraps a CAMetalLayer object and provides a higher-level abstraction.
If you’re using UIKit, to create a view that uses a CAMetalLayer, create a subclass of UIView and override its [CAMetalLayer.LayerClass] class method to return a CAMetalLayer:
If you’re using AppKit, configure an NSView object to use a backing layer and assign a CAMetalLayer object to the view:
Adjust the layer’s properties to configure its underlying pixel format and other display behaviors.
Rendering the Layer’s Contents ¶
A CAMetalLayer creates a pool of Metal drawable objects (CAMetalDrawable). At any given time, one of these drawable objects contains the contents of the layer. To change the layer’s contents, ask the layer for a drawable object, render into it, and then update the layer’s contents to point to the new drawable.
Call the layer’s CAMetalLayer.NextDrawable method to obtain a drawable object. Get the drawable object’s texture and create a render pass that renders to that texture, as shown in the code below:
To change the layer’s contents to the new drawable, call the present(_:) method (or one of its variants) on the command buffer containing the encoded render pass, passing in the drawable object to present.
Keeping References to Drawables ¶
The layer reuses a drawable only if it isn’t onscreen and there are no strong references to it. Further, if a drawable isn’t available when you call CAMetalLayer.NextDrawable, the system waits for one to become available. To avoid stalls in your app, request a new drawable only when you need it, and release any references to it as quickly as possible after you’re done with it.
For example, before retrieving a new drawable, you might perform other work on the CPU or submit commands to the GPU that don’t require the drawable. Then, obtain the drawable and encode a command buffer to render into it, as described above. After you commit this command buffer, release all strong references to the drawable. If you don’t release drawables correctly, the layer runs out of drawables, and future calls to CAMetalLayer.NextDrawable return `nil`.
Releasing the Drawable ¶
Don’t release the drawable explicitly; instead, embed your render loop within an autorelease pool block:
This block releases drawables promptly and avoids possible deadlock situations with multiple drawables. Release drawables as soon as possible after committing your onscreen render pass.
Configuring the Metal Device ¶
- CAMetalLayer.Device: The Metal device responsible for the layer’s drawable resources.
- CAMetalLayer.SetDevice
- CAMetalLayer.PreferredDevice: The device object that the system recommends using for this layer.
Configuring the Layer’s Drawable Objects ¶
- CAMetalLayer.PixelFormat: The pixel format of the layer’s textures.
- CAMetalLayer.SetPixelFormat
- CAMetalLayer.Colorspace: The color space of the rendered content.
- CAMetalLayer.SetColorspace
- CAMetalLayer.FramebufferOnly: A Boolean value that determines whether the layer’s textures are used only for rendering.
- CAMetalLayer.SetFramebufferOnly
- CAMetalLayer.DrawableSize: The size, in pixels, of textures for rendering layer content.
- CAMetalLayer.SetDrawableSize
Configuring Presentation Behavior ¶
- CAMetalLayer.PresentsWithTransaction: A Boolean value that determines whether the layer presents its content using a Core Animation transaction.
- CAMetalLayer.SetPresentsWithTransaction
- CAMetalLayer.DisplaySyncEnabled: A Boolean value that determines whether the layer synchronizes its updates to the display’s refresh rate.
- CAMetalLayer.SetDisplaySyncEnabled
Configuring Extended Dynamic Range Behavior ¶
- CAMetalLayer.EDRMetadata: Metadata describing the tone mapping to apply to the extended dynamic range (EDR) values in the layer.
- CAMetalLayer.SetEDRMetadata
Obtaining a Metal Drawable ¶
- CAMetalLayer.NextDrawable: Waits until a Metal drawable is available, and then returns it.
- CAMetalLayer.MaximumDrawableCount: The number of Metal drawables in the resource pool managed by Core Animation.
- CAMetalLayer.SetMaximumDrawableCount
- CAMetalLayer.AllowsNextDrawableTimeout: A Boolean value that determines whether requests for a new buffer expire if the system can’t satisfy them.
- CAMetalLayer.SetAllowsNextDrawableTimeout
Configuring the Metal Performance HUD ¶
- CAMetalLayer.DeveloperHUDProperties: The properties of the Metal performance heads-up display.
- CAMetalLayer.SetDeveloperHUDProperties
Instance Properties ¶
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer
func CAMetalLayerFromID ¶
func CAMetalLayerFromID(id objc.ID) CAMetalLayer
CAMetalLayerFromID constructs a CAMetalLayer from an objc.ID.
A Core Animation layer that Metal can render into, typically displayed onscreen.
func NewCAMetalLayer ¶
func NewCAMetalLayer() CAMetalLayer
NewCAMetalLayer creates a new CAMetalLayer instance.
func NewMetalLayerWithLayer ¶
func NewMetalLayerWithLayer(layer objectivec.IObject) CAMetalLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CAMetalLayer) AllowsNextDrawableTimeout ¶
func (m CAMetalLayer) AllowsNextDrawableTimeout() bool
A Boolean value that determines whether requests for a new buffer expire if the system can’t satisfy them.
Discussion ¶
If true, the [NextDrawable] method returns nil if it can’t provide a drawable object within one second. If false, the [NextDrawable] method waits indefinitely for a drawable to become available.
The default value is true.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/allowsNextDrawableTimeout
func (CAMetalLayer) Autorelease ¶
func (m CAMetalLayer) Autorelease() CAMetalLayer
Autorelease adds the receiver to the current autorelease pool.
func (CAMetalLayer) Colorspace ¶
func (m CAMetalLayer) Colorspace() coregraphics.CGColorSpaceRef
The color space of the rendered content.
Discussion ¶
Set this value to specify a color space for the contents of the layer. When a color space is present, Core Animation performs any necessary color space transformations when compositing this content.
The default value is `nil`, indicating that the rendered content isn’t color-matched.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/colorspace
func (CAMetalLayer) DeveloperHUDProperties ¶
func (m CAMetalLayer) DeveloperHUDProperties() foundation.INSDictionary
The properties of the Metal performance heads-up display.
Discussion ¶
The Metal performance HUD provides real-time statistics and logging, including CPU and GPU render time and frame-presentation deadlines.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/developerHUDProperties
func (CAMetalLayer) Device ¶
func (m CAMetalLayer) Device() objectivec.IObject
The Metal device responsible for the layer’s drawable resources.
Discussion ¶
This property determines which device object Metal uses to create its MTLTexture objects. When you retrieve a drawable object and its associated texture, you must render to the texture using the same device object.
The default value is `nil`—you must set the device for a layer before rendering.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/device
func (CAMetalLayer) DisplaySyncEnabled ¶
func (m CAMetalLayer) DisplaySyncEnabled() bool
A Boolean value that determines whether the layer synchronizes its updates to the display’s refresh rate.
Discussion ¶
Set this value to true to synchronize the presentation of the layer’s contents with the display’s refresh, also known as or . If false, the layer presents new content more quickly, but possibly with brief visual artifacts ().
The default value is true.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/displaySyncEnabled
func (CAMetalLayer) DrawableID ¶
func (m CAMetalLayer) DrawableID() int
A positive integer that identifies the drawable.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/drawableID
func (CAMetalLayer) DrawableSize ¶
func (m CAMetalLayer) DrawableSize() corefoundation.CGSize
The size, in pixels, of textures for rendering layer content.
Discussion ¶
By default, a layer creates textures sized to match its content—that is, this property’s value is the layer’s [Bounds] size multiplied by its [ContentsScale] factor.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/drawableSize
func (CAMetalLayer) EDRMetadata ¶
func (m CAMetalLayer) EDRMetadata() ICAEDRMetadata
Metadata describing the tone mapping to apply to the extended dynamic range (EDR) values in the layer.
Discussion ¶
You must set this property before calling [NextDrawable].
The default value is `nil`, which means that the system doesn’t perform any tone mapping of data prior to passing it on to the display. Values above the maximum (maximumExtendedDynamicRangeColorComponentValue) may be clipped.
If non-`nil`, the system uses the metadata provided to tone map values to the display, based on the display’s current characteristics. You must also set [PixelFormat] to a pixel format that supports pixel values greater than `1.0` (such as MTLPixelFormat.rgba16Float) and colorspace to a color space that supports a linear transfer function.
The tone mapping process requires significant amounts of memory and GPU processing.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/edrMetadata
func (CAMetalLayer) FramebufferOnly ¶
func (m CAMetalLayer) FramebufferOnly() bool
A Boolean value that determines whether the layer’s textures are used only for rendering.
Discussion ¶
If the value is true (the default), the CAMetalLayer class allocates its MTLTexture objects with only the renderTarget usage flag. Core Animation can then optimize the texture for display purposes. However, you may not sample, read from, or write to those textures. To support sampling and pixel read/write operations (at a cost to performance), set this value to false.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/framebufferOnly
func (CAMetalLayer) MaximumDrawableCount ¶
func (m CAMetalLayer) MaximumDrawableCount() uint
The number of Metal drawables in the resource pool managed by Core Animation.
Discussion ¶
You can set this value to `2` or `3` only; if you pass a different value, Core Animation ignores the value and throws an exception.
The default value is `3`.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/maximumDrawableCount
func (CAMetalLayer) NextDrawable ¶
func (m CAMetalLayer) NextDrawable() CAMetalDrawable
Waits until a Metal drawable is available, and then returns it.
Return Value ¶
A Metal drawable. Use the drawable’s [Texture] property to configure a MTLRenderPipelineColorAttachmentDescriptor object for rendering to the layer.
Discussion ¶
A CAMetalLayer object maintains an internal pool of textures for displaying layer content, each wrapped in a CAMetalDrawable object. Use this method to retrieve the next available drawable from the pool. If all drawables are in use, the layer waits up to one second for one to become available, after which it returns `nil`. The [AllowsNextDrawableTimeout] property affects this behavior.
This method returns `nil` if the layer’s [PixelFormat] or other properties are invalid.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/nextDrawable()
func (CAMetalLayer) PixelFormat ¶
func (m CAMetalLayer) PixelFormat() objectivec.IObject
The pixel format of the layer’s textures.
Discussion ¶
The default value is MTLPixelFormat.bgra8Unorm.
You must use one of the following formats:
- MTLPixelFormat.bgra8Unorm - MTLPixelFormat.bgra8Unorm_srgb - MTLPixelFormat.rgba16Float - MTLPixelFormat.rgb10a2Unorm - MTLPixelFormat.bgr10a2Unorm - MTLPixelFormat.bgra10_xr - MTLPixelFormat.bgra10_xr_srgb - MTLPixelFormat.bgr10_xr - MTLPixelFormat.bgr10_xr_srgb
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/pixelFormat
func (CAMetalLayer) PreferredDevice ¶
func (m CAMetalLayer) PreferredDevice() objectivec.IObject
The device object that the system recommends using for this layer.
Discussion ¶
On systems with a single GPU, this method returns the default device object; see MTLCreateSystemDefaultDevice(). On systems with more than one GPU, this method returns the MTLDevice that was last used to composite and present the CAMetalLayer. This device object usually corresponds to the GPU associated with the screen that’s displaying the layer. If you set the layer’s [Device] property to this device object, you reduce the number of cross-GPU texture copies that Core Animation must perform to present the layer’s contents onscreen.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/preferredDevice
func (CAMetalLayer) PresentedTime ¶
func (m CAMetalLayer) PresentedTime() float64
The host time, in seconds, when the drawable was displayed onscreen.
See: https://developer.apple.com/documentation/Metal/MTLDrawable/presentedTime
func (CAMetalLayer) PresentsWithTransaction ¶
func (m CAMetalLayer) PresentsWithTransaction() bool
A Boolean value that determines whether the layer presents its content using a Core Animation transaction.
Discussion ¶
By default, this value is false; CAMetalLayer displays the output of a rendering pass to the display as quickly as possible and asynchronously to any Core Animation transactions. Core Animation doesn’t guarantee that the Metal content arrives in the same frame as other Core Animation content. This behavior could be an issue if, for example, your app draws UIKit content over the top of your CAMetalLayer.
Setting this value to true makes the layer draw its contents synchronously, using whichever Core Animation transaction is current at the time you call the drawable’s present() method. To ensure that a transaction is available when you schedule the drawable to be presented, first commit the command buffer containing your Metal rendering commands. Then, call its waitUntilScheduled() method to synchronously wait until the command queue schedules the command buffer to execute on the GPU. Finally, call the drawable’s present() method.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/presentsWithTransaction
func (CAMetalLayer) ResidencySet ¶
func (m CAMetalLayer) ResidencySet() objectivec.IObject
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer/residencySet
func (CAMetalLayer) SetAllowsNextDrawableTimeout ¶
func (m CAMetalLayer) SetAllowsNextDrawableTimeout(value bool)
func (CAMetalLayer) SetColorspace ¶
func (m CAMetalLayer) SetColorspace(value coregraphics.CGColorSpaceRef)
func (CAMetalLayer) SetDeveloperHUDProperties ¶
func (m CAMetalLayer) SetDeveloperHUDProperties(value foundation.INSDictionary)
func (CAMetalLayer) SetDevice ¶
func (m CAMetalLayer) SetDevice(value objectivec.IObject)
func (CAMetalLayer) SetDisplaySyncEnabled ¶
func (m CAMetalLayer) SetDisplaySyncEnabled(value bool)
func (CAMetalLayer) SetDrawableID ¶
func (m CAMetalLayer) SetDrawableID(value int)
func (CAMetalLayer) SetDrawableSize ¶
func (m CAMetalLayer) SetDrawableSize(value corefoundation.CGSize)
func (CAMetalLayer) SetEDRMetadata ¶
func (m CAMetalLayer) SetEDRMetadata(value ICAEDRMetadata)
func (CAMetalLayer) SetFramebufferOnly ¶
func (m CAMetalLayer) SetFramebufferOnly(value bool)
func (CAMetalLayer) SetMaximumDrawableCount ¶
func (m CAMetalLayer) SetMaximumDrawableCount(value uint)
func (CAMetalLayer) SetPixelFormat ¶
func (m CAMetalLayer) SetPixelFormat(value objectivec.IObject)
func (CAMetalLayer) SetPresentedTime ¶
func (m CAMetalLayer) SetPresentedTime(value float64)
func (CAMetalLayer) SetPresentsWithTransaction ¶
func (m CAMetalLayer) SetPresentsWithTransaction(value bool)
type CAMetalLayerClass ¶
type CAMetalLayerClass struct {
// contains filtered or unexported fields
}
func GetCAMetalLayerClass ¶
func GetCAMetalLayerClass() CAMetalLayerClass
GetCAMetalLayerClass returns the class object for CAMetalLayer.
func (CAMetalLayerClass) Alloc ¶
func (cc CAMetalLayerClass) Alloc() CAMetalLayer
Alloc allocates memory for a new instance of the class.
func (CAMetalLayerClass) LayerClass ¶
func (_CAMetalLayerClass CAMetalLayerClass) LayerClass() objc.Class
Returns the class used to create the layer for instances of this class.
See: https://developer.apple.com/documentation/UIKit/UIView/layerClass
func (CAMetalLayerClass) SetLayerClass ¶
func (_CAMetalLayerClass CAMetalLayerClass) SetLayerClass(value objc.Class)
type CAPropertyAnimation ¶
type CAPropertyAnimation struct {
CAAnimation
}
An abstract subclass for creating animations that manipulate the value of layer properties.
Overview ¶
The property to animate is specified using a key path that is relative to the layer using the animation.
You do not create instances of CAPropertyAnimation: to animate the properties of a Core Animation layer, create instance of the concrete subclasses CABasicAnimation or CAKeyframeAnimation.
Animated Key Path ¶
- CAPropertyAnimation.KeyPath: Specifies the key path the receiver animates.
- CAPropertyAnimation.SetKeyPath
Property Value Calculation Behavior ¶
- CAPropertyAnimation.Cumulative: Determines if the value of the property is the value at the end of the previous repeat cycle, plus the value of the current repeat cycle.
- CAPropertyAnimation.SetCumulative
- CAPropertyAnimation.Additive: Determines if the value specified by the animation is added to the current render tree value to produce the new render tree value.
- CAPropertyAnimation.SetAdditive
- CAPropertyAnimation.ValueFunction: An optional value function that is applied to interpolated values.
- CAPropertyAnimation.SetValueFunction
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation
func CAPropertyAnimationFromID ¶
func CAPropertyAnimationFromID(id objc.ID) CAPropertyAnimation
CAPropertyAnimationFromID constructs a CAPropertyAnimation from an objc.ID.
An abstract subclass for creating animations that manipulate the value of layer properties.
func NewCAPropertyAnimation ¶
func NewCAPropertyAnimation() CAPropertyAnimation
NewCAPropertyAnimation creates a new CAPropertyAnimation instance.
func NewPropertyAnimationWithKeyPath ¶
func NewPropertyAnimationWithKeyPath(path string) CAPropertyAnimation
Creates and returns an CAPropertyAnimation instance for the specified key path.
path: The key path of the property to be animated.
Return Value ¶
A new instance of CAPropertyAnimation with the key path set to `keyPath`.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/init(keyPath:)
func (CAPropertyAnimation) Additive ¶
func (p CAPropertyAnimation) Additive() bool
Determines if the value specified by the animation is added to the current render tree value to produce the new render tree value.
Discussion ¶
If true, the value specified by the animation will be added to the current render tree value of the property to produce the new render tree value. The addition function is type-dependent, e.g. for affine transforms the two matrices are concatenated. The default is false.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/isAdditive
func (CAPropertyAnimation) Autorelease ¶
func (p CAPropertyAnimation) Autorelease() CAPropertyAnimation
Autorelease adds the receiver to the current autorelease pool.
func (CAPropertyAnimation) Cumulative ¶
func (p CAPropertyAnimation) Cumulative() bool
Determines if the value of the property is the value at the end of the previous repeat cycle, plus the value of the current repeat cycle.
Discussion ¶
If true, then the value of the property is the value at the end of the previous repeat cycle, plus the value of the current repeat cycle. If false, the value of the property is simply the value calculated for the current repeat cycle. The default is false.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/isCumulative
func (CAPropertyAnimation) Init ¶
func (p CAPropertyAnimation) Init() CAPropertyAnimation
Init initializes the instance.
func (CAPropertyAnimation) KeyPath ¶
func (p CAPropertyAnimation) KeyPath() string
Specifies the key path the receiver animates.
Discussion ¶
The key path is relative to the layer the receiver is attached to.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/keyPath
func (CAPropertyAnimation) SetAdditive ¶
func (p CAPropertyAnimation) SetAdditive(value bool)
func (CAPropertyAnimation) SetCumulative ¶
func (p CAPropertyAnimation) SetCumulative(value bool)
func (CAPropertyAnimation) SetKeyPath ¶
func (p CAPropertyAnimation) SetKeyPath(value string)
func (CAPropertyAnimation) SetValueFunction ¶
func (p CAPropertyAnimation) SetValueFunction(value ICAValueFunction)
func (CAPropertyAnimation) ValueFunction ¶
func (p CAPropertyAnimation) ValueFunction() ICAValueFunction
An optional value function that is applied to interpolated values.
Discussion ¶
If the `valueFunction` property is not `nil`, the function is applied to the values interpolated by the animation as they are applied to the presentation layer. Defaults to `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/valueFunction
type CAPropertyAnimationClass ¶
type CAPropertyAnimationClass struct {
// contains filtered or unexported fields
}
func GetCAPropertyAnimationClass ¶
func GetCAPropertyAnimationClass() CAPropertyAnimationClass
GetCAPropertyAnimationClass returns the class object for CAPropertyAnimation.
func (CAPropertyAnimationClass) Alloc ¶
func (cc CAPropertyAnimationClass) Alloc() CAPropertyAnimation
Alloc allocates memory for a new instance of the class.
type CARemoteLayerClient ¶
type CARemoteLayerClient struct {
objectivec.Object
}
A legacy class for cross-process rendering.
Overview ¶
[CARemoteLaterClient] is a legacy class for cross-process rendering. IOSurfaceCreateMachPort(_:) and IOSurfaceCreateXPCObject(_:), available with IOSurface, offer an improved way to perform cross-process rendering.
Creating a Client ¶
- CARemoteLayerClient.InitWithServerPort: Creates a layer client from a server port.
Retrieving Client Properties ¶
- CARemoteLayerClient.ClientId: The ID of the remote layer client.
- CARemoteLayerClient.Layer: The layer associated with the remote client.
- CARemoteLayerClient.SetLayer
Invalidating a Client ¶
- CARemoteLayerClient.Invalidate: Invalidates a remote layer client.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient
func CARemoteLayerClientFromID ¶
func CARemoteLayerClientFromID(id objc.ID) CARemoteLayerClient
CARemoteLayerClientFromID constructs a CARemoteLayerClient from an objc.ID.
A legacy class for cross-process rendering.
func NewCARemoteLayerClient ¶
func NewCARemoteLayerClient() CARemoteLayerClient
NewCARemoteLayerClient creates a new CARemoteLayerClient instance.
func NewRemoteLayerClientWithServerPort ¶
func NewRemoteLayerClientWithServerPort(port uint32) CARemoteLayerClient
Creates a layer client from a server port.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient/init(serverPort:)
func (CARemoteLayerClient) Autorelease ¶
func (r CARemoteLayerClient) Autorelease() CARemoteLayerClient
Autorelease adds the receiver to the current autorelease pool.
func (CARemoteLayerClient) ClientId ¶
func (r CARemoteLayerClient) ClientId() uint32
The ID of the remote layer client.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient/clientId
func (CARemoteLayerClient) Init ¶
func (r CARemoteLayerClient) Init() CARemoteLayerClient
Init initializes the instance.
func (CARemoteLayerClient) InitWithServerPort ¶
func (r CARemoteLayerClient) InitWithServerPort(port uint32) CARemoteLayerClient
Creates a layer client from a server port.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient/init(serverPort:)
func (CARemoteLayerClient) Invalidate ¶
func (r CARemoteLayerClient) Invalidate()
Invalidates a remote layer client.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient/invalidate()
func (CARemoteLayerClient) Layer ¶
func (r CARemoteLayerClient) Layer() ICALayer
The layer associated with the remote client.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient/layer
func (CARemoteLayerClient) SetLayer ¶
func (r CARemoteLayerClient) SetLayer(value ICALayer)
type CARemoteLayerClientClass ¶
type CARemoteLayerClientClass struct {
// contains filtered or unexported fields
}
func GetCARemoteLayerClientClass ¶
func GetCARemoteLayerClientClass() CARemoteLayerClientClass
GetCARemoteLayerClientClass returns the class object for CARemoteLayerClient.
func (CARemoteLayerClientClass) Alloc ¶
func (cc CARemoteLayerClientClass) Alloc() CARemoteLayerClient
Alloc allocates memory for a new instance of the class.
type CARemoteLayerServer ¶
type CARemoteLayerServer struct {
objectivec.Object
}
A legacy class for cross-process rendering.
Overview ¶
[CARemoteLaterServer] is a legacy class for cross-process rendering. IOSurfaceCreateMachPort(_:) and IOSurfaceCreateXPCObject(_:), available with IOSurface, offer an improved way to perform cross-process rendering.
Creating a Server ¶
- CARemoteLayerServer.ServerPort: The port number of the server.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerServer
func CARemoteLayerServerFromID ¶
func CARemoteLayerServerFromID(id objc.ID) CARemoteLayerServer
CARemoteLayerServerFromID constructs a CARemoteLayerServer from an objc.ID.
A legacy class for cross-process rendering.
func NewCARemoteLayerServer ¶
func NewCARemoteLayerServer() CARemoteLayerServer
NewCARemoteLayerServer creates a new CARemoteLayerServer instance.
func (CARemoteLayerServer) Autorelease ¶
func (r CARemoteLayerServer) Autorelease() CARemoteLayerServer
Autorelease adds the receiver to the current autorelease pool.
func (CARemoteLayerServer) Init ¶
func (r CARemoteLayerServer) Init() CARemoteLayerServer
Init initializes the instance.
func (CARemoteLayerServer) ServerPort ¶
func (r CARemoteLayerServer) ServerPort() uint32
The port number of the server.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerServer/serverPort
type CARemoteLayerServerClass ¶
type CARemoteLayerServerClass struct {
// contains filtered or unexported fields
}
func GetCARemoteLayerServerClass ¶
func GetCARemoteLayerServerClass() CARemoteLayerServerClass
GetCARemoteLayerServerClass returns the class object for CARemoteLayerServer.
func (CARemoteLayerServerClass) Alloc ¶
func (cc CARemoteLayerServerClass) Alloc() CARemoteLayerServer
Alloc allocates memory for a new instance of the class.
func (CARemoteLayerServerClass) SharedServer ¶
func (_CARemoteLayerServerClass CARemoteLayerServerClass) SharedServer() CARemoteLayerServer
Returns the (singleton) instance of the shared remote layer server.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerServer/shared()
type CARenderer ¶
type CARenderer struct {
objectivec.Object
}
A layer that allows an application to render a layer tree into a Core OpenGL context.
Overview ¶
For real-time output you should use an instance of NSView to host the layer-tree.
Getting the Rendered Layer ¶
- CARenderer.Layer: The root layer of the layer-tree the receiver should render.
- CARenderer.SetLayer
Determining Layer Bounds ¶
- CARenderer.Bounds: The bounds of the receiver.
- CARenderer.SetBounds
Rendering a Frame ¶
- CARenderer.BeginFrameAtTimeTimeStamp: Begin rendering a frame at the specified time.
- CARenderer.UpdateBounds: Returns the bounds of the update region that contains all pixels that will be rendered by the current frame.
- CARenderer.AddUpdateRect: Adds the rectangle to the update region of the current frame.
- CARenderer.Render: Render the update region of the current frame to the target context.
- CARenderer.NextFrameTime: Returns the time at which the next update should happen.
- CARenderer.EndFrame: Release any data associated with the current frame.
Instance Methods ¶
See: https://developer.apple.com/documentation/QuartzCore/CARenderer
func CARendererFromID ¶
func CARendererFromID(id objc.ID) CARenderer
CARendererFromID constructs a CARenderer from an objc.ID.
A layer that allows an application to render a layer tree into a Core OpenGL context.
func NewCARenderer ¶
func NewCARenderer() CARenderer
NewCARenderer creates a new CARenderer instance.
func NewRendererWithMTLTextureOptions ¶
func NewRendererWithMTLTextureOptions(tex objectivec.IObject, dict foundation.INSDictionary) CARenderer
Creates a layer renderer from a Metal texture.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/init(mtlTexture:options:)
func (CARenderer) AddUpdateRect ¶
func (r_ CARenderer) AddUpdateRect(r corefoundation.CGRect)
Adds the rectangle to the update region of the current frame.
r: A rectangle defining the region to be added to the update region.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/addUpdate(_:)
func (CARenderer) Autorelease ¶
func (r CARenderer) Autorelease() CARenderer
Autorelease adds the receiver to the current autorelease pool.
func (CARenderer) BeginFrameAtTimeTimeStamp ¶
func (r CARenderer) BeginFrameAtTimeTimeStamp(t float64, ts *corevideo.CVTimeStamp)
Begin rendering a frame at the specified time.
t: The layer time.
ts: The display timestamp associated with timeInterval. Can be null.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/beginFrame(atTime:timeStamp:)
func (CARenderer) Bounds ¶
func (r CARenderer) Bounds() corefoundation.CGRect
The bounds of the receiver.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/bounds
func (CARenderer) EndFrame ¶
func (r CARenderer) EndFrame()
Release any data associated with the current frame.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/endFrame()
func (CARenderer) Layer ¶
func (r CARenderer) Layer() ICALayer
The root layer of the layer-tree the receiver should render.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/layer
func (CARenderer) NextFrameTime ¶
func (r CARenderer) NextFrameTime() float64
Returns the time at which the next update should happen.
Return Value ¶
The time at which the next update should happen.
Discussion ¶
If infinite, no update needs to be scheduled yet. If `nextFrameTime` is the current frame time, a continuous animation is running and an update should be scheduled after an appropriate delay.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/nextFrameTime()
func (CARenderer) Render ¶
func (r CARenderer) Render()
Render the update region of the current frame to the target context.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/render()
func (CARenderer) SetBounds ¶
func (r CARenderer) SetBounds(value corefoundation.CGRect)
func (CARenderer) SetDestination ¶
func (r CARenderer) SetDestination(tex objectivec.IObject)
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/setDestination(_:)
func (CARenderer) SetLayer ¶
func (r CARenderer) SetLayer(value ICALayer)
func (CARenderer) UpdateBounds ¶
func (r CARenderer) UpdateBounds() corefoundation.CGRect
Returns the bounds of the update region that contains all pixels that will be rendered by the current frame.
Return Value ¶
The bounds of the update region..
Discussion ¶
Initially `updateBounds` will include all differences between the current frame and the previously rendered frame.
See: https://developer.apple.com/documentation/QuartzCore/CARenderer/updateBounds()
type CARendererClass ¶
type CARendererClass struct {
// contains filtered or unexported fields
}
func GetCARendererClass ¶
func GetCARendererClass() CARendererClass
GetCARendererClass returns the class object for CARenderer.
func (CARendererClass) Alloc ¶
func (cc CARendererClass) Alloc() CARenderer
Alloc allocates memory for a new instance of the class.
type CAReplicatorLayer ¶
type CAReplicatorLayer struct {
CALayer
}
A layer that creates a specified number of sublayer copies with varying geometric, temporal, and color transformations.
Overview ¶
You can use a CAReplicatorLayer object to build complex layouts based on a single source layer that is replicated with transformation rules that can affect the position, rotation color, and time.
The following shows a simple example: a red square is added to a replicator layer with an instance count of `5`. The position of each replicated instance is offset along the `x` axis so that it appears to the right of the previous instance. The blue and green color channels are offset so that their values reach `0` at the final instance.
The result of the code above is a row of five squares, with colors graduating from white to red.
[media-2776906]
Replicator layers can be nested. The following code adds `replicatorLayer` to a second replicator layer that offsets the position of each instance vertically and subtracts from the red channel.
The result of adding this code is to create a grid with the value of the red channel being reduced in the vertical direction.
[media-2776908]
Setting Instance Display Properties ¶
- CAReplicatorLayer.InstanceCount: The number of copies to create, including the source layers.
- CAReplicatorLayer.SetInstanceCount
- CAReplicatorLayer.InstanceDelay: Specifies the delay, in seconds, between replicated copies. Animatable.
- CAReplicatorLayer.SetInstanceDelay
- CAReplicatorLayer.InstanceTransform: The transform matrix applied to the previous instance to produce the current instance. Animatable.
- CAReplicatorLayer.SetInstanceTransform
Modifying Instance Layer Geometry ¶
- CAReplicatorLayer.PreservesDepth: Defines whether this layer flattens its sublayers into its plane.
- CAReplicatorLayer.SetPreservesDepth
Accessing Instance Color Values ¶
- CAReplicatorLayer.InstanceColor: Defines the color used to multiply the source object. Animatable.
- CAReplicatorLayer.SetInstanceColor
- CAReplicatorLayer.InstanceRedOffset: Defines the offset added to the red component of the color for each replicated instance. Animatable.
- CAReplicatorLayer.SetInstanceRedOffset
- CAReplicatorLayer.InstanceGreenOffset: Defines the offset added to the green component of the color for each replicated instance. Animatable.
- CAReplicatorLayer.SetInstanceGreenOffset
- CAReplicatorLayer.InstanceBlueOffset: Defines the offset added to the blue component of the color for each replicated instance. Animatable.
- CAReplicatorLayer.SetInstanceBlueOffset
- CAReplicatorLayer.InstanceAlphaOffset: Defines the offset added to the alpha component of the color for each replicated instance. Animatable.
- CAReplicatorLayer.SetInstanceAlphaOffset
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer
func CAReplicatorLayerFromID ¶
func CAReplicatorLayerFromID(id objc.ID) CAReplicatorLayer
CAReplicatorLayerFromID constructs a CAReplicatorLayer from an objc.ID.
A layer that creates a specified number of sublayer copies with varying geometric, temporal, and color transformations.
func NewCAReplicatorLayer ¶
func NewCAReplicatorLayer() CAReplicatorLayer
NewCAReplicatorLayer creates a new CAReplicatorLayer instance.
func NewReplicatorLayerWithLayer ¶
func NewReplicatorLayerWithLayer(layer objectivec.IObject) CAReplicatorLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CAReplicatorLayer) Autorelease ¶
func (r CAReplicatorLayer) Autorelease() CAReplicatorLayer
Autorelease adds the receiver to the current autorelease pool.
func (CAReplicatorLayer) Init ¶
func (r CAReplicatorLayer) Init() CAReplicatorLayer
Init initializes the instance.
func (CAReplicatorLayer) InstanceAlphaOffset ¶
func (r CAReplicatorLayer) InstanceAlphaOffset() float32
Defines the offset added to the alpha component of the color for each replicated instance. Animatable.
Discussion ¶
The `instanceAlphaOffset` is added to the alpha color component of instance `k-1` to produce the modulation color of instance k.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceAlphaOffset
func (CAReplicatorLayer) InstanceBlueOffset ¶
func (r CAReplicatorLayer) InstanceBlueOffset() float32
Defines the offset added to the blue component of the color for each replicated instance. Animatable.
Discussion ¶
The `instanceBlueOffset` is added to the blue color component of instance `k-1` to produce the modulation color of instance k.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceBlueOffset
func (CAReplicatorLayer) InstanceColor ¶
func (r CAReplicatorLayer) InstanceColor() coregraphics.CGColorRef
Defines the color used to multiply the source object. Animatable.
Discussion ¶
Defaults to opaque white.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceColor
func (CAReplicatorLayer) InstanceCount ¶
func (r CAReplicatorLayer) InstanceCount() int
The number of copies to create, including the source layers.
Discussion ¶
Default value is `1`, no extra copies are created.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceCount
func (CAReplicatorLayer) InstanceDelay ¶
func (r CAReplicatorLayer) InstanceDelay() float64
Specifies the delay, in seconds, between replicated copies. Animatable.
Discussion ¶
The default value is `0.0`, meaning that any animations added to replicated copies will be synchronized.
The following code shows a replicator layer being used to create an animated activity monitor. The replicator layer creates 30 small circles forming a larger circle. The source layer, `circle`, has a 1 second animated fade out and each of the copies offsets the time of the animation by 1 / 30 seconds.
The following illustration shows the result of the above code:
[media-2776911]
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceDelay
func (CAReplicatorLayer) InstanceGreenOffset ¶
func (r CAReplicatorLayer) InstanceGreenOffset() float32
Defines the offset added to the green component of the color for each replicated instance. Animatable.
Discussion ¶
The `instanceGreenOffset` is added to the green color component of instance `k-1` to produce the modulation color of instance k.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceGreenOffset
func (CAReplicatorLayer) InstanceRedOffset ¶
func (r CAReplicatorLayer) InstanceRedOffset() float32
Defines the offset added to the red component of the color for each replicated instance. Animatable.
Discussion ¶
The `instanceRedOffset` is added to the red color component of instance `k-1` to produce the modulation color of instance k.
Default is `0.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceRedOffset
func (CAReplicatorLayer) InstanceTransform ¶
func (r CAReplicatorLayer) InstanceTransform() CATransform3D
The transform matrix applied to the previous instance to produce the current instance. Animatable.
Discussion ¶
This transform matrix is applied to instance `k-1` to produce instance `k`. The matrix is applied relative to the center of this layer.
Defaults to the identity matrix.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/instanceTransform
func (CAReplicatorLayer) PreservesDepth ¶
func (r CAReplicatorLayer) PreservesDepth() bool
Defines whether this layer flattens its sublayers into its plane.
Discussion ¶
If true, the layer acts similarly to the CATransformLayer and has the same restrictions.
Default is false.
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer/preservesDepth
func (CAReplicatorLayer) SetInstanceAlphaOffset ¶
func (r CAReplicatorLayer) SetInstanceAlphaOffset(value float32)
func (CAReplicatorLayer) SetInstanceBlueOffset ¶
func (r CAReplicatorLayer) SetInstanceBlueOffset(value float32)
func (CAReplicatorLayer) SetInstanceColor ¶
func (r CAReplicatorLayer) SetInstanceColor(value coregraphics.CGColorRef)
func (CAReplicatorLayer) SetInstanceCount ¶
func (r CAReplicatorLayer) SetInstanceCount(value int)
func (CAReplicatorLayer) SetInstanceDelay ¶
func (r CAReplicatorLayer) SetInstanceDelay(value float64)
func (CAReplicatorLayer) SetInstanceGreenOffset ¶
func (r CAReplicatorLayer) SetInstanceGreenOffset(value float32)
func (CAReplicatorLayer) SetInstanceRedOffset ¶
func (r CAReplicatorLayer) SetInstanceRedOffset(value float32)
func (CAReplicatorLayer) SetInstanceTransform ¶
func (r CAReplicatorLayer) SetInstanceTransform(value CATransform3D)
func (CAReplicatorLayer) SetPreservesDepth ¶
func (r CAReplicatorLayer) SetPreservesDepth(value bool)
type CAReplicatorLayerClass ¶
type CAReplicatorLayerClass struct {
// contains filtered or unexported fields
}
func GetCAReplicatorLayerClass ¶
func GetCAReplicatorLayerClass() CAReplicatorLayerClass
GetCAReplicatorLayerClass returns the class object for CAReplicatorLayer.
func (CAReplicatorLayerClass) Alloc ¶
func (cc CAReplicatorLayerClass) Alloc() CAReplicatorLayer
Alloc allocates memory for a new instance of the class.
type CAScrollLayer ¶
type CAScrollLayer struct {
CALayer
}
A layer that displays scrollable content larger than its own bounds.
Overview ¶
The CAScrollLayer class is a subclass of CALayer that simplifies displaying a portion of a layer. The extent of the scrollable area of the CAScrollLayer is defined by the layout of its sublayers. The visible portion of the layer content is set by specifying the origin as a point or a rectangular area of the contents to be displayed. CAScrollLayer does not provide keyboard or mouse event-handling, nor does it provide visible scrollers.
Scrolling constraints ¶
- CAScrollLayer.ScrollMode: Defines the axes in which the layer may be scrolled.
- CAScrollLayer.SetScrollMode
Scrolling the layer ¶
- CAScrollLayer.ScrollToPoint: Changes the origin of the receiver to the specified point.
- CAScrollLayer.ScrollToRect: Scroll the contents of the receiver to ensure that the rectangle is visible.
See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayer
func CAScrollLayerFromID ¶
func CAScrollLayerFromID(id objc.ID) CAScrollLayer
CAScrollLayerFromID constructs a CAScrollLayer from an objc.ID.
A layer that displays scrollable content larger than its own bounds.
func NewCAScrollLayer ¶
func NewCAScrollLayer() CAScrollLayer
NewCAScrollLayer creates a new CAScrollLayer instance.
func NewScrollLayerWithLayer ¶
func NewScrollLayerWithLayer(layer objectivec.IObject) CAScrollLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CAScrollLayer) Autorelease ¶
func (s CAScrollLayer) Autorelease() CAScrollLayer
Autorelease adds the receiver to the current autorelease pool.
func (CAScrollLayer) Init ¶
func (s CAScrollLayer) Init() CAScrollLayer
Init initializes the instance.
func (CAScrollLayer) ScrollMode ¶
func (s CAScrollLayer) ScrollMode() CAScrollLayerScrollMode
Defines the axes in which the layer may be scrolled.
Discussion ¶
The possible values are described in Scroll Modes. The default is both.
See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayer/scrollMode
func (CAScrollLayer) ScrollToPoint ¶
func (s CAScrollLayer) ScrollToPoint(p corefoundation.CGPoint)
Changes the origin of the receiver to the specified point.
p: The new origin.
See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayer/scroll(to:)-37q0p
func (CAScrollLayer) ScrollToRect ¶
func (s CAScrollLayer) ScrollToRect(r corefoundation.CGRect)
Scroll the contents of the receiver to ensure that the rectangle is visible.
r: The rectangle that should be visible.
See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayer/scroll(to:)-782vd
func (CAScrollLayer) SetScrollMode ¶
func (s CAScrollLayer) SetScrollMode(value CAScrollLayerScrollMode)
type CAScrollLayerClass ¶
type CAScrollLayerClass struct {
// contains filtered or unexported fields
}
func GetCAScrollLayerClass ¶
func GetCAScrollLayerClass() CAScrollLayerClass
GetCAScrollLayerClass returns the class object for CAScrollLayer.
func (CAScrollLayerClass) Alloc ¶
func (cc CAScrollLayerClass) Alloc() CAScrollLayer
Alloc allocates memory for a new instance of the class.
type CAScrollLayerScrollMode ¶
type CAScrollLayerScrollMode = string
See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayerScrollMode
var ( // KCAScrollBoth is the receiver is able to scroll both horizontally and vertically. // // See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayerScrollMode/both KCAScrollBoth CAScrollLayerScrollMode // KCAScrollHorizontally is the receiver is able to scroll horizontally. // // See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayerScrollMode/horizontally KCAScrollHorizontally CAScrollLayerScrollMode // KCAScrollNone is the receiver is unable to scroll. // // See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayerScrollMode/none KCAScrollNone CAScrollLayerScrollMode // KCAScrollVertically is the receiver is able to scroll vertically. // // See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayerScrollMode/vertically KCAScrollVertically CAScrollLayerScrollMode )
type CAShapeLayer ¶
type CAShapeLayer struct {
CALayer
}
A layer that draws a cubic Bezier spline in its coordinate space.
Overview ¶
The shape is composited between the layer’s contents and its first sublayer.
The shape will be drawn antialiased, and whenever possible it will be mapped into screen space before being rasterized to preserve resolution independence. However, certain kinds of image processing operations, such as CoreImage filters, applied to the layer or its ancestors may force rasterization in a local coordinate space.
The following code shows how you can build complex, composite paths and display them using a shape layer. In this example, a series of progressively transformed ellipses form a simple flower shape. The shape layer that displays the path has its CAShapeLayer.FillRule set to evenOdd which stops the overlapping “petals” from filling with the yellow CAShapeLayer.FillColor.
The following figure shows the resulting shape layer.
[media-2825196]
Specifying the Shape Path ¶
- CAShapeLayer.Path: The path defining the shape to be rendered. Animatable.
- CAShapeLayer.SetPath
Accessing Shape Style Properties ¶
- CAShapeLayer.FillColor: The color used to fill the shape’s path. Animatable.
- CAShapeLayer.SetFillColor
- CAShapeLayer.FillRule: The fill rule used when filling the shape’s path.
- CAShapeLayer.SetFillRule
- CAShapeLayer.LineCap: Specifies the line cap style for the shape’s path.
- CAShapeLayer.SetLineCap
- CAShapeLayer.LineDashPattern: The dash pattern applied to the shape’s path when stroked.
- CAShapeLayer.SetLineDashPattern
- CAShapeLayer.LineDashPhase: The dash phase applied to the shape’s path when stroked. Animatable.
- CAShapeLayer.SetLineDashPhase
- CAShapeLayer.LineJoin: Specifies the line join style for the shape’s path.
- CAShapeLayer.SetLineJoin
- CAShapeLayer.LineWidth: Specifies the line width of the shape’s path. Animatable.
- CAShapeLayer.SetLineWidth
- CAShapeLayer.MiterLimit: The miter limit used when stroking the shape’s path. Animatable.
- CAShapeLayer.SetMiterLimit
- CAShapeLayer.StrokeColor: The color used to stroke the shape’s path. Animatable.
- CAShapeLayer.SetStrokeColor
- CAShapeLayer.StrokeStart: The relative location at which to begin stroking the path. Animatable.
- CAShapeLayer.SetStrokeStart
- CAShapeLayer.StrokeEnd: The relative location at which to stop stroking the path. Animatable.
- CAShapeLayer.SetStrokeEnd
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer
func CAShapeLayerFromID ¶
func CAShapeLayerFromID(id objc.ID) CAShapeLayer
CAShapeLayerFromID constructs a CAShapeLayer from an objc.ID.
A layer that draws a cubic Bezier spline in its coordinate space.
func NewCAShapeLayer ¶
func NewCAShapeLayer() CAShapeLayer
NewCAShapeLayer creates a new CAShapeLayer instance.
func NewShapeLayerWithLayer ¶
func NewShapeLayerWithLayer(layer objectivec.IObject) CAShapeLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CAShapeLayer) Autorelease ¶
func (s CAShapeLayer) Autorelease() CAShapeLayer
Autorelease adds the receiver to the current autorelease pool.
func (CAShapeLayer) EvenOdd ¶
func (s CAShapeLayer) EvenOdd() CAShapeLayerFillRule
Specifies the even-odd winding rule. Count the total number of path crossings. If the number of crossings is even, the point is outside the path. If the number of crossings is odd, the point is inside the path and the region containing it should be filled.
See: https://developer.apple.com/documentation/quartzcore/cashapelayerfillrule/evenodd
func (CAShapeLayer) FillColor ¶
func (s CAShapeLayer) FillColor() coregraphics.CGColorRef
The color used to fill the shape’s path. Animatable.
Discussion ¶
Setting `fillColor` to `nil` results in no fill being rendered.
Default is opaque black.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/fillColor
func (CAShapeLayer) FillRule ¶
func (s CAShapeLayer) FillRule() CAShapeLayerFillRule
The fill rule used when filling the shape’s path.
Discussion ¶
The possible values are shown in Shape Fill Mode Values. The default is nonZero. See Winding Rules for examples of the two fill rules.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/fillRule
func (CAShapeLayer) LineCap ¶
func (s CAShapeLayer) LineCap() CAShapeLayerLineCap
Specifies the line cap style for the shape’s path.
Discussion ¶
The line cap style specifies the shape of the endpoints of an open path when stroked. The supported values are described in Line Cap Values. The following figure shows the appearance of the available line cap styles.
[media-1965770]
The default is butt.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/lineCap
func (CAShapeLayer) LineDashPattern ¶
func (s CAShapeLayer) LineDashPattern() []foundation.NSNumber
The dash pattern applied to the shape’s path when stroked.
Discussion ¶
The dash pattern is specified as an array of [NSNumber] objects that specify the lengths of the painted segments and unpainted segments, respectively, of the dash pattern.
For example, passing an array with the values `[2,3]` sets a dash pattern that alternates between a 2-user-space-unit-long painted segment and a 3-user-space-unit-long unpainted segment. Passing the values `[10,5,5,5]` sets the pattern to a 10-unit painted segment, a 5-unit unpainted segment, a 5-unit painted segment, and a 5-unit unpainted segment.
Default is `nil`, a solid line.
The following code shows how how you can create three shape layers using the dash patterns described above. Each shape layer contains a simple path that describes a horizontal line.
The following figure shows three shape layers created with the code above. The top solid line has a `nil` [LineDashPattern], the middle has `[2,3]` and the bottom has `[10,5,5,5]`.
[media-2825198]
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/lineDashPattern
func (CAShapeLayer) LineDashPhase ¶
func (s CAShapeLayer) LineDashPhase() float64
The dash phase applied to the shape’s path when stroked. Animatable.
Discussion ¶
Line dash phase specifies how far into the dash pattern the line starts.
Default is `0`.
The following code shows how you can create a “marching ant” effect by adding an animation to a shape layer that animates its [LineDashPhase] from `0` to the sum of the segment lengths of its [LineDashPattern].
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/lineDashPhase
func (CAShapeLayer) LineJoin ¶
func (s CAShapeLayer) LineJoin() CAShapeLayerLineJoin
Specifies the line join style for the shape’s path.
Discussion ¶
The line join style specifies the shape of the joints between connected segments of a stroked path. The supported values are described in Line Join Values. The following figure shows the appearance of the available line join styles.
[media-1965771]
The default is miter.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/lineJoin
func (CAShapeLayer) LineWidth ¶
func (s CAShapeLayer) LineWidth() float64
Specifies the line width of the shape’s path. Animatable.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/lineWidth
func (CAShapeLayer) MiterLimit ¶
func (s CAShapeLayer) MiterLimit() float64
The miter limit used when stroking the shape’s path. Animatable.
Discussion ¶
If the current line join style is set to miter (see [LineJoin]), the miter limit determines whether the lines should be joined with a bevel instead of a miter. The length of the miter is divided by the line width. If the result is greater than the miter limit, the path is drawn with a bevel.
Default is `10.0`.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/miterLimit
func (CAShapeLayer) Path ¶
func (s CAShapeLayer) Path() coregraphics.CGPathRef
The path defining the shape to be rendered. Animatable.
Discussion ¶
Unlike most animatable properties, [Path] (as with all CGPath animatable properties) does not support implicit animation.
The path object may be animated using any of the concrete subclasses of CAPropertyAnimation. Paths will interpolate as a linear blend of the “on-line” points; “off-line” points may be interpolated non-linearly (e.g. to preserve continuity of the curve’s derivative). If the two paths have a different number of control points or segments the results are undefined. If the path extends outside the layer bounds it will not automatically be clipped to the layer, only if the normal layer masking rules cause that.
The default value of this property is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/path
func (CAShapeLayer) SetFillColor ¶
func (s CAShapeLayer) SetFillColor(value coregraphics.CGColorRef)
func (CAShapeLayer) SetFillRule ¶
func (s CAShapeLayer) SetFillRule(value CAShapeLayerFillRule)
func (CAShapeLayer) SetLineCap ¶
func (s CAShapeLayer) SetLineCap(value CAShapeLayerLineCap)
func (CAShapeLayer) SetLineDashPattern ¶
func (s CAShapeLayer) SetLineDashPattern(value []foundation.NSNumber)
func (CAShapeLayer) SetLineDashPhase ¶
func (s CAShapeLayer) SetLineDashPhase(value float64)
func (CAShapeLayer) SetLineJoin ¶
func (s CAShapeLayer) SetLineJoin(value CAShapeLayerLineJoin)
func (CAShapeLayer) SetLineWidth ¶
func (s CAShapeLayer) SetLineWidth(value float64)
func (CAShapeLayer) SetMiterLimit ¶
func (s CAShapeLayer) SetMiterLimit(value float64)
func (CAShapeLayer) SetPath ¶
func (s CAShapeLayer) SetPath(value coregraphics.CGPathRef)
func (CAShapeLayer) SetStrokeColor ¶
func (s CAShapeLayer) SetStrokeColor(value coregraphics.CGColorRef)
func (CAShapeLayer) SetStrokeEnd ¶
func (s CAShapeLayer) SetStrokeEnd(value float64)
func (CAShapeLayer) SetStrokeStart ¶
func (s CAShapeLayer) SetStrokeStart(value float64)
func (CAShapeLayer) StrokeColor ¶
func (s CAShapeLayer) StrokeColor() coregraphics.CGColorRef
The color used to stroke the shape’s path. Animatable.
Discussion ¶
Setting `strokeColor` to `nil` results in no stroke being rendered.
Default is `nil`.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/strokeColor
func (CAShapeLayer) StrokeEnd ¶
func (s CAShapeLayer) StrokeEnd() float64
The relative location at which to stop stroking the path. Animatable.
Discussion ¶
The value of this property must be in the range 0.0 to 1.0. The default value of this property is 1.0.
Combined with the [StrokeStart] property, this property defines the subregion of the path to stroke. The value in this property indicates the relative point along the path at which to finish stroking while the [StrokeStart] property defines the starting point. A value of 0.0 represents the beginning of the path while a value of 1.0 represents the end of the path. Values in between are interpreted linearly along the path length.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/strokeEnd
func (CAShapeLayer) StrokeStart ¶
func (s CAShapeLayer) StrokeStart() float64
The relative location at which to begin stroking the path. Animatable.
Discussion ¶
The value of this property must be in the range 0.0 to 1.0. The default value of this property is 0.0.
Combined with the [StrokeEnd] property, this property defines the subregion of the path to stroke. The value in this property indicates the relative point along the path at which to begin stroking while the [StrokeEnd] property defines the end point. A value of 0.0 represents the beginning of the path while a value of 1.0 represents the end of the path. Values in between are interpreted linearly along the path length.
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer/strokeStart
type CAShapeLayerClass ¶
type CAShapeLayerClass struct {
// contains filtered or unexported fields
}
func GetCAShapeLayerClass ¶
func GetCAShapeLayerClass() CAShapeLayerClass
GetCAShapeLayerClass returns the class object for CAShapeLayer.
func (CAShapeLayerClass) Alloc ¶
func (cc CAShapeLayerClass) Alloc() CAShapeLayer
Alloc allocates memory for a new instance of the class.
type CAShapeLayerFillRule ¶
type CAShapeLayerFillRule = string
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerFillRule
var ( // KCAFillRuleEvenOdd is specifies the even-odd winding rule. Count the total number of path crossings. If the number of crossings is even, the point is outside the path. If the number of crossings is odd, the point is inside the path and the region containing it should be filled. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerFillRule/evenOdd KCAFillRuleEvenOdd CAShapeLayerFillRule // KCAFillRuleNonZero is specifies the non-zero winding rule. Count each left-to-right path as +1 and each right-to-left path as -1. If the sum of all crossings is 0, the point is outside the path. If the sum is nonzero, the point is inside the path and the region containing it is filled. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerFillRule/nonZero KCAFillRuleNonZero CAShapeLayerFillRule )
type CAShapeLayerLineCap ¶
type CAShapeLayerLineCap = string
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineCap
var ( // KCALineCapButt is specifies a butt line cap style for endpoints for an open path when stroked. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineCap/butt KCALineCapButt CAShapeLayerLineCap // KCALineCapRound is specifies a round line cap style for endpoints for an open path when stroked. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineCap/round KCALineCapRound CAShapeLayerLineCap // KCALineCapSquare is specifies a square line cap style for endpoints for an open path when stroked. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineCap/square KCALineCapSquare CAShapeLayerLineCap )
type CAShapeLayerLineJoin ¶
type CAShapeLayerLineJoin = string
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineJoin
var ( // KCALineJoinBevel is specifies a bevel line shape of the joints between connected segments of a stroked path. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineJoin/bevel KCALineJoinBevel CAShapeLayerLineJoin // KCALineJoinMiter is specifies a miter line shape of the joints between connected segments of a stroked path. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineJoin/miter KCALineJoinMiter CAShapeLayerLineJoin // KCALineJoinRound is specifies a round line shape of the joints between connected segments of a stroked path. // // See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayerLineJoin/round KCALineJoinRound CAShapeLayerLineJoin )
type CASpringAnimation ¶
type CASpringAnimation struct {
CABasicAnimation
}
An animation that applies a spring-like force to a layer’s properties.
Overview ¶
You would typically use a spring animation to animate a layer’s position so that it appears to be pulled towards a target by a spring. The further the layer is from the target, the greater the acceleration towards it is.
CASpringAnimation allows control over physically based attributes such as the spring’s damping and stiffness.
You can use a spring animation to animation properties of a layer other than its position. The following code shows how to create a spring animation that bounces a layer into view by animating its scale from `0` to `1`. Because the spring animation can overshoot its [CASpringAnimation.ToValue], the animated layer may exceed its frame.
Configuring Physical Attributes ¶
- CASpringAnimation.Damping: Defines how the spring’s motion should be damped due to the forces of friction.
- CASpringAnimation.SetDamping
- CASpringAnimation.InitialVelocity: The initial velocity of the object attached to the spring.
- CASpringAnimation.SetInitialVelocity
- CASpringAnimation.Mass: The mass of the object attached to the end of the spring.
- CASpringAnimation.SetMass
- CASpringAnimation.SettlingDuration: The estimated duration required for the spring system to be considered at rest.
- CASpringAnimation.Stiffness: The spring stiffness coefficient.
- CASpringAnimation.SetStiffness
Initializers ¶
Instance Properties ¶
- CASpringAnimation.AllowsOverdamping
- CASpringAnimation.SetAllowsOverdamping
- CASpringAnimation.Bounce
- CASpringAnimation.PerceptualDuration
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation
func CASpringAnimationFromID ¶
func CASpringAnimationFromID(id objc.ID) CASpringAnimation
CASpringAnimationFromID constructs a CASpringAnimation from an objc.ID.
An animation that applies a spring-like force to a layer’s properties.
func NewCASpringAnimation ¶
func NewCASpringAnimation() CASpringAnimation
NewCASpringAnimation creates a new CASpringAnimation instance.
func NewSpringAnimationWithKeyPath ¶
func NewSpringAnimationWithKeyPath(path string) CASpringAnimation
Creates and returns an CAPropertyAnimation instance for the specified key path.
path: The key path of the property to be animated.
Return Value ¶
A new instance of CAPropertyAnimation with the key path set to `keyPath`.
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation/init(keyPath:)
func NewSpringAnimationWithPerceptualDurationBounce ¶
func NewSpringAnimationWithPerceptualDurationBounce(perceptualDuration float64, bounce float64) CASpringAnimation
func (CASpringAnimation) AllowsOverdamping ¶
func (s CASpringAnimation) AllowsOverdamping() bool
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/allowsOverdamping
func (CASpringAnimation) Autorelease ¶
func (s CASpringAnimation) Autorelease() CASpringAnimation
Autorelease adds the receiver to the current autorelease pool.
func (CASpringAnimation) Bounce ¶
func (s CASpringAnimation) Bounce() float64
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/bounce
func (CASpringAnimation) Damping ¶
func (s CASpringAnimation) Damping() float64
Defines how the spring’s motion should be damped due to the forces of friction.
Discussion ¶
The default value of the [Damping] property is `10`. Reducing this value reduces the energy loss with each oscillation: the animated value will overshoot the [ToValue] and the [SettlingDuration] may be greater than the [Duration]. Increasing the value increases the energy loss with each duration: there will be fewer and smaller oscillations and the [SettlingDuration] may be smaller than the duration.
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/damping
func (CASpringAnimation) Init ¶
func (s CASpringAnimation) Init() CASpringAnimation
Init initializes the instance.
func (CASpringAnimation) InitWithPerceptualDurationBounce ¶
func (s CASpringAnimation) InitWithPerceptualDurationBounce(perceptualDuration float64, bounce float64) CASpringAnimation
func (CASpringAnimation) InitialVelocity ¶
func (s CASpringAnimation) InitialVelocity() float64
The initial velocity of the object attached to the spring.
Discussion ¶
Defaults to `0`, which represents an unmoving object. Negative values represent the object moving away from the spring attachment point, positive values represent the object moving towards the spring attachment point.
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/initialVelocity
func (CASpringAnimation) Mass ¶
func (s CASpringAnimation) Mass() float64
The mass of the object attached to the end of the spring.
Discussion ¶
The default mass is `1`. Increasing this value will increase the spring effect: the attached object will be subject to more oscillations and greater overshoot, resulting in an increased [SettlingDuration]. Decreasing the mass will reduce the spring effect: there will be fewer oscillations and a reduced overshoot, resulting in a decreased [SettlingDuration].
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/mass
func (CASpringAnimation) PerceptualDuration ¶
func (s CASpringAnimation) PerceptualDuration() float64
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/perceptualDuration
func (CASpringAnimation) SetAllowsOverdamping ¶
func (s CASpringAnimation) SetAllowsOverdamping(value bool)
func (CASpringAnimation) SetDamping ¶
func (s CASpringAnimation) SetDamping(value float64)
func (CASpringAnimation) SetInitialVelocity ¶
func (s CASpringAnimation) SetInitialVelocity(value float64)
func (CASpringAnimation) SetMass ¶
func (s CASpringAnimation) SetMass(value float64)
func (CASpringAnimation) SetStiffness ¶
func (s CASpringAnimation) SetStiffness(value float64)
func (CASpringAnimation) SettlingDuration ¶
func (s CASpringAnimation) SettlingDuration() float64
The estimated duration required for the spring system to be considered at rest.
Discussion ¶
The duration is evaluated for the current animation parameters and may not the same as the [Duration].
The following code creates a spring animation with a [Duration] of 2 seconds.
With a damping coefficient of `5`, the settling duration is approximately 2.85 seconds: the animated layer bounces around the target position several times before settling. However, changing the [Damping] property to `15` reduces the settling duration to just over 1 second: the animated layer quickly comes to a stop as it reaches the target position.
All of the spring animation’s physical attributes: [Damping], [InitialVelocity], [Mass] and [Stiffness], can affect the settling duration.
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/settlingDuration
func (CASpringAnimation) Stiffness ¶
func (s CASpringAnimation) Stiffness() float64
The spring stiffness coefficient.
Discussion ¶
The default stiffness coefficient is `100`. Increasing the [Stiffness] reduces the number of oscillations and will reduce the settling duration. Decreasing the [Stiffness] increases the the number of oscillations and will increase the settling duration.
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation/stiffness
type CASpringAnimationClass ¶
type CASpringAnimationClass struct {
// contains filtered or unexported fields
}
func GetCASpringAnimationClass ¶
func GetCASpringAnimationClass() CASpringAnimationClass
GetCASpringAnimationClass returns the class object for CASpringAnimation.
func (CASpringAnimationClass) Alloc ¶
func (cc CASpringAnimationClass) Alloc() CASpringAnimation
Alloc allocates memory for a new instance of the class.
type CATextLayer ¶
type CATextLayer struct {
CALayer
}
A layer that provides simple text layout and rendering of plain or attributed strings.
Overview ¶
The first line is aligned to the top of the layer.
Text Visual Properties ¶
- CATextLayer.Font: The font used to render the receiver’s text.
- CATextLayer.SetFont
- CATextLayer.FontSize: The font size used to render the receiver’s text. Animatable.
- CATextLayer.SetFontSize
- CATextLayer.ForegroundColor: The color used to render the receiver’s text. Animatable.
- CATextLayer.SetForegroundColor
- CATextLayer.AllowsFontSubpixelQuantization: Determines whether to allow subpixel quantization for the graphics context used for text rendering.
- CATextLayer.SetAllowsFontSubpixelQuantization
Text Alignment and Truncation ¶
- CATextLayer.Wrapped: Determines whether the text is wrapped to fit within the receiver’s bounds.
- CATextLayer.SetWrapped
- CATextLayer.AlignmentMode: Determines how individual lines of text are horizontally aligned within the receiver’s bounds.
- CATextLayer.SetAlignmentMode
- CATextLayer.TruncationMode: Determines how the text is truncated to fit within the receiver’s bounds.
- CATextLayer.SetTruncationMode
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer
func CATextLayerFromID ¶
func CATextLayerFromID(id objc.ID) CATextLayer
CATextLayerFromID constructs a CATextLayer from an objc.ID.
A layer that provides simple text layout and rendering of plain or attributed strings.
func NewCATextLayer ¶
func NewCATextLayer() CATextLayer
NewCATextLayer creates a new CATextLayer instance.
func NewTextLayerWithLayer ¶
func NewTextLayerWithLayer(layer objectivec.IObject) CATextLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CATextLayer) AlignmentMode ¶
func (t CATextLayer) AlignmentMode() CATextLayerAlignmentMode
Determines how individual lines of text are horizontally aligned within the receiver’s bounds.
Discussion ¶
The possible values are described in Horizontal alignment modes. Defaults to natural.
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/alignmentMode
func (CATextLayer) AllowsFontSubpixelQuantization ¶
func (t CATextLayer) AllowsFontSubpixelQuantization() bool
Determines whether to allow subpixel quantization for the graphics context used for text rendering.
Discussion ¶
When enabled, the graphics context used for text rendering may quantize the subpixel positions of glyphs.
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/allowsFontSubpixelQuantization
func (CATextLayer) Autorelease ¶
func (t CATextLayer) Autorelease() CATextLayer
Autorelease adds the receiver to the current autorelease pool.
func (CATextLayer) Font ¶
func (t CATextLayer) Font() corefoundation.CFTypeRef
The font used to render the receiver’s text.
Discussion ¶
May be either a CTFont, a CGFont, an instance of [NSFont] (macOS only), or a string naming the font. In iOS, you cannot assign a UIFont object to this property. Defaults to Helvetica.
The `font` property is only used when the [String] property is not an [NSAttributedString].
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/font
func (CATextLayer) FontSize ¶
func (t CATextLayer) FontSize() float64
The font size used to render the receiver’s text. Animatable.
Discussion ¶
Defaults to 36.0.
The `fontSize` property is only used when the [String] property is not an [NSAttributedString].
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/fontSize
func (CATextLayer) ForegroundColor ¶
func (t CATextLayer) ForegroundColor() coregraphics.CGColorRef
The color used to render the receiver’s text. Animatable.
Discussion ¶
Defaults to opaque white.
The `foregroundColor` property is only used when the [String] property is not an [NSAttributedString].
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/foregroundColor
func (CATextLayer) SetAlignmentMode ¶
func (t CATextLayer) SetAlignmentMode(value CATextLayerAlignmentMode)
func (CATextLayer) SetAllowsFontSubpixelQuantization ¶
func (t CATextLayer) SetAllowsFontSubpixelQuantization(value bool)
func (CATextLayer) SetFont ¶
func (t CATextLayer) SetFont(value corefoundation.CFTypeRef)
func (CATextLayer) SetFontSize ¶
func (t CATextLayer) SetFontSize(value float64)
func (CATextLayer) SetForegroundColor ¶
func (t CATextLayer) SetForegroundColor(value coregraphics.CGColorRef)
func (CATextLayer) SetTruncationMode ¶
func (t CATextLayer) SetTruncationMode(value CATextLayerTruncationMode)
func (CATextLayer) SetWrapped ¶
func (t CATextLayer) SetWrapped(value bool)
func (CATextLayer) TruncationMode ¶
func (t CATextLayer) TruncationMode() CATextLayerTruncationMode
Determines how the text is truncated to fit within the receiver’s bounds.
Discussion ¶
The possible values are described in Truncation modes. Defaults to none.
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/truncationMode
func (CATextLayer) Wrapped ¶
func (t CATextLayer) Wrapped() bool
Determines whether the text is wrapped to fit within the receiver’s bounds.
Discussion ¶
Defaults to false.
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer/isWrapped
type CATextLayerAlignmentMode ¶
type CATextLayerAlignmentMode = string
See: https://developer.apple.com/documentation/QuartzCore/CATextLayerAlignmentMode
var ( // KCAAlignmentCenter is text is visually center aligned. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerAlignmentMode/center KCAAlignmentCenter CATextLayerAlignmentMode // KCAAlignmentJustified is text is justified. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerAlignmentMode/justified KCAAlignmentJustified CATextLayerAlignmentMode // KCAAlignmentLeft is text is visually left aligned. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerAlignmentMode/left KCAAlignmentLeft CATextLayerAlignmentMode // KCAAlignmentNatural is use the natural alignment of the text’s script. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerAlignmentMode/natural KCAAlignmentNatural CATextLayerAlignmentMode // KCAAlignmentRight is text is visually right aligned. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerAlignmentMode/right KCAAlignmentRight CATextLayerAlignmentMode )
type CATextLayerClass ¶
type CATextLayerClass struct {
// contains filtered or unexported fields
}
func GetCATextLayerClass ¶
func GetCATextLayerClass() CATextLayerClass
GetCATextLayerClass returns the class object for CATextLayer.
func (CATextLayerClass) Alloc ¶
func (cc CATextLayerClass) Alloc() CATextLayer
Alloc allocates memory for a new instance of the class.
type CATextLayerTruncationMode ¶
type CATextLayerTruncationMode = string
See: https://developer.apple.com/documentation/QuartzCore/CATextLayerTruncationMode
var ( // KCATruncationEnd is each line is displayed so that the beginning fits in the container and the missing text is indicated by some kind of ellipsis glyph. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerTruncationMode/end KCATruncationEnd CATextLayerTruncationMode // KCATruncationMiddle is each line is displayed so that the beginning and end fit in the container and the missing text is indicated by some kind of ellipsis glyph in the middle. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerTruncationMode/middle KCATruncationMiddle CATextLayerTruncationMode // KCATruncationNone is each line is displayed so that the text is either wrapped or clipped. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerTruncationMode/none KCATruncationNone CATextLayerTruncationMode // KCATruncationStart is each line is displayed so that the end fits in the container and the missing text is indicated by some kind of ellipsis glyph. // // See: https://developer.apple.com/documentation/QuartzCore/CATextLayerTruncationMode/start KCATruncationStart CATextLayerTruncationMode )
type CATiledLayer ¶
type CATiledLayer struct {
CALayer
}
A layer that provides a way to asynchronously provide tiles of the layer’s content, potentially cached at multiple levels of detail.
Overview ¶
As more data is required by the renderer, the layer’s [DrawInContext] method is called on one or more background threads to supply the drawing operations to fill in one tile of data. The clip bounds and current transformation matrix (CTM) of the drawing context can be used to determine the bounds and resolution of the tile being requested.
Regions of the layer may be invalidated using the [SetNeedsDisplayInRect] method however the update will be asynchronous. While the next display update will most likely not contain the updated content, a future update will.
Levels of detail ¶
- CATiledLayer.LevelsOfDetail: The number of levels of detail maintained by this layer.
- CATiledLayer.SetLevelsOfDetail
- CATiledLayer.LevelsOfDetailBias: The number of magnified levels of detail for this layer.
- CATiledLayer.SetLevelsOfDetailBias
Layer tile size ¶
- CATiledLayer.TileSize: The maximum size of each tile used to create the layer’s content.
- CATiledLayer.SetTileSize
See: https://developer.apple.com/documentation/QuartzCore/CATiledLayer
func CATiledLayerFromID ¶
func CATiledLayerFromID(id objc.ID) CATiledLayer
CATiledLayerFromID constructs a CATiledLayer from an objc.ID.
A layer that provides a way to asynchronously provide tiles of the layer’s content, potentially cached at multiple levels of detail.
func NewCATiledLayer ¶
func NewCATiledLayer() CATiledLayer
NewCATiledLayer creates a new CATiledLayer instance.
func NewTiledLayerWithLayer ¶
func NewTiledLayerWithLayer(layer objectivec.IObject) CATiledLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CATiledLayer) Autorelease ¶
func (t CATiledLayer) Autorelease() CATiledLayer
Autorelease adds the receiver to the current autorelease pool.
func (CATiledLayer) LevelsOfDetail ¶
func (t CATiledLayer) LevelsOfDetail() uintptr
The number of levels of detail maintained by this layer.
Discussion ¶
Defaults to 1. Each level of detail is half the resolution of the previous level. If too many levels are specified for the current size of the layer, then the number of levels is clamped to the maximum value (the bottom most level of detail must contain at least a single pixel in each dimension.)
See: https://developer.apple.com/documentation/QuartzCore/CATiledLayer/levelsOfDetail
func (CATiledLayer) LevelsOfDetailBias ¶
func (t CATiledLayer) LevelsOfDetailBias() uintptr
The number of magnified levels of detail for this layer.
Discussion ¶
Defaults to 0. Each previous level of detail is twice the resolution of the later. For example, specifying a value of 2 means that the layer has two extra levels of detail: 2x and 4x.
See: https://developer.apple.com/documentation/QuartzCore/CATiledLayer/levelsOfDetailBias
func (CATiledLayer) SetLevelsOfDetail ¶
func (t CATiledLayer) SetLevelsOfDetail(value uintptr)
func (CATiledLayer) SetLevelsOfDetailBias ¶
func (t CATiledLayer) SetLevelsOfDetailBias(value uintptr)
func (CATiledLayer) SetTileSize ¶
func (t CATiledLayer) SetTileSize(value corefoundation.CGSize)
func (CATiledLayer) TileSize ¶
func (t CATiledLayer) TileSize() corefoundation.CGSize
The maximum size of each tile used to create the layer’s content.
Discussion ¶
Defaults to (256.0, 256.0).
See: https://developer.apple.com/documentation/QuartzCore/CATiledLayer/tileSize
type CATiledLayerClass ¶
type CATiledLayerClass struct {
// contains filtered or unexported fields
}
func GetCATiledLayerClass ¶
func GetCATiledLayerClass() CATiledLayerClass
GetCATiledLayerClass returns the class object for CATiledLayer.
func (CATiledLayerClass) Alloc ¶
func (cc CATiledLayerClass) Alloc() CATiledLayer
Alloc allocates memory for a new instance of the class.
func (CATiledLayerClass) FadeDuration ¶
func (_CATiledLayerClass CATiledLayerClass) FadeDuration() float64
The time, in seconds, that newly added images take to “fade-in” to the rendered representation of the tiled layer.
Discussion ¶
The default implementation returns 0.25 seconds.
See: https://developer.apple.com/documentation/QuartzCore/CATiledLayer/fadeDuration()
type CATransaction ¶
type CATransaction struct {
objectivec.Object
}
A mechanism for grouping multiple layer-tree operations into atomic updates to the render tree.
Overview ¶
CATransaction is the Core Animation mechanism for batching multiple layer-tree operations into atomic updates to the render tree. Every modification to a layer tree must be part of a transaction. Nested transactions are supported.
Core Animation supports two types of transactions: transactions and transactions. Implicit transactions are created automatically when the layer tree is modified by a thread without an active transaction and are committed automatically when the thread’s runloop next iterates. Explicit transactions occur when the the application sends the CATransaction class a [CATransaction.Begin] message before modifying the layer tree, and a [CATransaction.Commit] message afterwards.
CATransaction allows you to override default animation properties that are set for animatable properties. You can customize duration, timing function, whether changes to properties trigger animations, and provide a handler that informs you when all animations from the transaction group are completed.
During a transaction you can temporarily acquire a recursive spin lock for managing property atomicity.
CATransaction supports nested transactions. The following code shows how you can fade out a layer (named `transitioningLayer`) over a 2 second duration while scaling it to three times its original size. The scale animation is within a nested transaction with its own duration of 1 second. After the outer transaction completes, a completion block removes `transitioningLayer` from its parent layer.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction
func CATransactionFromID ¶
func CATransactionFromID(id objc.ID) CATransaction
CATransactionFromID constructs a CATransaction from an objc.ID.
A mechanism for grouping multiple layer-tree operations into atomic updates to the render tree.
func NewCATransaction ¶
func NewCATransaction() CATransaction
NewCATransaction creates a new CATransaction instance.
func (CATransaction) Autorelease ¶
func (t CATransaction) Autorelease() CATransaction
Autorelease adds the receiver to the current autorelease pool.
func (CATransaction) Init ¶
func (t CATransaction) Init() CATransaction
Init initializes the instance.
type CATransactionClass ¶
type CATransactionClass struct {
// contains filtered or unexported fields
}
func GetCATransactionClass ¶
func GetCATransactionClass() CATransactionClass
GetCATransactionClass returns the class object for CATransaction.
func (CATransactionClass) Alloc ¶
func (cc CATransactionClass) Alloc() CATransaction
Alloc allocates memory for a new instance of the class.
func (CATransactionClass) AnimationDuration ¶
func (_CATransactionClass CATransactionClass) AnimationDuration() float64
Returns the animation duration used by all animations within this transaction group.
Return Value ¶
An interval of time used as the duration.
Discussion ¶
You can retrieve the animation duration for a specific transaction by calling the [ValueForKey] method of the transaction object and asking for the kCATransactionAnimationDuration key.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/animationDuration()
func (CATransactionClass) AnimationTimingFunction ¶
func (_CATransactionClass CATransactionClass) AnimationTimingFunction() CAMediaTimingFunction
Returns the timing function used for all animations within this transaction group.
Return Value ¶
An instance of CAMediaTimingFunction.
Discussion ¶
This is a convenience method that returns the CAMediaTimingFunction for the [ValueForKey] value returned by the kCATransactionAnimationTimingFunction key.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/animationTimingFunction()
func (CATransactionClass) Begin ¶
func (_CATransactionClass CATransactionClass) Begin()
Begin a new transaction for the current thread.
Discussion ¶
The transaction is nested within the thread’s current transaction, if there is one.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/begin()
func (CATransactionClass) Commit ¶
func (_CATransactionClass CATransactionClass) Commit()
Commit all changes made during the current transaction.
Discussion ¶
Raises an exception if no current transaction exists.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/commit()
func (CATransactionClass) CompletionBlock ¶
func (_CATransactionClass CATransactionClass) CompletionBlock()
Returns the completion block object.
Discussion ¶
See [SetCompletionBlock] for a description of the role of the completion block object.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/completionBlock()
func (CATransactionClass) DisableActions ¶
func (_CATransactionClass CATransactionClass) DisableActions() bool
Returns whether actions triggered as a result of property changes made within this transaction group are suppressed.
Return Value ¶
true if actions are disabled.
Discussion ¶
This is a convenience method that returns the `boolValue` for the [ValueForKey] value returned by the kCATransactionDisableActions key.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/disableActions()
func (CATransactionClass) Flush ¶
func (_CATransactionClass CATransactionClass) Flush()
Flushes any extant implicit transaction.
Discussion ¶
Delays the commit until any nested explicit transactions have completed.
Flush is typically called automatically at the end of the current runloop, regardless of the runloop mode. If your application does not have a runloop, you must call this method explicitly.
However, you should attempt to avoid calling `flush` explicitly. By allowing `flush` to execute during the runloop your application will achieve better performance, atomic screen updates will be preserved, and transactions and animations that work from transaction to transaction will continue to function.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/flush()
func (CATransactionClass) Lock ¶
func (_CATransactionClass CATransactionClass) Lock()
Attempts to acquire a recursive spin-lock lock, ensuring that returned layer values are valid until unlocked.
Discussion ¶
Core Animation uses a data model that promises not to corrupt the internal data structures when called from multiple threads concurrently, but not that data returned is still valid if the property was valid on another thread. By locking during a transaction you can ensure data that is read, modified, and set is correctly managed.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/lock()
func (CATransactionClass) SetAnimationDuration ¶
func (_CATransactionClass CATransactionClass) SetAnimationDuration(dur float64)
Sets the animation duration used by all animations within this transaction group.
dur: An interval of time used as the duration.
Discussion ¶
You can also set the animation duration for a specific transaction object by calling the [SetValueForKey] method of that object and specifying the kCATransactionAnimationDuration key.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/setAnimationDuration(_:)
func (CATransactionClass) SetAnimationTimingFunction ¶
func (_CATransactionClass CATransactionClass) SetAnimationTimingFunction(function ICAMediaTimingFunction)
Sets the timing function used for all animations within this transaction group.
function: An instance of CAMediaTimingFunction.
Discussion ¶
This is a convenience method that sets the CAMediaTimingFunction for the [ValueForKey] value of the kCATransactionAnimationTimingFunction key.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/setAnimationTimingFunction(_:)
func (CATransactionClass) SetCompletionBlock ¶
func (_CATransactionClass CATransactionClass) SetCompletionBlock(block VoidHandler)
Sets the completion block object.
block: A block object called when animations for this transaction group are completed.
The block object takes no parameters and returns no value.
Discussion ¶
The completion block object that is guaranteed to be called (on the main thread) as soon as all animations subsequently added by this transaction group have completed (or have been removed.) If no animations are added before the current transaction group is committed (or the completion block is set to a different value,) the block will be invoked immediately.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/setCompletionBlock(_:)
func (CATransactionClass) SetCompletionBlockSync ¶
func (tc CATransactionClass) SetCompletionBlockSync(ctx context.Context) error
SetCompletionBlockSync is a synchronous wrapper around [CATransaction.SetCompletionBlock]. It blocks until the completion handler fires or the context is cancelled.
func (CATransactionClass) SetDisableActions ¶
func (_CATransactionClass CATransactionClass) SetDisableActions(flag bool)
Sets whether actions triggered as a result of property changes made within this transaction group are suppressed.
flag: true, if actions should be disabled. // true: https://developer.apple.com/documentation/Swift/true
Discussion ¶
This is a convenience method that invokes [SetValueForKey] with an [NSNumber] containing a true for the kCATransactionDisableActions key.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/setDisableActions(_:)
func (CATransactionClass) Unlock ¶
func (_CATransactionClass CATransactionClass) Unlock()
Relinquishes a previously acquired transaction lock.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction/unlock()
type CATransform3D ¶
type CATransform3D struct {
M11 float64 // The entry at position 1,1 in the matrix.
M12 float64 // The entry at position 1,2 in the matrix.
M13 float64 // The entry at position 1,3 in the matrix.
M14 float64 // The entry at position 1,4 in the matrix.
M21 float64 // The entry at position 2,1 in the matrix.
M22 float64 // The entry at position 2,2 in the matrix.
M23 float64 // The entry at position 2,3 in the matrix.
M24 float64 // The entry at position 2,4 in the matrix.
M31 float64 // The entry at position 3,1 in the matrix.
M32 float64 // The entry at position 3,2 in the matrix.
M33 float64 // The entry at position 3,3 in the matrix.
M34 float64 // The entry at position 3,4 in the matrix.
M41 float64 // The entry at position 4,1 in the matrix.
M42 float64 // The entry at position 4,2 in the matrix.
M43 float64 // The entry at position 4,3 in the matrix.
M44 float64 // The entry at position 4,4 in the matrix.
}
CATransform3D - The standard transform matrix used throughout Core Animation.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/QuartzCore/CATransform3D
var ( // CATransform3DIdentity is the identity transform: `[1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]`. // // See: https://developer.apple.com/documentation/QuartzCore/CATransform3DIdentity CATransform3DIdentity CATransform3D )
func CATransform3DConcat ¶
func CATransform3DConcat(a CATransform3D, b CATransform3D) CATransform3D
CATransform3DConcat concatenates `b` to `a` and returns the result: `t = a * b`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DConcat(_:_:)
func CATransform3DInvert ¶
func CATransform3DInvert(t CATransform3D) CATransform3D
CATransform3DInvert inverts `t` and returns the result.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DInvert(_:)
func CATransform3DMakeAffineTransform ¶
func CATransform3DMakeAffineTransform(m corefoundation.CGAffineTransform) CATransform3D
CATransform3DMakeAffineTransform returns a transform with the same effect as affine transform `m`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DMakeAffineTransform(_:)
func CATransform3DMakeRotation ¶
func CATransform3DMakeRotation(angle float64, x float64, y float64, z float64) CATransform3D
CATransform3DMakeRotation returns a transform that rotates by `angle` radians about the vector `(x, y, z)`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DMakeRotation(_:_:_:_:)
func CATransform3DMakeScale ¶
func CATransform3DMakeScale(sx float64, sy float64, sz float64) CATransform3D
CATransform3DMakeScale returns a transform that scales by `(sx, sy, sz)`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DMakeScale(_:_:_:)
func CATransform3DMakeTranslation ¶
func CATransform3DMakeTranslation(tx float64, ty float64, tz float64) CATransform3D
CATransform3DMakeTranslation returns a transform that translates by `(tx, ty, tz)`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DMakeTranslation(_:_:_:)
func CATransform3DRotate ¶
func CATransform3DRotate(t CATransform3D, angle float64, x float64, y float64, z float64) CATransform3D
CATransform3DRotate rotates `t` by `angle` radians about the vector `(x, y, z)` and returns the result.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DRotate(_:_:_:_:_:)
func CATransform3DScale ¶
func CATransform3DScale(t CATransform3D, sx float64, sy float64, sz float64) CATransform3D
CATransform3DScale scales `t` by `(sx, sy, sz)` and returns the result: `t = scale(sx, sy, sz) * t`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DScale(_:_:_:_:)
func CATransform3DTranslate ¶
func CATransform3DTranslate(t CATransform3D, tx float64, ty float64, tz float64) CATransform3D
CATransform3DTranslate translates `t` by `(tx, ty, tz)` and returns the result: `t` `= translate(tx, ty, tz) * t`.
See: https://developer.apple.com/documentation/QuartzCore/CATransform3DTranslate(_:_:_:_:)
type CATransformLayer ¶
type CATransformLayer struct {
CALayer
}
Objects used to create true 3D layer hierarchies, rather than the flattened hierarchy rendering model used by other layer types.
Overview ¶
Unlike normal layers, transform layers do not flatten their sublayers into the plane at `Z=0`. Due to this, they do not support many of the features of the CALayer class compositing model:
- Only the sublayers of a transform layer are rendered. The CALayer properties that are rendered by a layer are ignored, including: `backgroundColor`, `contents`, border style properties, stroke style properties, etc. - The properties that assume 2D image processing are also ignored, including: `filters`, `backgroundFilters`, `compositingFilter`, `mask`, `masksToBounds`, and shadow style properties. - The `opacity` property is applied to each sublayer individually, the transform layer does not form a compositing group. - The [HitTest] method should never be called on a transform layer as they do not have a 2D coordinate space into which the point can be mapped.
Example: Displaying layers in 3D ¶
Because CATransformLayer creates true 3D layer hierarchies, you can display otherwise hidden layers when applying 3D transforms.
The following code shows three layers with different colors but identical sizes added at the same position to `layer`. The blue layer is visible because it has the highest [CATransformLayer.ZPosition]. Defining the layer’s transform rotates the viewpoint in 3D space and, because `layer` is a CATransformLayer, all three layers are visible as illustrated below.
[media-2826921]
However, if `layer` is created as a CALayer, the green and red layers, being hidden by the blue layer, are not rendered as illustrated in the following figure.
[media-2826922]
See: https://developer.apple.com/documentation/QuartzCore/CATransformLayer
func CATransformLayerFromID ¶
func CATransformLayerFromID(id objc.ID) CATransformLayer
CATransformLayerFromID constructs a CATransformLayer from an objc.ID.
Objects used to create true 3D layer hierarchies, rather than the flattened hierarchy rendering model used by other layer types.
func NewCATransformLayer ¶
func NewCATransformLayer() CATransformLayer
NewCATransformLayer creates a new CATransformLayer instance.
func NewTransformLayerWithLayer ¶
func NewTransformLayerWithLayer(layer objectivec.IObject) CATransformLayer
Override to copy or initialize custom fields of the specified layer.
layer: The layer from which custom fields should be copied.
Return Value ¶
A layer instance with any custom instance variables copied from `layer`.
Discussion ¶
This initializer is used to create shadow copies of layers, for example, for the [PresentationLayer] method. Using this method in any other situation will produce undefined behavior. For example, do not use this method to initialize a new layer with an existing layer’s content.
If you are implementing a custom layer subclass, you can override this method and use it to copy the values of instance variables into the new object. Subclasses should always invoke the superclass implementation.
This method is the designated initializer for layer objects in the presentation layer.
See: https://developer.apple.com/documentation/QuartzCore/CALayer/init(layer:)
func (CATransformLayer) Autorelease ¶
func (t CATransformLayer) Autorelease() CATransformLayer
Autorelease adds the receiver to the current autorelease pool.
func (CATransformLayer) Init ¶
func (t CATransformLayer) Init() CATransformLayer
Init initializes the instance.
type CATransformLayerClass ¶
type CATransformLayerClass struct {
// contains filtered or unexported fields
}
func GetCATransformLayerClass ¶
func GetCATransformLayerClass() CATransformLayerClass
GetCATransformLayerClass returns the class object for CATransformLayer.
func (CATransformLayerClass) Alloc ¶
func (cc CATransformLayerClass) Alloc() CATransformLayer
Alloc allocates memory for a new instance of the class.
type CATransition ¶
type CATransition struct {
CAAnimation
}
An object that provides an animated transition between a layer’s states.
Overview ¶
You can transition between a layer’s states by creating and adding a CATransition object to it. The default transition is a cross fade, but you can specify different effects from a set of predefined transitions.
The following code shows how you can transition between the two states of a CATextLayer named `transitioningLayer`. When the layer is first created, its CATransition.BackgroundColor is set to red and its [CATransition.String] property is set to [Red]. When the `runTransition()` function is called, a new CATransition object is created and added to `transitioningLayer`, and the state of the layer is changed so that its background color is blue and its rendered text reads [Blue].
The end result is that the push transition animates the red state from left to right with the blue state entering the scene from the left.
Transition start and end point ¶
- CATransition.StartProgress: Indicates the start point of the receiver as a fraction of the entire transition.
- CATransition.SetStartProgress
- CATransition.EndProgress: Indicates the end point of the receiver as a fraction of the entire transition.
- CATransition.SetEndProgress
Transition Properties ¶
- CATransition.Type: Specifies the predefined transition type.
- CATransition.SetType
- CATransition.Subtype: Specifies an optional subtype that indicates the direction for the predefined motion-based transitions.
- CATransition.SetSubtype
Custom transition filter ¶
- CATransition.Filter: An optional Core Image filter object that provides the transition.
- CATransition.SetFilter
See: https://developer.apple.com/documentation/QuartzCore/CATransition
func CATransitionFromID ¶
func CATransitionFromID(id objc.ID) CATransition
CATransitionFromID constructs a CATransition from an objc.ID.
An object that provides an animated transition between a layer’s states.
func NewCATransition ¶
func NewCATransition() CATransition
NewCATransition creates a new CATransition instance.
func (CATransition) Autorelease ¶
func (t CATransition) Autorelease() CATransition
Autorelease adds the receiver to the current autorelease pool.
func (CATransition) BackgroundColor ¶
func (t CATransition) BackgroundColor() coregraphics.CGColorRef
The background color of the receiver. Animatable.
See: https://developer.apple.com/documentation/quartzcore/calayer/backgroundcolor
func (CATransition) EndProgress ¶
func (t CATransition) EndProgress() float32
Indicates the end point of the receiver as a fraction of the entire transition.
Discussion ¶
The value must be greater than or equal to [StartProgress], and not greater than 1.0. If `endProgress` is less than [StartProgress] the behavior is undefined. The default value is 1.0.
See: https://developer.apple.com/documentation/QuartzCore/CATransition/endProgress
func (CATransition) Filter ¶
func (t CATransition) Filter() objectivec.IObject
An optional Core Image filter object that provides the transition.
Discussion ¶
If specified, the filter must support both kCIInputImageKey and kCIInputTargetImageKey input keys, and the kCIOutputImageKey output key. The filter may optionally support the kCIInputExtentKey input key, which is set to a rectangle describing the region in which the transition should run. If `filter` does not support the required input and output keys the behavior is undefined.
Defaults to `nil`. When a transition filter is specified the [Type] and [Subtype] properties are ignored.
The NSView that contains the transitioning layer must have its layerUsesCoreImageFilters set to true.
The following code shows how you can transition between the two states of a CATextLayer named `transitioningLayer`. When the layer is first created, its [BackgroundColor] is set to red and its [String] property is set to [Red]. When the `runTransition()` function is called, a new CATransition object is created and added to `transitioningLayer`, and the state of the layer is changed so that its background color is blue and its rendered text reads [Blue].
The end result is that the transition animates from the red state to the blue state using a CICopyMachineTransition transition.
Special Considerations ¶
This property is not supported on layers in iOS.
See: https://developer.apple.com/documentation/QuartzCore/CATransition/filter
func (CATransition) SetBackgroundColor ¶
func (t CATransition) SetBackgroundColor(value coregraphics.CGColorRef)
func (CATransition) SetEndProgress ¶
func (t CATransition) SetEndProgress(value float32)
func (CATransition) SetFilter ¶
func (t CATransition) SetFilter(value objectivec.IObject)
func (CATransition) SetStartProgress ¶
func (t CATransition) SetStartProgress(value float32)
func (CATransition) SetSubtype ¶
func (t CATransition) SetSubtype(value CATransitionSubtype)
func (CATransition) SetType ¶
func (t CATransition) SetType(value CATransitionType)
func (CATransition) StartProgress ¶
func (t CATransition) StartProgress() float32
Indicates the start point of the receiver as a fraction of the entire transition.
Discussion ¶
Legal values are numbers between 0.0 and 1.0. For example, to start the transition half way through its progress set `startProgress` to 0.5. The default value is 0.
See: https://developer.apple.com/documentation/QuartzCore/CATransition/startProgress
func (CATransition) Subtype ¶
func (t CATransition) Subtype() CATransitionSubtype
Specifies an optional subtype that indicates the direction for the predefined motion-based transitions.
Discussion ¶
The possible values are shown in Common Transition Subtypes. The default is `nil`.
This property is ignored if a custom transition is specified in the [Filter] property.
See: https://developer.apple.com/documentation/QuartzCore/CATransition/subtype
func (CATransition) Type ¶
func (t CATransition) Type() CATransitionType
Specifies the predefined transition type.
Discussion ¶
The possible values are shown in Common Transition Types. This property is ignored if a custom transition is specified in the [Filter] property. The default is fade.
See: https://developer.apple.com/documentation/QuartzCore/CATransition/type
type CATransitionClass ¶
type CATransitionClass struct {
// contains filtered or unexported fields
}
func GetCATransitionClass ¶
func GetCATransitionClass() CATransitionClass
GetCATransitionClass returns the class object for CATransition.
func (CATransitionClass) Alloc ¶
func (cc CATransitionClass) Alloc() CATransition
Alloc allocates memory for a new instance of the class.
type CATransitionSubtype ¶
type CATransitionSubtype = string
See: https://developer.apple.com/documentation/QuartzCore/CATransitionSubtype
var ( // KCATransitionFromBottom is the transition begins at the bottom of the layer. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionSubtype/fromBottom KCATransitionFromBottom CATransitionSubtype // KCATransitionFromLeft is the transition begins at the left side of the layer. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionSubtype/fromLeft KCATransitionFromLeft CATransitionSubtype // KCATransitionFromRight is the transition begins at the right side of the layer. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionSubtype/fromRight KCATransitionFromRight CATransitionSubtype // KCATransitionFromTop is the transition begins at the top of the layer. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionSubtype/fromTop KCATransitionFromTop CATransitionSubtype )
type CATransitionType ¶
type CATransitionType = string
See: https://developer.apple.com/documentation/QuartzCore/CATransitionType
var ( // KCATransitionFade is the layer’s content fades as it becomes visible or hidden. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionType/fade KCATransitionFade CATransitionType // KCATransitionMoveIn is the layer’s content slides into place over any existing content. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionType/moveIn KCATransitionMoveIn CATransitionType // KCATransitionPush is the layer’s content pushes any existing content as it slides into place. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionType/push KCATransitionPush CATransitionType // KCATransitionReveal is the layer’s content is revealed gradually in the direction specified by the transition subtype. // // See: https://developer.apple.com/documentation/QuartzCore/CATransitionType/reveal KCATransitionReveal CATransitionType )
type CAValueFunction ¶
type CAValueFunction struct {
objectivec.Object
}
An object that provides a flexible method of defining animated transformations.
Overview ¶
You can use a value function to specify the individual components of an animated transform.
For example, to create a basic animation that rotates a layer from 0° to 180° around its z-axis, you would create a CABasicAnimation object with a CAValueFunction.FromValue of `0`, a CAValueFunction.ToValue of CAValueFunction.Pi, and a [ValueFunction] of a CAValueFunction with a function name of rotateZ.
The following code shows how you would create such a rotation and apply it to a CALayer named `rotatingLayer`.
The value functions scale and translate require 3 values, for the individual `x`, `y` and `z` components. When working with these value functions, you specify the animation’s CAValueFunction.FromValue and CAValueFunction.ToValue as arrays.
The following code shows how you could animate a layer’s scale from `0` to `1` using a value function.
Getting Value Function Properties ¶
- CAValueFunction.Name: Returns the name of the value function.
See: https://developer.apple.com/documentation/QuartzCore/CAValueFunction
func CAValueFunctionFromID ¶
func CAValueFunctionFromID(id objc.ID) CAValueFunction
CAValueFunctionFromID constructs a CAValueFunction from an objc.ID.
An object that provides a flexible method of defining animated transformations.
func NewCAValueFunction ¶
func NewCAValueFunction() CAValueFunction
NewCAValueFunction creates a new CAValueFunction instance.
func NewValueFunctionWithName ¶
func NewValueFunctionWithName(name CAValueFunctionName) CAValueFunction
Returns the value function object identified by the name.
name: The name of the value function.
Return Value ¶
A new CAValueFunction instance with the value function specified by the name.
Discussion ¶
The possible values for `name` are specified in Rotate Value Functions, Scale Value Functions, and Translate Functions.
See: https://developer.apple.com/documentation/QuartzCore/CAValueFunction/init(name:)
func (CAValueFunction) Autorelease ¶
func (v CAValueFunction) Autorelease() CAValueFunction
Autorelease adds the receiver to the current autorelease pool.
func (CAValueFunction) EncodeWithCoder ¶
func (v CAValueFunction) EncodeWithCoder(coder foundation.INSCoder)
func (CAValueFunction) FromValue ¶
func (v CAValueFunction) FromValue() objectivec.IObject
Defines the value the receiver uses to start interpolation.
See: https://developer.apple.com/documentation/quartzcore/cabasicanimation/fromvalue
func (CAValueFunction) Init ¶
func (v CAValueFunction) Init() CAValueFunction
Init initializes the instance.
func (CAValueFunction) Name ¶
func (v CAValueFunction) Name() CAValueFunctionName
Returns the name of the value function.
See: https://developer.apple.com/documentation/QuartzCore/CAValueFunction/name
func (CAValueFunction) Pi ¶
func (v CAValueFunction) Pi() float32
The mathematical constant pi (π), approximately equal to 3.14159.
See: https://developer.apple.com/documentation/Swift/Float/pi
func (CAValueFunction) RotateZ ¶
func (v CAValueFunction) RotateZ() CAValueFunctionName
A value function that rotates by the input value, in radians, around the z-axis. This value function expects a single input value.
See: https://developer.apple.com/documentation/quartzcore/cavaluefunctionname/rotatez
func (CAValueFunction) Scale ¶
func (v CAValueFunction) Scale() CAValueFunctionName
A value function scales by the input value along all three axis. Animations using this value transform function must provide animation values in an
See: https://developer.apple.com/documentation/quartzcore/cavaluefunctionname/scale
func (CAValueFunction) SetFromValue ¶
func (v CAValueFunction) SetFromValue(value objectivec.IObject)
func (CAValueFunction) SetPi ¶
func (v CAValueFunction) SetPi(value float32)
func (CAValueFunction) SetToValue ¶
func (v CAValueFunction) SetToValue(value objectivec.IObject)
func (CAValueFunction) SetValueFunction ¶
func (v CAValueFunction) SetValueFunction(value ICAValueFunction)
func (CAValueFunction) ToValue ¶
func (v CAValueFunction) ToValue() objectivec.IObject
Defines the value the receiver uses to end interpolation.
See: https://developer.apple.com/documentation/quartzcore/cabasicanimation/tovalue
func (CAValueFunction) Translate ¶
func (v CAValueFunction) Translate() CAValueFunctionName
A value function that translates by the input values along all three axis. Animations using this value transform function must provide animation values in an
See: https://developer.apple.com/documentation/quartzcore/cavaluefunctionname/translate
func (CAValueFunction) ValueFunction ¶
func (v CAValueFunction) ValueFunction() ICAValueFunction
An optional value function that is applied to interpolated values.
See: https://developer.apple.com/documentation/quartzcore/capropertyanimation/valuefunction
type CAValueFunctionClass ¶
type CAValueFunctionClass struct {
// contains filtered or unexported fields
}
func GetCAValueFunctionClass ¶
func GetCAValueFunctionClass() CAValueFunctionClass
GetCAValueFunctionClass returns the class object for CAValueFunction.
func (CAValueFunctionClass) Alloc ¶
func (cc CAValueFunctionClass) Alloc() CAValueFunction
Alloc allocates memory for a new instance of the class.
type CAValueFunctionName ¶
type CAValueFunctionName = string
See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName
var ( // KCAValueFunctionRotateX is a value function that rotates by the input value, in radians, around the x-axis. This value function expects a single input value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/rotateX KCAValueFunctionRotateX CAValueFunctionName // KCAValueFunctionRotateY is a value function that rotates by the input value, in radians, around the y-axis. This value function expects a single input value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/rotateY KCAValueFunctionRotateY CAValueFunctionName // KCAValueFunctionRotateZ is a value function that rotates by the input value, in radians, around the z-axis. This value function expects a single input value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/rotateZ KCAValueFunctionRotateZ CAValueFunctionName // KCAValueFunctionScale is a value function scales by the input value along all three axis. Animations using this value transform function must provide animation values in an [NSArray] of three [NSNumber] instances that specify the (x, y, z) scale values. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/scale KCAValueFunctionScale CAValueFunctionName // KCAValueFunctionScaleX is a value function scales by the input value along the x-axis. Animations referencing this value transform function must provide a single animation value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/scaleX KCAValueFunctionScaleX CAValueFunctionName // KCAValueFunctionScaleY is a value function scales by the input value along the y-axis. Animations referencing this value function must provide a single animation value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/scaleY KCAValueFunctionScaleY CAValueFunctionName // KCAValueFunctionScaleZ is a value function that scales by the input value along the z-axis. Animations referencing this value function must provide a single animation value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/scaleZ KCAValueFunctionScaleZ CAValueFunctionName // KCAValueFunctionTranslate is a value function that translates by the input values along all three axis. Animations using this value transform function must provide animation values in an [NSArray] of three [NSNumber] instances that specify the (x, y, z) translate values. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/translate KCAValueFunctionTranslate CAValueFunctionName // KCAValueFunctionTranslateX is a value function translates by the input value along the x-axis. Animations referencing this value function must provide a single input value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/translateX KCAValueFunctionTranslateX CAValueFunctionName // KCAValueFunctionTranslateY is a value function translates by the input value along the y-axis. Animations referencing this value function must provide a single input value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/translateY KCAValueFunctionTranslateY CAValueFunctionName // KCAValueFunctionTranslateZ is a value function translates by the input value along the z-axis. Animations referencing this value function must provide a single input value. // // See: https://developer.apple.com/documentation/QuartzCore/CAValueFunctionName/translateZ KCAValueFunctionTranslateZ CAValueFunctionName )
type ICAAnimation ¶
type ICAAnimation interface {
objectivec.IObject
CAAction
CAMediaTiming
// Determines if the animation is removed from the target layer’s animations upon completion.
RemovedOnCompletion() bool
SetRemovedOnCompletion(value bool)
// An optional timing function defining the pacing of the animation.
TimingFunction() ICAMediaTimingFunction
SetTimingFunction(value ICAMediaTimingFunction)
// Specifies the receiver’s delegate object.
Delegate() CAAnimationDelegate
SetDelegate(value CAAnimationDelegate)
// Specifies whether the value of the property for a given key is archived.
ShouldArchiveValueForKey(key string) bool
// For animations attached to SceneKit objects, a Boolean value that determines whether the animation is evaluated using the scene time or the system time.
UsesSceneTimeBase() bool
SetUsesSceneTimeBase(value bool)
// For animations attached to SceneKit objects, the duration for transitioning into the animation’s effect as it begins.
FadeInDuration() float64
SetFadeInDuration(value float64)
// For animations attached to SceneKit objects, the duration for transitioning out of the animation’s effect as it ends.
FadeOutDuration() float64
SetFadeOutDuration(value float64)
// For animations attached to SceneKit objects, a list of events attached to an animation.
AnimationEvents() []objectivec.IObject
SetAnimationEvents(value []objectivec.IObject)
PreferredFrameRateRange() CAFrameRateRange
SetPreferredFrameRateRange(value CAFrameRateRange)
EncodeWithCoder(coder foundation.INSCoder)
// Sets the value of the property identified by the given key.
SetValueForKey(value objectivec.IObject, key string)
// Returns the value of the property identified by the given key.
ValueForKey(key string) objectivec.IObject
}
An interface definition for the CAAnimation class.
Animation Attributes ¶
- [ICAAnimation.RemovedOnCompletion]: Determines if the animation is removed from the target layer’s animations upon completion.
- [ICAAnimation.SetRemovedOnCompletion]
- [ICAAnimation.TimingFunction]: An optional timing function defining the pacing of the animation.
- [ICAAnimation.SetTimingFunction]
Designating a Delegate ¶
- [ICAAnimation.Delegate]: Specifies the receiver’s delegate object.
- [ICAAnimation.SetDelegate]
Archiving Properties ¶
- [ICAAnimation.ShouldArchiveValueForKey]: Specifies whether the value of the property for a given key is archived.
Controlling SceneKit Animation Timing ¶
- [ICAAnimation.UsesSceneTimeBase]: For animations attached to SceneKit objects, a Boolean value that determines whether the animation is evaluated using the scene time or the system time.
- [ICAAnimation.SetUsesSceneTimeBase]
Fading between SceneKit Animations ¶
- [ICAAnimation.FadeInDuration]: For animations attached to SceneKit objects, the duration for transitioning into the animation’s effect as it begins.
- [ICAAnimation.SetFadeInDuration]
- [ICAAnimation.FadeOutDuration]: For animations attached to SceneKit objects, the duration for transitioning out of the animation’s effect as it ends.
- [ICAAnimation.SetFadeOutDuration]
Attaching SceneKit Animation Events ¶
- [ICAAnimation.AnimationEvents]: For animations attached to SceneKit objects, a list of events attached to an animation.
- [ICAAnimation.SetAnimationEvents]
Instance Properties ¶
- [ICAAnimation.PreferredFrameRateRange]
- [ICAAnimation.SetPreferredFrameRateRange]
See: https://developer.apple.com/documentation/QuartzCore/CAAnimation
type ICAAnimationGroup ¶
type ICAAnimationGroup interface {
ICAAnimation
// An array of [CAAnimation] objects to be evaluated in the time space of the receiver.
Animations() []CAAnimation
SetAnimations(value []CAAnimation)
// Determines if the animation is removed from the target layer’s animations upon completion.
IsRemovedOnCompletion() bool
SetIsRemovedOnCompletion(value bool)
}
An interface definition for the CAAnimationGroup class.
Grouped animations ¶
- [ICAAnimationGroup.Animations]: An array of CAAnimation objects to be evaluated in the time space of the receiver.
- [ICAAnimationGroup.SetAnimations]
See: https://developer.apple.com/documentation/QuartzCore/CAAnimationGroup
type ICABasicAnimation ¶
type ICABasicAnimation interface {
ICAPropertyAnimation
// Defines the value the receiver uses to start interpolation.
FromValue() objectivec.IObject
SetFromValue(value objectivec.IObject)
// Defines the value the receiver uses to end interpolation.
ToValue() objectivec.IObject
SetToValue(value objectivec.IObject)
// Defines the value the receiver uses to perform relative interpolation.
ByValue() objectivec.IObject
SetByValue(value objectivec.IObject)
// The background color of the receiver. Animatable.
BackgroundColor() coregraphics.CGColorRef
SetBackgroundColor(value coregraphics.CGColorRef)
// The opacity of the receiver. Animatable.
Opacity() float32
SetOpacity(value float32)
// The transform applied to the layer’s contents. Animatable.
Transform() CATransform3D
SetTransform(value CATransform3D)
}
An interface definition for the CABasicAnimation class.
Interpolation values ¶
- [ICABasicAnimation.FromValue]: Defines the value the receiver uses to start interpolation.
- [ICABasicAnimation.SetFromValue]
- [ICABasicAnimation.ToValue]: Defines the value the receiver uses to end interpolation.
- [ICABasicAnimation.SetToValue]
- [ICABasicAnimation.ByValue]: Defines the value the receiver uses to perform relative interpolation.
- [ICABasicAnimation.SetByValue]
See: https://developer.apple.com/documentation/QuartzCore/CABasicAnimation
type ICAConstraint ¶
type ICAConstraint interface {
objectivec.IObject
// Returns an [CAConstraint] object with the specified parameters. Designated initializer.
InitWithAttributeRelativeToAttributeScaleOffset(attr CAConstraintAttribute, srcId string, srcAttr CAConstraintAttribute, m float64, c float64) CAConstraint
// The attribute the constraint affects.
Attribute() CAConstraintAttribute
// Offset value of the constraint attribute.
Offset() float64
// Scale factor of the constraint attribute.
Scale() float64
// The constraint attribute of the layer the receiver is calculated relative to
SourceAttribute() CAConstraintAttribute
// Name of the layer that the constraint is calculated relative to.
SourceName() string
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CAConstraint class.
Create a New Constraint ¶
- [ICAConstraint.InitWithAttributeRelativeToAttributeScaleOffset]: Returns an CAConstraint object with the specified parameters. Designated initializer.
Accessing Constraint Values ¶
- [ICAConstraint.Attribute]: The attribute the constraint affects.
- [ICAConstraint.Offset]: Offset value of the constraint attribute.
- [ICAConstraint.Scale]: Scale factor of the constraint attribute.
- [ICAConstraint.SourceAttribute]: The constraint attribute of the layer the receiver is calculated relative to
- [ICAConstraint.SourceName]: Name of the layer that the constraint is calculated relative to.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraint
type ICAConstraintLayoutManager ¶
type ICAConstraintLayoutManager interface {
objectivec.IObject
CALayoutManager
// The object responsible for laying out the layer’s sublayers.
LayoutManager() CALayoutManager
SetLayoutManager(value CALayoutManager)
// The name of the receiver.
Name() string
SetName(value string)
}
An interface definition for the CAConstraintLayoutManager class.
See: https://developer.apple.com/documentation/QuartzCore/CAConstraintLayoutManager
type ICADisplayLink ¶
type ICADisplayLink interface {
objectivec.IObject
// The time interval between screen refresh updates.
Duration() float64
// A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
PreferredFrameRateRange() CAFrameRateRange
SetPreferredFrameRateRange(value CAFrameRateRange)
// A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
Paused() bool
SetPaused(value bool)
// The time interval that represents when the last frame displayed.
Timestamp() float64
// The time interval that represents when the next frame displays.
TargetTimestamp() float64
// Registers the display link with a run loop.
AddToRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
// Removes the display link from the run loop for the given mode.
RemoveFromRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
// Removes the display link from all run loop modes.
Invalidate()
// The maximum number of frames per second a screen can render.
MaximumFramesPerSecond() int
SetMaximumFramesPerSecond(value int)
}
An interface definition for the CADisplayLink class.
Configuring a Display Link ¶
- [ICADisplayLink.Duration]: The time interval between screen refresh updates.
- [ICADisplayLink.PreferredFrameRateRange]: A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
- [ICADisplayLink.SetPreferredFrameRateRange]
- [ICADisplayLink.Paused]: A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
- [ICADisplayLink.SetPaused]
- [ICADisplayLink.Timestamp]: The time interval that represents when the last frame displayed.
- [ICADisplayLink.TargetTimestamp]: The time interval that represents when the next frame displays.
Scheduling a Display Link to Send Notifications ¶
- [ICADisplayLink.AddToRunLoopForMode]: Registers the display link with a run loop.
- [ICADisplayLink.RemoveFromRunLoopForMode]: Removes the display link from the run loop for the given mode.
- [ICADisplayLink.Invalidate]: Removes the display link from all run loop modes.
See: https://developer.apple.com/documentation/QuartzCore/CADisplayLink
type ICAEDRMetadata ¶
type ICAEDRMetadata interface {
objectivec.IObject
// Metadata describing the tone mapping to apply to the extended dynamic range (EDR) values in the layer.
EdrMetadata() ICAEDRMetadata
SetEdrMetadata(value ICAEDRMetadata)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CAEDRMetadata class.
See: https://developer.apple.com/documentation/QuartzCore/CAEDRMetadata
type ICAEmitterCell ¶
type ICAEmitterCell interface {
objectivec.IObject
CAMediaTiming
// An object that provides the contents of the layer. Animatable.
Contents() objectivec.IObject
SetContents(value objectivec.IObject)
// A rectangle (in the unit coordinate space) that specifies the portion of [contents](<doc://com.apple.quartzcore/documentation/QuartzCore/CAEmitterCell/contents>) that the receiver should draw. Animatable.
ContentsRect() corefoundation.CGRect
SetContentsRect(value corefoundation.CGRect)
// An optional array containing the sub-cells of this cell.
EmitterCells() []CAEmitterCell
SetEmitterCells(value []CAEmitterCell)
// A Boolean value indicating whether or not cells from this emitter are rendered.
Enabled() bool
SetEnabled(value bool)
// The color of each emitted object. Animatable.
Color() coregraphics.CGColorRef
SetColor(value coregraphics.CGColorRef)
// The amount by which the red color component of the cell can vary. Animatable.
RedRange() float32
SetRedRange(value float32)
// The amount by which the green color component of the cell can vary. Animatable.
GreenRange() float32
SetGreenRange(value float32)
// The amount by which the blue color component of the cell can vary. Animatable.
BlueRange() float32
SetBlueRange(value float32)
// The amount by which the alpha component of the cell can vary. Animatable.
AlphaRange() float32
SetAlphaRange(value float32)
// The speed, in seconds, at which the red color component changes over the lifetime of the cell. Animatable.
RedSpeed() float32
SetRedSpeed(value float32)
// The speed, in seconds, at which the green color component changes over the lifetime of the cell. Animatable.
GreenSpeed() float32
SetGreenSpeed(value float32)
// The speed, in seconds, at which the blue color component changes over the lifetime of the cell. Animatable.
BlueSpeed() float32
SetBlueSpeed(value float32)
// The speed, in seconds, at which the alpha component changes over the lifetime of the cell. Animatable.
AlphaSpeed() float32
SetAlphaSpeed(value float32)
// The filter used when increasing the size of the content.
MagnificationFilter() string
SetMagnificationFilter(value string)
// The filter used when reducing the size of the content.
MinificationFilter() string
SetMinificationFilter(value string)
// The bias factor used by the minification filter to determine the levels of detail.
MinificationFilterBias() float32
SetMinificationFilterBias(value float32)
// Specifies the scale factor applied to the cell. Animatable.
Scale() float64
SetScale(value float64)
// Specifies the range over which the scale value can vary. Animatable.
ScaleRange() float64
SetScaleRange(value float64)
// The scale factor of the cell contents.
ContentsScale() float64
SetContentsScale(value float64)
// The name of the cell.
Name() string
SetName(value string)
// An optional dictionary containing additional style values that are not explicitly defined by the receiver.
Style() foundation.INSDictionary
SetStyle(value foundation.INSDictionary)
// The rotational velocity, measured in radians per second, to apply to the cell. Animatable.
Spin() float64
SetSpin(value float64)
// The amount by which the spin of the cell can vary over its lifetime. Animatable.
SpinRange() float64
SetSpinRange(value float64)
// The latitudinal orientation of the emission angle. Animatable.
EmissionLatitude() float64
SetEmissionLatitude(value float64)
// The longitudinal orientation of the emission angle. Animatable.
EmissionLongitude() float64
SetEmissionLongitude(value float64)
// The angle, in radians, defining a cone around the emission angle. Animatable.
EmissionRange() float64
SetEmissionRange(value float64)
// The lifetime of the cell, in seconds. Animatable.
Lifetime() float32
SetLifetime(value float32)
// The mean value by which the [lifetime](<doc://com.apple.quartzcore/documentation/QuartzCore/CAEmitterCell/lifetime>) of the cell can vary. Animatable.
LifetimeRange() float32
SetLifetimeRange(value float32)
// The number of emitted objects created every second. Animatable.
BirthRate() float32
SetBirthRate(value float32)
// The speed at which the scale changes over the lifetime of the cell. Animatable.
ScaleSpeed() float64
SetScaleSpeed(value float64)
// The initial velocity of the cell. Animatable.
Velocity() float64
SetVelocity(value float64)
// The amount by which the velocity of the cell can vary. Animatable.
VelocityRange() float64
SetVelocityRange(value float64)
// The x component of an acceleration vector applied to cell.
XAcceleration() float64
SetXAcceleration(value float64)
// The y component of an acceleration vector applied to cell.
YAcceleration() float64
SetYAcceleration(value float64)
// The z component of an acceleration vector applied to cell.
ZAcceleration() float64
SetZAcceleration(value float64)
// Returns a Boolean value indicating whether the value for a given key should be archived.
ShouldArchiveValueForKey(key string) bool
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CAEmitterCell class.
Providing Emitter Cell Content ¶
- [ICAEmitterCell.Contents]: An object that provides the contents of the layer. Animatable.
- [ICAEmitterCell.SetContents]
- [ICAEmitterCell.ContentsRect]: A rectangle (in the unit coordinate space) that specifies the portion of [contents](<doc://com.apple.quartzcore/documentation/QuartzCore/CAEmitterCell/contents>) that the receiver should draw. Animatable.
- [ICAEmitterCell.SetContentsRect]
- [ICAEmitterCell.EmitterCells]: An optional array containing the sub-cells of this cell.
- [ICAEmitterCell.SetEmitterCells]
Setting Emitter Cell Visual Attributes ¶
- [ICAEmitterCell.Enabled]: A Boolean value indicating whether or not cells from this emitter are rendered.
- [ICAEmitterCell.SetEnabled]
- [ICAEmitterCell.Color]: The color of each emitted object. Animatable.
- [ICAEmitterCell.SetColor]
- [ICAEmitterCell.RedRange]: The amount by which the red color component of the cell can vary. Animatable.
- [ICAEmitterCell.SetRedRange]
- [ICAEmitterCell.GreenRange]: The amount by which the green color component of the cell can vary. Animatable.
- [ICAEmitterCell.SetGreenRange]
- [ICAEmitterCell.BlueRange]: The amount by which the blue color component of the cell can vary. Animatable.
- [ICAEmitterCell.SetBlueRange]
- [ICAEmitterCell.AlphaRange]: The amount by which the alpha component of the cell can vary. Animatable.
- [ICAEmitterCell.SetAlphaRange]
- [ICAEmitterCell.RedSpeed]: The speed, in seconds, at which the red color component changes over the lifetime of the cell. Animatable.
- [ICAEmitterCell.SetRedSpeed]
- [ICAEmitterCell.GreenSpeed]: The speed, in seconds, at which the green color component changes over the lifetime of the cell. Animatable.
- [ICAEmitterCell.SetGreenSpeed]
- [ICAEmitterCell.BlueSpeed]: The speed, in seconds, at which the blue color component changes over the lifetime of the cell. Animatable.
- [ICAEmitterCell.SetBlueSpeed]
- [ICAEmitterCell.AlphaSpeed]: The speed, in seconds, at which the alpha component changes over the lifetime of the cell. Animatable.
- [ICAEmitterCell.SetAlphaSpeed]
- [ICAEmitterCell.MagnificationFilter]: The filter used when increasing the size of the content.
- [ICAEmitterCell.SetMagnificationFilter]
- [ICAEmitterCell.MinificationFilter]: The filter used when reducing the size of the content.
- [ICAEmitterCell.SetMinificationFilter]
- [ICAEmitterCell.MinificationFilterBias]: The bias factor used by the minification filter to determine the levels of detail.
- [ICAEmitterCell.SetMinificationFilterBias]
- [ICAEmitterCell.Scale]: Specifies the scale factor applied to the cell. Animatable.
- [ICAEmitterCell.SetScale]
- [ICAEmitterCell.ScaleRange]: Specifies the range over which the scale value can vary. Animatable.
- [ICAEmitterCell.SetScaleRange]
- [ICAEmitterCell.ContentsScale]: The scale factor of the cell contents.
- [ICAEmitterCell.SetContentsScale]
- [ICAEmitterCell.Name]: The name of the cell.
- [ICAEmitterCell.SetName]
- [ICAEmitterCell.Style]: An optional dictionary containing additional style values that are not explicitly defined by the receiver.
- [ICAEmitterCell.SetStyle]
Setting Emitter Cell Motion Attributes ¶
- [ICAEmitterCell.Spin]: The rotational velocity, measured in radians per second, to apply to the cell. Animatable.
- [ICAEmitterCell.SetSpin]
- [ICAEmitterCell.SpinRange]: The amount by which the spin of the cell can vary over its lifetime. Animatable.
- [ICAEmitterCell.SetSpinRange]
- [ICAEmitterCell.EmissionLatitude]: The latitudinal orientation of the emission angle. Animatable.
- [ICAEmitterCell.SetEmissionLatitude]
- [ICAEmitterCell.EmissionLongitude]: The longitudinal orientation of the emission angle. Animatable.
- [ICAEmitterCell.SetEmissionLongitude]
- [ICAEmitterCell.EmissionRange]: The angle, in radians, defining a cone around the emission angle. Animatable.
- [ICAEmitterCell.SetEmissionRange]
Setting Emitter Cell Temporal Attributes ¶
- [ICAEmitterCell.Lifetime]: The lifetime of the cell, in seconds. Animatable.
- [ICAEmitterCell.SetLifetime]
- [ICAEmitterCell.LifetimeRange]: The mean value by which the [lifetime](<doc://com.apple.quartzcore/documentation/QuartzCore/CAEmitterCell/lifetime>) of the cell can vary. Animatable.
- [ICAEmitterCell.SetLifetimeRange]
- [ICAEmitterCell.BirthRate]: The number of emitted objects created every second. Animatable.
- [ICAEmitterCell.SetBirthRate]
- [ICAEmitterCell.ScaleSpeed]: The speed at which the scale changes over the lifetime of the cell. Animatable.
- [ICAEmitterCell.SetScaleSpeed]
- [ICAEmitterCell.Velocity]: The initial velocity of the cell. Animatable.
- [ICAEmitterCell.SetVelocity]
- [ICAEmitterCell.VelocityRange]: The amount by which the velocity of the cell can vary. Animatable.
- [ICAEmitterCell.SetVelocityRange]
- [ICAEmitterCell.XAcceleration]: The x component of an acceleration vector applied to cell.
- [ICAEmitterCell.SetXAcceleration]
- [ICAEmitterCell.YAcceleration]: The y component of an acceleration vector applied to cell.
- [ICAEmitterCell.SetYAcceleration]
- [ICAEmitterCell.ZAcceleration]: The z component of an acceleration vector applied to cell.
- [ICAEmitterCell.SetZAcceleration]
Using Key-Value Coding Extensions ¶
- [ICAEmitterCell.ShouldArchiveValueForKey]: Returns a Boolean value indicating whether the value for a given key should be archived.
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterCell
type ICAEmitterLayer ¶
type ICAEmitterLayer interface {
ICALayer
// The array emitter cells attached to the layer.
EmitterCells() []CAEmitterCell
SetEmitterCells(value []CAEmitterCell)
// Defines how particle cells are rendered into the layer.
RenderMode() CAEmitterLayerRenderMode
SetRenderMode(value CAEmitterLayerRenderMode)
// The position of the center of the particle emitter. Animatable.
EmitterPosition() corefoundation.CGPoint
SetEmitterPosition(value corefoundation.CGPoint)
// Specifies the emitter shape.
EmitterShape() CAEmitterLayerEmitterShape
SetEmitterShape(value CAEmitterLayerEmitterShape)
// Specifies the center of the particle emitter shape along the z-axis. Animatable.
EmitterZPosition() float64
SetEmitterZPosition(value float64)
// Determines the depth of the emitter shape.
EmitterDepth() float64
SetEmitterDepth(value float64)
// Determines the size of the particle emitter shape. Animatable.
EmitterSize() corefoundation.CGSize
SetEmitterSize(value corefoundation.CGSize)
// Defines a multiplier applied to the cell-defined particle scale.
Scale() float32
SetScale(value float32)
// Specifies the seed used to initialize the random number generator.
Seed() uint32
SetSeed(value uint32)
// Defines a multiplier applied to the cell-defined particle spin. Animatable.
Spin() float32
SetSpin(value float32)
// Defines a multiplier applied to the cell-defined particle velocity. Animatable.
Velocity() float32
SetVelocity(value float32)
// Defines a multiplier that is applied to the cell-defined birth rate. Animatable
BirthRate() float32
SetBirthRate(value float32)
// Specifies the emitter mode.
EmitterMode() CAEmitterLayerEmitterMode
SetEmitterMode(value CAEmitterLayerEmitterMode)
// Defines a multiplier applied to the cell-defined lifetime range when particles are created. Animatable.
Lifetime() float32
SetLifetime(value float32)
// Defines whether the layer flattens the particles into its plane.
PreservesDepth() bool
SetPreservesDepth(value bool)
// The angle, in radians, defining a cone around the emission angle. Animatable.
EmissionRange() float64
SetEmissionRange(value float64)
// The mathematical constant pi (π), approximately equal to 3.14159.
Pi() objectivec.IObject
SetPi(value objectivec.IObject)
// Particles are emitted from a single point at (
Point() CAEmitterLayerEmitterShape
}
An interface definition for the CAEmitterLayer class.
Specifying Particle Emitter Cells ¶
- [ICAEmitterLayer.EmitterCells]: The array emitter cells attached to the layer.
- [ICAEmitterLayer.SetEmitterCells]
Emitter Geometry ¶
- [ICAEmitterLayer.RenderMode]: Defines how particle cells are rendered into the layer.
- [ICAEmitterLayer.SetRenderMode]
- [ICAEmitterLayer.EmitterPosition]: The position of the center of the particle emitter. Animatable.
- [ICAEmitterLayer.SetEmitterPosition]
- [ICAEmitterLayer.EmitterShape]: Specifies the emitter shape.
- [ICAEmitterLayer.SetEmitterShape]
- [ICAEmitterLayer.EmitterZPosition]: Specifies the center of the particle emitter shape along the z-axis. Animatable.
- [ICAEmitterLayer.SetEmitterZPosition]
- [ICAEmitterLayer.EmitterDepth]: Determines the depth of the emitter shape.
- [ICAEmitterLayer.SetEmitterDepth]
- [ICAEmitterLayer.EmitterSize]: Determines the size of the particle emitter shape. Animatable.
- [ICAEmitterLayer.SetEmitterSize]
Emitter Cell Attribute Multipliers ¶
- [ICAEmitterLayer.Scale]: Defines a multiplier applied to the cell-defined particle scale.
- [ICAEmitterLayer.SetScale]
- [ICAEmitterLayer.Seed]: Specifies the seed used to initialize the random number generator.
- [ICAEmitterLayer.SetSeed]
- [ICAEmitterLayer.Spin]: Defines a multiplier applied to the cell-defined particle spin. Animatable.
- [ICAEmitterLayer.SetSpin]
- [ICAEmitterLayer.Velocity]: Defines a multiplier applied to the cell-defined particle velocity. Animatable.
- [ICAEmitterLayer.SetVelocity]
- [ICAEmitterLayer.BirthRate]: Defines a multiplier that is applied to the cell-defined birth rate. Animatable
- [ICAEmitterLayer.SetBirthRate]
- [ICAEmitterLayer.EmitterMode]: Specifies the emitter mode.
- [ICAEmitterLayer.SetEmitterMode]
- [ICAEmitterLayer.Lifetime]: Defines a multiplier applied to the cell-defined lifetime range when particles are created. Animatable.
- [ICAEmitterLayer.SetLifetime]
- [ICAEmitterLayer.PreservesDepth]: Defines whether the layer flattens the particles into its plane.
- [ICAEmitterLayer.SetPreservesDepth]
See: https://developer.apple.com/documentation/QuartzCore/CAEmitterLayer
type ICAGradientLayer ¶
type ICAGradientLayer interface {
ICALayer
// An array of [CGColorRef] objects defining the color of each gradient stop. Animatable.
Colors() foundation.INSArray
SetColors(value foundation.INSArray)
// An optional array of NSNumber objects defining the location of each gradient stop. Animatable.
Locations() []foundation.NSNumber
SetLocations(value []foundation.NSNumber)
// The end point of the gradient when drawn in the layer’s coordinate space. Animatable.
EndPoint() corefoundation.CGPoint
SetEndPoint(value corefoundation.CGPoint)
// The start point of the gradient when drawn in the layer’s coordinate space. Animatable.
StartPoint() corefoundation.CGPoint
SetStartPoint(value corefoundation.CGPoint)
// Style of gradient drawn by the layer.
Type() CAGradientLayerType
SetType(value CAGradientLayerType)
// The mathematical constant pi (π), approximately equal to 3.14159.
Pi() objectivec.IObject
SetPi(value objectivec.IObject)
}
An interface definition for the CAGradientLayer class.
Gradient Style Properties ¶
- [ICAGradientLayer.Colors]: An array of [CGColorRef] objects defining the color of each gradient stop. Animatable.
- [ICAGradientLayer.SetColors]
- [ICAGradientLayer.Locations]: An optional array of NSNumber objects defining the location of each gradient stop. Animatable.
- [ICAGradientLayer.SetLocations]
- [ICAGradientLayer.EndPoint]: The end point of the gradient when drawn in the layer’s coordinate space. Animatable.
- [ICAGradientLayer.SetEndPoint]
- [ICAGradientLayer.StartPoint]: The start point of the gradient when drawn in the layer’s coordinate space. Animatable.
- [ICAGradientLayer.SetStartPoint]
- [ICAGradientLayer.Type]: Style of gradient drawn by the layer.
- [ICAGradientLayer.SetType]
See: https://developer.apple.com/documentation/QuartzCore/CAGradientLayer
type ICAKeyframeAnimation ¶
type ICAKeyframeAnimation interface {
ICAPropertyAnimation
// An array of objects that specify the keyframe values to use for the animation.
Values() foundation.INSArray
SetValues(value foundation.INSArray)
// The path for a point-based property to follow.
Path() coregraphics.CGPathRef
SetPath(value coregraphics.CGPathRef)
// An optional array of [NSNumber] objects that define the time at which to apply a given keyframe segment.
KeyTimes() []foundation.NSNumber
SetKeyTimes(value []foundation.NSNumber)
// An optional array of [CAMediaTimingFunction] objects that define the pacing for each keyframe segment.
TimingFunctions() []CAMediaTimingFunction
SetTimingFunctions(value []CAMediaTimingFunction)
// Specifies how intermediate keyframe values are calculated by the receiver.
CalculationMode() CAAnimationCalculationMode
SetCalculationMode(value CAAnimationCalculationMode)
// Determines whether objects animating along the path rotate to match the path tangent.
RotationMode() CAAnimationRotationMode
SetRotationMode(value CAAnimationRotationMode)
// An array of numbers that define the tightness of the curve.
TensionValues() []foundation.NSNumber
SetTensionValues(value []foundation.NSNumber)
// An array of numbers that define the sharpness of the timing curve’s corners.
ContinuityValues() []foundation.NSNumber
SetContinuityValues(value []foundation.NSNumber)
// An array of numbers that define the position of the curve relative to a control point.
BiasValues() []foundation.NSNumber
SetBiasValues(value []foundation.NSNumber)
}
An interface definition for the CAKeyframeAnimation class.
Providing keyframe values ¶
- [ICAKeyframeAnimation.Values]: An array of objects that specify the keyframe values to use for the animation.
- [ICAKeyframeAnimation.SetValues]
- [ICAKeyframeAnimation.Path]: The path for a point-based property to follow.
- [ICAKeyframeAnimation.SetPath]
Keyframe timing ¶
- [ICAKeyframeAnimation.KeyTimes]: An optional array of [NSNumber] objects that define the time at which to apply a given keyframe segment.
- [ICAKeyframeAnimation.SetKeyTimes]
- [ICAKeyframeAnimation.TimingFunctions]: An optional array of CAMediaTimingFunction objects that define the pacing for each keyframe segment.
- [ICAKeyframeAnimation.SetTimingFunctions]
- [ICAKeyframeAnimation.CalculationMode]: Specifies how intermediate keyframe values are calculated by the receiver.
- [ICAKeyframeAnimation.SetCalculationMode]
Rotation Mode Attribute ¶
- [ICAKeyframeAnimation.RotationMode]: Determines whether objects animating along the path rotate to match the path tangent.
- [ICAKeyframeAnimation.SetRotationMode]
Cubic Mode Attributes ¶
- [ICAKeyframeAnimation.TensionValues]: An array of numbers that define the tightness of the curve.
- [ICAKeyframeAnimation.SetTensionValues]
- [ICAKeyframeAnimation.ContinuityValues]: An array of numbers that define the sharpness of the timing curve’s corners.
- [ICAKeyframeAnimation.SetContinuityValues]
- [ICAKeyframeAnimation.BiasValues]: An array of numbers that define the position of the curve relative to a control point.
- [ICAKeyframeAnimation.SetBiasValues]
See: https://developer.apple.com/documentation/QuartzCore/CAKeyframeAnimation
type ICALayer ¶
type ICALayer interface {
objectivec.IObject
CAMediaTiming
// Override to copy or initialize custom fields of the specified layer.
InitWithLayer(layer objectivec.IObject) CALayer
// Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen.
PresentationLayer() ICALayer
// Returns the model layer object associated with the receiver, if any.
ModelLayer() ICALayer
// The layer’s delegate object.
Delegate() CALayerDelegate
SetDelegate(value CALayerDelegate)
// An object that provides the contents of the layer. Animatable.
Contents() objectivec.IObject
SetContents(value objectivec.IObject)
// The rectangle, in the unit coordinate space, that defines the portion of the layer’s contents that should be used. Animatable.
ContentsRect() corefoundation.CGRect
SetContentsRect(value corefoundation.CGRect)
// The rectangle that defines how the layer contents are scaled if the layer’s contents are resized. Animatable.
ContentsCenter() corefoundation.CGRect
SetContentsCenter(value corefoundation.CGRect)
// Reloads the content of this layer.
Display()
// Draws the layer’s content using the specified graphics context.
DrawInContext(ctx coregraphics.CGContextRef)
// A constant that specifies how the layer’s contents are positioned or scaled within its bounds.
ContentsGravity() CALayerContentsGravity
SetContentsGravity(value CALayerContentsGravity)
// The opacity of the receiver. Animatable.
Opacity() float32
SetOpacity(value float32)
// A Boolean indicating whether the layer is displayed. Animatable.
Hidden() bool
SetHidden(value bool)
// A Boolean indicating whether sublayers are clipped to the layer’s bounds. Animatable.
MasksToBounds() bool
SetMasksToBounds(value bool)
// An optional layer whose alpha channel is used to mask the layer’s content.
Mask() ICALayer
SetMask(value ICALayer)
// A Boolean indicating whether the layer displays its content when facing away from the viewer. Animatable.
DoubleSided() bool
SetDoubleSided(value bool)
// The radius to use when drawing rounded corners for the layer’s background. Animatable.
CornerRadius() float64
SetCornerRadius(value float64)
MaskedCorners() CACornerMask
SetMaskedCorners(value CACornerMask)
// The width of the layer’s border. Animatable.
BorderWidth() float64
SetBorderWidth(value float64)
// The color of the layer’s border. Animatable.
BorderColor() coregraphics.CGColorRef
SetBorderColor(value coregraphics.CGColorRef)
// The background color of the receiver. Animatable.
BackgroundColor() coregraphics.CGColorRef
SetBackgroundColor(value coregraphics.CGColorRef)
// The opacity of the layer’s shadow. Animatable.
ShadowOpacity() float32
SetShadowOpacity(value float32)
// The blur radius (in points) used to render the layer’s shadow. Animatable.
ShadowRadius() float64
SetShadowRadius(value float64)
// The offset (in points) of the layer’s shadow. Animatable.
ShadowOffset() corefoundation.CGSize
SetShadowOffset(value corefoundation.CGSize)
// The color of the layer’s shadow. Animatable.
ShadowColor() coregraphics.CGColorRef
SetShadowColor(value coregraphics.CGColorRef)
// The shape of the layer’s shadow. Animatable.
ShadowPath() coregraphics.CGPathRef
SetShadowPath(value coregraphics.CGPathRef)
// An optional dictionary used to store property values that aren’t explicitly defined by the layer.
Style() foundation.INSDictionary
SetStyle(value foundation.INSDictionary)
// A Boolean indicating whether the layer is allowed to perform edge antialiasing.
AllowsEdgeAntialiasing() bool
SetAllowsEdgeAntialiasing(value bool)
// A Boolean indicating whether the layer is allowed to composite itself as a group separate from its parent.
AllowsGroupOpacity() bool
SetAllowsGroupOpacity(value bool)
// An array of Core Image filters to apply to the contents of the layer and its sublayers. Animatable.
Filters() foundation.INSArray
SetFilters(value foundation.INSArray)
// A CoreImage filter used to composite the layer and the content behind it. Animatable.
CompositingFilter() objectivec.IObject
SetCompositingFilter(value objectivec.IObject)
// An array of Core Image filters to apply to the content immediately behind the layer. Animatable.
BackgroundFilters() foundation.INSArray
SetBackgroundFilters(value foundation.INSArray)
// The filter used when reducing the size of the content.
MinificationFilter() CALayerContentsFilter
SetMinificationFilter(value CALayerContentsFilter)
// The bias factor used by the minification filter to determine the levels of detail.
MinificationFilterBias() float32
SetMinificationFilterBias(value float32)
// The filter used when increasing the size of the content.
MagnificationFilter() CALayerContentsFilter
SetMagnificationFilter(value CALayerContentsFilter)
// A Boolean value indicating whether the layer contains completely opaque content.
Opaque() bool
SetOpaque(value bool)
// A bitmask defining how the edges of the receiver are rasterized.
EdgeAntialiasingMask() CAEdgeAntialiasingMask
SetEdgeAntialiasingMask(value CAEdgeAntialiasingMask)
// Returns a Boolean indicating whether the layer content is implicitly flipped when rendered.
ContentsAreFlipped() bool
// A Boolean that indicates whether the geometry of the layer and its sublayers is flipped vertically.
GeometryFlipped() bool
SetGeometryFlipped(value bool)
// A Boolean indicating whether drawing commands are deferred and processed asynchronously in a background thread.
DrawsAsynchronously() bool
SetDrawsAsynchronously(value bool)
// A Boolean that indicates whether the layer is rendered as a bitmap before compositing. Animatable
ShouldRasterize() bool
SetShouldRasterize(value bool)
// The scale at which to rasterize content, relative to the coordinate space of the layer. Animatable
RasterizationScale() float64
SetRasterizationScale(value float64)
// A hint for the desired storage format of the layer contents.
ContentsFormat() CALayerContentsFormat
SetContentsFormat(value CALayerContentsFormat)
// Renders the layer and its sublayers into the specified context.
RenderInContext(ctx coregraphics.CGContextRef)
// The layer’s frame rectangle.
Frame() corefoundation.CGRect
SetFrame(value corefoundation.CGRect)
// The layer’s bounds rectangle. Animatable.
Bounds() corefoundation.CGRect
SetBounds(value corefoundation.CGRect)
// The layer’s position in its superlayer’s coordinate space. Animatable.
Position() corefoundation.CGPoint
SetPosition(value corefoundation.CGPoint)
// The layer’s position on the z axis. Animatable.
ZPosition() float64
SetZPosition(value float64)
// The anchor point for the layer’s position along the z axis. Animatable.
AnchorPointZ() float64
SetAnchorPointZ(value float64)
// Defines the anchor point of the layer’s bounds rectangle. Animatable.
AnchorPoint() corefoundation.CGPoint
SetAnchorPoint(value corefoundation.CGPoint)
// The scale factor applied to the layer.
ContentsScale() float64
SetContentsScale(value float64)
// The transform applied to the layer’s contents. Animatable.
Transform() CATransform3D
SetTransform(value CATransform3D)
// Specifies the transform to apply to sublayers when rendering. Animatable.
SublayerTransform() CATransform3D
SetSublayerTransform(value CATransform3D)
// Returns an affine version of the layer’s transform.
AffineTransform() corefoundation.CGAffineTransform
// Sets the layer’s transform to the specified affine transform.
SetAffineTransform(m corefoundation.CGAffineTransform)
// An array containing the layer’s sublayers.
Sublayers() []CALayer
SetSublayers(value []CALayer)
// The superlayer of the layer.
Superlayer() ICALayer
// Appends the layer to the layer’s list of sublayers.
AddSublayer(layer ICALayer)
// Detaches the layer from its parent layer.
RemoveFromSuperlayer()
// Inserts the specified layer into the receiver’s list of sublayers at the specified index.
InsertSublayerAtIndex(layer ICALayer, idx uint32)
// Inserts the specified sublayer below a different sublayer that already belongs to the receiver.
InsertSublayerBelow(layer ICALayer, sibling ICALayer)
// Inserts the specified sublayer above a different sublayer that already belongs to the receiver.
InsertSublayerAbove(layer ICALayer, sibling ICALayer)
// Replaces the specified sublayer with a different layer object.
ReplaceSublayerWith(oldLayer ICALayer, newLayer ICALayer)
// Marks the layer’s contents as needing to be updated.
SetNeedsDisplay()
// Marks the region within the specified rectangle as needing to be updated.
SetNeedsDisplayInRect(r corefoundation.CGRect)
// A Boolean indicating whether the layer contents must be updated when its bounds rectangle changes.
NeedsDisplayOnBoundsChange() bool
SetNeedsDisplayOnBoundsChange(value bool)
// Initiates the update process for a layer if it is currently marked as needing an update.
DisplayIfNeeded()
// Returns a Boolean indicating whether the layer has been marked as needing an update.
NeedsDisplay() bool
// Add the specified animation object to the layer’s render tree.
AddAnimationForKey(anim ICAAnimation, key string)
// Returns the animation object with the specified identifier.
AnimationForKey(key string) ICAAnimation
// Remove all animations attached to the layer.
RemoveAllAnimations()
// Remove the animation object with the specified key.
RemoveAnimationForKey(key string)
// Returns an array of strings that identify the animations currently attached to the layer.
AnimationKeys() []string
// The object responsible for laying out the layer’s sublayers.
LayoutManager() CALayoutManager
SetLayoutManager(value CALayoutManager)
// Invalidates the layer’s layout and marks it as needing an update.
SetNeedsLayout()
// Tells the layer to update its layout.
LayoutSublayers()
// Recalculate the receiver’s layout, if required.
LayoutIfNeeded()
// Returns a Boolean indicating whether the layer has been marked as needing a layout update.
NeedsLayout() bool
// A bitmask defining how the layer is resized when the bounds of its superlayer changes.
AutoresizingMask() CAAutoresizingMask
SetAutoresizingMask(value CAAutoresizingMask)
// Informs the receiver that the size of its superlayer changed.
ResizeWithOldSuperlayerSize(size corefoundation.CGSize)
// Informs the receiver’s sublayers that the receiver’s size has changed.
ResizeSublayersWithOldSize(size corefoundation.CGSize)
// Returns the preferred size of the layer in the coordinate space of its superlayer.
PreferredFrameSize() corefoundation.CGSize
// The constraints used to position current layer’s sublayers.
Constraints() []CAConstraint
SetConstraints(value []CAConstraint)
// Adds the specified constraint to the layer.
AddConstraint(c ICAConstraint)
// Returns the action object assigned to the specified key.
ActionForKey(event string) CAAction
// A dictionary containing layer actions.
Actions() foundation.INSDictionary
SetActions(value foundation.INSDictionary)
// Converts the point from the specified layer’s coordinate system to the receiver’s coordinate system.
ConvertPointFromLayer(p corefoundation.CGPoint, l ICALayer) corefoundation.CGPoint
// Converts the point from the receiver’s coordinate system to the specified layer’s coordinate system.
ConvertPointToLayer(p corefoundation.CGPoint, l ICALayer) corefoundation.CGPoint
// Converts the rectangle from the specified layer’s coordinate system to the receiver’s coordinate system.
ConvertRectFromLayer(r corefoundation.CGRect, l ICALayer) corefoundation.CGRect
// Converts the rectangle from the receiver’s coordinate system to the specified layer’s coordinate system.
ConvertRectToLayer(r corefoundation.CGRect, l ICALayer) corefoundation.CGRect
// Converts the time interval from the specified layer’s time space to the receiver’s time space.
ConvertTimeFromLayer(t float64, l ICALayer) float64
// Converts the time interval from the receiver’s time space to the specified layer’s time space
ConvertTimeToLayer(t float64, l ICALayer) float64
// Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.
HitTest(p corefoundation.CGPoint) ICALayer
// Returns whether the receiver contains a specified point.
ContainsPoint(p corefoundation.CGPoint) bool
// The visible region of the layer in its own coordinate space.
VisibleRect() corefoundation.CGRect
// Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified point lies at the origin of the scroll layer.
ScrollPoint(p corefoundation.CGPoint)
// Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified rectangle becomes visible.
ScrollRectToVisible(r corefoundation.CGRect)
// The name of the receiver.
Name() string
SetName(value string)
// Returns a Boolean indicating whether the value of the specified key should be archived.
ShouldArchiveValueForKey(key string) bool
PreferredDynamicRange() CADynamicRange
SetPreferredDynamicRange(value CADynamicRange)
ContentsHeadroom() float64
SetContentsHeadroom(value float64)
WantsExtendedDynamicRangeContent() bool
SetWantsExtendedDynamicRangeContent(value bool)
CornerCurve() CALayerCornerCurve
SetCornerCurve(value CALayerCornerCurve)
ToneMapMode() uint
SetToneMapMode(value uint)
EncodeWithCoder(coder foundation.INSCoder)
// Sets the value of the property identified by the given key.
SetValueForKey(value objectivec.IObject, key string)
// Returns the value of the property identified by the given key.
ValueForKey(key string) objectivec.IObject
}
An interface definition for the CALayer class.
Creating a layer ¶
- [ICALayer.InitWithLayer]: Override to copy or initialize custom fields of the specified layer.
Accessing related layer objects ¶
- [ICALayer.PresentationLayer]: Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen.
- [ICALayer.ModelLayer]: Returns the model layer object associated with the receiver, if any.
Accessing the delegate ¶
- [ICALayer.Delegate]: The layer’s delegate object.
- [ICALayer.SetDelegate]
Providing the layer’s content ¶
- [ICALayer.Contents]: An object that provides the contents of the layer. Animatable.
- [ICALayer.SetContents]
- [ICALayer.ContentsRect]: The rectangle, in the unit coordinate space, that defines the portion of the layer’s contents that should be used. Animatable.
- [ICALayer.SetContentsRect]
- [ICALayer.ContentsCenter]: The rectangle that defines how the layer contents are scaled if the layer’s contents are resized. Animatable.
- [ICALayer.SetContentsCenter]
- [ICALayer.Display]: Reloads the content of this layer.
- [ICALayer.DrawInContext]: Draws the layer’s content using the specified graphics context.
Modifying the layer’s appearance ¶
- [ICALayer.ContentsGravity]: A constant that specifies how the layer’s contents are positioned or scaled within its bounds.
- [ICALayer.SetContentsGravity]
- [ICALayer.Opacity]: The opacity of the receiver. Animatable.
- [ICALayer.SetOpacity]
- [ICALayer.Hidden]: A Boolean indicating whether the layer is displayed. Animatable.
- [ICALayer.SetHidden]
- [ICALayer.MasksToBounds]: A Boolean indicating whether sublayers are clipped to the layer’s bounds. Animatable.
- [ICALayer.SetMasksToBounds]
- [ICALayer.Mask]: An optional layer whose alpha channel is used to mask the layer’s content.
- [ICALayer.SetMask]
- [ICALayer.DoubleSided]: A Boolean indicating whether the layer displays its content when facing away from the viewer. Animatable.
- [ICALayer.SetDoubleSided]
- [ICALayer.CornerRadius]: The radius to use when drawing rounded corners for the layer’s background. Animatable.
- [ICALayer.SetCornerRadius]
- [ICALayer.MaskedCorners]
- [ICALayer.SetMaskedCorners]
- [ICALayer.BorderWidth]: The width of the layer’s border. Animatable.
- [ICALayer.SetBorderWidth]
- [ICALayer.BorderColor]: The color of the layer’s border. Animatable.
- [ICALayer.SetBorderColor]
- [ICALayer.BackgroundColor]: The background color of the receiver. Animatable.
- [ICALayer.SetBackgroundColor]
- [ICALayer.ShadowOpacity]: The opacity of the layer’s shadow. Animatable.
- [ICALayer.SetShadowOpacity]
- [ICALayer.ShadowRadius]: The blur radius (in points) used to render the layer’s shadow. Animatable.
- [ICALayer.SetShadowRadius]
- [ICALayer.ShadowOffset]: The offset (in points) of the layer’s shadow. Animatable.
- [ICALayer.SetShadowOffset]
- [ICALayer.ShadowColor]: The color of the layer’s shadow. Animatable.
- [ICALayer.SetShadowColor]
- [ICALayer.ShadowPath]: The shape of the layer’s shadow. Animatable.
- [ICALayer.SetShadowPath]
- [ICALayer.Style]: An optional dictionary used to store property values that aren’t explicitly defined by the layer.
- [ICALayer.SetStyle]
- [ICALayer.AllowsEdgeAntialiasing]: A Boolean indicating whether the layer is allowed to perform edge antialiasing.
- [ICALayer.SetAllowsEdgeAntialiasing]
- [ICALayer.AllowsGroupOpacity]: A Boolean indicating whether the layer is allowed to composite itself as a group separate from its parent.
- [ICALayer.SetAllowsGroupOpacity]
Layer filters ¶
- [ICALayer.Filters]: An array of Core Image filters to apply to the contents of the layer and its sublayers. Animatable.
- [ICALayer.SetFilters]
- [ICALayer.CompositingFilter]: A CoreImage filter used to composite the layer and the content behind it. Animatable.
- [ICALayer.SetCompositingFilter]
- [ICALayer.BackgroundFilters]: An array of Core Image filters to apply to the content immediately behind the layer. Animatable.
- [ICALayer.SetBackgroundFilters]
- [ICALayer.MinificationFilter]: The filter used when reducing the size of the content.
- [ICALayer.SetMinificationFilter]
- [ICALayer.MinificationFilterBias]: The bias factor used by the minification filter to determine the levels of detail.
- [ICALayer.SetMinificationFilterBias]
- [ICALayer.MagnificationFilter]: The filter used when increasing the size of the content.
- [ICALayer.SetMagnificationFilter]
Configuring the layer’s rendering behavior ¶
- [ICALayer.Opaque]: A Boolean value indicating whether the layer contains completely opaque content.
- [ICALayer.SetOpaque]
- [ICALayer.EdgeAntialiasingMask]: A bitmask defining how the edges of the receiver are rasterized.
- [ICALayer.SetEdgeAntialiasingMask]
- [ICALayer.ContentsAreFlipped]: Returns a Boolean indicating whether the layer content is implicitly flipped when rendered.
- [ICALayer.GeometryFlipped]: A Boolean that indicates whether the geometry of the layer and its sublayers is flipped vertically.
- [ICALayer.SetGeometryFlipped]
- [ICALayer.DrawsAsynchronously]: A Boolean indicating whether drawing commands are deferred and processed asynchronously in a background thread.
- [ICALayer.SetDrawsAsynchronously]
- [ICALayer.ShouldRasterize]: A Boolean that indicates whether the layer is rendered as a bitmap before compositing. Animatable
- [ICALayer.SetShouldRasterize]
- [ICALayer.RasterizationScale]: The scale at which to rasterize content, relative to the coordinate space of the layer. Animatable
- [ICALayer.SetRasterizationScale]
- [ICALayer.ContentsFormat]: A hint for the desired storage format of the layer contents.
- [ICALayer.SetContentsFormat]
- [ICALayer.RenderInContext]: Renders the layer and its sublayers into the specified context.
Modifying the layer geometry ¶
- [ICALayer.Frame]: The layer’s frame rectangle.
- [ICALayer.SetFrame]
- [ICALayer.Bounds]: The layer’s bounds rectangle. Animatable.
- [ICALayer.SetBounds]
- [ICALayer.Position]: The layer’s position in its superlayer’s coordinate space. Animatable.
- [ICALayer.SetPosition]
- [ICALayer.ZPosition]: The layer’s position on the z axis. Animatable.
- [ICALayer.SetZPosition]
- [ICALayer.AnchorPointZ]: The anchor point for the layer’s position along the z axis. Animatable.
- [ICALayer.SetAnchorPointZ]
- [ICALayer.AnchorPoint]: Defines the anchor point of the layer’s bounds rectangle. Animatable.
- [ICALayer.SetAnchorPoint]
- [ICALayer.ContentsScale]: The scale factor applied to the layer.
- [ICALayer.SetContentsScale]
Managing the layer’s transform ¶
- [ICALayer.Transform]: The transform applied to the layer’s contents. Animatable.
- [ICALayer.SetTransform]
- [ICALayer.SublayerTransform]: Specifies the transform to apply to sublayers when rendering. Animatable.
- [ICALayer.SetSublayerTransform]
- [ICALayer.AffineTransform]: Returns an affine version of the layer’s transform.
- [ICALayer.SetAffineTransform]: Sets the layer’s transform to the specified affine transform.
Managing the layer hierarchy ¶
- [ICALayer.Sublayers]: An array containing the layer’s sublayers.
- [ICALayer.SetSublayers]
- [ICALayer.Superlayer]: The superlayer of the layer.
- [ICALayer.AddSublayer]: Appends the layer to the layer’s list of sublayers.
- [ICALayer.RemoveFromSuperlayer]: Detaches the layer from its parent layer.
- [ICALayer.InsertSublayerAtIndex]: Inserts the specified layer into the receiver’s list of sublayers at the specified index.
- [ICALayer.InsertSublayerBelow]: Inserts the specified sublayer below a different sublayer that already belongs to the receiver.
- [ICALayer.InsertSublayerAbove]: Inserts the specified sublayer above a different sublayer that already belongs to the receiver.
- [ICALayer.ReplaceSublayerWith]: Replaces the specified sublayer with a different layer object.
Updating layer display ¶
- [ICALayer.SetNeedsDisplay]: Marks the layer’s contents as needing to be updated.
- [ICALayer.SetNeedsDisplayInRect]: Marks the region within the specified rectangle as needing to be updated.
- [ICALayer.NeedsDisplayOnBoundsChange]: A Boolean indicating whether the layer contents must be updated when its bounds rectangle changes.
- [ICALayer.SetNeedsDisplayOnBoundsChange]
- [ICALayer.DisplayIfNeeded]: Initiates the update process for a layer if it is currently marked as needing an update.
- [ICALayer.NeedsDisplay]: Returns a Boolean indicating whether the layer has been marked as needing an update.
Layer animations ¶
- [ICALayer.AddAnimationForKey]: Add the specified animation object to the layer’s render tree.
- [ICALayer.AnimationForKey]: Returns the animation object with the specified identifier.
- [ICALayer.RemoveAllAnimations]: Remove all animations attached to the layer.
- [ICALayer.RemoveAnimationForKey]: Remove the animation object with the specified key.
- [ICALayer.AnimationKeys]: Returns an array of strings that identify the animations currently attached to the layer.
Managing layer resizing and layout ¶
- [ICALayer.LayoutManager]: The object responsible for laying out the layer’s sublayers.
- [ICALayer.SetLayoutManager]
- [ICALayer.SetNeedsLayout]: Invalidates the layer’s layout and marks it as needing an update.
- [ICALayer.LayoutSublayers]: Tells the layer to update its layout.
- [ICALayer.LayoutIfNeeded]: Recalculate the receiver’s layout, if required.
- [ICALayer.NeedsLayout]: Returns a Boolean indicating whether the layer has been marked as needing a layout update.
- [ICALayer.AutoresizingMask]: A bitmask defining how the layer is resized when the bounds of its superlayer changes.
- [ICALayer.SetAutoresizingMask]
- [ICALayer.ResizeWithOldSuperlayerSize]: Informs the receiver that the size of its superlayer changed.
- [ICALayer.ResizeSublayersWithOldSize]: Informs the receiver’s sublayers that the receiver’s size has changed.
- [ICALayer.PreferredFrameSize]: Returns the preferred size of the layer in the coordinate space of its superlayer.
Managing layer constraints ¶
- [ICALayer.Constraints]: The constraints used to position current layer’s sublayers.
- [ICALayer.SetConstraints]
- [ICALayer.AddConstraint]: Adds the specified constraint to the layer.
Getting the layer’s actions ¶
- [ICALayer.ActionForKey]: Returns the action object assigned to the specified key.
- [ICALayer.Actions]: A dictionary containing layer actions.
- [ICALayer.SetActions]
Mapping between coordinate and time spaces ¶
- [ICALayer.ConvertPointFromLayer]: Converts the point from the specified layer’s coordinate system to the receiver’s coordinate system.
- [ICALayer.ConvertPointToLayer]: Converts the point from the receiver’s coordinate system to the specified layer’s coordinate system.
- [ICALayer.ConvertRectFromLayer]: Converts the rectangle from the specified layer’s coordinate system to the receiver’s coordinate system.
- [ICALayer.ConvertRectToLayer]: Converts the rectangle from the receiver’s coordinate system to the specified layer’s coordinate system.
- [ICALayer.ConvertTimeFromLayer]: Converts the time interval from the specified layer’s time space to the receiver’s time space.
- [ICALayer.ConvertTimeToLayer]: Converts the time interval from the receiver’s time space to the specified layer’s time space
Hit testing ¶
- [ICALayer.HitTest]: Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.
- [ICALayer.ContainsPoint]: Returns whether the receiver contains a specified point.
Scrolling ¶
- [ICALayer.VisibleRect]: The visible region of the layer in its own coordinate space.
- [ICALayer.ScrollPoint]: Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified point lies at the origin of the scroll layer.
- [ICALayer.ScrollRectToVisible]: Initiates a scroll in the layer’s closest ancestor scroll layer so that the specified rectangle becomes visible.
Identifying the layer ¶
- [ICALayer.Name]: The name of the receiver.
- [ICALayer.SetName]
Key-value coding extensions ¶
- [ICALayer.ShouldArchiveValueForKey]: Returns a Boolean indicating whether the value of the specified key should be archived.
High dynamic range ¶
- [ICALayer.PreferredDynamicRange]
- [ICALayer.SetPreferredDynamicRange]
- [ICALayer.ContentsHeadroom]
- [ICALayer.SetContentsHeadroom]
- [ICALayer.WantsExtendedDynamicRangeContent]
- [ICALayer.SetWantsExtendedDynamicRangeContent]
Instance properties ¶
- [ICALayer.CornerCurve]
- [ICALayer.SetCornerCurve]
Instance Properties ¶
- [ICALayer.ToneMapMode]
- [ICALayer.SetToneMapMode]
See: https://developer.apple.com/documentation/QuartzCore/CALayer
type ICAMediaTimingFunction ¶
type ICAMediaTimingFunction interface {
objectivec.IObject
// Returns an initialized timing function modeled as a cubic Bézier curve using the specified control points.
InitWithControlPoints(c1x float32, c1y float32, c2x float32, c2y float32) CAMediaTimingFunction
// Returns the control point for the specified index.
GetControlPointAtIndexValues(idx uintptr, ptr unsafe.Pointer)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CAMediaTimingFunction class.
Creating Timing Functions ¶
- [ICAMediaTimingFunction.InitWithControlPoints]: Returns an initialized timing function modeled as a cubic Bézier curve using the specified control points.
Accessing the Control Points ¶
- [ICAMediaTimingFunction.GetControlPointAtIndexValues]: Returns the control point for the specified index.
See: https://developer.apple.com/documentation/QuartzCore/CAMediaTimingFunction
type ICAMetalDisplayLink ¶
type ICAMetalDisplayLink interface {
objectivec.IObject
// Creates a display link for Metal from a Core Animation layer.
InitWithMetalLayer(layer ICAMetalLayer) CAMetalDisplayLink
// A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
PreferredFrameRateRange() CAFrameRateRange
SetPreferredFrameRateRange(value CAFrameRateRange)
// The amount of time, in frames, your app requests to render a frame.
PreferredFrameLatency() float32
SetPreferredFrameLatency(value float32)
// An instance of a type your app implements that responds to the system’s callbacks.
Delegate() CAMetalDisplayLinkDelegate
SetDelegate(value CAMetalDisplayLinkDelegate)
// Registers the display link with a run loop.
AddToRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
// A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
Paused() bool
SetPaused(value bool)
// Removes a mode’s display link from a run loop.
RemoveFromRunLoopForMode(runloop foundation.NSRunLoop, mode foundation.NSString)
// Removes the display link from all run loops for all modes.
Invalidate()
}
An interface definition for the CAMetalDisplayLink class.
Creating a Display Link ¶
- [ICAMetalDisplayLink.InitWithMetalLayer]: Creates a display link for Metal from a Core Animation layer.
Configuring a Display Link ¶
- [ICAMetalDisplayLink.PreferredFrameRateRange]: A range of frequencies your app allows for frame updates, affecting how often the system invokes your delegate’s callback.
- [ICAMetalDisplayLink.SetPreferredFrameRateRange]
- [ICAMetalDisplayLink.PreferredFrameLatency]: The amount of time, in frames, your app requests to render a frame.
- [ICAMetalDisplayLink.SetPreferredFrameLatency]
- [ICAMetalDisplayLink.Delegate]: An instance of a type your app implements that responds to the system’s callbacks.
- [ICAMetalDisplayLink.SetDelegate]
Registering for Callbacks ¶
- [ICAMetalDisplayLink.AddToRunLoopForMode]: Registers the display link with a run loop.
Pausing Callbacks ¶
- [ICAMetalDisplayLink.Paused]: A Boolean value that indicates whether the system suspends the display link’s notifications to the target.
- [ICAMetalDisplayLink.SetPaused]
Deregistering for callbacks ¶
- [ICAMetalDisplayLink.RemoveFromRunLoopForMode]: Removes a mode’s display link from a run loop.
- [ICAMetalDisplayLink.Invalidate]: Removes the display link from all run loops for all modes.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink
type ICAMetalDisplayLinkUpdate ¶
type ICAMetalDisplayLinkUpdate interface {
objectivec.IObject
// The time the system estimates until the display of the next frame.
TargetPresentationTimestamp() float64
// A deadline that indicates when your app needs to finish rendering to the drawable.
TargetTimestamp() float64
// The Metal drawable your app uses to render the next frame.
Drawable() CAMetalDrawable
}
An interface definition for the CAMetalDisplayLinkUpdate class.
Timing the Next Animation Frame ¶
- [ICAMetalDisplayLinkUpdate.TargetPresentationTimestamp]: The time the system estimates until the display of the next frame.
Drawing the Next Frame ¶
- [ICAMetalDisplayLinkUpdate.TargetTimestamp]: A deadline that indicates when your app needs to finish rendering to the drawable.
- [ICAMetalDisplayLinkUpdate.Drawable]: The Metal drawable your app uses to render the next frame.
See: https://developer.apple.com/documentation/QuartzCore/CAMetalDisplayLink/Update
type ICAMetalLayer ¶
type ICAMetalLayer interface {
ICALayer
// The Metal device responsible for the layer’s drawable resources.
Device() objectivec.IObject
SetDevice(value objectivec.IObject)
// The device object that the system recommends using for this layer.
PreferredDevice() objectivec.IObject
// The pixel format of the layer’s textures.
PixelFormat() objectivec.IObject
SetPixelFormat(value objectivec.IObject)
// The color space of the rendered content.
Colorspace() coregraphics.CGColorSpaceRef
SetColorspace(value coregraphics.CGColorSpaceRef)
// A Boolean value that determines whether the layer’s textures are used only for rendering.
FramebufferOnly() bool
SetFramebufferOnly(value bool)
// The size, in pixels, of textures for rendering layer content.
DrawableSize() corefoundation.CGSize
SetDrawableSize(value corefoundation.CGSize)
// A Boolean value that determines whether the layer presents its content using a Core Animation transaction.
PresentsWithTransaction() bool
SetPresentsWithTransaction(value bool)
// A Boolean value that determines whether the layer synchronizes its updates to the display’s refresh rate.
DisplaySyncEnabled() bool
SetDisplaySyncEnabled(value bool)
// Metadata describing the tone mapping to apply to the extended dynamic range (EDR) values in the layer.
EDRMetadata() ICAEDRMetadata
SetEDRMetadata(value ICAEDRMetadata)
// Waits until a Metal drawable is available, and then returns it.
NextDrawable() CAMetalDrawable
// The number of Metal drawables in the resource pool managed by Core Animation.
MaximumDrawableCount() uint
SetMaximumDrawableCount(value uint)
// A Boolean value that determines whether requests for a new buffer expire if the system can’t satisfy them.
AllowsNextDrawableTimeout() bool
SetAllowsNextDrawableTimeout(value bool)
// The properties of the Metal performance heads-up display.
DeveloperHUDProperties() foundation.INSDictionary
SetDeveloperHUDProperties(value foundation.INSDictionary)
ResidencySet() objectivec.IObject
// A positive integer that identifies the drawable.
DrawableID() int
SetDrawableID(value int)
// The host time, in seconds, when the drawable was displayed onscreen.
PresentedTime() float64
SetPresentedTime(value float64)
}
An interface definition for the CAMetalLayer class.
Configuring the Metal Device ¶
- [ICAMetalLayer.Device]: The Metal device responsible for the layer’s drawable resources.
- [ICAMetalLayer.SetDevice]
- [ICAMetalLayer.PreferredDevice]: The device object that the system recommends using for this layer.
Configuring the Layer’s Drawable Objects ¶
- [ICAMetalLayer.PixelFormat]: The pixel format of the layer’s textures.
- [ICAMetalLayer.SetPixelFormat]
- [ICAMetalLayer.Colorspace]: The color space of the rendered content.
- [ICAMetalLayer.SetColorspace]
- [ICAMetalLayer.FramebufferOnly]: A Boolean value that determines whether the layer’s textures are used only for rendering.
- [ICAMetalLayer.SetFramebufferOnly]
- [ICAMetalLayer.DrawableSize]: The size, in pixels, of textures for rendering layer content.
- [ICAMetalLayer.SetDrawableSize]
Configuring Presentation Behavior ¶
- [ICAMetalLayer.PresentsWithTransaction]: A Boolean value that determines whether the layer presents its content using a Core Animation transaction.
- [ICAMetalLayer.SetPresentsWithTransaction]
- [ICAMetalLayer.DisplaySyncEnabled]: A Boolean value that determines whether the layer synchronizes its updates to the display’s refresh rate.
- [ICAMetalLayer.SetDisplaySyncEnabled]
Configuring Extended Dynamic Range Behavior ¶
- [ICAMetalLayer.EDRMetadata]: Metadata describing the tone mapping to apply to the extended dynamic range (EDR) values in the layer.
- [ICAMetalLayer.SetEDRMetadata]
Obtaining a Metal Drawable ¶
- [ICAMetalLayer.NextDrawable]: Waits until a Metal drawable is available, and then returns it.
- [ICAMetalLayer.MaximumDrawableCount]: The number of Metal drawables in the resource pool managed by Core Animation.
- [ICAMetalLayer.SetMaximumDrawableCount]
- [ICAMetalLayer.AllowsNextDrawableTimeout]: A Boolean value that determines whether requests for a new buffer expire if the system can’t satisfy them.
- [ICAMetalLayer.SetAllowsNextDrawableTimeout]
Configuring the Metal Performance HUD ¶
- [ICAMetalLayer.DeveloperHUDProperties]: The properties of the Metal performance heads-up display.
- [ICAMetalLayer.SetDeveloperHUDProperties]
Instance Properties ¶
- [ICAMetalLayer.ResidencySet]
See: https://developer.apple.com/documentation/QuartzCore/CAMetalLayer
type ICAPropertyAnimation ¶
type ICAPropertyAnimation interface {
ICAAnimation
// Specifies the key path the receiver animates.
KeyPath() string
SetKeyPath(value string)
// Determines if the value of the property is the value at the end of the previous repeat cycle, plus the value of the current repeat cycle.
Cumulative() bool
SetCumulative(value bool)
// Determines if the value specified by the animation is added to the current render tree value to produce the new render tree value.
Additive() bool
SetAdditive(value bool)
// An optional value function that is applied to interpolated values.
ValueFunction() ICAValueFunction
SetValueFunction(value ICAValueFunction)
}
An interface definition for the CAPropertyAnimation class.
Animated Key Path ¶
- [ICAPropertyAnimation.KeyPath]: Specifies the key path the receiver animates.
- [ICAPropertyAnimation.SetKeyPath]
Property Value Calculation Behavior ¶
- [ICAPropertyAnimation.Cumulative]: Determines if the value of the property is the value at the end of the previous repeat cycle, plus the value of the current repeat cycle.
- [ICAPropertyAnimation.SetCumulative]
- [ICAPropertyAnimation.Additive]: Determines if the value specified by the animation is added to the current render tree value to produce the new render tree value.
- [ICAPropertyAnimation.SetAdditive]
- [ICAPropertyAnimation.ValueFunction]: An optional value function that is applied to interpolated values.
- [ICAPropertyAnimation.SetValueFunction]
See: https://developer.apple.com/documentation/QuartzCore/CAPropertyAnimation
type ICARemoteLayerClient ¶
type ICARemoteLayerClient interface {
objectivec.IObject
// Creates a layer client from a server port.
InitWithServerPort(port uint32) CARemoteLayerClient
// The ID of the remote layer client.
ClientId() uint32
// The layer associated with the remote client.
Layer() ICALayer
SetLayer(value ICALayer)
// Invalidates a remote layer client.
Invalidate()
}
An interface definition for the CARemoteLayerClient class.
Creating a Client ¶
- [ICARemoteLayerClient.InitWithServerPort]: Creates a layer client from a server port.
Retrieving Client Properties ¶
- [ICARemoteLayerClient.ClientId]: The ID of the remote layer client.
- [ICARemoteLayerClient.Layer]: The layer associated with the remote client.
- [ICARemoteLayerClient.SetLayer]
Invalidating a Client ¶
- [ICARemoteLayerClient.Invalidate]: Invalidates a remote layer client.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerClient
type ICARemoteLayerServer ¶
type ICARemoteLayerServer interface {
objectivec.IObject
// The port number of the server.
ServerPort() uint32
}
An interface definition for the CARemoteLayerServer class.
Creating a Server ¶
- [ICARemoteLayerServer.ServerPort]: The port number of the server.
See: https://developer.apple.com/documentation/QuartzCore/CARemoteLayerServer
type ICARenderer ¶
type ICARenderer interface {
objectivec.IObject
// The root layer of the layer-tree the receiver should render.
Layer() ICALayer
SetLayer(value ICALayer)
// The bounds of the receiver.
Bounds() corefoundation.CGRect
SetBounds(value corefoundation.CGRect)
// Begin rendering a frame at the specified time.
BeginFrameAtTimeTimeStamp(t float64, ts *corevideo.CVTimeStamp)
// Returns the bounds of the update region that contains all pixels that will be rendered by the current frame.
UpdateBounds() corefoundation.CGRect
// Adds the rectangle to the update region of the current frame.
AddUpdateRect(r corefoundation.CGRect)
// Render the update region of the current frame to the target context.
Render()
// Returns the time at which the next update should happen.
NextFrameTime() float64
// Release any data associated with the current frame.
EndFrame()
SetDestination(tex objectivec.IObject)
}
An interface definition for the CARenderer class.
Getting the Rendered Layer ¶
- [ICARenderer.Layer]: The root layer of the layer-tree the receiver should render.
- [ICARenderer.SetLayer]
Determining Layer Bounds ¶
- [ICARenderer.Bounds]: The bounds of the receiver.
- [ICARenderer.SetBounds]
Rendering a Frame ¶
- [ICARenderer.BeginFrameAtTimeTimeStamp]: Begin rendering a frame at the specified time.
- [ICARenderer.UpdateBounds]: Returns the bounds of the update region that contains all pixels that will be rendered by the current frame.
- [ICARenderer.AddUpdateRect]: Adds the rectangle to the update region of the current frame.
- [ICARenderer.Render]: Render the update region of the current frame to the target context.
- [ICARenderer.NextFrameTime]: Returns the time at which the next update should happen.
- [ICARenderer.EndFrame]: Release any data associated with the current frame.
Instance Methods ¶
- [ICARenderer.SetDestination]
See: https://developer.apple.com/documentation/QuartzCore/CARenderer
type ICAReplicatorLayer ¶
type ICAReplicatorLayer interface {
ICALayer
// The number of copies to create, including the source layers.
InstanceCount() int
SetInstanceCount(value int)
// Specifies the delay, in seconds, between replicated copies. Animatable.
InstanceDelay() float64
SetInstanceDelay(value float64)
// The transform matrix applied to the previous instance to produce the current instance. Animatable.
InstanceTransform() CATransform3D
SetInstanceTransform(value CATransform3D)
// Defines whether this layer flattens its sublayers into its plane.
PreservesDepth() bool
SetPreservesDepth(value bool)
// Defines the color used to multiply the source object. Animatable.
InstanceColor() coregraphics.CGColorRef
SetInstanceColor(value coregraphics.CGColorRef)
// Defines the offset added to the red component of the color for each replicated instance. Animatable.
InstanceRedOffset() float32
SetInstanceRedOffset(value float32)
// Defines the offset added to the green component of the color for each replicated instance. Animatable.
InstanceGreenOffset() float32
SetInstanceGreenOffset(value float32)
// Defines the offset added to the blue component of the color for each replicated instance. Animatable.
InstanceBlueOffset() float32
SetInstanceBlueOffset(value float32)
// Defines the offset added to the alpha component of the color for each replicated instance. Animatable.
InstanceAlphaOffset() float32
SetInstanceAlphaOffset(value float32)
}
An interface definition for the CAReplicatorLayer class.
Setting Instance Display Properties ¶
- [ICAReplicatorLayer.InstanceCount]: The number of copies to create, including the source layers.
- [ICAReplicatorLayer.SetInstanceCount]
- [ICAReplicatorLayer.InstanceDelay]: Specifies the delay, in seconds, between replicated copies. Animatable.
- [ICAReplicatorLayer.SetInstanceDelay]
- [ICAReplicatorLayer.InstanceTransform]: The transform matrix applied to the previous instance to produce the current instance. Animatable.
- [ICAReplicatorLayer.SetInstanceTransform]
Modifying Instance Layer Geometry ¶
- [ICAReplicatorLayer.PreservesDepth]: Defines whether this layer flattens its sublayers into its plane.
- [ICAReplicatorLayer.SetPreservesDepth]
Accessing Instance Color Values ¶
- [ICAReplicatorLayer.InstanceColor]: Defines the color used to multiply the source object. Animatable.
- [ICAReplicatorLayer.SetInstanceColor]
- [ICAReplicatorLayer.InstanceRedOffset]: Defines the offset added to the red component of the color for each replicated instance. Animatable.
- [ICAReplicatorLayer.SetInstanceRedOffset]
- [ICAReplicatorLayer.InstanceGreenOffset]: Defines the offset added to the green component of the color for each replicated instance. Animatable.
- [ICAReplicatorLayer.SetInstanceGreenOffset]
- [ICAReplicatorLayer.InstanceBlueOffset]: Defines the offset added to the blue component of the color for each replicated instance. Animatable.
- [ICAReplicatorLayer.SetInstanceBlueOffset]
- [ICAReplicatorLayer.InstanceAlphaOffset]: Defines the offset added to the alpha component of the color for each replicated instance. Animatable.
- [ICAReplicatorLayer.SetInstanceAlphaOffset]
See: https://developer.apple.com/documentation/QuartzCore/CAReplicatorLayer
type ICAScrollLayer ¶
type ICAScrollLayer interface {
ICALayer
// Defines the axes in which the layer may be scrolled.
ScrollMode() CAScrollLayerScrollMode
SetScrollMode(value CAScrollLayerScrollMode)
// Changes the origin of the receiver to the specified point.
ScrollToPoint(p corefoundation.CGPoint)
// Scroll the contents of the receiver to ensure that the rectangle is visible.
ScrollToRect(r corefoundation.CGRect)
}
An interface definition for the CAScrollLayer class.
Scrolling constraints ¶
- [ICAScrollLayer.ScrollMode]: Defines the axes in which the layer may be scrolled.
- [ICAScrollLayer.SetScrollMode]
Scrolling the layer ¶
- [ICAScrollLayer.ScrollToPoint]: Changes the origin of the receiver to the specified point.
- [ICAScrollLayer.ScrollToRect]: Scroll the contents of the receiver to ensure that the rectangle is visible.
See: https://developer.apple.com/documentation/QuartzCore/CAScrollLayer
type ICAShapeLayer ¶
type ICAShapeLayer interface {
ICALayer
// The path defining the shape to be rendered. Animatable.
Path() coregraphics.CGPathRef
SetPath(value coregraphics.CGPathRef)
// The color used to fill the shape’s path. Animatable.
FillColor() coregraphics.CGColorRef
SetFillColor(value coregraphics.CGColorRef)
// The fill rule used when filling the shape’s path.
FillRule() CAShapeLayerFillRule
SetFillRule(value CAShapeLayerFillRule)
// Specifies the line cap style for the shape’s path.
LineCap() CAShapeLayerLineCap
SetLineCap(value CAShapeLayerLineCap)
// The dash pattern applied to the shape’s path when stroked.
LineDashPattern() []foundation.NSNumber
SetLineDashPattern(value []foundation.NSNumber)
// The dash phase applied to the shape’s path when stroked. Animatable.
LineDashPhase() float64
SetLineDashPhase(value float64)
// Specifies the line join style for the shape’s path.
LineJoin() CAShapeLayerLineJoin
SetLineJoin(value CAShapeLayerLineJoin)
// Specifies the line width of the shape’s path. Animatable.
LineWidth() float64
SetLineWidth(value float64)
// The miter limit used when stroking the shape’s path. Animatable.
MiterLimit() float64
SetMiterLimit(value float64)
// The color used to stroke the shape’s path. Animatable.
StrokeColor() coregraphics.CGColorRef
SetStrokeColor(value coregraphics.CGColorRef)
// The relative location at which to begin stroking the path. Animatable.
StrokeStart() float64
SetStrokeStart(value float64)
// The relative location at which to stop stroking the path. Animatable.
StrokeEnd() float64
SetStrokeEnd(value float64)
// Specifies the even-odd winding rule. Count the total number of path crossings. If the number of crossings is even, the point is outside the path. If the number of crossings is odd, the point is inside the path and the region containing it should be filled.
EvenOdd() CAShapeLayerFillRule
}
An interface definition for the CAShapeLayer class.
Specifying the Shape Path ¶
- [ICAShapeLayer.Path]: The path defining the shape to be rendered. Animatable.
- [ICAShapeLayer.SetPath]
Accessing Shape Style Properties ¶
- [ICAShapeLayer.FillColor]: The color used to fill the shape’s path. Animatable.
- [ICAShapeLayer.SetFillColor]
- [ICAShapeLayer.FillRule]: The fill rule used when filling the shape’s path.
- [ICAShapeLayer.SetFillRule]
- [ICAShapeLayer.LineCap]: Specifies the line cap style for the shape’s path.
- [ICAShapeLayer.SetLineCap]
- [ICAShapeLayer.LineDashPattern]: The dash pattern applied to the shape’s path when stroked.
- [ICAShapeLayer.SetLineDashPattern]
- [ICAShapeLayer.LineDashPhase]: The dash phase applied to the shape’s path when stroked. Animatable.
- [ICAShapeLayer.SetLineDashPhase]
- [ICAShapeLayer.LineJoin]: Specifies the line join style for the shape’s path.
- [ICAShapeLayer.SetLineJoin]
- [ICAShapeLayer.LineWidth]: Specifies the line width of the shape’s path. Animatable.
- [ICAShapeLayer.SetLineWidth]
- [ICAShapeLayer.MiterLimit]: The miter limit used when stroking the shape’s path. Animatable.
- [ICAShapeLayer.SetMiterLimit]
- [ICAShapeLayer.StrokeColor]: The color used to stroke the shape’s path. Animatable.
- [ICAShapeLayer.SetStrokeColor]
- [ICAShapeLayer.StrokeStart]: The relative location at which to begin stroking the path. Animatable.
- [ICAShapeLayer.SetStrokeStart]
- [ICAShapeLayer.StrokeEnd]: The relative location at which to stop stroking the path. Animatable.
- [ICAShapeLayer.SetStrokeEnd]
See: https://developer.apple.com/documentation/QuartzCore/CAShapeLayer
type ICASpringAnimation ¶
type ICASpringAnimation interface {
ICABasicAnimation
// Defines how the spring’s motion should be damped due to the forces of friction.
Damping() float64
SetDamping(value float64)
// The initial velocity of the object attached to the spring.
InitialVelocity() float64
SetInitialVelocity(value float64)
// The mass of the object attached to the end of the spring.
Mass() float64
SetMass(value float64)
// The estimated duration required for the spring system to be considered at rest.
SettlingDuration() float64
// The spring stiffness coefficient.
Stiffness() float64
SetStiffness(value float64)
InitWithPerceptualDurationBounce(perceptualDuration float64, bounce float64) CASpringAnimation
AllowsOverdamping() bool
SetAllowsOverdamping(value bool)
Bounce() float64
PerceptualDuration() float64
}
An interface definition for the CASpringAnimation class.
Configuring Physical Attributes ¶
- [ICASpringAnimation.Damping]: Defines how the spring’s motion should be damped due to the forces of friction.
- [ICASpringAnimation.SetDamping]
- [ICASpringAnimation.InitialVelocity]: The initial velocity of the object attached to the spring.
- [ICASpringAnimation.SetInitialVelocity]
- [ICASpringAnimation.Mass]: The mass of the object attached to the end of the spring.
- [ICASpringAnimation.SetMass]
- [ICASpringAnimation.SettlingDuration]: The estimated duration required for the spring system to be considered at rest.
- [ICASpringAnimation.Stiffness]: The spring stiffness coefficient.
- [ICASpringAnimation.SetStiffness]
Initializers ¶
- [ICASpringAnimation.InitWithPerceptualDurationBounce]
Instance Properties ¶
- [ICASpringAnimation.AllowsOverdamping]
- [ICASpringAnimation.SetAllowsOverdamping]
- [ICASpringAnimation.Bounce]
- [ICASpringAnimation.PerceptualDuration]
See: https://developer.apple.com/documentation/QuartzCore/CASpringAnimation
type ICATextLayer ¶
type ICATextLayer interface {
ICALayer
// The font used to render the receiver’s text.
Font() corefoundation.CFTypeRef
SetFont(value corefoundation.CFTypeRef)
// The font size used to render the receiver’s text. Animatable.
FontSize() float64
SetFontSize(value float64)
// The color used to render the receiver’s text. Animatable.
ForegroundColor() coregraphics.CGColorRef
SetForegroundColor(value coregraphics.CGColorRef)
// Determines whether to allow subpixel quantization for the graphics context used for text rendering.
AllowsFontSubpixelQuantization() bool
SetAllowsFontSubpixelQuantization(value bool)
// Determines whether the text is wrapped to fit within the receiver’s bounds.
Wrapped() bool
SetWrapped(value bool)
// Determines how individual lines of text are horizontally aligned within the receiver’s bounds.
AlignmentMode() CATextLayerAlignmentMode
SetAlignmentMode(value CATextLayerAlignmentMode)
// Determines how the text is truncated to fit within the receiver’s bounds.
TruncationMode() CATextLayerTruncationMode
SetTruncationMode(value CATextLayerTruncationMode)
}
An interface definition for the CATextLayer class.
Text Visual Properties ¶
- [ICATextLayer.Font]: The font used to render the receiver’s text.
- [ICATextLayer.SetFont]
- [ICATextLayer.FontSize]: The font size used to render the receiver’s text. Animatable.
- [ICATextLayer.SetFontSize]
- [ICATextLayer.ForegroundColor]: The color used to render the receiver’s text. Animatable.
- [ICATextLayer.SetForegroundColor]
- [ICATextLayer.AllowsFontSubpixelQuantization]: Determines whether to allow subpixel quantization for the graphics context used for text rendering.
- [ICATextLayer.SetAllowsFontSubpixelQuantization]
Text Alignment and Truncation ¶
- [ICATextLayer.Wrapped]: Determines whether the text is wrapped to fit within the receiver’s bounds.
- [ICATextLayer.SetWrapped]
- [ICATextLayer.AlignmentMode]: Determines how individual lines of text are horizontally aligned within the receiver’s bounds.
- [ICATextLayer.SetAlignmentMode]
- [ICATextLayer.TruncationMode]: Determines how the text is truncated to fit within the receiver’s bounds.
- [ICATextLayer.SetTruncationMode]
See: https://developer.apple.com/documentation/QuartzCore/CATextLayer
type ICATiledLayer ¶
type ICATiledLayer interface {
ICALayer
// The number of levels of detail maintained by this layer.
LevelsOfDetail() uintptr
SetLevelsOfDetail(value uintptr)
// The number of magnified levels of detail for this layer.
LevelsOfDetailBias() uintptr
SetLevelsOfDetailBias(value uintptr)
// The maximum size of each tile used to create the layer’s content.
TileSize() corefoundation.CGSize
SetTileSize(value corefoundation.CGSize)
}
An interface definition for the CATiledLayer class.
Levels of detail ¶
- [ICATiledLayer.LevelsOfDetail]: The number of levels of detail maintained by this layer.
- [ICATiledLayer.SetLevelsOfDetail]
- [ICATiledLayer.LevelsOfDetailBias]: The number of magnified levels of detail for this layer.
- [ICATiledLayer.SetLevelsOfDetailBias]
Layer tile size ¶
- [ICATiledLayer.TileSize]: The maximum size of each tile used to create the layer’s content.
- [ICATiledLayer.SetTileSize]
See: https://developer.apple.com/documentation/QuartzCore/CATiledLayer
type ICATransaction ¶
type ICATransaction interface {
objectivec.IObject
}
An interface definition for the CATransaction class.
See: https://developer.apple.com/documentation/QuartzCore/CATransaction
type ICATransformLayer ¶
type ICATransformLayer interface {
ICALayer
}
An interface definition for the CATransformLayer class.
See: https://developer.apple.com/documentation/QuartzCore/CATransformLayer
type ICATransition ¶
type ICATransition interface {
ICAAnimation
// Indicates the start point of the receiver as a fraction of the entire transition.
StartProgress() float32
SetStartProgress(value float32)
// Indicates the end point of the receiver as a fraction of the entire transition.
EndProgress() float32
SetEndProgress(value float32)
// Specifies the predefined transition type.
Type() CATransitionType
SetType(value CATransitionType)
// Specifies an optional subtype that indicates the direction for the predefined motion-based transitions.
Subtype() CATransitionSubtype
SetSubtype(value CATransitionSubtype)
// An optional Core Image filter object that provides the transition.
Filter() objectivec.IObject
SetFilter(value objectivec.IObject)
// The background color of the receiver. Animatable.
BackgroundColor() coregraphics.CGColorRef
SetBackgroundColor(value coregraphics.CGColorRef)
}
An interface definition for the CATransition class.
Transition start and end point ¶
- [ICATransition.StartProgress]: Indicates the start point of the receiver as a fraction of the entire transition.
- [ICATransition.SetStartProgress]
- [ICATransition.EndProgress]: Indicates the end point of the receiver as a fraction of the entire transition.
- [ICATransition.SetEndProgress]
Transition Properties ¶
- [ICATransition.Type]: Specifies the predefined transition type.
- [ICATransition.SetType]
- [ICATransition.Subtype]: Specifies an optional subtype that indicates the direction for the predefined motion-based transitions.
- [ICATransition.SetSubtype]
Custom transition filter ¶
- [ICATransition.Filter]: An optional Core Image filter object that provides the transition.
- [ICATransition.SetFilter]
See: https://developer.apple.com/documentation/QuartzCore/CATransition
type ICAValueFunction ¶
type ICAValueFunction interface {
objectivec.IObject
// Returns the name of the value function.
Name() CAValueFunctionName
// Defines the value the receiver uses to start interpolation.
FromValue() objectivec.IObject
SetFromValue(value objectivec.IObject)
// The mathematical constant pi (π), approximately equal to 3.14159.
Pi() float32
SetPi(value float32)
// A value function that rotates by the input value, in radians, around the z-axis. This value function expects a single input value.
RotateZ() CAValueFunctionName
// A value function scales by the input value along all three axis. Animations using this value transform function must provide animation values in an
Scale() CAValueFunctionName
// Defines the value the receiver uses to end interpolation.
ToValue() objectivec.IObject
SetToValue(value objectivec.IObject)
// A value function that translates by the input values along all three axis. Animations using this value transform function must provide animation values in an
Translate() CAValueFunctionName
// An optional value function that is applied to interpolated values.
ValueFunction() ICAValueFunction
SetValueFunction(value ICAValueFunction)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CAValueFunction class.
Getting Value Function Properties ¶
- [ICAValueFunction.Name]: Returns the name of the value function.
See: https://developer.apple.com/documentation/QuartzCore/CAValueFunction
type VoidHandler ¶
type VoidHandler = func()
VoidHandler handles A block object called when animations for this transaction group are completed.
Used by:
- [CATransaction.SetCompletionBlock]
Source Files
¶
- action_protocol.gen.go
- animation_delegate_protocol.gen.go
- blocks.gen.go
- ca_animation.gen.go
- ca_animation_group.gen.go
- ca_basic_animation.gen.go
- ca_constraint.gen.go
- ca_constraint_layout_manager.gen.go
- ca_display_link.gen.go
- ca_emitter_cell.gen.go
- ca_emitter_layer.gen.go
- ca_gradient_layer.gen.go
- ca_keyframe_animation.gen.go
- ca_layer.gen.go
- ca_media_timing_function.gen.go
- ca_metal_display_link.gen.go
- ca_metal_display_link_update.gen.go
- ca_metal_layer.gen.go
- ca_property_animation.gen.go
- ca_remote_layer_client.gen.go
- ca_remote_layer_server.gen.go
- ca_renderer.gen.go
- ca_replicator_layer.gen.go
- ca_scroll_layer.gen.go
- ca_shape_layer.gen.go
- ca_spring_animation.gen.go
- ca_text_layer.gen.go
- ca_tiled_layer.gen.go
- ca_transaction.gen.go
- ca_transform_layer.gen.go
- ca_transition.gen.go
- ca_value_function.gen.go
- caedr_metadata.gen.go
- delegate_class_counter.gen.go
- doc.gen.go
- enums.gen.go
- functions.gen.go
- generate.go
- global_vars.gen.go
- layer_delegate_protocol.gen.go
- layout_manager_protocol.gen.go
- media_timing_protocol.gen.go
- metal_display_link_delegate_protocol.gen.go
- metal_drawable_protocol.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go