Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
void poImage::resizeMinDimension(float min_dim) {
	int newW = getWidth();
	int newH = getHeight();
	
	if(newW < newH)
		resizeWidth(min_dim);
	else
		resizeHeight(min_dim);
}
Exemplo n.º 3
0
void poImage::resizeMaxDimension(float max_dim) {
	int newW = getWidth();
	int newH = getHeight();
	
	if(newW > newH)
		resizeWidth(max_dim);
	else
		resizeHeight(max_dim);
}