Into

Modules

Documentation

classPiiSequenceFile

#include <PiiSequenceFile.h>

Stores and restores captured frames to/from a sequence file.

Inherits QFile

Inherited by PiiSequenceFileListener

Description

The sequence file contains raw image data, preceded by a short header defined in PiiSequenceFile::Header.

Classes

struct

Sequence file header.

Constructors and destructor

(
  • Data * data
  • const QString & fileName
)

Create a PiiSequenceFile that writes/reads frames to/from the given file.

( )
virtual

Public member functions

unsigned int

Get the number of bits per pixel.

int

Get the number of bytes each frame occupies.

void
( )

Close the sequence file.

int

Get the number of frames in the sequence.

Get the size of stored frames.

( )

Get image format information.

Get image format.

bool
(
  • QIODevice::OpenMode mode
)

Open a sequence file.

bool
(
  • void * frameBuffer
)

Read a frame from the sequence file.

bool
(
  • int frameIndex
)

Seek to the given frame index.

void
(
  • unsigned int bitsPerPixel
)

Set the number of bits per pixel.

void
(
  • int frameCount
)

Set the number of frames in the sequence.

void
( )

Set the size of stored frames.

void

Set image format.

bool
(
  • const void * frameBuffer
)

Write a frame into the sequence file.

Protected member functions

(
  • Data * data
  • const QString & fileName
)

Create a PiiSequenceFile that writes/reads frames to/from the given file.

( )
virtual

Function details

  • PiiSequenceFile

    (
    • Data * data
    • const QString & fileName
    )
    [protected]

    Create a PiiSequenceFile that writes/reads frames to/from the given file.

  • PiiSequenceFile

    ( )
    [protected]
  • virtual ~PiiSequenceFile

    ()
    [protected, virtual]
  • unsigned int bitsPerPixel

    ()

    Get the number of bits per pixel.

  • int bytesPerFrame

    ()

    Get the number of bytes each frame occupies.

    The buffers used with readFrame() and writeFrame() must have a capacity of at least this many bytes.

  • void close

    ()

    Close the sequence file.

    This will rewrite the header to the beginning of the file. Therefore, any changes you make to the header will be stored.

  • int frameCount

    ()

    Get the number of frames in the sequence.

    -1 means unknown.

  • QSize frameSize

    ()

    Get the size of stored frames.

    The same information can be retrieved via header().

  • Header header

    ()

    Get image format information.

    If the sequence is opened for reading, the returned value contains the header read from the file. If the sequence is opened for writing, the header is constructed from the current image settings.

  • PiiCamera::ImageFormat imageFormat

    ()

    Get image format.

  • bool open

    (
    • QIODevice::OpenMode mode
    )

    Open a sequence file.

    If the file is opened for writing, the header will be written to it. For this to succeed, the camera driver must have been initialized. If the file is opened for reading, the header will be read. The header is accessible with the header() function.

  • bool readFrame

    (
    • void * frameBuffer
    )

    Read a frame from the sequence file.

    Image data will be stored to the memory buffer pointed by frameBuffer, which must be allocated to hold at least width*height*bytesPerPixel bytes.

    Returns

    true if reading was successful, false otherwise

  • bool seekFrame

    (
    • int frameIndex
    )

    Seek to the given frame index.

    Parameters
    frameIndex

    seek to the beginning of this frame.

    Returns

    true if seek was successful, false otherwise.

  • void setBitsPerPixel

    (
    • unsigned int bitsPerPixel
    )

    Set the number of bits per pixel.

  • void setFrameCount

    (
    • int frameCount
    )

    Set the number of frames in the sequence.

    The file automatically changes this value, and there should be no need to alter it.

  • void setFrameSize

    ( )

    Set the size of stored frames.

    The value will be stored to the file header and must be correct.

  • void setImageFormat

    Set image format.

  • bool writeFrame

    (
    • const void * frameBuffer
    )

    Write a frame into the sequence file.

    frameBuffer points to the beginning of a raw frame buffer. width*height*bytesPerPixel bytes will be written into the file.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.