Documentation ¶
Index ¶
- Constants
- type Action
- type ActionList
- type AudioStream
- type BitmapDefinition
- type Combinable
- type Depth
- type FontDefinition
- func (d *FontDefinition) ComposeTextSWF(entries []subtypes.GLYPHENTRY, height, yOffset, xOffset float64, c math.Color) (list shapes.DrawPathList, newXOffset float64)
- func (d *FontDefinition) GetObjectId() uint16
- func (d *FontDefinition) GetSafeObject() shapes.ObjectDefinition
- func (d *FontDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
- type FontEntry
- type FrameInformation
- type MorphShapeDefinition
- type MultiFrameObjectDefinition
- type NextFrameAction
- type Option
- type PlaceAction
- type PlayAction
- type RenderedFrame
- type RenderedObject
- type SWFProcessor
- type SWFTreeProcessor
- type ShapeDefinition
- type SpriteDefinition
- func (d *SpriteDefinition) GetObjectId() uint16
- func (d *SpriteDefinition) GetSafeObject() shapes.ObjectDefinition
- func (d *SpriteDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
- func (d *SpriteDefinition) NextFrame(frameNumber int64, p shapes.ObjectProperties) *ViewFrame
- type SpriteFrameEntry
- type StopAction
- type TextDefinition
- type ViewFrame
- type ViewLayout
- func (v *ViewLayout) Get(depth uint16) *ViewLayout
- func (v *ViewLayout) GetObjectId() uint16
- func (v *ViewLayout) NextFrame(frameNumber int64, actions ActionList) (frame *ViewFrame)
- func (v *ViewLayout) Place(depth uint16, ob *ViewLayout)
- func (v *ViewLayout) Remove(depth uint16)
- func (v *ViewLayout) Replace(depth uint16, ob *ViewLayout)
Constants ¶
View Source
const ( ActionPlace = PlaceAction(iota) ActionReplace ActionModify )
View Source
const BackgroundObjectDepth = 0
View Source
const BackgroundObjectId = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface {
Code() subtypes.ActionCode
}
type ActionList ¶
type ActionList []Action
type AudioStream ¶
type AudioStream struct { Format swftag.SoundFormat SampleRate int SampleSize int Channels int SoundId uint16 SoundData []byte Start *int64 Data []byte }
func AudioStreamFromSWF ¶
func AudioStreamFromSWF(soundRate swftag.SoundRate, soundSize uint8, isStereo bool, soundFormat swftag.SoundFormat) *AudioStream
func (*AudioStream) AddStreamBlock ¶
func (s *AudioStream) AddStreamBlock(node *swftag.SoundStreamBlock)
type BitmapDefinition ¶
type BitmapDefinition struct { ObjectId uint16 ShapeList shapes.DrawPathList }
func BitmapDefinitionFromSWF ¶
func BitmapDefinitionFromSWF(bitmapId uint16, imageData []byte, alphaData []byte) (*BitmapDefinition, error)
func BitmapDefinitionFromSWFLossless ¶
func BitmapDefinitionFromSWFLossless(bitmapId uint16, im image.Image) *BitmapDefinition
func (*BitmapDefinition) GetObjectId ¶
func (d *BitmapDefinition) GetObjectId() uint16
func (*BitmapDefinition) GetSafeObject ¶
func (d *BitmapDefinition) GetSafeObject() shapes.ObjectDefinition
func (*BitmapDefinition) GetShapeList ¶
func (d *BitmapDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
type Combinable ¶
type Combinable[T any] interface { Combine(o T) T }
type Depth ¶
type Depth []uint16
func DepthFromPackedLayer ¶
func DepthFromString ¶
func (Depth) GetPackedLayer ¶
GetPackedLayer Segment depth into specific layers, leaving 2^16 for first, at least 2^8 for second (and 2^8 for third), if no third it'll use whole for second TODO: handle higher depths gracefully It is known layers CAN overlap, TODO: check if limiting range might make sense? TODO: change this to a truly dynamic mode. might need 2-pass to check for hole overlap libass reads this onto an int32, TODO it overflows onto negative? Additionally the order of fields has extra read order. earlier lines have lower effective layer than later lines, if layers are equal
type FontDefinition ¶
type FontDefinition struct { FontId uint16 Name []byte Italic bool Bold bool Scale float64 Entries []FontEntry }
func FontDefinitionFromSWF ¶
func (*FontDefinition) ComposeTextSWF ¶
func (d *FontDefinition) ComposeTextSWF(entries []subtypes.GLYPHENTRY, height, yOffset, xOffset float64, c math.Color) (list shapes.DrawPathList, newXOffset float64)
func (*FontDefinition) GetObjectId ¶
func (d *FontDefinition) GetObjectId() uint16
func (*FontDefinition) GetSafeObject ¶
func (d *FontDefinition) GetSafeObject() shapes.ObjectDefinition
func (*FontDefinition) GetShapeList ¶
func (d *FontDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
type FrameInformation ¶
type FrameInformation struct { FrameNumber int64 FrameOffset int64 FrameRate float64 Frame *ViewFrame }
func (FrameInformation) Difference ¶
func (i FrameInformation) Difference(o FrameInformation) FrameInformation
func (FrameInformation) GetEndTime ¶
func (i FrameInformation) GetEndTime() time.Duration
func (FrameInformation) GetFrameDuration ¶
func (i FrameInformation) GetFrameDuration() time.Duration
func (FrameInformation) GetFrameNumber ¶
func (i FrameInformation) GetFrameNumber() int64
func (FrameInformation) GetStartTime ¶
func (i FrameInformation) GetStartTime() time.Duration
type MorphShapeDefinition ¶
type MorphShapeDefinition struct { ObjectId uint16 StartBounds, EndBounds shapes.Rectangle[float64] StartShapeList, EndShapeList shapes.DrawPathList }
func MorphShapeDefinitionFromSWF ¶
func MorphShapeDefinitionFromSWF(collection shapes.ObjectCollection, shapeId uint16, startBounds, endBounds shapes.Rectangle[float64], startRecords, endRecords subtypes.SHAPERECORDS, fillStyles subtypes.MORPHFILLSTYLEARRAY, lineStyles subtypes.MORPHLINESTYLEARRAY) *MorphShapeDefinition
func (*MorphShapeDefinition) GetObjectId ¶
func (d *MorphShapeDefinition) GetObjectId() uint16
func (*MorphShapeDefinition) GetSafeObject ¶
func (d *MorphShapeDefinition) GetSafeObject() shapes.ObjectDefinition
func (*MorphShapeDefinition) GetShapeList ¶
func (d *MorphShapeDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
type MultiFrameObjectDefinition ¶
type MultiFrameObjectDefinition interface { shapes.ObjectDefinition NextFrame(frameNumber int64, p shapes.ObjectProperties) *ViewFrame }
type NextFrameAction ¶
type NextFrameAction struct { }
func (*NextFrameAction) Code ¶
func (a *NextFrameAction) Code() subtypes.ActionCode
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func SomeDefault ¶
func SomePointer ¶
type PlaceAction ¶
type PlaceAction uint8
func PlaceActionFromFlags ¶
func PlaceActionFromFlags(hasCharacter, isMove bool) PlaceAction
type PlayAction ¶
type PlayAction struct { }
func (*PlayAction) Code ¶
func (a *PlayAction) Code() subtypes.ActionCode
type RenderedFrame ¶
type RenderedFrame []*RenderedObject
type RenderedObject ¶
type RenderedObject struct { Depth Depth ObjectId uint16 DrawPathList shapes.DrawPathList Clip *shapes.ClipPath ColorTransform math.ColorTransform MatrixTransform math.MatrixTransform }
func (*RenderedObject) GetDepth ¶
func (o *RenderedObject) GetDepth() Depth
type SWFProcessor ¶
type SWFProcessor struct { SWFTreeProcessor Background *shapes.FillStyleRecord ViewPort shapes.Rectangle[float64] FrameRate float64 ExpectedFrameCount int64 Audio *AudioStream }
func NewSWFProcessor ¶
func (*SWFProcessor) NextFrameOutput ¶
func (p *SWFProcessor) NextFrameOutput() *FrameInformation
type SWFTreeProcessor ¶
type SWFTreeProcessor struct { Layout *ViewLayout Objects shapes.ObjectCollection Tags []swftag.Tag Index int Frame int64 LastFrame *ViewFrame Playing bool Loops int Version uint8 JPEGTables []byte // contains filtered or unexported fields }
func NewSWFTreeProcessor ¶
func NewSWFTreeProcessor(objectId uint16, tags []swftag.Tag, objects shapes.ObjectCollection, version uint8) *SWFTreeProcessor
func (*SWFTreeProcessor) Current ¶
func (p *SWFTreeProcessor) Current() swftag.Tag
func (*SWFTreeProcessor) Next ¶
func (p *SWFTreeProcessor) Next()
func (*SWFTreeProcessor) NextFrame ¶
func (p *SWFTreeProcessor) NextFrame(loop bool) *ViewFrame
func (*SWFTreeProcessor) Process ¶
func (p *SWFTreeProcessor) Process(actions ActionList) (tag swftag.Tag, newActions ActionList)
type ShapeDefinition ¶
type ShapeDefinition struct { ObjectId uint16 Bounds shapes.Rectangle[float64] ShapeList shapes.DrawPathList }
func ShapeDefinitionFromSWF ¶
func ShapeDefinitionFromSWF(collection shapes.ObjectCollection, shapeId uint16, bounds shapes.Rectangle[float64], records subtypes.SHAPERECORDS, fillStyles subtypes.FILLSTYLEARRAY, lineStyles subtypes.LINESTYLEARRAY) *ShapeDefinition
func (*ShapeDefinition) GetObjectId ¶
func (d *ShapeDefinition) GetObjectId() uint16
func (*ShapeDefinition) GetSafeObject ¶
func (d *ShapeDefinition) GetSafeObject() shapes.ObjectDefinition
func (*ShapeDefinition) GetShapeList ¶
func (d *ShapeDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
type SpriteDefinition ¶
type SpriteDefinition struct { ObjectId uint16 Frames [][]SpriteFrameEntry }
func SpriteDefinitionFromSWF ¶
func SpriteDefinitionFromSWF(spriteId uint16, frameCount int, p *SWFTreeProcessor) *SpriteDefinition
func (*SpriteDefinition) GetObjectId ¶
func (d *SpriteDefinition) GetObjectId() uint16
func (*SpriteDefinition) GetSafeObject ¶
func (d *SpriteDefinition) GetSafeObject() shapes.ObjectDefinition
func (*SpriteDefinition) GetShapeList ¶
func (d *SpriteDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
func (*SpriteDefinition) NextFrame ¶
func (d *SpriteDefinition) NextFrame(frameNumber int64, p shapes.ObjectProperties) *ViewFrame
type SpriteFrameEntry ¶
type SpriteFrameEntry struct { Depth uint16 Object shapes.ObjectDefinition ColorTransform Option[math2.ColorTransform] MatrixTransform Option[math2.MatrixTransform] ClipDepth Option[uint16] Properties shapes.ObjectProperties }
type StopAction ¶
type StopAction struct { }
func (*StopAction) Code ¶
func (a *StopAction) Code() subtypes.ActionCode
type TextDefinition ¶
type TextDefinition struct { ObjectId uint16 Bounds shapes.Rectangle[float64] ShapeList shapes.DrawPathList }
func TextDefinitionFromSWF ¶
func TextDefinitionFromSWF(collection shapes.ObjectCollection, characterId uint16, bounds types.RECT, textRecords subtypes.TEXTRECORDS, matrix types.MATRIX) *TextDefinition
func (*TextDefinition) GetObjectId ¶
func (d *TextDefinition) GetObjectId() uint16
func (*TextDefinition) GetSafeObject ¶
func (d *TextDefinition) GetSafeObject() shapes.ObjectDefinition
func (*TextDefinition) GetShapeList ¶
func (d *TextDefinition) GetShapeList(p shapes.ObjectProperties) (list shapes.DrawPathList)
type ViewFrame ¶
type ViewFrame struct { ObjectId uint16 DepthMap map[uint16]*ViewFrame DrawPathList Option[shapes.DrawPathList] ColorTransform Option[math.ColorTransform] MatrixTransform Option[math.MatrixTransform] ClipDepth Option[uint16] }
func NewClippingFrame ¶
func NewClippingFrame(objectId, clipDepth uint16, list Option[shapes.DrawPathList]) *ViewFrame
func NewViewFrame ¶
func NewViewFrame(objectId uint16, list Option[shapes.DrawPathList]) *ViewFrame
func (*ViewFrame) Render ¶
func (f *ViewFrame) Render(baseDepth uint16, depthChain Depth, parentColor Option[math.ColorTransform], parentMatrix Option[math.MatrixTransform]) RenderedFrame
type ViewLayout ¶
type ViewLayout struct { Parent *ViewLayout DepthMap map[uint16]*ViewLayout Object shapes.ObjectDefinition ColorTransform Option[math2.ColorTransform] MatrixTransform Option[math2.MatrixTransform] Properties shapes.ObjectProperties ClipDepth Option[uint16] }
func NewClippingViewLayout ¶
func NewClippingViewLayout(objectId, clipDepth uint16, object shapes.ObjectDefinition, parent *ViewLayout) *ViewLayout
func NewViewLayout ¶
func NewViewLayout(objectId uint16, object shapes.ObjectDefinition, parent *ViewLayout) *ViewLayout
func (*ViewLayout) Get ¶
func (v *ViewLayout) Get(depth uint16) *ViewLayout
func (*ViewLayout) GetObjectId ¶
func (v *ViewLayout) GetObjectId() uint16
func (*ViewLayout) NextFrame ¶
func (v *ViewLayout) NextFrame(frameNumber int64, actions ActionList) (frame *ViewFrame)
func (*ViewLayout) Place ¶
func (v *ViewLayout) Place(depth uint16, ob *ViewLayout)
func (*ViewLayout) Remove ¶
func (v *ViewLayout) Remove(depth uint16)
func (*ViewLayout) Replace ¶
func (v *ViewLayout) Replace(depth uint16, ob *ViewLayout)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.