本文整理汇总了C++中QPixmap::scanLine方法的典型用法代码示例。如果您正苦于以下问题:C++ QPixmap::scanLine方法的具体用法?C++ QPixmap::scanLine怎么用?C++ QPixmap::scanLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPixmap
的用法示例。
在下文中一共展示了QPixmap::scanLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JSR239_getWindowContents
void JSR239_getWindowContents(JSR239_Pixmap *dst,
jobject srcGraphicsHandle,
jint srcWidth, jint srcHeight,
jint deltaHeight) {
QPixmap* pixmap;
void* src;
KNI_StartHandles(1);
KNI_DeclareHandle(GraphicsClassHandle);
#ifdef DEBUG
printf("JSR239_getWindowContents >>\n");
#endif
KNI_FindClass("javax/microedition/lcdui/Graphics", GraphicsClassHandle);
if (!KNI_IsInstanceOf(graphicsHandle, GraphicsClassHandle)) {
#ifdef DEBUG
printf("JSR239_getWindowContents only implemented for graphicsHandle "
"instanceof Graphics!\n");
#endif
} else {
pixmap = getGraphicsBuffer(graphicsHandle);
#ifdef DEBUG
printf("JSR239_getWindowContents: pixmap=%p\n", pixmap);
printf(" pixmap Bpp = %d\n", pixmap->depth()/8);
printf(" pixmap width = %d\n", pixmap->width());
printf(" pixmap height = %d\n", pixmap->height());
printf(" dst Bpp = %d\n", dst->pixelBytes);
printf(" dst width = %d\n", dst->width);
printf(" dst height = %d\n", dst->height);
#endif
src = (void*)pixmap->scanLine(0);
/* IMPL_NOTE: get clip sizes into account. */
copyFromScreenBuffer(dst,
src, srcWidth, srcHeight,
deltaHeight);
}
#ifdef DEBUG
printf("JSR239_getWindowContents <<\n");
#endif
KNI_EndHandles();
}
示例2: printf
void
JSR239_putWindowContents(jobject graphicsHandle,
jint delta_height,
JSR239_Pixmap *src,
jint clipX, jint clipY, jint clipWidth, jint clipHeight,
jint flipY) {
void* s;
void* d;
QPixmap* pixmap;
KNI_StartHandles(1);
KNI_DeclareHandle(GraphicsClassHandle);
#ifdef DEBUG
printf("JSR239_putWindowContents >>\n");
#endif
KNI_FindClass("javax/microedition/lcdui/Graphics", GraphicsClassHandle);
if (!KNI_IsInstanceOf(graphicsHandle, GraphicsClassHandle)) {
#ifdef DEBUG
printf("JSR239_putWindowContents only implemented for graphicsHandle "
"instanceof Graphics!\n");
#endif
} else {
const jint bytes_for_depth = 2;
const jint bits_per_byte = 8;
jint min_height;
pixmap = getGraphicsBuffer(graphicsHandle);
min_height = (pixmap->height() > src->height) ? src->height :
pixmap->height();
#ifdef DEBUG
printf("JSR239_putWindowContent: pixmap=%p\n", pixmap);
printf(" pixmap Bpp = %d\n", pixmap->depth()/bits_per_byte);
printf(" pixmap width = %d\n", pixmap->width());
printf(" pixmap height = %d\n", pixmap->height());
printf(" src Bpp = %d\n", src->pixelBytes);
printf(" src width = %d\n", src->width);
printf(" src height = %d\n", src->height);
printf(" min height = %d\n", min_height);
#endif
/* IMPL_NOTE: get clip sizes into account. */
copyToScreenBuffer(src, delta_height,
clipX, clipY,
clipWidth, clipHeight,
clipWidth, clipHeight,
flipY);
/* src->screen_buffer is an output of copyToScreenBuffer function. */
s = (void*)src->screen_buffer;
d = (void*)pixmap->scanLine(0);
if ((pixmap->width() != src->width) ||
(pixmap->depth() != bits_per_byte * bytes_for_depth)) {
#ifdef DEBUG
printf("JSR239: offscreen buffer data is incorrect.\n");
#endif
} else {
/* Source data must be in 16bit 565 format. */
JSR239_memcpy(
d, s, pixmap->width() * min_height * bytes_for_depth);
}
}
#ifdef DEBUG
printf("JSR239_putWindowContents <<\n");
#endif
KNI_EndHandles();
}