KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /usr/local/share/doc/tiff-4.6.0/manual/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/share/doc/tiff-4.6.0/manual/functions/TIFFReadRGBAImage.html
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

    <title>TIFFReadRGBAImage &#8212; LibTIFF 4.6.0 documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/sphinxdoc.css" />
    <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/sphinx_highlight.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TIFFReadRGBAStrip" href="TIFFReadRGBAStrip.html" />
    <link rel="prev" title="TIFFReadRawTile" href="TIFFReadRawTile.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="TIFFReadRGBAStrip.html" title="TIFFReadRGBAStrip"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="TIFFReadRawTile.html" title="TIFFReadRawTile"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">LibTIFF 4.6.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../functions.html" accesskey="U">TIFF Functions Overview</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">TIFFReadRGBAImage</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="tiffreadrgbaimage">
<h1>TIFFReadRGBAImage<a class="headerlink" href="#tiffreadrgbaimage" title="Permalink to this heading">¶</a></h1>
<section id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this heading">¶</a></h2>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;tiffio.h&gt;</span>
</pre></div>
</div>
<dl class="c macro">
<dt class="sig sig-object c" id="c.TIFFGetR">
<span class="sig-name descname"><span class="n"><span class="pre">TIFFGetR</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">abgr</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.TIFFGetR" title="Permalink to this definition">¶</a><br /></dt>
<dd><p><span class="c-expr sig sig-inline c"><span class="p">(</span><span class="p">(</span><span class="n">abgr</span><span class="p">)</span><span class="o">&amp;</span><span class="m">0xff</span><span class="p">)</span></span></p>
</dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.TIFFGetG">
<span class="sig-name descname"><span class="n"><span class="pre">TIFFGetG</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">abgr</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.TIFFGetG" title="Permalink to this definition">¶</a><br /></dt>
<dd><p><span class="c-expr sig sig-inline c"><span class="p">(</span><span class="p">(</span><span class="p">(</span><span class="n">abgr</span><span class="p">)</span><span class="w"> </span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="m">8</span><span class="p">)</span><span class="w"> </span><span class="o">&amp;</span><span class="w"> </span><span class="m">0xff</span><span class="p">)</span></span></p>
</dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.TIFFGetB">
<span class="sig-name descname"><span class="n"><span class="pre">TIFFGetB</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">abgr</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.TIFFGetB" title="Permalink to this definition">¶</a><br /></dt>
<dd><p><span class="c-expr sig sig-inline c"><span class="p">(</span><span class="p">(</span><span class="p">(</span><span class="n">abgr</span><span class="p">)</span><span class="w"> </span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="m">16</span><span class="p">)</span><span class="w"> </span><span class="o">&amp;</span><span class="w"> </span><span class="m">0xff</span><span class="p">)</span></span></p>
</dd></dl>

<dl class="c macro">
<dt class="sig sig-object c" id="c.TIFFGetA">
<span class="sig-name descname"><span class="n"><span class="pre">TIFFGetA</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">abgr</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.TIFFGetA" title="Permalink to this definition">¶</a><br /></dt>
<dd><p><span class="c-expr sig sig-inline c"><span class="p">(</span><span class="p">(</span><span class="p">(</span><span class="n">abgr</span><span class="p">)</span><span class="w"> </span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="m">24</span><span class="p">)</span><span class="w"> </span><span class="o">&amp;</span><span class="w"> </span><span class="m">0xff</span><span class="p">)</span></span></p>
</dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.TIFFReadRGBAImage">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">TIFFReadRGBAImage</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">TIFF</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">tif</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">width</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">height</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">raster</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">stopOnError</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.TIFFReadRGBAImage" title="Permalink to this definition">¶</a><br /></dt>
<dd></dd></dl>

<dl class="c function">
<dt class="sig sig-object c" id="c.TIFFReadRGBAImageOriented">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">TIFFReadRGBAImageOriented</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">TIFF</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">tif</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">width</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="n"><span class="pre">height</span></span>, <span class="n"><span class="pre">uint32_t</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">raster</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">orientation</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">stopOnError</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.TIFFReadRGBAImageOriented" title="Permalink to this definition">¶</a><br /></dt>
<dd></dd></dl>

</section>
<section id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this heading">¶</a></h2>
<p><a class="reference internal" href="#c.TIFFReadRGBAImage" title="TIFFReadRGBAImage"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImage()</span></code></a> reads a strip- or tile-based image into memory,
storing the result in the user supplied <em>raster</em>.
The raster is assumed to be an array of <em>width</em> × <em>height</em> 32-bit entries,
where <em>width</em> must be less than or equal to the width of the image
(<em>height</em> may be any non-zero size).
If the raster dimensions are smaller than the image, the image data is
cropped to the raster bounds.
If the raster height is greater than that of the image, then the image data
are placed in the lower part of the raster.
(Note that the raster is assume to be organized such that the pixel
at location (<em>x</em>, <em>y</em>) is <em>raster</em> [ <em>y</em> × <em>width</em> + <em>x</em> ];
with the raster origin in the lower-left hand corner.)</p>
<p><a class="reference internal" href="#c.TIFFReadRGBAImageOriented" title="TIFFReadRGBAImageOriented"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImageOriented()</span></code></a> works like <a class="reference internal" href="#c.TIFFReadRGBAImage" title="TIFFReadRGBAImage"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImage()</span></code></a>
except that the user can specify the raster origin position with the
<em>orientation</em> parameter. Four orientations are supported:</p>
<ul class="simple">
<li><p><code class="xref c c-macro docutils literal notranslate"><span class="pre">ORIENTATION_TOPLEFT</span></code>: origin in top-left corner,</p></li>
<li><p><code class="xref c c-macro docutils literal notranslate"><span class="pre">ORIENTATION_TOPRIGHT</span></code>: origin in top-right corner,</p></li>
<li><p><code class="xref c c-macro docutils literal notranslate"><span class="pre">ORIENTATION_BOTLEFT</span></code>: origin in bottom-left corner</p></li>
<li><p><code class="xref c c-macro docutils literal notranslate"><span class="pre">ORIENTATION_BOTRIGHT</span></code>: origin in bottom-right corner.</p></li>
</ul>
<p>If you choose <code class="xref c c-macro docutils literal notranslate"><span class="pre">ORIENTATION_BOTLEFT</span></code>, the result will be the same
as returned by the <a class="reference internal" href="#c.TIFFReadRGBAImage" title="TIFFReadRGBAImage"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImage()</span></code></a>.</p>
<p>Raster pixels are 8-bit packed red, green, blue, alpha samples.
The macros <a class="reference internal" href="#c.TIFFGetR" title="TIFFGetR"><code class="xref c c-macro docutils literal notranslate"><span class="pre">TIFFGetR</span></code></a>, <a class="reference internal" href="#c.TIFFGetG" title="TIFFGetG"><code class="xref c c-macro docutils literal notranslate"><span class="pre">TIFFGetG</span></code></a>, <a class="reference internal" href="#c.TIFFGetB" title="TIFFGetB"><code class="xref c c-macro docutils literal notranslate"><span class="pre">TIFFGetB</span></code></a>,
and <a class="reference internal" href="#c.TIFFGetA" title="TIFFGetA"><code class="xref c c-macro docutils literal notranslate"><span class="pre">TIFFGetA</span></code></a> should be used to access individual samples.
Images without Associated Alpha matting information have a constant
Alpha of 1.0 (255).</p>
<p><a class="reference internal" href="#c.TIFFReadRGBAImage" title="TIFFReadRGBAImage"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImage()</span></code></a> converts non-8-bit images by scaling sample
values.  Palette, grayscale, bilevel, CMYK, and YCbCr images are
converted to RGB transparently.
Raster pixels are returned uncorrected by any colorimetry information
present in the directory.</p>
<p>The parameter <em>stopOnError</em> specifies how to act if an error is
encountered while reading the image. If <em>stopOnError</em> is non-zero, then
an error will terminate the operation; otherwise <a class="reference internal" href="#c.TIFFReadRGBAImage" title="TIFFReadRGBAImage"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImage()</span></code></a>
will continue processing data until all the possible data in the
image have been requested.</p>
</section>
<section id="notes">
<h2>Notes<a class="headerlink" href="#notes" title="Permalink to this heading">¶</a></h2>
<p>In C++ the <em>stopOnError</em> parameter defaults to 0.</p>
<p><code class="docutils literal notranslate"><span class="pre">SamplesPerPixel</span></code> must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
<code class="docutils literal notranslate"><span class="pre">SamplesPerPixel</span></code> minus <code class="docutils literal notranslate"><span class="pre">ExtraSamples</span></code>).</p>
<p>Palettte image colormaps that appear to be incorrectly written
as 8-bit values are automatically scaled to 16-bits.</p>
<p><code class="xref c c-func docutils literal notranslate"><span class="pre">IFFReadRGBAImage()</span></code> is just a wrapper around the more general
<a class="reference internal" href="TIFFRGBAImage.html"><span class="doc">TIFFRGBAImage</span></a> facilities.</p>
</section>
<section id="return-values">
<h2>Return values<a class="headerlink" href="#return-values" title="Permalink to this heading">¶</a></h2>
<p>1 is returned if the image was successfully read and converted.
Otherwise, 0 is returned if an error was encountered and
<em>stopOnError</em> is zero.</p>
</section>
<section id="diagnostics">
<h2>Diagnostics<a class="headerlink" href="#diagnostics" title="Permalink to this heading">¶</a></h2>
<p>All error messages are directed to the <a class="reference internal" href="TIFFError.html#c.TIFFErrorExtR" title="TIFFErrorExtR"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFErrorExtR()</span></code></a> routine.</p>
<p><code class="docutils literal notranslate"><span class="pre">&quot;Sorry,</span> <span class="pre">can</span> <span class="pre">not</span> <span class="pre">handle</span> <span class="pre">%d-bit</span> <span class="pre">pictures&quot;</span></code>:</p>
<blockquote>
<div><p>The image had <code class="docutils literal notranslate"><span class="pre">BitsPerSample</span></code> other than 1, 2, 4, 8, or 16.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;Sorry,</span> <span class="pre">can</span> <span class="pre">not</span> <span class="pre">handle</span> <span class="pre">%d-channel</span> <span class="pre">images&quot;</span></code>:</p>
<blockquote>
<div><p>The image had <code class="docutils literal notranslate"><span class="pre">SamplesPerPixel</span></code> other than 1, 3, or 4.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">Missing</span> <span class="pre">needed</span> <span class="pre">&quot;PhotometricInterpretation&quot;</span> <span class="pre">tag</span></code>:</p>
<blockquote>
<div><p>The image did not have a tag that describes how to display
the data.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">No</span> <span class="pre">&quot;PhotometricInterpretation&quot;</span> <span class="pre">tag,</span> <span class="pre">assuming</span> <span class="pre">RGB</span></code>:</p>
<blockquote>
<div><p>The image was missing a tag that describes how to display it,
but because it has 3 or 4 samples/pixel, it is assumed to be
RGB.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">No</span> <span class="pre">&quot;PhotometricInterpretation&quot;</span> <span class="pre">tag,</span> <span class="pre">assuming</span> <span class="pre">min-is-black</span></code>:</p>
<blockquote>
<div><p>The image was missing a tag that describes how to display it,
but because it has 1 sample/pixel, it is assumed to be a grayscale
or bilevel image.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;No</span> <span class="pre">space</span> <span class="pre">for</span> <span class="pre">photometric</span> <span class="pre">conversion</span> <span class="pre">table&quot;</span></code>:</p>
<blockquote>
<div><p>There was insufficient memory for a table used to convert
image samples to 8-bit RGB.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">Missing</span> <span class="pre">required</span> <span class="pre">&quot;Colormap&quot;</span> <span class="pre">tag</span></code>:</p>
<blockquote>
<div><p>A Palette image did not have a required <code class="docutils literal notranslate"><span class="pre">Colormap</span></code> tag.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;No</span> <span class="pre">space</span> <span class="pre">for</span> <span class="pre">tile</span> <span class="pre">buffer&quot;</span></code>:</p>
<blockquote>
<div><p>There was insufficient memory to allocate an i/o buffer.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;No</span> <span class="pre">space</span> <span class="pre">for</span> <span class="pre">strip</span> <span class="pre">buffer&quot;</span></code>:</p>
<blockquote>
<div><p>There was insufficient memory to allocate an i/o buffer.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;Can</span> <span class="pre">not</span> <span class="pre">handle</span> <span class="pre">format&quot;</span></code>:</p>
<blockquote>
<div><p>The image has a format (combination of <code class="docutils literal notranslate"><span class="pre">BitsPerSample</span></code>,
<code class="docutils literal notranslate"><span class="pre">SamplesPerPixel</span></code>, and <code class="docutils literal notranslate"><span class="pre">PhotometricInterpretation</span></code>)
that <a class="reference internal" href="#c.TIFFReadRGBAImage" title="TIFFReadRGBAImage"><code class="xref c c-func docutils literal notranslate"><span class="pre">TIFFReadRGBAImage()</span></code></a> can not handle.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;No</span> <span class="pre">space</span> <span class="pre">for</span> <span class="pre">B&amp;W</span> <span class="pre">mapping</span> <span class="pre">table&quot;</span></code>:</p>
<blockquote>
<div><p>There was insufficient memory to allocate a table used to map
grayscale data to RGB.</p>
</div></blockquote>
<p><code class="docutils literal notranslate"><span class="pre">&quot;No</span> <span class="pre">space</span> <span class="pre">for</span> <span class="pre">Palette</span> <span class="pre">mapping</span> <span class="pre">table&quot;</span></code>:</p>
<blockquote>
<div><p>There was insufficient memory to allocate a table used to map
data to 8-bit RGB.</p>
</div></blockquote>
</section>
<section id="see-also">
<h2>See also<a class="headerlink" href="#see-also" title="Permalink to this heading">¶</a></h2>
<p><a class="reference internal" href="TIFFOpen.html"><span class="doc">TIFFOpen</span></a> (3tiff),
<a class="reference internal" href="TIFFRGBAImage.html"><span class="doc">TIFFRGBAImage</span></a> (3tiff),
<a class="reference internal" href="TIFFReadRGBAStrip.html"><span class="doc">TIFFReadRGBAStrip</span></a> (3tiff),
<a class="reference internal" href="TIFFReadRGBATile.html"><span class="doc">TIFFReadRGBATile</span></a> (3tiff),
<a class="reference internal" href="libtiff.html"><span class="doc">libtiff</span></a> (3tiff)</p>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3><a href="../index.html">Table of Contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">TIFFReadRGBAImage</a><ul>
<li><a class="reference internal" href="#synopsis">Synopsis</a></li>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#notes">Notes</a></li>
<li><a class="reference internal" href="#return-values">Return values</a></li>
<li><a class="reference internal" href="#diagnostics">Diagnostics</a></li>
<li><a class="reference internal" href="#see-also">See also</a></li>
</ul>
</li>
</ul>

  </div>
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="TIFFReadRawTile.html"
                          title="previous chapter">TIFFReadRawTile</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="TIFFReadRGBAStrip.html"
                          title="next chapter">TIFFReadRGBAStrip</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/functions/TIFFReadRGBAImage.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="TIFFReadRGBAStrip.html" title="TIFFReadRGBAStrip"
             >next</a> |</li>
        <li class="right" >
          <a href="TIFFReadRawTile.html" title="TIFFReadRawTile"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">LibTIFF 4.6.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../functions.html" >TIFF Functions Overview</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">TIFFReadRGBAImage</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 1988-2022, LibTIFF contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.0.1.
    </div>
  </body>
</html>

Anon7 - 2021