Package dvedit :: Module core :: Class Frame
[hide private]
[frames] | no frames]

Class Frame



object --+
         |
        Frame
Known Subclasses:
BlankFrame

Encapsulates a single frame, with video and audio

Attributes:

Instance Methods [hide private]
 
__new__(T, S, ...)
Returns: a new object with type S, a subtype of T
 
blank(...)
blanks out all audio/video in this frame
 
damage(...)
Indicate that this frame is getting its raw data changed, which will render its encoded data useless
 
decode(...)
 
dump(...)
Prints diagnostics
 
encode(...)
 
ensureDecoded(...)
Ensures this frame is encoded
 
ensureDecodedAsRgb(...)
Converts this frame to RGB format.
 
ensureDecodedAsYuv(...)
Converts this frame to YUV format.
 
ensureEncoded(...)
Ensures this frame is encoded
 
fromPilImg(...)
Sets this frame's video data from the given PIL image
 
getPixel(...)
retrieves value of pixel at x,y as R,G,B or Y,U,V tuple
 
loadFrom(...)
Attempts to load this frame from given file, which must be of compatible dimensions
 
old__init__(...)
 
reverse(...)
 
saveAs(...)
Saves this frame as a still graphics image
 
setFormat(...)
Sets a chosen pixel format (one of the PIXFMT_xxx constants)
 
setFormat_BGR(...)
Ensures pixel format of this frame is BGR, decoding/converting as necessary
 
setFormat_BGRA(...)
Ensures pixel format of this frame is BGRA, decoding/converting as necessary
 
setFormat_RGB(...)
Ensures pixel format of this frame is RGB, decoding/converting as necessary
 
setFormat_RGBA(...)
Ensures pixel format of this frame is RGBA, decoding/converting as necessary
 
setFormat_YUV(...)
Ensures pixel format of this frame is YCbCr, decoding/converting as necessary
 
setFormat_YUVA(...)
Ensures pixel format of this frame is YCbCrA, decoding/converting as necessary
 
setPixel(...)
Sets the given pixel at x,y to value (tuple R,G,B or Y,U,V)
 
toPilImg(...)
Returns a PIL image object containing this frame's raw data
 
toPpm(...)
writes the last decoded frame to PPM file

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]
  _codec
  audioBufLen
  colorModel
  encoded
  hasEncoded
  hasRaw
  height
  isBlank
  isPal
  isProgressive
  numAudioChannels
  pixFmt
  raw
  rawFull
  videoBufLen

Inherited from object: __class__

Method Details [hide private]

__new__(T, S, ...)

 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

ensureDecodedAsRgb(...)

 

Converts this frame to RGB format.

If frame is only in encoded format, decodes to RGB

If frame is in YUV format, converts to RGB

If frame is already in RGB format, does nothing

ensureDecodedAsYuv(...)

 

Converts this frame to YUV format.

If frame is only in encoded format, decodes to YUV

If frame is in RGB format, converts to YUV

If frame is already in YUV format, does nothing

saveAs(...)

 

Saves this frame as a still graphics image

Filename is any filename like 'foo.jpg', 'bar.png' etc

toPpm(...)

 

writes the last decoded frame to PPM file

Useful as a handy way of dumping raw video data