Lines Matching refs:canvas

46  * the canvas is cleared for the next glyph.
48 * If the necessary canvas is too large, the shared one will not be used and a
66 * They will print out a full UInt8 canvas and any pixels struck (assuming
67 * the canvas is not too big).
69 * As another debug feature, the entire canvas will be filled with a light
214 CGGI_CopyImageFromCanvasToRGBInfo(CGGI_GlyphCanvas *canvas, GlyphInfo *info)
216 UInt32 *src = (UInt32 *)canvas->image->data;
217 size_t srcRowWidth = canvas->image->width;
243 //(CGGI_GlyphCanvas *canvas, GlyphInfo *info)
258 // vImageConvert_ARGB8888toPlanar8(canvas->image, &infoBuffer,
273 CGGI_CopyImageFromCanvasToAlphaInfo(CGGI_GlyphCanvas *canvas, GlyphInfo *info)
275 UInt32 *src = (UInt32 *)canvas->image->data;
276 size_t srcRowWidth = canvas->image->width;
301 void (*copyFxnPtr)(CGGI_GlyphCanvas *canvas, GlyphInfo *info);
343 * Creates a new canvas of a fixed size, and initializes the CGContext as
347 CGGI_InitCanvas(CGGI_GlyphCanvas *canvas,
350 // our canvas is *always* 4-byte ARGB
354 canvas->image = malloc(sizeof(vImage_Buffer));
355 canvas->image->width = width;
356 canvas->image->height = height;
357 canvas->image->rowBytes = bytesPerRow;
359 canvas->image->data = (void *)calloc(byteCount, sizeof(UInt32));
360 if (canvas->image->data == NULL) {
366 canvas->context = CGBitmapContextCreate(canvas->image->data,
371 CGContextSetRGBFillColor(canvas->context, 0.0f, 0.0f, 0.0f, 1.0f);
372 CGContextSetFontSize(canvas->context, 1);
373 CGContextSaveGState(canvas->context);
382 CGGI_FreeCanvas(CGGI_GlyphCanvas *canvas)
384 if (canvas->context != NULL) {
385 CGContextRelease(canvas->context);
388 if (canvas->image != NULL) {
389 if (canvas->image->data != NULL) {
390 free(canvas->image->data);
392 free(canvas->image);
404 * Quick and easy inline to check if this canvas is big enough.
407 CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width, const vImagePixelCount height, const JRSFontRenderingStyle style)
409 if (canvas->image != NULL &&
410 width < canvas->image->width &&
411 height < canvas->image->height)
417 // run, resize the canvas
418 CGGI_FreeCanvas(canvas);
419 CGGI_InitCanvas(canvas,
422 JRSFontSetRenderingStyleOnContext(canvas->context, style);
426 * Clear the canvas by blitting white only into the region of interest
430 CGGI_ClearCanvas(CGGI_GlyphCanvas *canvas, GlyphInfo *info)
433 canvasRectToClear.data = canvas->image->data;
436 // use the row stride of the canvas, not the info
437 canvasRectToClear.rowBytes = canvas->image->rowBytes;
439 // clean the canvas
513 * Clears the canvas, strikes the glyph with CoreGraphics, and then
518 (CGGI_GlyphCanvas *canvas, const CGGlyph glyph,
521 // clean the canvas
522 CGGI_ClearCanvas(canvas, info);
525 CGContextShowGlyphsAtPoint(canvas->context,
527 canvas->image->height + info->topLeftY,
530 // copy the glyph from the canvas into the info
531 (*mode->glyphDescriptor->copyFxnPtr)(canvas, info);
539 (CGGI_GlyphCanvas *canvas, const AWTStrike *strike,
543 CGContextSaveGState(canvas->context);
573 CGGI_SizeCanvas(canvas, info->width, info->height, mode->cgFontMode);
576 CGContextSetTextMatrix(canvas->context, strike->fAltTx);
579 CGContextSetFont(canvas->context, cgFallback);
582 // clean the canvas - align, strike, and copy the glyph from the canvas into the info
583 CGGI_CreateImageForGlyph(canvas, glyph, info, mode);
586 CGContextRestoreGState(canvas->context);
594 DUMP_IMG_PIXELS("CGGI Canvas", canvas->image);
607 * Sets all the per-run properties for the canvas, and then iterates through
613 CGGI_FillImagesForGlyphsWithSizedCanvas(CGGI_GlyphCanvas *canvas,
621 CGContextSetTextMatrix(canvas->context, strike->fAltTx);
623 CGContextSetFont(canvas->context, strike->fAWTFont->fNativeCGFont);
624 JRSFontSetRenderingStyleOnContext(canvas->context, strike->fStyle);
630 CGGI_CreateImageForGlyph(canvas, glyphs[i], info, mode);
632 info = CGGI_CreateImageForUnicode(canvas, strike, mode, uniChars[i]);
640 DUMP_IMG_PIXELS("CGGI Canvas", canvas->image);
644 DUMP_IMG_PIXELS("CGGI Canvas", canvas->image);
645 PRINT_CGSTATES_INFO(canvas->context);
654 * to determine if we go with the global canvas, or malloc one on the spot.
660 * either use the global shared canvas, or make one up on the spot, strike
686 CGGI_GlyphCanvas *canvas = [threadDict objectForKey:threadLocalCanvasKey];
687 if (canvas == nil) {
688 canvas = [[CGGI_GlyphCanvas alloc] init];
689 [threadDict setObject:canvas forKey:threadLocalCanvasKey];
692 CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode->cgFontMode);
693 CGGI_FillImagesForGlyphsWithSizedCanvas(canvas, strike, mode,
699 * cycles through all the bounds and calculates the maximum canvas space