示例#1
0
//----------------------------------------------------
void ofxImage::rotatePixels(ofPixels &pix, float angle){
	if(angle == 0.0)
		return;
	
	FIBITMAP * bmp               = getBmpFromPixels(pix);
	FIBITMAP * convertedBmp         = NULL;
	
	convertedBmp = FreeImage_RotateClassic(bmp, angle);
	putBmpIntoPixels(convertedBmp, pix);
	
	if (bmp != NULL)            FreeImage_Unload(bmp);
	if (convertedBmp != NULL)      FreeImage_Unload(convertedBmp);
}
示例#2
0
BOOL fipImage::rotate(double angle) {
	if(_dib) {
		switch(FreeImage_GetBPP(_dib)) {
			case 1:
			case 8:
			case 24:
			case 32:
				FIBITMAP *rotated = FreeImage_RotateClassic(_dib, angle);
				return replace(rotated);
				break;
		}
	}
	return FALSE;
}