Total Variation Inpainting using Split Bregman
Data Structures | Functions | Variables
drawtext.c File Reference

Draw text on an image. More...

#include "drawtext.h"

Go to the source code of this file.

Data Structures

struct  fontinfo
 Font info. More...
 

Functions

static void PutPixel (unsigned char *Image, int Width, int Height, int x, int y, unsigned char Value)
 Draw a pixel on an image.
 
static void DrawGlyph (unsigned char *Image, int Width, int Height, const unsigned char *Glyph, int GlyphWidth, int GlyphHeight, int x0, int y0, unsigned Value)
 Draw a packed binary glyph on an image. More...
 
int TextWidth (const char *Text)
 Compute the width of text in pixels.
 
void DrawText (unsigned char *Image, int Width, int Height, int x0, int y0, unsigned char Value, const char *Text)
 Draw text on an image. More...
 

Variables

static struct fontinfo FontInfo []
 
static unsigned char FontBitmapData []
 Font bitmap data.
 

Detailed Description

Draw text on an image.

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.gmail.nosp@m..com

This file contains a simple implementation for drawing text onto an image. Data for one 18-point sans serif font is included.

Copyright (c) 2012, Pascal Getreuer All rights reserved.

This program is free software: you can redistribute it and/or modify it under, at your option, the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or the terms of the simplified BSD license.

You should have received a copy of these licenses along with this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.

Definition in file drawtext.c.

Function Documentation

static void DrawGlyph ( unsigned char *  Image,
int  Width,
int  Height,
const unsigned char *  Glyph,
int  GlyphWidth,
int  GlyphHeight,
int  x0,
int  y0,
unsigned  Value 
)
static

Draw a packed binary glyph on an image.

Parameters
Imagethe destination image
Width,Heightthe image dimensions
Glyphthe packed binary glyph data
GlyphWidth,GlyphHeightthe glyph dimensions in pixels
x0,y0the upper-left corner of the glyph
Valuethe grayscale value of the drawn glyph

Definition at line 231 of file drawtext.c.

void DrawText ( unsigned char *  Image,
int  Width,
int  Height,
int  x0,
int  y0,
unsigned char  Value,
const char *  Text 
)

Draw text on an image.

Parameters
Imagethe destination image
Width,Heightthe image dimensions
x0,y0the upper-left corner of the text
Valuethe grayscale value of the drawn text
Textthe text to be drawn

Definition at line 291 of file drawtext.c.