this library provides some basic functionality to operate on raster images. it is thought to wrap code from different libraries in common manner. some parts of it are self-written for better performance.

library content

library consists of many namespaces, all under main Graphics namespace. below goes short description of them and its content.


this is the main namespace. it contains only the basic code.

  • Pixel – representation of pixel in different colour spaces.
  • Position – coordinates representation of pixel in image (x;y).
  • Offset – representation of offset on the image (x;y).
  • Size – common representation of image size (x;y).
  • Raster – main class representing single image.
  • AutoRaster – std::auto_ptr<>-like class wrapping Raster.
  • SharedRaster – boost::shared_ptr<>-like wrapper for Raster.
  • SharedSyncRaster – like SharedRaster but offering synchronisation for multi threading.
  • RasterLayer – representation of single layer of a given raster.
  • SyncRasterLayer – thread-safe raster layer version.
  • SharedSyncRasterLayer – single-object (shared) version of synchronized raster layer.


code representing mask as a pair <Offset;UserValue>.

  • General – general mask of any shape. to be used by derived classes.
  • Radial – radius-shaped mask. computationali efficient.


namespace containing code for filters.

  • General – common base class for all filters.
  • GeneralTwo – General class version assuming that there are two input images. this is useful when computing several operations like image difference.
  • GeneralLayer – General specialization for RasterLayer.
  • GeneralLayerTransformation – Transform wrapper for GeneralLayer.
  • GeneralLayerTwo – works as GeneralLayer but assumes two input images.
  • GeneralLayerTwoTransformation – Transform of GeneralLayerTwo.
  • GeneralRaster – General specialization for Raster.
  • GeneralRasterTransformation – Transform wrapper for GeneralRaster.
  • GeneralRasterTwo – GeneralRaster version assuming that there can be two input images.
  • GeneralRasterTwoTransformation – Transform for GeneralRasterTwo.
  • Median – median filter.
  • SobelEdge – Sobel's edge detecting filter.
  • ColorConverter – code for converting between Rasters in different colour spaces.
  • CenterPass – transformation cutting lower and upper values from image layer.
  • RasterAdder – perform pixel-by-pixel addition of two images.
  • RasterDiffer – perform pixel-by-pixel difference computation of two images.
  • Thresholder – filter computing threshold of given image. Output is always binary image.


this namespace contains histogram computation code.

  • General – general histogram representation.
  • GeneralTransformation – Transform wrapper for General.
  • Color – computer histogram form all images types that uses Graphics::color as pixel values (arrays), i.e.: RasterRGB, RasterMono.


namespace grouping pixelwise operations.

  • PixelAdder – adds two pixels of the same type.
  • PixelConverter – converts between pixels of a different type.
  • PixelDiffer – computes different between pixels.


wrapper for image pyramids.

  • Generic – base for all pyramids.

this is code in progress and will be available in next release.


namespace for scaling algorithms.

  • Resizer – base for all resizing classes.
  • Simple – scaling with “simple” method: for each output pixel corresponding position from input image is computed and colour from there is copied. note that although this algorithm is fast it might cause aliasing.
  • SimpleTransformation – Transform wrapper for Simple scaling.


functionality for reading and writing images from/to disk.

  • Storers.hpp – main include for all available storing classes.
  • Storer – base class for all “storers”.
  • StorerByExt – stores image using its extension as information on prefered output format.


all operations transforming images have bases class from this namespace. it also contains some raster, non-filtering operations.

  • Transofmration – base calss for all transformations. allows to create abstract operations that can be connected by data they operate on.
  • Sequence – sequence of transformations. it assumes that they are already connected in the proper way with data. processing call invokes them in order from first to last. usefull for abstracting complex operations content.


Video4Linux C++ wrapper. operates with both APIv1 and APIv2.

  • CaptureConfiguration – abstrac class used for getting configuration for Capturer.
  • Capturer – main class performing capture of image using predefined settings.
  • Descriptors – enums used for specifying capture configuration.
  • Device – /dev/videoX representation.


this library uses: build process and system. they are both included inside the download package.

it also requires Magick++ library. this is C++ wrapper for ImageMagick.


here you can download Graphics library. current release is 0.4.0.

current version notes

  • API has changed in many points – now most important is RasterLayer class, not Raster as it was before.
  • slightly improved V4L API wrapping – now all is in one header, so there is a chance that V4L API nightmare will finally end (or at least won't propagate further).
  • RasterBinary is now fully supported.
  • image convertion between different color spaces finaly work.
  • Pixel code has been improved – hierarchy has been introduced and wrapped so that it is possible to call specific value of layer in generic way.

known bugs

  • Storage uses Magick++ library to read/write files to disk – there are number of problems with that library causing problems when saving files. in most cases read → write sequence is fine from code level, but sometimes files cannot be opened using external tools (ex: gimp).
  • V4L currently supports only RGB capture since my WebCam driver does not support an other and i'm unable to perform proper tests.
prjs/graphics/graphics.txt · Last modified: 2021/06/15 20:09 by
Back to top
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0