#include <GLImageItterator.h>
Public Types | |
| enum | Type { wrap, stretch } |
Public Member Functions | |
| ImageItterator (Image &bitmap, int destX, int destY, Type type=stretch) | |
| virtual | ~ImageItterator () |
| void | reset () |
| void | incX () |
| void | incY () |
| unsigned char * | getPos () |
Protected Attributes | |
| Image & | bitmap_ |
| float | dx_ |
| float | dy_ |
| int | width_ |
| Type | type_ |
| unsigned char * | pos_ |
| float | posX_ |
| float | posY_ |
ImageItterator bitmapItor(myBitmap, myRequiredWidth, myRequiredHeight, myRequiredType); for (int by=0; by<myRequiredHeight; by++, bitmapItor.incY()) { for (int bx=0; bx<myRequiredWidth; bx++, bitmapItor.incX()) { Get the bytes at bx, by position in the bitmap. This will be an array of 3 or 4 bytes depending on the bitmap type. unsigned char *sourceBits = bitmapItor.getPos(); } }
Definition at line 43 of file GLImageItterator.h.
| enum ImageItterator::Type |
Defines the type of the iteration. Wrap - The bitmap is tiled/repeated if it is smaller than the given destX/destY sizes. Stretch - The bitmap extents are stretched to match the destX and destY sizes.
Definition at line 53 of file GLImageItterator.h.
DestX is the maximum width you will ask the iterator to return. DestY is the maximum height you will ask the iterator to return. Type defines how these width/height maps the bitmaps size.
Definition at line 23 of file GLImageItterator.cpp.
References dx_, dy_, Image::getHeight(), Image::getWidth(), reset(), stretch, and width_.
| ImageItterator::~ImageItterator | ( | ) | [virtual] |
Definition at line 45 of file GLImageItterator.cpp.
| void ImageItterator::reset | ( | ) |
Reset the iterator.
Definition at line 50 of file GLImageItterator.cpp.
References bitmap_, Image::getBits(), pos_, posX_, and posY_.
Referenced by ImageItterator().
| void ImageItterator::incX | ( | ) |
Position the iterator at the next bitmap bytes in the row.
Definition at line 56 of file GLImageItterator.cpp.
References bitmap_, dx_, Image::getWidth(), and posX_.
| void ImageItterator::incY | ( | ) |
Position the iterator at the next row.
Definition at line 62 of file GLImageItterator.cpp.
References bitmap_, dy_, Image::getBits(), Image::getHeight(), int(), pos_, posX_, posY_, and width_.
| unsigned char * ImageItterator::getPos | ( | ) |
Get the bytes at the current iterator's position.
Definition at line 70 of file GLImageItterator.cpp.
References int(), pos_, and posX_.
Referenced by ImageModifier::addHeightToBitmap().
Image& ImageItterator::bitmap_ [protected] |
float ImageItterator::dx_ [protected] |
float ImageItterator::dy_ [protected] |
int ImageItterator::width_ [protected] |
Type ImageItterator::type_ [protected] |
Definition at line 91 of file GLImageItterator.h.
unsigned char* ImageItterator::pos_ [protected] |
float ImageItterator::posX_ [protected] |
float ImageItterator::posY_ [protected] |
1.5.3