bool faxImage::setPixel (int col, int row, int value, int rgbg) { QRgb oldColor; QRgb color; if (col >= image. width ()) return false; if (row >= image. height () + 1) return false; if (row >= image. height ()) resizeHeight (50); oldColor = image. pixel (col, row); switch (rgbg) { case 0: color = qRgb (value, qGreen (oldColor), qBlue (oldColor)); break; case 1: color = qRgb (qRed (oldColor), value, qBlue (oldColor)); break; case 2: color = qRgb (qRed (oldColor), qGreen (oldColor), value); break; default: color = qRgb (value, value, value); break; } image. setPixel (QPoint(col, row), (uint)color); return true; }
void poImage::resizeMinDimension(float min_dim) { int newW = getWidth(); int newH = getHeight(); if(newW < newH) resizeWidth(min_dim); else resizeHeight(min_dim); }
void poImage::resizeMaxDimension(float max_dim) { int newW = getWidth(); int newH = getHeight(); if(newW > newH) resizeWidth(max_dim); else resizeHeight(max_dim); }