HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_FileFilterConvert.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: IMG_FileFilterConvert ( IMG Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Does data format conversion (int8, fp16, etc) and color model
11  * conversion (RGB, A, RGBA).
12  */
13 #ifndef IMG_FILE_FILTER_CONVERT_H
14 #define IMG_FILE_FILTER_CONVERT_H
15 
16 #include "IMG_API.h"
17 #include "IMG_FileFilter.h"
18 #include <PXL/PXL_LumFuncs.h>
19 #include <UT/UT_NonCopyable.h>
20 
21 class img_PlaneConvert;
22 
24 {
25 public:
26  IMG_FileFilterConvert(IMG_File *file_to_filter);
27  ~IMG_FileFilterConvert() override;
28 
30 
31  const char *className() const override { return "IMG_FileFilterConvert"; }
32 
33  void initConversion(IMG_DataType type,
34  IMG_ColorModel model,
36  bool interleaved,
38  bool splitoutalpha,
39  const char *plane_name);
40 
41  const void *readPlaneScanline(int y, const IMG_Plane &pi) override;
42 
43  int writePlaneScanline(const void *data, int y,
44  const IMG_Plane &pi) override;
45 private:
46  void convertPlane(int pindex,
47  const IMG_Stat &sstat,
48  bool sinterleave,
49  IMG_Stat &dstat,
50  bool dinterleave);
51 
52  void convertData(void *dest, const void *source, int pindex, int y);
53 
54  void splitAlphaFromColor(void *dest, const void *alpha, int pindex,
55  bool reversed);
56  void writeAlphaToColor(void *dest, const void *alpha, int pindex);
57 
58  bool findAlphaPlane(const IMG_Stat &stat,int &aindex, int &acomp);
59 
60  void initRead(IMG_DataType type,
61  IMG_ColorModel model,
63  bool interleaved,
65  bool splitoutalpha,
66  const char *plane_name);
67 
68  void initWrite(IMG_DataType type,
69  IMG_ColorModel model,
71  bool interleaved,
73  bool splitoutalpha,
74  const char *plane_name);
75 
76  UT_ValArray<img_PlaneConvert *> myPlaneConvert;
77  PXL_LumFunction myLumFunc;
78  UT_IntArray myAlphaCombineFlags;
79 };
80 
81 #endif
GLint y
Definition: glcorearb.h:103
Describes the format and layout of a single plane in an image The plane specifies the format and name...
Definition: IMG_Plane.h:48
PXL_LumFunction
Definition: PXL_LumFuncs.h:18
#define IMG_API
Definition: IMG_API.h:10
IMG_DataType
Definition: IMG_FileTypes.h:17
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLdouble GLdouble GLint GLint order
Definition: glad.h:2676
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
GLenum func
Definition: glcorearb.h:783
IMG_ColorModel
Definition: IMG_FileTypes.h:53
IMG_ComponentOrder
Definition: IMG_FileTypes.h:95
Contains the details of a specific image file, used by IMG_File. This class contains all the high-lev...
Definition: IMG_Stat.h:38
constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: Math.h:119
#define const
Definition: zconf.h:214
type
Definition: core.h:1059
Definition: format.h:895