HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_StitchDeep.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: TIL_StitchDeep.h (TIL Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __TIL_StitchDeep__
12 #define __TIL_StitchDeep__
13 
14 #include "TIL_API.h"
15 #include "TIL_Stitch.h"
17 
19  class ImageInput;
20  class ImageOutput;
21  class DeepData;
22  class ImageSpec;
24 
25 namespace TIL_Stitch
26 {
27  class TIL_API DeepScanline : public Scanline
28  {
29  public:
30  DeepScanline();
31  ~DeepScanline() override;
32 
33  void allocate(int width, const OIIO::ImageSpec &spec);
34 
36  };
37 
39  {
40  public:
42  ~DeepTileReader() override;
43 
44  const UT_DimRect &dataWindow() const override;
45  bool open() override;
46  bool canRead(const Scanline *scan) const override;
47  bool readScanline(int plane, int xoff, int scanline,
48  Scanline *buffer) override;
49  bool close() override;
50 
51  void setFile(const UT_StringHolder &filename);
52  const UT_StringHolder &filename() const { return myFilename; }
53  const OIIO::ImageSpec &imageSpec() const;
54 
55  protected:
56  virtual void error(const char *msg) const;
57 
62  bool myRead;
63  };
64 
66  {
67  public:
68  DeepWriter(const char *filename, const OIIO::ImageSpec &spec);
70  ~DeepWriter() override;
71 
72  const UT_DimRect &dataWindow() const override;
73  bool startRow(const TileReader &row) override;
74  bool finishImage() override;
75  bool process(TileReader &tile) override;
76 
77  bool isValid() const { return myOut.get() != nullptr; }
78  int tilesRead() const { return myTilesRead; }
79 
80  // Return an error string if there was a problem creating the spec,
81  // otherwise return an empty string.
82  static UT_StringHolder createSpec(OIIO::ImageSpec &spec,
83  const UT_Span<DeepTileReader *> &input,
84  bool match_display_window = false);
85  protected:
86  virtual bool flushScanlines();
87  virtual void error(const char *msg) const;
88  virtual void warning(const char *msg) const;
89 
93  int myTilesRead = 0;
94  int myY0, myY1;
95  };
96 }
97 
98 #endif
99 
Class to store scanline data.
Definition: TIL_Stitch.h:28
GT_API const UT_StringHolder filename
const UT_StringHolder & filename() const
UT_UniquePtr< OIIO::DeepData > myData
UT_Array< DeepScanline > myScanBuffer
UT_StringHolder myFilename
void close() override
GLuint buffer
Definition: glcorearb.h:660
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
< returns > If no error
Definition: snippets.dox:2
int open(float queuesize) override
UT_UniquePtr< OIIO::ImageInput > myIn
Class to read the tile data and write it to an output sink.
Definition: TIL_Stitch.h:62
UT_UniquePtr< OIIO::DeepData > myData
bool process(T &func, UT_WorkBuffer &fullpath, exint fullpath_len, const UT_StringArray &paths, const UT_Array< FS_Stat > &stats)
Utility function to process the contents of the traverse() function.
Definition: FS_Traverse.h:24
GLint GLsizei width
Definition: glcorearb.h:103
GLenum GLenum GLsizei void * row
Definition: glad.h:5135
#define OIIO_NAMESPACE_END
Definition: oiioversion.h:127
#define TIL_API
Definition: TIL_API.h:10
#define OIIO_NAMESPACE_BEGIN
Definition: oiioversion.h:126
UT_UniquePtr< OIIO::ImageOutput > myOut