19 #include <ubit/udata.hpp> 54 UIma(
int width,
int height);
58 UIma(
const char* filename = null,
bool load_now =
false);
66 UIma(
const UStr& filename,
bool load_now =
false);
74 UIma(
const char** xpm_data,
bool load_now =
false);
96 void resize(
int width,
int height) {
resize(width, height,
false,
false);}
101 void resize(
int max_width,
int max_height,
bool preserve_ratio,
bool dont_magnify);
113 bool rescale(
float xscale,
float yscale);
118 virtual int read(
const UStr& filename,
int max_width = 0,
int max_height =0);
125 virtual int read(
const char* filename,
int max_width = 0,
int max_height =0);
149 virtual void set(
const UStr& filename);
150 virtual void set(
const char* filename);
151 virtual void set(
const char** xpm_data);
174 virtual bool isPix()
const {
return false;}
182 int realize(
int max_w = 0,
int max_h = 0,
183 UDisp* disp = null,
bool force_reload =
true)
const;
213 virtual void setImpl(
const char* fname);
214 virtual void setImpl(
const char** xpm_data);
215 virtual void setImpl(
int width,
int height);
216 virtual void cleanCache();
225 mutable std::list<UHardIma*> natimas;
228 mutable signed char stat;
229 enum Mode {EMPTY, CREATE, READ_FROM_FILE, READ_FROM_DATA};
231 bool show_unknown_ima;
235 inline UIma& uima(
const UStr& filename) {
return *
new UIma(filename);}
238 inline UIma& uima(
const char* filename) {
return *
new UIma(filename);}
241 inline UIma& uima(
const char** xpm_data) {
return *
new UIma(xpm_data);}
int getHeight() const
returns the image height (0 if the image is not loaded).
Definition: uima.cpp:101
virtual bool isPix() const
returns true if this UIma is in fact a UPix (that derives from UIma).
Definition: uima.hpp:174
2D Dimension.
Definition: ugeom.hpp:55
virtual int loadNow()
loads the image file that was specified by set() or by the constructor.
Definition: uima.cpp:209
std::list< UHardIma * > & getNatImas() const
[impl] returns internal implementation.
Definition: uima.hpp:199
UIma & operator=(const UIma &ima2)
copies the content of ima2 to this image.
Definition: uima.cpp:128
Image.
Definition: uima.hpp:50
Definition: uobject.hpp:282
Box container.
Definition: ubox.hpp:64
int getTransparency() const
0 (opaque), 1(bitmask) or >1(alpha channel).
Definition: uima.cpp:113
bool rescale(float scale)
rescales this image.
Definition: uima.hpp:110
class for drawing on widgets.
Definition: ugraph.hpp:44
2D Rectangle.
Definition: ugeom.hpp:165
[Impl] image implementation (encapsulates system resources).
Definition: uhardima.hpp:71
Display Context.
Definition: udisp.hpp:44
bool isLoaded() const
returns true if the image has been loaded.
Definition: uima.hpp:143
int getWidth() const
returns the image width (0 if the image is not loaded).
Definition: uima.cpp:105
virtual int read(const UStr &filename, int max_width=0, int max_height=0)
loads an image file.
Definition: uima.cpp:191
void resize(int width, int height)
resizes the image data to the specified size.
Definition: uima.hpp:96
Base class for Viewable Objects.
Definition: udata.hpp:31
int realize(int max_w=0, int max_h=0, UDisp *disp=null, bool force_reload=true) const
[impl] allocates physical resources and loads the image in memory.
Definition: uima.cpp:427
static void getFullPath(UStr &fullpath, const char *filename)
gets the full image pathname.
Definition: uima.cpp:418
bool isRealized() const
[impl] returns true if the image has been sucesfully loaded and initialized.
Definition: uima.cpp:97
int getStatus() const
returns the loading status of this image (see UFilestat)
Definition: uima.hpp:171
Definition: uupdatecontext.hpp:32
int getBpp() const
returns the number of bits per pixel (0 if the image is not loaded).
Definition: uima.cpp:109
Definition: uhardfont.hpp:31
virtual void update()
update parents' views.
Definition: uima.cpp:91
Pixmap Image.
Definition: upix.hpp:31
UIma(int width, int height)
creates an empty image.
Definition: uima.cpp:69
Ubit String.
Definition: ustr.hpp:72
virtual int loadFromData(const char **xpm_data)
loads XPM data.
Definition: uima.cpp:216