Into

Modules

Documentation

classPiiImageReaderOperation

#include <PiiImageReaderOperation.h>

A base class for image sources.

Inherits PiiDefaultOperation

Inherited by PiiCameraOperation, PiiImageFileReader, PiiNetworkCameraOperation, PiiVideoFileReader

Description

Inputs

triggeran optional trigger input. A new image is emitted whenever any object is received in this input.

Outputs

imagethe image output. Emits either four-channel color or grayscale (the default) images in 8-bit (unsigned char) channel format.

Properties

int

The (zero-based) index of the next image to be emitted.

The type of the images that are written out.

int

The maximum number of images the source will emit.

Public types

enum
{ GrayScale, Color, Original }

Possible image types.

Constructors and destructor

(
  • Data * data
)

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

virtual int
virtual ImageType
( )
virtual int
( )
virtual void
virtual void
(
  • int cnt
)

Protected member functions

void

Creates a PiiQImage<PiiColor4<> > out of img and emits it through the image output.

void
( )

Creates a PiiQImage<unsigned char> out of img and emits it through the image output.

void
( )

Creates either a PiiMatrix<PiiColor4<> > or PiiMatrix<unsigned char>=""> depending on the type of img, and emits the result through the image output.

(
  • Data * data
)

Property details

  • int currentImageIndex

    [read]

    The (zero-based) index of the next image to be emitted.

  • ImageType imageType

    [read, write]

    The type of the images that are written out.

    If the type of the opened image does not match the one indicated here, the image will be automatically converted to the correct type. The default type is Original.

  • int maxImages

    [read, write]

    The maximum number of images the source will emit.

    This is the upper limit for the number of images the source will ever emit, regardless of the total amount of images available. -1 means eternally.

Enumeration details

  • enum ImageType

    Possible image types.

    • GrayScale - the images will be of an 8-bit gray scale type (unsigned char)

    • Color - the images will be of a 32-bit RGBA color type (PiiColor4<unsigned char>). This is the native color format supported by QImage.

    • Original - the output type will be either gray scale or color, depending on the type of the input image.

Function details

  • PiiImageReaderOperation

    (
    • Data * data
    )
    [protected]
  • virtual void check

    (
    • bool reset
    )
    [virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiDefaultOperation.

  • virtual int currentImageIndex

    ()
    [virtual]
  • virtual ImageType imageType

    ()
    [virtual]
  • virtual int maxImages

    ()
    [virtual]
  • virtual void setImageType

    ()
    [virtual]
  • virtual void setMaxImages

    (
    • int cnt
    )
    [virtual]
  • void emitColorImage

    ()
    [protected]

    Creates a PiiQImage<PiiColor4<> > out of img and emits it through the image output.

    The ownership of the data buffer in img is transferred to the PiiQImage, and may have been deleted already when the function returns.

  • void emitGrayImage

    ()
    [protected]

    Creates a PiiQImage<unsigned char> out of img and emits it through the image output.

    The ownership of the data buffer in img is transferred to the PiiQImage, and may have been deleted already when the function returns.

  • void emitImage

    ()
    [protected]

    Creates either a PiiMatrix<PiiColor4<> > or PiiMatrix<unsigned char>=""> depending on the type of img, and emits the result through the image output.

Notes (0)

Add a note

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