.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "TIFFSWAB" "3tiff" "Jan 27, 2024" "4.5" "LibTIFF" .SH NAME TIFFswab \- byte- and bit-swapping routines .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B const unsigned char *TIFFGetBitRevTable(int reversed) .UNINDENT .INDENT 0.0 .TP .B void TIFFReverseBits(u_char *data, unsigned long nbytes) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabShort(uint16_t *data) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabLong(uint32_t *data) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabLong8(uint64_t *lp) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabFloat(float *fp) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabDouble(double *dp) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabArrayOfShort(uint16_t *wp, tmsize_t n) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabArrayOfTriples(uint8_t *tp, tmsize_t n) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabArrayOfLong(uint32_t *lp, tmsize_t n) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabArrayOfLong8(uint64_t *lp, tmsize_t n) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabArrayOfFloat(float *fp, tmsize_t n) .UNINDENT .INDENT 0.0 .TP .B void TIFFSwabArrayOfDouble(double *dp, tmsize_t n) .UNINDENT .SH DESCRIPTION .sp The following routines are used by the library to swap 16\-, 32\- and 64\-bit data and to reverse the order of bits in bytes. .sp \fI\%TIFFSwabShort()\fP and \fI\%TIFFSwabLong()\fP and \fI\%TIFFSwabFloat()\fP swap the bytes in a single 16\- and 32\-bit item, respectively. .sp \fI\%TIFFSwabLong8()\fP and \fI\%TIFFSwabDouble()\fP swap the bytes in a single 64\-bit item. .sp \fI\%TIFFSwabArrayOfTriples()\fP swap the first and the third byte of each triple (three bytes) within the byte array. The second byte of each triple stays untouched. .sp \fI\%TIFFSwabArrayOfShort()\fP and \fI\%TIFFSwabArrayOfLong()\fP, \fI\%TIFFSwabArrayOfFloat()\fP swap the bytes in an array of 16\- and 32\-bit items, respectively. .sp \fI\%TIFFSwabArrayOfLong8()\fP and \fI\%TIFFSwabArrayOfDouble()\fP swap the bytes in an array of 64\-bit items. .sp \fI\%TIFFReverseBits()\fP replaces each byte in \fIdata\fP with the equivalent bit\-reversed value. This operation is performed with a lookup table, which is returned using the \fI\%TIFFGetBitRevTable()\fP function. The \fIreversed\fP parameter specifies which table should be returned. Supply \fI1\fP if you want bit reversal table. Supply \fI0\fP to get the table that do not reverse bit values. It is a lookup table that can be used as an \(dqidentity function\(dq; i.e. TIFFNoBitRevTable[n] == n\&. .SH DIAGNOSTICS .sp None. .SH SEE ALSO .sp \fI\%libtiff\fP (3tiff) .SH AUTHOR LibTIFF contributors .SH COPYRIGHT 1988-2024, LibTIFF contributors .\" Generated by docutils manpage writer. .