Image Component Library (ICL)
Static Public Member Functions | Static Private Member Functions | List of all members
icl::io::TestImages Class Reference

Utility class for creating test images. More...

#include <TestImages.h>

Static Public Member Functions

static core::ImgBasecreate (const std::string &name, const utils::Size &size, core::format f=core::formatRGB, core::depth d=core::depth8u)
 creates a new testimage instance More...
 
static core::ImgBasecreate (const std::string &name, core::format f=core::formatRGB, core::depth d=core::depth8u)
 creats testimages in original size More...
 
static void xv (const core::ImgBase *image, const std::string &tmpName="./tmp_image.ppm", long msec_to_rm_call=1000)
 writes the image to the disc an shows it using xv. More...
 
static void show (const core::ImgBase *image, const std::string &showCommand="icl-xv -input %s -delete", long msec_to_rm_call=0, const std::string &rmCommand="")
 writes the image to the hard disk and show it using the given shell command More...
 

Static Private Member Functions

static core::Img8uinternalCreate (const std::string &name)
 internal creation funtion for image More...
 

Detailed Description

Utility class for creating test images.

Member Function Documentation

◆ create() [1/2]

static core::ImgBase* icl::io::TestImages::create ( const std::string &  name,
const utils::Size size,
core::format  f = core::formatRGB,
core::depth  d = core::depth8u 
)
static

creates a new testimage instance

possible values for name are

  • lena
  • cameraman
  • mandril
  • women
  • house
  • tree
  • parrot
  • windows
  • flowers
    Parameters
    namename identifier of the image
    sizedestination size of the image
    fcore::format of the image
    dcore::depth of the image
    Returns
    new image (ownership is passed to the caller!)

◆ create() [2/2]

static core::ImgBase* icl::io::TestImages::create ( const std::string &  name,
core::format  f = core::formatRGB,
core::depth  d = core::depth8u 
)
static

creats testimages in original size

Parameters
namename identifier of the image
fcore::format of the image
dcore::depth of the image
Returns
new image (ownership is passed to the caller!)

◆ internalCreate()

static core::Img8u* icl::io::TestImages::internalCreate ( const std::string &  name)
staticprivate

internal creation funtion for image

◆ show()

static void icl::io::TestImages::show ( const core::ImgBase image,
const std::string &  showCommand = "icl-xv -input %s -delete",
long  msec_to_rm_call = 0,
const std::string &  rmCommand = "" 
)
static

writes the image to the hard disk and show it using the given shell command

Parameters
imageimage to show
showCommandcommand to visualize the image. As default, the iclxv viewer of the ICLQt package is used. Enshure, that at least a link to this viewer is available in your path variable. A temporarily created filename (composed of a prefix, a current-system-time-body and a file name postfix is inserted where the s token is found
msec_to_rm_callwhen showing images using other image viewers, the temporarily created image must be deleted when the extern editor has read the image. This value determines how many milliseconds should be waited before the rmCommand is called.
rmCommandcommand to remove the temporary image (something like "rm -rf %s"

◆ xv()

static void icl::io::TestImages::xv ( const core::ImgBase image,
const std::string &  tmpName = "./tmp_image.ppm",
long  msec_to_rm_call = 1000 
)
static

writes the image to the disc an shows it using xv.

Parameters
imageimage to write and to show
tmpNametemporary filename for this image
msec_to_rm_callthis time in msec is waited for xv to come up and to read the tmp image

The documentation for this class was generated from the following file: