Blender V2.61 - r43446
|
#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BKE_global.h"
#include "IMB_imbuf_types.h"
#include "BKE_bmfont.h"
#include "BKE_bmfont_types.h"
Go to the source code of this file.
Defines | |
#define | MAX2(x, y) ( (x)>(y) ? (x) : (y) ) |
#define | MAX3(x, y, z) MAX2( MAX2((x),(y)) , (z) ) |
Functions | |
void | calcAlpha (ImBuf *ibuf) |
void | readBitmapFontVersion0 (ImBuf *ibuf, unsigned char *rect, int step) |
void | detectBitmapFont (ImBuf *ibuf) |
int | locateGlyph (bmFont *bmfont, unsigned short unicode) |
void | matrixGlyph (ImBuf *ibuf, unsigned short unicode, float *centerx, float *centery, float *sizex, float *sizey, float *transx, float *transy, float *movex, float *movey, float *advance) |
Definition in file bmfont.cpp.
#define MAX2 | ( | x, | |
y | |||
) | ( (x)>(y) ? (x) : (y) ) |
Two external functions:
void detectBitmapFont(ImBuf *ibuf) detects if an image buffer contains a bitmap font. It makes the specific bitmap data which is stored in the bitmap invisible to blender.
void matrixGlyph(ImBuf * ibuf, unsigned short unicode, *float x 7) returns all the information about the character (unicode) in the floats
Room for improvement: add kerning data in the bitmap all calculations in matrixGlyph() are static and could be done during initialization
Definition at line 76 of file bmfont.cpp.
#define MAX3 | ( | x, | |
y, | |||
z | |||
) | MAX2( MAX2((x),(y)) , (z) ) |
Definition at line 77 of file bmfont.cpp.
void calcAlpha | ( | ImBuf * | ibuf | ) |
Definition at line 79 of file bmfont.cpp.
References i, MAX3, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by readBitmapFontVersion0().
void detectBitmapFont | ( | ImBuf * | ibuf | ) |
Definition at line 185 of file bmfont.cpp.
References i, is_power_of_two, NULL, readBitmapFontVersion0(), ImBuf::rect, ImBuf::userdata, ImBuf::x, and ImBuf::y.
Referenced by image_load_image_file().
int locateGlyph | ( | bmFont * | bmfont, |
unsigned short | unicode | ||
) |
Definition at line 227 of file bmfont.cpp.
References bmFont::glyphcount, bmFont::glyphs, max, min, and bmGlyph::unicode.
Referenced by matrixGlyph().
void matrixGlyph | ( | ImBuf * | ibuf, |
unsigned short | unicode, | ||
float * | centerx, | ||
float * | centery, | ||
float * | sizex, | ||
float * | sizey, | ||
float * | transx, | ||
float * | transy, | ||
float * | movex, | ||
float * | movey, | ||
float * | advance | ||
) |
Definition at line 259 of file bmfont.cpp.
References bmGlyph::advance, bmFont::glyphs, IB_BITMAPFONT, if(), locateGlyph(), bmGlyph::locx, bmGlyph::locy, bmGlyph::ofsx, bmGlyph::ofsy, bmGlyph::sizex, bmGlyph::sizey, ImBuf::userdata, ImBuf::userflags, ImBuf::x, and ImBuf::y.
Referenced by GPU_render_text().
void readBitmapFontVersion0 | ( | ImBuf * | ibuf, |
unsigned char * | rect, | ||
int | step | ||
) |
Definition at line 93 of file bmfont.cpp.
References bmGlyph::advance, calcAlpha(), bmFont::glyphcount, bmFont::glyphs, i, IB_BITMAPFONT, bmGlyph::locx, bmGlyph::locy, bmFont::magic, MEM_freeN(), MEM_mallocN(), bmGlyph::ofsx, bmGlyph::ofsy, ImBuf::planes, bmGlyph::reserved, bmGlyph::sizex, bmGlyph::sizey, step(), bmGlyph::unicode, ImBuf::userdata, ImBuf::userflags, bmFont::version, ImBuf::x, bmFont::xsize, ImBuf::y, and bmFont::ysize.
Referenced by detectBitmapFont().