HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 class img_PlaneConvert;
17 
18 #include <PXL/PXL_LumFuncs.h>
19 
20 #include "IMG_FileFilter.h"
21 
23 {
24 public:
25  IMG_FileFilterConvert(IMG_File *file_to_filter);
26  virtual ~IMG_FileFilterConvert();
27 
28  virtual const char *className() const { return "IMG_FileFilterConvert"; }
29 
30  void initConversion(IMG_DataType type,
31  IMG_ColorModel model,
32  IMG_ComponentOrder order,
33  bool interleaved,
35  bool splitoutalpha,
36  const char *plane_name);
37 
38  virtual const void *readPlaneScanline(int y, const IMG_Plane &pi);
39 
40  virtual int writePlaneScanline(const void *data, int y,
41  const IMG_Plane &pi);
42 private:
43  void convertPlane(int pindex,
44  const IMG_Stat &sstat,
45  bool sinterleave,
46  IMG_Stat &dstat,
47  bool dinterleave);
48 
49  void convertData(void *dest, const void *source, int pindex, int y);
50 
51  void splitAlphaFromColor(void *dest, const void *alpha, int pindex,
52  bool reversed);
53  void writeAlphaToColor(void *dest, const void *alpha, int pindex);
54 
55  bool findAlphaPlane(const IMG_Stat &stat,int &aindex, int &acomp);
56 
57  void initRead(IMG_DataType type,
58  IMG_ColorModel model,
59  IMG_ComponentOrder order,
60  bool interleaved,
62  bool splitoutalpha,
63  const char *plane_name);
64 
65  void initWrite(IMG_DataType type,
66  IMG_ColorModel model,
67  IMG_ComponentOrder order,
68  bool interleaved,
70  bool splitoutalpha,
71  const char *plane_name);
72 
73  UT_ValArray<img_PlaneConvert *> myPlaneConvert;
74  PXL_LumFunction myLumFunc;
75  UT_IntArray myAlphaCombineFlags;
76 };
77 
78 #endif
virtual const char * className() const
virtual int writePlaneScanline(const void *data, int y, const IMG_Plane &pi)
GLint y
Definition: glcorearb.h:102
Describes the format and layout of a single plane in an image The plane specifies the format and name...
Definition: IMG_Plane.h:44
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:802
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:111
Generic interface for reading and writing image files. This class handles the reading and writing of ...
Definition: IMG_File.h:54
GLboolean * data
Definition: glcorearb.h:130
GLenum func
Definition: glcorearb.h:782
IMG_ColorModel
Definition: IMG_FileTypes.h:53
IMG_ComponentOrder
Definition: IMG_FileTypes.h:84
Contains the details of a specific image file, used by IMG_File. This class contains all the high-lev...
Definition: IMG_Stat.h:40
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual const void * readPlaneScanline(int y, const IMG_Plane &pi)