camera.formats.util
index
d:\00_ip\spmdev\tripod\applications\python\packages\camera\formats\util.py

# camera/formats/util.py
#
# Utility functions to read binary data.
#
# This file is part of the Python package to handle Camera data (CAMPP).
#
# Copyright (c) 2009-2012, Universiteit Leiden
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
#   this list of conditions and the following disclaimer in the documentation
#   and/or other materials provided with the distribution.
# - Neither the name of Universiteit Leiden nor the names of its contributors
#   may be used to endorse or promote products derived from this software
#   without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Martin Moene (original), Sander Roobol
#
# $Id: util.py 649 2012-02-27 13:41:59Z moene $
#

 
Modules
       
struct

 
Functions
       
CHAR = readByte(f)
Read a byte at the current file position.
CSTR = readCString(f)
Read CArchive-style string: data prepended by 8-bit integer indicating the length.
DOUBLE = readDouble(f)
Read a double at the current file position.
INT16 = readInt16(f)
Read a 16-bit int at the current file position.
INT32 = readInt32(f)
Read a 32-bit int at the current file position.
OBJNAME = readObjName(f)
Read CArchive object name: a string prepended by its length as an 16-byte integer
UINT16 = readUInt16(f)
Read an unsigned 16-bit int at the current file position.
UINT32 = readUInt32(f)
Read an unsigned 32-bit int at the current file position.
ZSTR = readZString(f)
Read a nul-terminated string at the current file position.
Ok for Python 2.6 and Python 3.
bitcount(x)
the number of set bits, see http://wiki.python.org/moin/BitManipulation
readBinaryHeader(f, description)
readByte(f)
Read a byte at the current file position.
readCString(f)
Read CArchive-style string: data prepended by 8-bit integer indicating the length.
readDouble(f)
Read a double at the current file position.
readInt16(f)
Read a 16-bit int at the current file position.
readInt32(f)
Read a 32-bit int at the current file position.
readObjName(f)
Read CArchive object name: a string prepended by its length as an 16-byte integer
readUInt16(f)
Read an unsigned 16-bit int at the current file position.
readUInt32(f)
Read an unsigned 32-bit int at the current file position.
readZString(f)
Read a nul-terminated string at the current file position.
Ok for Python 2.6 and Python 3.