Xmipp  v3.23.11-Nereus
rwTIFF.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Authors: Joaquin Oton (joton@cnb.csic.es)
3  *
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #ifndef CORE_RWTIFF_H_
27 #define CORE_RWTIFF_H_
28 
31 
32 
36 { // Header for each Directory in TIFF
37  unsigned short bitsPerSample;
38  unsigned short samplesPerPixel;
39  unsigned int imageWidth;
40  unsigned int imageLength;
42  unsigned short resUnit;
44  unsigned int subFileType;
45  uint16_t pNumber, pTotal; // pagenumber and total number of pages of current directory
47  {
48  bitsPerSample=samplesPerPixel=0;
49  imageWidth=imageLength=subFileType=0;
50  imageSampleFormat=0;
51  xTiffRes=yTiffRes=0;
52  }
53 };
54 
58 void castTiffTile2T(
59  size_t offset ,
60  char* tif_buf,
61  unsigned int x, unsigned int y,
62  unsigned int imageWidth, unsigned int imageLength,
63  unsigned int tileWidth, unsigned int tileLength,
64  unsigned short samplesPerPixel,
65  DataType datatype);
66 
70 void castTiffLine2T(
71  size_t offset,
72  char* tif_buf,
73  unsigned int y,
74  unsigned int imageWidth, unsigned int imageLength,
75  unsigned short samplesPerPixel,
76  DataType datatype);
77 
82 
85 int readTIFF(size_t select_img, bool isStack=false);
86 
89 int writeTIFF(size_t select_img, bool isStack=false, int mode=WRITE_OVERWRITE, String bitDepth="", CastWriteMode castMode = CW_CAST);
91 #endif /* RWTIFF_H_ */
uint16_t pNumber
Definition: rwTIFF.h:45
unsigned int subFileType
Definition: rwTIFF.h:44
float xTiffRes
Definition: rwTIFF.h:43
void castTiffTile2T(size_t offset, char *tif_buf, unsigned int x, unsigned int y, unsigned int imageWidth, unsigned int imageLength, unsigned int tileWidth, unsigned int tileLength, unsigned short samplesPerPixel, DataType datatype)
void castTiffLine2T(size_t offset, char *tif_buf, unsigned int y, unsigned int imageWidth, unsigned int imageLength, unsigned short samplesPerPixel, DataType datatype)
static double * y
unsigned short samplesPerPixel
Definition: rwTIFF.h:38
DataType datatypeTIFF(TIFFDirHead dHead)
unsigned int imageWidth
Definition: rwTIFF.h:39
unsigned int imageLength
Definition: rwTIFF.h:40
int readTIFF(size_t select_img, bool isStack=false)
unsigned short resUnit
Definition: rwTIFF.h:42
float yTiffRes
Definition: rwTIFF.h:43
doublereal * x
TIFFDirHead()
Definition: rwTIFF.h:46
unsigned short bitsPerSample
Definition: rwTIFF.h:37
DataType
void mode
std::string String
Definition: xmipp_strings.h:34
uint16_t pTotal
Definition: rwTIFF.h:45
CastWriteMode
uint16_t imageSampleFormat
Definition: rwTIFF.h:41
int writeTIFF(size_t select_img, bool isStack=false, int mode=WRITE_OVERWRITE, String bitDepth="", CastWriteMode castMode=CW_CAST)