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 "ImfImageChannel.h"
20 #include "ImfUtilExport.h"
21 #include <ImathBox.h>
22 #include <string>
23 
25 
26 class Image;
27 
29 {
30 public:
31  //
32  // Access to the image to which the level belongs.
33  //
34 
35  Image& image () { return _image; }
36  const Image& image () const { return _image; }
37 
38  //
39  // Access to the level number and the data window of this level.
40  //
41 
42  int xLevelNumber () const { return _xLevelNumber; }
43  int yLevelNumber () const { return _yLevelNumber; }
44 
45  const IMATH_NAMESPACE::Box2i& dataWindow () const { return _dataWindow; }
46 
47 protected:
48  friend class Image;
49 
51  ImageLevel (Image& image, int xLevelNumber, int yLevelNumber);
52 
54  virtual ~ImageLevel ();
55 
57  virtual void resize (const IMATH_NAMESPACE::Box2i& dataWindow);
58 
60  virtual void shiftPixels (int dx, int dy);
61 
62  virtual void insertChannel (
63  const std::string& name,
65  int xSampling,
66  int ySampling,
67  bool pLinear) = 0;
68 
69  virtual void eraseChannel (const std::string& name) = 0;
70 
71  virtual void clearChannels () = 0;
72 
73  virtual void
74  renameChannel (const std::string& oldName, const std::string& newName) = 0;
75 
76  virtual void renameChannels (const RenamingMap& oldToNewNames) = 0;
77 
79  void throwChannelExists (const std::string& name) const;
81  void throwBadChannelName (const std::string& name) const;
83  void throwBadChannelNameOrType (const std::string& name) const;
84 
85 private:
86  ImageLevel (const ImageLevel&); // not implemented
87  ImageLevel& operator= (const ImageLevel&); // not implemented
88 
89  Image& _image;
90  int _xLevelNumber;
91  int _yLevelNumber;
92  IMATH_NAMESPACE::Box2i _dataWindow;
93 };
94 
96 
97 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
IMFUTIL_EXPORT const IMATH_NAMESPACE::Box2i & dataWindow() const
int yLevelNumber() const
Definition: ImfImageLevel.h:43
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLenum GLenum GLsizei void * image
Definition: glad.h:5132
Definition: Image.h:45
int xLevelNumber() const
Definition: ImfImageLevel.h:42
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:35
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMF_EXPORT_ENUM PixelType
Definition: ImfPixelType.h:20
Box< V2i > Box2i
2D box of base type int.
Definition: ImathBox.h:143
const Image & image() const
Definition: ImfImageLevel.h:36
#define IMFUTIL_EXPORT_TYPE
Definition: ImfUtilExport.h:54
GLuint const GLchar * name
Definition: glcorearb.h:786
#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)
LeafData & operator=(const LeafData &)=delete
IMFUTIL_EXPORT void shiftPixels(int dx, int dy)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:80
const IMATH_NAMESPACE::Box2i & dataWindow() const
Definition: ImfImageLevel.h:45
type
Definition: core.h:1059