Lines Matching refs:spc

588 STBTT_DEF int  stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context);
599 STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc);
604 STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size,
629 STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges);
635 STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample);
651 STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip);
663 STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
664 STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects);
665 STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
3957 STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context)
3969 spc->user_allocator_context = alloc_context;
3970 spc->width = pw;
3971 spc->height = ph;
3972 spc->pixels = pixels;
3973 spc->pack_info = context;
3974 spc->nodes = nodes;
3975 spc->padding = padding;
3976 spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw;
3977 spc->h_oversample = 1;
3978 spc->v_oversample = 1;
3979 spc->skip_missing = 0;
3989 STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc)
3991 STBTT_free(spc->nodes , spc->user_allocator_context);
3992 STBTT_free(spc->pack_info, spc->user_allocator_context);
3995 STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample)
4000 spc->h_oversample = h_oversample;
4002 spc->v_oversample = v_oversample;
4005 STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip)
4007 spc->skip_missing = skip;
4149 STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
4158 ranges[i].h_oversample = (unsigned char) spc->h_oversample;
4159 ranges[i].v_oversample = (unsigned char) spc->v_oversample;
4164 if (glyph == 0 && (spc->skip_missing || missing_glyph_added)) {
4168 scale * spc->h_oversample,
4169 scale * spc->v_oversample,
4172 rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
4173 rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
4208 STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
4213 int old_h_over = spc->h_oversample;
4214 int old_v_over = spc->v_oversample;
4221 spc->h_oversample = ranges[i].h_oversample;
4222 spc->v_oversample = ranges[i].v_oversample;
4223 recip_h = 1.0f / spc->h_oversample;
4224 recip_v = 1.0f / spc->v_oversample;
4225 sub_x = stbtt__oversample_shift(spc->h_oversample);
4226 sub_y = stbtt__oversample_shift(spc->v_oversample);
4234 stbrp_coord pad = (stbrp_coord) spc->padding;
4243 scale * spc->h_oversample,
4244 scale * spc->v_oversample,
4247 spc->pixels + r->x + r->y*spc->stride_in_bytes,
4248 r->w - spc->h_oversample+1,
4249 r->h - spc->v_oversample+1,
4250 spc->stride_in_bytes,
4251 scale * spc->h_oversample,
4252 scale * spc->v_oversample,
4256 if (spc->h_oversample > 1)
4257 stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
4258 r->w, r->h, spc->stride_in_bytes,
4259 spc->h_oversample);
4261 if (spc->v_oversample > 1)
4262 stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
4263 r->w, r->h, spc->stride_in_bytes,
4264 spc->v_oversample);
4278 } else if (spc->skip_missing) {
4291 spc->h_oversample = old_h_over;
4292 spc->v_oversample = old_v_over;
4297 STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects)
4299 stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects);
4302 STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
4306 //stbrp_context *context = (stbrp_context *) spc->pack_info;
4321 rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);
4325 info.userdata = spc->user_allocator_context;
4328 n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);
4330 stbtt_PackFontRangesPackRects(spc, rects, n);
4332 return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects);
4334 STBTT_free(rects, spc->user_allocator_context);
4338 STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size,
4347 return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1);