| http://www.sim.no/ http://www.coin3d.org/

SoSFImage.h
1 #ifndef COIN_SOSFIMAGE_H
2 #define COIN_SOSFIMAGE_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/fields/SoSField.h>
28 #include <Inventor/fields/SoSubField.h>
29 #include <Inventor/SbVec2s.h>
30
31 class SbImage;
32
33 class COIN_DLL_API SoSFImage : public SoSField {
34 typedef SoSField inherited;
35
36 SO_SFIELD_CONSTRUCTOR_HEADER(SoSFImage);
37 SO_SFIELD_REQUIRED_HEADER(SoSFImage);
38
39 public:
40 enum CopyPolicy {
41 COPY,
42 NO_COPY,
43 NO_COPY_AND_DELETE,
44 NO_COPY_AND_FREE
45 };
46
47 static void initClass(void);
48
49 const unsigned char * getValue(SbVec2s & size, int & nc) const;
50 const SbImage & getValue() const;
51
52 void setValue(const SbVec2s & size, const int nc,
53 const unsigned char * pixels, CopyPolicy copypolicy = COPY);
54
55 int operator==(const SoSFImage & field) const;
56 int operator!=(const SoSFImage & field) const { return ! operator == (field); }
57
58 unsigned char * startEditing(SbVec2s & size, int & nc);
59 void finishEditing(void);
60
61 void setSubValue(const SbVec2s & dims, const SbVec2s & offset, unsigned char * pixels);
62 void setSubValues(const SbVec2s * dims, const SbVec2s * offsets, int num, unsigned char ** pixelblocks);
63 unsigned char * getSubTexture(int idx, SbVec2s & dims, SbVec2s & offset) const;
64 SbBool hasSubTextures(int & numsubtextures);
65
66 void setNeverWrite(SbBool flag);
67 SbBool isNeverWrite(void) const;
68
69 SbBool hasTransparency(void) const;
70
71 private:
72 virtual SbBool readValue(SoInput * in);
73 virtual void writeValue(SoOutput * out) const;
74
75 class SoSFImageP * pimpl;
76 };
77
78 #endif // !COIN_SOSFIMAGE_H
SoField::readValue
virtual SbBool readValue(SoInput *in)=0
SoOutput
The SoOutput class is an abstraction of an output stream.SoOutput offers the ability to write basic t...
Definition: SoOutput.h:42
SoSField
The SoSField class is the base class for fields which contains only a single value.All field types which should always contain only a single member value inherits this class. SoSField is an abstract class.
Definition: SoSField.h:29
SoField::operator==
int operator==(const SoField &f) const
Definition: SoField.cpp:1573
SoField::writeValue
virtual void writeValue(SoOutput *out) const =0
SoSFImage::operator!=
int operator!=(const SoSFImage &field) const
Definition: SoSFImage.h:56
SoSFImage
The SoSFImage class is used to store pixel images.The SoSFImage class provides storage for inline 2D ...
Definition: SoSFImage.h:33
SoInput
The SoInput class is an abstraction of file import functionality.This class takes care of most of the...
Definition: SoInput.h:52
SbImage
The SbImage class is an abstract datatype for 2D and 3D images.Be aware that this class is an extensi...
Definition: SbImage.h:37
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.