1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright (c) Contributors to the OpenEXR Project.
4 //
5 
6 #ifndef INCLUDED_IMF_IMAGE_DATA_WINDOW_H
7 #define INCLUDED_IMF_IMAGE_DATA_WINDOW_H
8 
9 //----------------------------------------------------------------------------
10 //
11 //      enum DataWindowSource,
12 //      function dataWindowForFile()
13 //
14 //----------------------------------------------------------------------------
15 
16 #include "ImfUtilExport.h"
17 #include "ImfNamespace.h"
18 #include <ImathBox.h>
19 
20 OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
21 
22 
23 enum IMFUTIL_EXPORT_ENUM DataWindowSource
24 {
25     USE_IMAGE_DATA_WINDOW,
26     USE_HEADER_DATA_WINDOW
27 };
28 
29 
30 //
31 // Given the an image, i, an OpenEXR file header, h, and a data window
32 // source flag, d, dataWindowForFile(i,h,d) returns i.dataWindow() if d
33 // is USE_IMAGE_DATA_WINDOW, or the intersection of i.dataWindow() and
34 // h.dataWindow() if d is USE_HEADER_DATA_WINDOW.
35 //
36 
37 class Image;
38 class Header;
39 
40 IMFUTIL_EXPORT
41 IMATH_NAMESPACE::Box2i
42 dataWindowForFile (const Header &hdr, const Image &img, DataWindowSource dws);
43 
44 
45 OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
46 
47 #endif
48