Xmipp  v3.23.11-Nereus
xmipp_image_convert.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Carlos Oscar coss@cnb.csic.es (2007)
4  * Joaquin Oton joton@cnb.csic.es (2010)
5  *
6  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21  * 02111-1307 USA
22  *
23  * All comments concerning this program package may be sent to the
24  * e-mail address 'xmipp@cnb.csic.es'
25  ***************************************************************************/
26 #ifndef IMAGE_CONVERT_H_
27 #define IMAGE_CONVERT_H_
28 
31 
35 typedef enum
36 {
40 } ImageConv;
41 
43 {
44 
45 private:
46  String type; // Type of output conversion
47  String depth;
48  ImageGeneric imIn;
49  ImageGeneric *imOut = nullptr;
50  ImageConv convMode;
51  CastWriteMode castMode;
52  size_t k;
53  int writeMode;
54  bool appendToStack;
55  bool swap;
56 
57 public:
59  ProgConvImg();
60  virtual ~ProgConvImg() {
61  if (imOut) {
62  delete imOut;
63  }
64  }
65  void setType(const String &sType)
66  {
67  type = sType;
68  }
69 protected:
70  void init();
71  void defineParams();
72  void readParams();
73  void preProcess();
74  void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut);
75  void finishProcessing();
76  void show();
77 };//class ProgConvImg
79 #endif /* IMAGE_CONVERT_H_ */
void setType(const String &sType)
virtual ~ProgConvImg()
std::string String
Definition: xmipp_strings.h:34
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
CastWriteMode