29 : pixmap(_pixmap), doDestroy(false)
38 : pixmap(0), doDestroy(true)
45 if ((pixmap != 0) && doDestroy)
globPtr->destroy(pixmap);
51 doDestroy = iu.doDestroy;
58 if ((pixmap != 0) && doDestroy)
globPtr->destroy(pixmap);
82 void create(
int w,
int h, LWImageType type)
84 pixmap =
globPtr->create(w, h, type);
94 globPtr->setPixel(pixmap, x, y, pix);
104 globPtr->getPixel(pixmap, x, y, pix);
114 globPtr->getInfo(pixmap, w, h, type);
116 static void getInfo(LWPixmapID
id,
int *w,
int *h,
int *type)
118 globPtr->getInfo(
id, w, h, type);
123 return globPtr->resample(pixmap, w, h, mode);
128 globPtr->setPixelTyped(pixmap, x, y, type, pix);
132 globPtr->getPixelTyped(pixmap, x, y, type, pix);
136 return globPtr->getIndex8Map(pixmap, map);
140 return globPtr->getAttr(pixmap, tag, data);
144 return globPtr->getMakerNote(pixmap, tag, data);
148 void save(
int saver,
const std::string name)
150 globPtr->save(pixmap, saver, name.c_str());
196 virtual const char *
popName(
int n);
200 Image(LWImageID _id = 0) : id(_id) {;}
211 void SetID(LWImageID _id) {
id = _id;}
212 LWImageID
getID()
const {
return id;}
227 return globPtr->replace(
id, newFile.c_str()) != 0;
236 return (
globPtr->isColor(
id) != 0);
240 return (
globPtr->hasAlpha(
id) != 0);
243 void size (
int &w,
int &h)
const
266 void RGB (
int x,
int y, LWBufferValue val[3])
const
275 void GetRGBSpot (
double x,
double y,
double spotSize,
bool blend,
double rgb[3])
277 if (
id)
globPtr->RGBSpot(
id, x, y, spotSize, blend ? 1 : 0, rgb);
282 if (
id)
return globPtr->alphaSpot(
id, x, y, spotSize, blend ? 1 : 0);
286 double GetLumaSpot (
double x,
double y,
double spotSize,
bool blend)
288 if (
id)
return globPtr->lumaSpot(
id, x, y, spotSize, blend ? 1 : 0);
292 LWBufferValue
alpha (
int x,
int y)
const
294 return globPtr->alpha(
id, x, y);
297 LWBufferValue
luma (
int x,
int y)
const
299 return globPtr->luma(
id, x, y);
304 return globPtr->evaluate(
id, t);
311 if (
id == 0) err =
"Could not load image";
322 #define IMAGECHANGE_COMRING "lwppImageChange"
334 #endif // LWPP_IMAGE_H