Blender V2.61 - r43446
|
#include <stdio.h>
#include "MEM_guardedalloc.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 | printfGlyph (bmGlyph *glyph) |
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.c.
#define MAX2 | ( | x, | |
y | |||
) | ( (x)>(y) ? (x) : (y) ) |
Definition at line 68 of file bmfont.c.
Referenced by _getSubSurf(), alpha_clip_aniso(), animviz_calc_motionpaths(), avgLogLum(), avi_fetchibuf(), BB_expand(), BB_expand_with_bb(), best_socket_input(), BKE_ptcache_bake(), BKE_ptcache_id_time(), BKE_ptcache_load_external(), BKE_ptcache_read(), BKE_text_to_curve(), BKE_tracking_clamp_track(), BKE_tracking_context_new(), BKE_tracking_next(), BKE_tracking_projection_matrix(), BKE_tracking_reconstruction_context_new(), BLI_bvhtree_new(), BLI_bvhtree_overlap(), BLI_calcGraphLength(), BLI_mempool_create(), BLI_pbvh_build_grids(), BLI_subtreeLength(), bloom_with_reference(), blur_with_reference(), boid_body(), border_apply_rect(), BPy_FloatProperty(), BPy_FloatVectorProperty(), BPy_IntProperty(), BPy_IntVectorProperty(), brush_apply_pressure(), brush_drawcursor(), brush_edit_apply(), brush_painter_paint(), BTP(), cache_occ_samples(), calc_action_range(), calc_fcurve_bounds(), calc_fcurve_range(), calc_text_rcts(), calculate_collision_balls(), ccd_mesh_make(), ccd_mesh_update(), cloth_build_springs(), cloth_bvh_objcollision(), cloth_collision_response_static(), cloth_from_object(), collision_response(), colorband_buttons_large(), compatible_bump_compute(), compress_deepsamples(), compute_radiance(), console_copy_exec(), console_draw_sel(), cp_cu_key(), curvemap_make_table(), curvemapping_add(), curvemapping_changed(), dag_node_recurs_level(), damptrack_evaluate(), defocus_blur(), dfdx_damp(), distribute_grid(), do_channel_matte(), do_drop_effect_byte(), do_drop_effect_float(), do_material_tex(), do_projectpaint_thread(), do_versions(), doEdgeSlide(), draw_empty_image(), draw_outliner(), draw_seq_backdrop(), draw_seq_strips(), draw_text_main(), drawmeta_contents(), ed_preview_draw_rect(), ED_region_do_draw(), ED_region_panels(), ED_region_tag_redraw_partial(), ff_quad_form_factor(), file_draw_buttons(), finalize_render_object(), freetypechar_to_vchar(), get_keyframe_extents(), get_nlastrip_extents(), give_ibuf_seq(), glaDrawPixelsSafe(), GPU_verify_image(), halo_tile(), IIR_gauss(), IIR_gauss_single(), image_view_selected_exec(), imagewraposa(), imagewraposa_aniso(), imapaint_dirty_region(), implicit_needed_branches(), init_particle_interpolation(), initialize_chain(), initialize_posetree(), lamp_get_visibility(), makeBokeh(), Matrix_str(), Minnaert_Diff(), morpho_dilate(), multires_set_tot_level(), node_composit_exec_crop(), node_composit_exec_glare(), node_composit_exec_lensdist(), node_composit_exec_scale(), node_update_hidden(), ntap_bump_compute(), occ_compute_bounces(), occ_lookup(), occ_quad_form_factor(), ocean_texture(), p_smooth(), paint_convert_bb_to_rect(), partial_redraw_array_merge(), preview_prepare_scene(), psys_alloc_path_cache_buffers(), psys_cache_edit_paths(), psys_changed_type(), psys_get_pointcache_start_end(), psys_render_simplify_distribution(), ptcache_particle_interpolate(), RE_WriteEnvmapResult(), RE_zbuf_accumulate_vecblur(), render_frame(), render_lighting_halo(), render_new_particle_system(), renormalizeWeight(), ringcut_modal(), RNA_property_float_get_array_range(), RNA_property_float_ui_range(), RNA_property_int_get_array_range(), RNA_property_int_ui_range(), rtbuild_heuristic_object_split(), rule_avoid_collision(), sample_occ(), sb_detect_edge_collisionCached(), scan_for_ext_face_forces(), screen_find_active_scredge(), screen_test_scale(), seg_intersect(), seq_tx_get_final_left(), sequencer_meta_make_exec(), sequencer_view_selected_exec(), shadowbuf_autoclip(), shuffle_seq(), shuffle_seq_time_offset_test(), SimpleDeformModifier_do(), sk_applyMergeGesture(), sk_clampPointSize(), sk_detectMergeGesture(), sk_getIntersections(), softbody_apply_forces(), softbody_step(), splineik_evaluate_bone(), stabilization_auto_scale_factor(), texpaint_break_stroke(), text_update_character_width(), tonemap(), track_markers_exec(), track_markers_initjob(), track_mouse_area(), txt_add_marker(), ui_bounds_block(), ui_but_add_search(), ui_do_drag(), ui_handle_list_event(), ui_litem_estimate_absolute(), ui_litem_estimate_column(), ui_litem_estimate_column_flow(), ui_litem_estimate_overlap(), ui_litem_estimate_row(), ui_litem_layout_absolute(), ui_litem_layout_overlap(), ui_litem_layout_split(), ui_panels_size(), ui_popup_bounds_block(), ui_text_bounds_block(), ui_tooltip_create(), uiTemplateList(), uiTemplateReportsBanner(), vgroup_normalize(), vicon_view3d_draw(), view3d_main_area_setup_view(), view3d_panel_object(), WardIso_Spec(), widget_progressbar(), and widget_scroll().
#define MAX3 | ( | x, | |
y, | |||
z | |||
) | MAX2( MAX2((x),(y)) , (z) ) |
Definition at line 69 of file bmfont.c.
Referenced by calcAlpha().
void calcAlpha | ( | ImBuf * | ibuf | ) |
void detectBitmapFont | ( | ImBuf * | ibuf | ) |
Definition at line 171 of file bmfont.c.
References i, is_power_of_two, NULL, readBitmapFontVersion0(), ImBuf::rect, ImBuf::userdata, ImBuf::x, and ImBuf::y.
int locateGlyph | ( | bmFont * | bmfont, |
unsigned short | unicode | ||
) |
Definition at line 213 of file bmfont.c.
References bmFont::glyphcount, bmFont::glyphs, max, min, and bmGlyph::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 at line 245 of file bmfont.c.
References bmGlyph::advance, bmFont::glyphs, IB_BITMAPFONT, locateGlyph(), bmGlyph::locx, bmGlyph::locy, bmGlyph::ofsx, bmGlyph::ofsy, bmGlyph::sizex, bmGlyph::sizey, ImBuf::userdata, ImBuf::userflags, ImBuf::x, and ImBuf::y.
void printfGlyph | ( | bmGlyph * | glyph | ) |
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 59 of file bmfont.c.
References bmGlyph::advance, bmGlyph::locx, bmGlyph::locy, bmGlyph::ofsx, bmGlyph::ofsy, bmGlyph::reserved, bmGlyph::sizex, bmGlyph::sizey, and bmGlyph::unicode.
Referenced by readBitmapFontVersion0().
void readBitmapFontVersion0 | ( | ImBuf * | ibuf, |
unsigned char * | rect, | ||
int | step | ||
) |
Definition at line 85 of file bmfont.c.
References bmGlyph::advance, calcAlpha(), G, G_DEBUG, bmFont::glyphcount, bmFont::glyphs, i, IB_BITMAPFONT, bmGlyph::locx, bmGlyph::locy, bmFont::magic, MEM_freeN(), MEM_mallocN(), bmGlyph::ofsx, bmGlyph::ofsy, ImBuf::planes, printfGlyph(), bmGlyph::reserved, bmGlyph::sizex, bmGlyph::sizey, step(), bmGlyph::unicode, ImBuf::userdata, ImBuf::userflags, bmFont::version, ImBuf::x, bmFont::xsize, ImBuf::y, and bmFont::ysize.