Debian Codegraph @

texk/xdvipsk/thirdparty/libtiff/doc/functions/TIFFswab.rst

raw
1 TIFFswab
2 ========
3
4 Synopsis
5 --------
6
7 .. highlight:: c
8
9 ::
10
11 #include <tiffio.h>
12
13 .. c:function:: const unsigned char* TIFFGetBitRevTable(int reversed)
14
15 .. c:function:: void TIFFReverseBits(u_char* data, unsigned long nbytes)
16
17 .. c:function:: void TIFFSwabShort(uint16_t* data)
18
19 .. c:function:: void TIFFSwabLong(uint32_t* data)
20
21 .. c:function:: void TIFFSwabLong8(uint64_t* lp)
22
23 .. c:function:: void TIFFSwabFloat(float* fp)
24
25 .. c:function:: void TIFFSwabDouble(double *dp)
26
27 .. c:function:: void TIFFSwabArrayOfShort(uint16_t* wp, tmsize_t n)
28
29 .. c:function:: void TIFFSwabArrayOfTriples(uint8_t* tp, tmsize_t n)
30
31 .. c:function:: void TIFFSwabArrayOfLong(uint32_t* lp, tmsize_t n)
32
33 .. c:function:: void TIFFSwabArrayOfLong8(uint64_t* lp, tmsize_t n)
34
35 .. c:function:: void TIFFSwabArrayOfFloat(float* fp, tmsize_t n)
36
37 .. c:function:: void TIFFSwabArrayOfDouble(double* dp, tmsize_t n)
38
39 Description
40 -----------
41
42 The following routines are used by the library to swap 16-, 32- and 64-bit
43 data and to reverse the order of bits in bytes.
44
45 :c:func:`TIFFSwabShort` and :c:func:`TIFFSwabLong` and :c:func:`TIFFSwabFloat`
46 swap the bytes in a single 16- and 32-bit item, respectively.
47
48 :c:func:`TIFFSwabLong8` and :c:func:`TIFFSwabDouble`
49 swap the bytes in a single 64-bit item.
50
51 :c:func:`TIFFSwabArrayOfTriples` swap the first and the third byte of
52 each triple (three bytes) within the byte array. The second byte of each
53 triple stays untouched.
54
55 :c:func:`TIFFSwabArrayOfShort` and :c:func:`TIFFSwabArrayOfLong`,
56 :c:func:`TIFFSwabArrayOfFloat` swap the bytes in an array of 16- and 32-bit
57 items, respectively.
58
59 :c:func:`TIFFSwabArrayOfLong8` and :c:func:`TIFFSwabArrayOfDouble`
60 swap the bytes in an array of 64-bit items.
61
62 :c:func:`TIFFReverseBits` replaces each byte in *data* with the
63 equivalent bit-reversed value. This operation is performed with a
64 lookup table, which is returned using the :c:func:`TIFFGetBitRevTable`
65 function. The *reversed* parameter specifies which table should be
66 returned. Supply *1* if you want bit reversal table. Supply *0* to get
67 the table that do not reverse bit values. It is a lookup table that can
68 be used as an "identity function"; i.e. :c:expr:`TIFFNoBitRevTable[n] == n`.
69
70 Diagnostics
71 -----------
72
73 None.
74
75 See also
76 --------
77
78 :doc:`libtiff` (3tiff)