Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4a71d9984febeb5a206904a5a379841a > files > 677

python-morph-0.8-7mdv2010.0.noarch.rpm

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
    <title>mmdatatype</title>
    <link href="../tbxdok.css" rel="stylesheet">
  </head>
  <body>
    <table class="topNav">
      <tr>
        <td class="index">
                  [<a href="../morph/mmmaxleveltype.html"><tt>mmmaxleveltype</tt></a>]
              
                  [<a href="index.html">Up</a>]
                  
                  [<a href="../morph/mmmat2set.html"><tt>mmmat2set</tt></a>]
              </td>
        <td class="title">Image Information and Manipulation</td>
      </tr>
    </table>
    <h1>mmdatatype
      <br>
      <span class="subtitle">Return the image datatype string
</span>
    </h1>
    <div class="synopsis">
      <H2>Synopsis</H2>
      <div class="H2">
        <div class="prototype">type = 
          <span class="fun">mmdatatype</span>(
                  
          <span class="par">f</span>
                  )
        </div>
        <p>Implemented in 
          <b>Python.</b>
        </p>
        <div class="input">
          <H3>Input</H3>
          <div class="H3">
            <table class="deflist">
              <tbody valign="baseline">
                <tr>
                  <td class="term"><span class="par">f</span></td>
                  <td class="def"><span class="type"><a href="../mmtypes/mmImage.html">Image</a></span>          Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image.
                          <p>Any image</p></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <div class="output">
          <H3>Output</H3>
          <div class="H3">
            <table class="deflist">
              <tbody valign="baseline">
                <tr>
                  <td class="term"><span class="par">type</span></td>
                  <td class="def"><span class="type"><a href="../mmtypes/mmString.html">String</a></span><p>   String representation of image type: 'binary', 'uint8', 'uint16' or 'int32'
                         
                    </p></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
    <div class="descr">
      <H2>Description</H2>
      <div class="H2">
        <p>
          <span class="fun">mmdatatype</span> returns a string that identifies the pixel datatype of the image 
          <code>f</code>.
                  
        </p>
      </div>
    </div>
    <div class="sourcecode">
      <H2>Source Code</H2>
      <div class="H2">
        <pre class="listing">
def mmdatatype(f):
    code = f.typecode()
    if   code == '1': type='binary'
    elif code == 'b': type='uint8'
    elif code == 'w': type='uint16'
    elif code == 'i': type='int32'
    else:
        assert 0,'Does not accept this typecode:'+code
    return type
    </pre>
      </div>
    </div>
    <center>
      <table class="botNav">
        <tr>
          <td class="index">
                    [<a href="../morph/mmmaxleveltype.html"><tt>mmmaxleveltype</tt></a>]
                
                    [<a href="index.html">Up</a>]
                    
                    [<a href="../morph/mmmat2set.html"><tt>mmmat2set</tt></a>]
                </td>
          <td rowspan="2" class="xhtml"><a href="http://www.python.org"><img width="55" alt="Python" height="22" src="../PythonPoweredSmall.gif"></a></td>
        </tr>
        <tr>
          <td class="copyright">Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.</td>
        </tr>
      </table>
    </center>
  </body>
</html>