SbImage.h Source File

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

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SbImage.h
1 #ifndef COIN_SBIMAGE_H
2 #define COIN_SBIMAGE_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/SbVec2s.h>
28 #include <Inventor/SbVec3s.h>
29 #include <Inventor/SbString.h>
30 #include <stddef.h> // for NULL
31
32 class SbImage;
33
34 typedef SbBool SbImageScheduleReadCB(const SbString &, SbImage *, void *);
35 typedef SbBool SbImageReadImageCB(const SbString &, SbImage *, void *);
36
37 class COIN_DLL_API SbImage {
38 public:
39 SbImage(void);
40 SbImage(const unsigned char * bytes,
41 const SbVec2s & size, const int bytesperpixel);
42 SbImage(const unsigned char * bytes,
43 const SbVec3s & size, const int bytesperpixel);
44 ~SbImage();
45
46 void setValue(const SbVec2s & size, const int bytesperpixel,
47 const unsigned char * bytes);
48 void setValue(const SbVec3s & size, const int bytesperpixel,
49 const unsigned char * bytes);
50 void setValuePtr(const SbVec2s & size, const int bytesperpixel,
51 const unsigned char * bytes);
52 void setValuePtr(const SbVec3s & size, const int bytesperpixel,
53 const unsigned char * bytes);
54 unsigned char * getValue(SbVec2s & size, int & bytesperpixel) const;
55 unsigned char * getValue(SbVec3s & size, int & bytesperpixel) const;
56 SbVec3s getSize(void) const;
57
58 SbBool readFile(const SbString & filename,
59 const SbString * const * searchdirectories = NULL,
60 const int numdirectories = 0);
61
62 int operator==(const SbImage & image) const;
63 int operator!=(const SbImage & image) const {
64 return ! operator == (image);
65 }
66 SbImage & operator=(const SbImage & image);
67
68 static void addReadImageCB(SbImageReadImageCB * cb, void * closure);
69 static void removeReadImageCB(SbImageReadImageCB * cb, void * closure);
70
71 static SbString searchForFile(const SbString & basename,
72 const SbString * const * dirlist,
73 const int numdirs);
74
75 SbBool hasData(void) const;
76
77 private:
78
79 class SbImageP * pimpl;
80
81 public:
82
83 // methods for delaying image loading until it is actually needed.
84 void readLock(void) const;
85 void readUnlock(void) const;
86
87 SbBool scheduleReadFile(SbImageScheduleReadCB * cb,
88 void * closure,
89 const SbString & filename,
90 const SbString * const * searchdirectories = NULL,
91 const int numdirectories = 0);
92 };
93
94 #endif // !COIN_SBIMAGE_H
SbVec3s
The SbVec3s class is a 3 dimensional vector with short integer coordinates.This vector class provides...
Definition: SbVec3s.h:39
SbImage::operator!=
int operator!=(const SbImage &image) const
Definition: SbImage.h:63
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
SbString
The SbString class is a string class with convenience functions for string operations.This is the class used for storing and working with character strings. It automatically takes care of supporting all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.
Definition: SbString.h:42
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.