Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoRasterImageRW.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : C. OGNIER (Jun 2003)
22**=======================================================================*/
23
24
25
26#ifndef _SORASTERIMAGERW_
27#define _SORASTERIMAGERW_
28
29#include <Inventor/nodes/SoNode.h>
30#include <Inventor/image/SoRasterImageIO.h>
31#include <Inventor/image/SbRasterImage.h>
32#include <Inventor/errors/SoDebugError.h>
33#include <Inventor/image/SoSubRasterImageRW.h>
34#include <Inventor/SbPImpl.h>
35
36class SoRasterImageFile; // FORWARD
37
38SO_PIMPL_BASE_PUBLIC_DECLARATION(SoRasterImageRW);
39
218{
219
220 SO_IMAGE_RASTER_RW_ABSTRACT_HEADER()
221 SO_PIMPL_BASE_PUBLIC_HEADER(SoRasterImageRW);
222
223public:
224
240
252
264
269
274 virtual SbBool open(SoRasterImageIO* rasterImageIO, OpenMode openMode);
275
279 virtual void close();
280
285 virtual SbBool checkRead( SoRasterImageFile* imageFile );
286
287
294 virtual SbBool write(SbRasterImage* rasterImage, unsigned int xPos = 0, unsigned int yPos = 0) = 0;
295
302 virtual SbBool writeHeader( const SbVec2i32& size );
303
304#if 1 SoDEPRECATED
313 virtual SbBool writeHeader( SbVec2i32& size );
314#endif
321
322
330 virtual SbBool read(SbRasterImage* rasterImage, SbBool infoOnly = FALSE) = 0;
331
332
342 virtual SbBool readRegion(SbRasterImage* rasterImage, const SbBox2i32& region);
343
344
352 virtual SbString* getSuffixes(int& numSuffixes) const;
353
354
362
363
369
370
376
377
382 virtual void enableMultipleWriting(SbBool state);
383
384
389
390#if 1 SoDEPRECATED
400 virtual SbBool writeHeader(SbVec2s& size);
401
402#endif
404private:
405
411 virtual SbBool getImagesNumber(size_t& imagesNumber);
412
413
419 virtual SbBool read(SbRasterImage* rasterImage, size_t imageIndex, SbBool infoOnly = FALSE);
420
421
430 virtual SbBool readRegion(SbRasterImage* rasterImage, size_t imageIndex, const SbBox2i32& region);
431
438 virtual SbVec3f getOrigin(const size_t& imageId);
439
445 virtual SbVec2f getPixelSize(const size_t& imageId);
446
452 virtual float getThickness(const size_t& imageId);
453
459 virtual SbVec3f getX(const size_t& imageId);
460
466 virtual SbVec3f getY(const size_t& imageId);
467
474 virtual SbVec3f getZ(const size_t& imageId);
475
477 virtual bool supportsAlpha() const;
478
483 static bool write(const SbString& filename, const SbRasterImage& rasterImage);
484
485private:
486
487 // This method must fill m_suffixes and update m_numSuffixes
488 virtual void createSuffixList() = 0;
490
491 SoRasterImageIO* m_rasterImageIO;
492 SbBool m_multipleWriting;
493 SbVec2i32 m_rasterSize;
494 unsigned int m_multipleWritingNumComponents;
495 SbBool m_firstMultipleImages;
496
497 SbString* m_suffixes;
498 int m_numSuffixes;
499};
500
501#endif
2D box class.
Definition SbBox.h:2383
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class encapsulat...
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:76
2D vector class.
Definition SbVec.h:517
2D vector class.
Definition SbVec.h:700
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class for raster...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
virtual SoRasterImageRW::ReadCapability getReadCapability() const
Returns the read capability of the raster format.
virtual SoDEPRECATED SbBool writeHeader(SbVec2i32 &size)
Writes and encodes the header for this specific format.
ReadCapability
Read Capability enumeration values.
@ READ_UNAVAILABLE
No reading available.
@ READ_AVAILABLE
Read functionality available.
virtual SbBool read(SbRasterImage *rasterImage, SbBool infoOnly=FALSE)=0
Read the current open image into rasterImage.
virtual SbBool isMultipleWritingEnabled() const
Returns TRUE if multiple buffer writing is enabled.
OpenMode
open Mode enumeration values.
@ OPEN_READ
Opened for reading.
@ OPEN_WRITE
Opened for writing.
virtual SoDEPRECATED SbBool writeHeader(SbVec2s &size)
Writes and encodes the header for this specific format.
WriteCapability
Write Capability enumeration values.
@ WRITE_FULL_IMAGE
Can only write a complete image.
@ WRITE_SCANLINES
Can write an image incrementally (e.g., by scan-line).
@ WRITE_UNAVAILABLE
No writing available.
virtual SoRasterImageRW::WriteCapability getWriteCapability() const
Returns the write capability of the raster format.
virtual SbBool open(SoRasterImageIO *rasterImageIO, OpenMode openMode)
Opens the reader/writer in the specified open mode.
virtual void close()
Closes the reader/writer.
virtual ~SoRasterImageRW()
Destructor.
virtual SbBool readRegion(SbRasterImage *rasterImage, const SbBox2i32 &region)
Read the specified region of current open image into rasterImage.
virtual SbBool writeHeader(const SbVec2i32 &size)
Writes and encodes the header for this specific format.
virtual SbBool checkRead(SoRasterImageFile *imageFile)
Checks if the specified file can be read.
virtual void enableMultipleWriting(SbBool state)
Enable writing image with multiple calls to write method.
virtual SbBool isMultipleBufferInverted() const
Returns the write order when using multiple buffers.
virtual SbBool write(SbRasterImage *rasterImage, unsigned int xPos=0, unsigned int yPos=0)=0
Writes and encodes the given data in the specific format.
virtual SbBool writeFooter()
Writes and encodes the footer for this specific format.
virtual SbString * getSuffixes(int &numSuffixes) const
Returns the list of file suffixes supported.
int SbBool
Boolean type.
Definition SbBase.h:87