PAGComposition Class Reference

Inherits from PAGLayer : NSObject
Declared in PAGComposition.h

+ Make:

Make a empty PAGComposition with specified size.

+ (PAGComposition *)Make:(CGSize)size

Declared In

PAGComposition.h

– width

Returns the width of the Composition.

- (NSInteger)width

Declared In

PAGComposition.h

– height

Returns the height of the Composition.

- (NSInteger)height

Declared In

PAGComposition.h

– setContentSize:

Set the size of the Composition.

- (void)setContentSize:(CGSize)size

Declared In

PAGComposition.h

– numChildren

Returns the number of child layers of this composition.

- (NSInteger)numChildren

Declared In

PAGComposition.h

– getLayerAt:

Returns the child layer that exists at the specified index.

- (PAGLayer *)getLayerAt:(int)index

Parameters

index

The index position of the child layer.

Return Value

The child layer at the specified index position.

Declared In

PAGComposition.h

– getLayerIndex:

Returns the index position of a child layer.

- (NSInteger)getLayerIndex:(PAGLayer *)child

Parameters

child

The layer instance to identify.

Return Value

The index position of the child layer to identify.

Declared In

PAGComposition.h

– setLayerIndex:layer:

Changes the position of an existing child in the container. This affects the layering of child layers.

- (void)setLayerIndex:(NSInteger)index layer:(PAGLayer *)child

Parameters

index

The resulting index number for the child layer.

child

The child layer for which you want to change the index number.

Declared In

PAGComposition.h

– addLayer:

Add PAGLayer to current PAGComposition at the top.

- (BOOL)addLayer:(PAGLayer *)pagLayer

Parameters

pagLayer

specified PAGLayer to add

Return Value

return YES if operation succeed, otherwise NO.

Declared In

PAGComposition.h

– addLayer:atIndex:

Add PAGLayer to current PAGComposition at the specified index.

- (BOOL)addLayer:(PAGLayer *)pagLayer atIndex:(int)index

Parameters

pagLayer

specified PAGLayer to add

index

specified index where to add

Return Value

return YES if operation succeed,else NO.

Declared In

PAGComposition.h

– contains:

Check whether current PAGComposition cotains the specified pagLayer.

- (BOOL)contains:(PAGLayer *)pagLayer

Parameters

pagLayer

specified layer to check

Return Value

return YES if the current PAGComposition contains the paglayer,else NO.

Declared In

PAGComposition.h

– removeLayer:

Remove the specified PAGLayer from current PAGComposition.

- (PAGLayer *)removeLayer:(PAGLayer *)pagLayer

Parameters

pagLayer

specified PAGLayer to remove

Return Value

return the PAGLayer if remove successfully,else nil.

Declared In

PAGComposition.h

– removeLayerAt:

Remove the PAGLayer at specified index from current PAGComposition.

- (PAGLayer *)removeLayerAt:(int)index

Parameters

index

specified index to remove

Return Value

return the PAGLayer if remove successfully,else nil.

Declared In

PAGComposition.h

– removeAllLayers

Remove all PAGLayers from current PAGComposition.

- (void)removeAllLayers

Declared In

PAGComposition.h

– swapLayer:withLayer:

Swap the layers.

- (void)swapLayer:(PAGLayer *)pagLayer1 withLayer:(PAGLayer *)pagLayer2

Parameters

pagLayer1

specified PAGLayer 1 to swap

pagLayer2

specified PAGLayer 2 to swap

Declared In

PAGComposition.h

– swapLayerAt:withIndex:

Swap the layers at the specified index.

- (void)swapLayerAt:(int)index1 withIndex:(int)index2

Parameters

index1

specified index 1 to swap

index2

specified index 2 to swap

Declared In

PAGComposition.h

– audioBytes

Returns the audio data of this composition, which is an AAC audio in an MPEG-4 container.

- (NSData *)audioBytes

Declared In

PAGComposition.h

– audioStartTime

Returns when the first frame of the audio plays in the composition’s timeline.

- (int64_t)audioStartTime

Declared In

PAGComposition.h

– audioMarkers

Returns the audio Markers of the composition.

- (NSArray<PAGMarker*> *)audioMarkers

Declared In

PAGComposition.h

– getLayersByName:

Returns an array of layers that match the specified layer name.

- (NSArray<PAGLayer*> *)getLayersByName:(NSString *)layerName

Declared In

PAGComposition.h

– getLayersUnderPoint:

Returns an array of layers that lie under the specified point. The point is in pixels and from this PAGComposition’s local coordinates.

- (NSArray<PAGLayer*> *)getLayersUnderPoint:(CGPoint)point

Declared In

PAGComposition.h