Tony Cook > Imager-0.95 > Imager::Preprocess

Download:
Imager-0.95.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  39
Open  16
View/Report Bugs
Module Version: 1.000   Source   Latest Release: Imager-0.99_02

NAME ^

Imager::Preprocess - simple preprocessor for handling multiple sample sizes

SYNOPSIS ^

  /* in the source: */
  #code condition true to work with 8-bit samples
  ... code using preprocessor types/values ...
  #/code

  # process and make #line directives
  perl -MImager::Preprocess -epreprocess foo.im foo.c

  # process and no #line directives
  perl -MImager::Preprocess -epreprocess -l foo.im foo.c

DESCRIPTION ^

This is a simple preprocessor that aims to reduce duplication of source code when implementing an algorithm both for 8-bit samples and double samples in Imager.

Imager's Makefile.PL currently scans the MANIFEST for .im files and adds Makefile files to convert these to .c files.

The beginning of a sample-independent section of code is preceded by:

  #code expression

where expression should return true if processing should be done at 8-bits/sample.

You can also use a #code block around a function definition to produce 8-bit and double sample versions of a function. In this case #code has no expression and you will need to use IM_SUFFIX() to produce different function names.

The end of a sample-independent section of code is terminated by:

  #/code

#code sections cannot be nested.

#/code without a starting #code is an error.

The following types and values are defined in a #code section:

Other types, functions and values may be added in the future.

AUTHOR ^

Tony Cook <tonyc@cpan.org>

syntax highlighting: