<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='not2intr1'>
<!--  @(#)not2intr.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  Craig Watson and Michael D. Garris -->

<refmeta>
<refentrytitle>NOT2INTR</refentrytitle>
<manvolnum>1D</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>not2intr</refname>
<refpurpose>converts an image comprised of non-interleaved color component planes to an image with interleaved color component pixels.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>not2intr</command>    
    <arg choice='plain'><replaceable>&lt;outext&gt;&lt;imagefile&gt;&lt;w,h,d,</replaceable></arg>
    <arg choice='opt'><replaceable>ppi</replaceable></arg>
    <arg>&gt;</arg>
    <arg choice='opt'>-raw_out </arg>
    <sbr/>
    <arg choice='opt'>-YCbCr <replaceable>H0,V0:H1,V1:H2,V2</replaceable></arg>
    <sbr/>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Not2intr</emphasis>
takes as input a raw pixmap file containing an uncompressed image
comprised of non-interleaved color component planes and converts the image
to interleaved color component pixels.  This utility requires there be
three color components in the input image.  Two output file formats are
possible, a NIST IHead file (the default) or a raw pixmap file
(specified by the <option>-raw_out</option> option).</para>

<para>For example, the pixels of an RGB color image are interleaved
when a pixel's R, G, and B components are sequentially
adjacent in the image byte stream, ie. RGBRGBRGB... .  If the
color components are non-interleaved, then all (R)ed components in the
image are sequentially adjacent in the image byte stream, followed
by all (G)reen components, and then lastly followed by all (B)lue
components.  Each complete sequence of color components is called
a <emphasis remap='I'>plane</emphasis>.  The utility <emphasis remap='B'>intr2not</emphasis> converts interleaved
to non-interleaved color components.</para>

<para>It is possible that the component planes of an input YCbCr image
have been previously downsampled.  If so, the <option>-YCbCr</option> flag
must be included on the command line, listing the appropriate component
plane downsampling factors.  By default, this utility assumes
no downsampling.  YCbCr image results should always be explicitly
stored in a raw pixmap file, because the IHead format only supports
RGB pixels.  (See YCbCr OPTIONS below.)</para>  

</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<para>All switch names may be abbreviated; for example,
<option>-raw_out</option> may be written <option>-r</option>.</para>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;outext&gt;</emphasis></term>
  <listitem>
<para>the extension of the output file.
To construct the output filename, <command>not2intr</command> takes the
input filename and replaces its extension with the one
specified here.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;image file&gt;</emphasis></term>
  <listitem>
<para>the input raw pixmap file containing the color image to be converted.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term>&lt;<emphasis remap='I'>w</emphasis>,<emphasis remap='I'>h</emphasis>,<emphasis remap='I'>d</emphasis>,[<emphasis remap='I'>ppi</emphasis>]&gt;</term>
  <listitem>
<para>the attributes of the input image in the raw pixmap file.</para>
<!-- .br -->
  <!-- .RS -->
  </listitem>
  </varlistentry>
</variablelist>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>w</emphasis></term>
  <listitem>
<para>the pixel width of the pixmap</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>h</emphasis></term>
  <listitem>
<para>the pixel height of the pixmap</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>d</emphasis></term>
  <listitem>
<para>the pixel depth of the pixmap</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>ppi</emphasis></term>
  <listitem>
<para>the optional scan resolution of the image in integer units of
pixels per inch.</para>
  </listitem>
  </varlistentry>
</variablelist>
<!-- .RE -->
<variablelist remap='TP'>
  <varlistentry>
  <term><option>-raw_out</option></term>
  <listitem>
<para>specifies that the results should be stored to a raw pixmap file.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-YCbCr</option> <replaceable>H0</replaceable>,<emphasis remap='I'>V0</emphasis>:<emphasis remap='I'>H1</emphasis>,<emphasis remap='I'>V1</emphasis>:<emphasis remap='I'>H2</emphasis>,<emphasis remap='I'>V2</emphasis></term>
  <listitem>
<para>indicates that a YCbCr color image is being input whose
component planes have been previously downsampled.
The <option>-raw_out</option> flag should always be used in conjunction with
this option.
(See YCbCr Options below.)</para>

  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='ycbcr_options'><title>YCbCr OPTIONS</title>
<para>A common compression technique for YCbCr images is to downsample
the Cb &amp; Cr component planes.
<emphasis remap='B'>Not2intr</emphasis> can handle a limited range of YCbCr
downsampling schemes that are represented by a list of component
plane factors.
These factors together represent downsampling ratios relative to
each other.  The comma-separated list of factor pairs correspond to
the Y, Cb, and
Cr component planes respectively.  The first value in a factor
pair represents the downsampling of that particular component plane
in the X-dimension, while the second represents the Y-dimension.
Compression ratios for a particular component plane are calculated
by dividing the maximum component factors in the list by the current
component's factors.  These integer factors are limited
between 1 and 4.  H,V factors all set to 1 represent
no downsampling.  For complete details, <command>not2intr</command> implements
the downsampling and interleaving schemes described in the
following reference:</para>

<!-- .RS -->
<para>W.B. Pennebaker and J.L. Mitchell, "JPEG: Still Image Compression
Standard," Appendix A - "ISO DIS 10918-1 Requirements and Guidelines,"
Van Nostrand Reinhold, NY, 1993, pp. A1-A4.</para>
<!-- .RE -->

<para>For example the option specification:</para>

<!-- .RS -->
<para>-YCbCr 4,4:2,2:1,1</para>
<!-- .RE -->

<para>indicates that there has been no downsampling of the Y
component plane (4,4 are the largest X and Y factors listed);
the Cb component plane has been downsampled in X and Y by a factor of 2
(maximum factors 4 divided by current factors 2); and the Cr component
plane has been downsampled in X and Y by a factor of 4 (maximum factors 4
divided by current factors 1).  Note that downsampling
component planes is a form of <emphasis remap='I'>lossy</emphasis> compression.
The utility <emphasis remap='B'>rgb2ycc</emphasis> converts RGB pixmaps to the YCbCr
colorspace, and it conducts downsampling of the resulting YCbCr
component planes upon request.</para>

</refsect1>

<refsect1 id='examples'><title>EXAMPLES</title>
<para>From <emphasis remap='I'>test/imgtools/execs/not2intr/not2intr.src</emphasis>:</para>

<!-- .RS -->
<para><emphasis remap='B'>% not2intr raw face.nin 768,1024,24 -r</emphasis>
<!-- .br -->
converts the non-interleaved RGB face image in a
raw pixmap file into interleaved color pixels.</para>

</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><emphasis remap='B'>intr2not</emphasis>(1D),
<emphasis remap='B'>rgb2ycc</emphasis>(1D)</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

