本文整理汇总了C++中DImage::rotate90_方法的典型用法代码示例。如果您正苦于以下问题:C++ DImage::rotate90_方法的具体用法?C++ DImage::rotate90_怎么用?C++ DImage::rotate90_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImage
的用法示例。
在下文中一共展示了DImage::rotate90_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toDImage
/**The resulting image will be 8-bit grayscale and if fVertical is
* true, then the image will be numPixels wide and dataLen() high (if
* fVertical is false, then the image will be dataLen() wide and
* numPixels high). The grayscale values for the profile foreground
* and background can be specified with fg and bg, respectively. (fg
* specifies the pixels that are part of the profile, bg specifies the
* pixels that are NOT part of the profile)
*/
DImage DProfile::toDImage(int numPixels, bool fVertical,
D_uint8 fg, D_uint8 bg){
DImage img;
double max;
D_uint8 *pdata;
img.create(numPixels, len, DImage::DImage_u8);
pdata = img.dataPointer_u8();
max = 0.;
for(int i = 0; i < len; ++i){
if(rgProf[i] > max)
max = rgProf[i];
}
// printf("DProfile::toDImage() max=%f\n",max);
for(int y = 0, idx = 0; y < len; ++y){
double fillTo;
fillTo = rgProf[y] * numPixels / max;
for(int x = 0; x < numPixels; ++x, ++idx){
if(x <= fillTo)
pdata[idx] = fg;
else
pdata[idx] = bg;
}
}
if(!fVertical){
DImage imgRot;
img.rotate90_(imgRot, -90);
return imgRot;
}
return img;
}