HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfImageLevel.h
Go to the documentation of this file.
1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright (c) Contributors to the OpenEXR Project.
4 //
5 
6 #ifndef INCLUDED_IMF_IMAGE_LEVEL_H
7 #define INCLUDED_IMF_IMAGE_LEVEL_H
8 
9 //----------------------------------------------------------------------------
10 //
11 // class ImageLevel
12 //
13 // For an explanation of images, levels and channels,
14 // see the comments in header file Image.h.
15 //
16 //----------------------------------------------------------------------------
17 
18 #include "ImfUtilExport.h"
19 #include "ImfImageChannel.h"
21 #include <ImathBox.h>
22 #include <string>
23 
25 
26 class Image;
27 
28 
30 {
31  public:
32 
33  //
34  // Access to the image to which the level belongs.
35  //
36 
37 
38  Image & image () {return _image;}
39  const Image & image () const {return _image;}
40 
41 
42  //
43  // Access to the level number and the data window of this level.
44  //
45 
46  int xLevelNumber () const {return _xLevelNumber;}
47  int yLevelNumber () const {return _yLevelNumber;}
48 
49  const IMATH_NAMESPACE::Box2i & dataWindow () const {return _dataWindow;}
50 
51 
52  protected:
53 
54  friend class Image;
55 
58  int xLevelNumber,
59  int yLevelNumber);
60 
62  virtual ~ImageLevel ();
63 
65  virtual void resize (const IMATH_NAMESPACE::Box2i& dataWindow);
66 
68  virtual void shiftPixels (int dx, int dy);
69 
70  virtual void insertChannel (const std::string& name,
72  int xSampling,
73  int ySampling,
74  bool pLinear) = 0;
75 
76  virtual void eraseChannel (const std::string& name) = 0;
77 
78  virtual void clearChannels () = 0;
79 
80  virtual void renameChannel (const std::string &oldName,
81  const std::string &newName) = 0;
82 
83  virtual void renameChannels (const RenamingMap &oldToNewNames) = 0;
84 
86  void throwChannelExists(const std::string& name) const;
88  void throwBadChannelName(const std::string& name) const;
90  void throwBadChannelNameOrType (const std::string& name) const;
91 
92  private:
93 
94  ImageLevel (const ImageLevel &); // not implemented
95  ImageLevel & operator = (const ImageLevel &); // not implemented
96 
97  Image & _image;
98  int _xLevelNumber;
99  int _yLevelNumber;
100  IMATH_NAMESPACE::Box2i _dataWindow;
101 };
102 
103 
105 
106 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:80
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i & dataWindow() const
int yLevelNumber() const
Definition: ImfImageLevel.h:47
GLenum GLsizei GLenum GLenum const void * image
Definition: glew.h:4973
GLuint const GLchar * name
Definition: glcorearb.h:786
Definition: Image.h:42
int xLevelNumber() const
Definition: ImfImageLevel.h:46
IMFUTIL_EXPORT void clearChannels()
IMFUTIL_EXPORT void insertChannel(const std::string &name, PixelType type, int xSampling=1, int ySampling=1, bool pLinear=false)
IMFUTIL_EXPORT void renameChannels(const RenamingMap &oldToNewNames)
IMFUTIL_EXPORT void eraseChannel(const std::string &name)
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef std::map< std::string, std::string > RenamingMap
Image & image()
Definition: ImfImageLevel.h:38
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMF_EXPORT_ENUM PixelType
Definition: ImfPixelType.h:22
Box< V2i > Box2i
2D box of base type int.
Definition: ImathBox.h:143
const Image & image() const
Definition: ImfImageLevel.h:39
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define IMFUTIL_EXPORT_TYPE
Definition: ImfUtilExport.h:54
#define IMFUTIL_EXPORT
Definition: ImfUtilExport.h:51
IMFUTIL_EXPORT void renameChannel(const std::string &oldName, const std::string &newName)
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
IMFUTIL_EXPORT void shiftPixels(int dx, int dy)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:79
const IMATH_NAMESPACE::Box2i & dataWindow() const
Definition: ImfImageLevel.h:49
type
Definition: core.h:1059