HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_FileFilterScale.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_FileFilterScale ( IMG Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Scales a file from one res to another.
11  *
12  */
13 #ifndef IMG_FILE_FILTER_SCALE_H
14 #define IMG_FILE_FILTER_SCALE_H
15 
16 #include "IMG_FileFilter.h"
17 
18 #include <UT/UT_ValArray.h>
19 #include <UT/UT_FilterType.h>
20 #include <UT/UT_NonCopyable.h>
21 
22 
23 class img_PlaneScale;
24 class img_MipCache;
25 
26 
27 //
28 // IMG_FileFilterScale
29 //
31 {
32 public:
33  IMG_FileFilterScale(IMG_File *file_to_filter);
34  ~IMG_FileFilterScale() override;
35 
37 
38  const char *className() const override { return "IMG_FileFilterScale"; }
39 
40  // fileparms may be passed in when the scale filter is used to generate mip
41  // levels, but otherwise should be left null.
42  void initScale(int xres, int yres, UT_FilterType filter,
43  IMG_FileParms *fileparms = nullptr);
44 
45  const void *readPlaneScanline(int y, const IMG_Plane &pi) override;
46 
47  int writePlaneScanline(const void *data, int y,
48  const IMG_Plane &pi) override;
49 
50  static IMG_FileFilter *allocMipLevel0CacheFilter(IMG_File *file,
51  IMG_FileParms *fileparms);
52 
53 private:
54  bool grabScan(void *buffer, int y, int pi, int comp);
55  void finishedScanline(int scan) override;
56 
57  UT_ValArray<img_PlaneScale *> myPlaneScale;
58  UT_SharedPtr<img_MipCache> myMipCache;
59  int mySupport;
60 
61  friend class img_PlaneScale;
62 };
63 
64 #endif
GLint y
Definition: glcorearb.h:103
UT_FilterType
Definition: UT_FilterType.h:16
Describes the format and layout of a single plane in an image The plane specifies the format and name...
Definition: IMG_Plane.h:48
#define IMG_API
Definition: IMG_API.h:10
Definition: core.h:760
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
File options for manipulating image data on load or save. This class allows you to modify the incomin...
Definition: IMG_FileParms.h:38
constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: Math.h:119
#define const
Definition: zconf.h:214
Definition: format.h:895
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297