#include <imagetile.h>
Inheritance diagram for PixmapImageTile:
Public Member Functions | |
PixmapImageTile () | |
PixmapImageTile (const PixmapFormat &pf, uint width, uint height) | |
~PixmapImageTile () | |
void | setup (const PixmapFormat &pf, uint width, uint height) |
uint | width () const |
Get width and height of tile:. | |
uint | height () const |
uint | DataSize () const |
void | GetPixel8 (uint x, uint y, uint8 *p) const |
void | PutPixel8 (uint x, uint y, const uint8 *p) |
void | GetPixel16 (uint x, uint y, uint16 *p) const |
void | PutPixel16 (uint x, uint y, const uint16 *p) |
void | GetPixelF (uint x, uint y, flt *p) const |
void | PutPixelF (uint x, uint y, const flt *p) |
Public Attributes | |
char * | data |
image data storage or NULL (swapped out) | |
Private Member Functions | |
void | _ZapPixelFuncs () |
Set default (i.e. CritAssert(0)-like) get/put pixel functions:. | |
int | _SetPixelFuncs (const PixmapFormat &pf) |
PixmapImageTile (const PixmapImageTile &) | |
DO NOT USE THESE:. | |
void | operator= (const PixmapImageTile &) |
Private Attributes | |
uint | w |
uint | h |
size of the image (tile) in pixels | |
size_t | size |
size of data[] in bytes | |
PixmapImageTile::Methods | meth |
Friends | |
class | PixmapImageTileInternal |
For internal use only.
The image data is stored as dense as possible in the buffer data[]. In order to set or get pixels, use setpixel() and getpixel(). You must use SetFormat() or the apropriate constructor to set the pixmap format before starting to store data.
NOTE: You are responsible for (de)allocating (or swapping in/out) memory for this type; the data member is public and needs to be externally controlled. This type can merely calculate the required amount of memory.
NOTE: This type is not "C++-safe"; do NOT use copy constructor or assignment operator for this type.
Definition at line 56 of file imagetile.h.
|
DO NOT USE THESE:.
|
|
Default constructor which can also be used for arrays. Sets width=height=size=0, data=NULL. Use setup() lateron so set the format and size. Definition at line 647 of file imagetile.cc. References _ZapPixelFuncs(). |
|
Set format and size. Note that the format is not stored inside the image tile and an assertion will fail if the format is not supported. Data is NOT allocated for that. Definition at line 655 of file imagetile.cc. References _SetPixelFuncs(), CritAssert, data, and uint. |
|
Definition at line 666 of file imagetile.cc. |
|
Choose the correct pixel functions according to the format. This also sets the >size< value according to width and height. Will return 0 on success and 1 for a non-supported format. See the implementation on supported formats. Definition at line 548 of file imagetile.cc. References _ZapPixelFuncs(), PixmapFormat::bits(), flt, h, meth, PixmapFormat::nchannels(), PixmapFormat::SameBitsForAll(), size, and w. Referenced by PixmapImageTile(), and setup(). |
|
Set default (i.e. CritAssert(0)-like) get/put pixel functions:.
Definition at line 537 of file imagetile.cc. References PixmapImageTile::Methods::getpixel16, PixmapImageTile::Methods::getpixel8, PixmapImageTile::Methods::getpixelF, meth, PixmapImageTile::Methods::putpixel16, PixmapImageTile::Methods::putpixel8, and PixmapImageTile::Methods::putpixelF. Referenced by _SetPixelFuncs(), and PixmapImageTile(). |
|
Get size in memory; this is the size of the tile and has the same value independent of data being present or not. Definition at line 117 of file imagetile.h. |
|
Definition at line 135 of file imagetile.h. References PixmapImageTile::Methods::getpixel16, meth, uint, and uint16. |
|
Get pixel at (x,y) and store values in *p. Set pixel at (x,y) to values passed in *p. p[] is an array with one entry for each channel. The values in p[] are the raw values in the image; there is no scaling applied. This means that valid values for p[] in an image with 4 bit per channel range from 0..15 (=2^4-1). Hence, do not use the 8 bit versions for images which have channels with greater bit depth. These functions cannot be used for images saved as flt values (an assertion will fail in that case). NOTE: No range check is done for speed reasons. No check if *data is NULL (swapped out) is performed. Definition at line 131 of file imagetile.h. References PixmapImageTile::Methods::getpixel8, meth, uint, and uint8. |
|
Like above pixel functions but using flt values. If the image is stored as flt values (see FloatBits in PixmapFormat), the raw flt values are returned. If the image is stored as integer values, the values are scaled to the flt range 0..1 (inclusive both "borders"). Definition at line 145 of file imagetile.h. References flt, PixmapImageTile::Methods::getpixelF, meth, and uint. |
|
Definition at line 113 of file imagetile.h. |
|
|
|
Definition at line 137 of file imagetile.h. References meth, PixmapImageTile::Methods::putpixel16, uint, and uint16. |
|
Definition at line 133 of file imagetile.h. References meth, PixmapImageTile::Methods::putpixel8, uint, and uint8. |
|
Definition at line 147 of file imagetile.h. References flt, meth, PixmapImageTile::Methods::putpixelF, and uint. |
|
Set the format and size. If some other format was already set, the stored information is freed. No data is alloctated. Definition at line 637 of file imagetile.cc. References _SetPixelFuncs(), CritAssert, h, uint, and w. |
|
Get width and height of tile:.
Definition at line 112 of file imagetile.h. |
|
Definition at line 58 of file imagetile.h. |
|
|
size of the image (tile) in pixels
Definition at line 60 of file imagetile.h. Referenced by _SetPixelFuncs(), height(), and setup(). |
|
Pointers to the get/put pixel functions to be used for the format. These pointers are never NULL, if they cannot be used then they point to a version which will abort the program via an assertion. Referenced by _SetPixelFuncs(), _ZapPixelFuncs(), GetPixel16(), GetPixel8(), GetPixelF(), PutPixel16(), PutPixel8(), and PutPixelF(). |
|
size of data[] in bytes
Definition at line 61 of file imagetile.h. Referenced by _SetPixelFuncs(), and DataSize(). |
|