21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
23#include FT_TRUETYPE_TAGS_H
24#include FT_CONFIG_STANDARD_LIBRARY_H
27#if defined( TT_CONFIG_OPTION_EMBEDDED_BITMAPS ) && \
28 defined( FT_CONFIG_OPTION_USE_PNG )
31#define PNG_SKIP_SETJMP_CHECK 1
42 multiply_alpha(
unsigned int alpha,
48 return (
temp + (
temp >> 8 ) ) >> 8;
64#if ( ( defined( __GNUC__ ) && \
65 ( ( __GNUC__ >= 5 ) || \
66 ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 7 ) ) ) ) || \
67 ( defined( __clang__ ) && \
68 ( ( __clang_major__ >= 4 ) || \
69 ( ( __clang_major__ == 3 ) && ( __clang_minor__ >= 2 ) ) ) ) ) && \
70 defined( __OPTIMIZE__ ) && \
71 __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
77#define vector_shuffle __builtin_shufflevector
79#define vector_shuffle __builtin_shuffle
82 typedef unsigned short v82
__attribute__(( vector_size( 16 ) ));
97 v82 n0x80 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
98 v82 n0xFF = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
99 v82 n8 = { 8, 8, 8, 8, 8, 8, 8, 8 };
101 v82 ma = { 1, 1, 3, 3, 5, 5, 7, 7 };
102 v82 o1 = { 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF };
103 v82 m0 = { 1, 0, 3, 2, 5, 4, 7, 6 };
110 a = vector_shuffle(
s1, ma );
112 s0 = vector_shuffle( s0, m0 );
118 s0 = ( s0 + ( s0 >> n8 ) ) >> n8;
119 s1 = (
s1 + (
s1 >> n8 ) ) >> n8;
121 s = s0 | (
s1 << n8 );
200#ifdef PNG_SETJMP_SUPPORTED
235 png_error( png,
NULL );
255 FT_Bool populate_map_and_metrics,
266 int bitdepth, color_type, interlace;
268 png_byte* *rows =
NULL;
278 if ( !populate_map_and_metrics &&
300 info = png_create_info_struct( png );
304 png_destroy_read_struct( &png,
NULL,
NULL );
314 png_set_read_fn( png, &
stream, read_data_from_FT_Stream );
316 png_read_info( png,
info );
317 png_get_IHDR( png,
info,
318 &imgWidth, &imgHeight,
319 &bitdepth, &color_type, &interlace,
323 ( !populate_map_and_metrics &&
328 if ( populate_map_and_metrics )
337 map->num_grays = 256;
340 if (
map->rows > 0x7FFF ||
map->width > 0x7FFF )
349 png_set_palette_to_rgb( png );
354#if PNG_LIBPNG_VER >= 10209
355 png_set_expand_gray_1_2_4_to_8( png );
357 png_set_gray_1_2_4_to_8( png );
363 png_set_tRNS_to_alpha( png );
365 if ( bitdepth == 16 )
366 png_set_strip_16( png );
369 png_set_packing( png );
374 png_set_gray_to_rgb( png );
377 png_set_interlace_handling( png );
382 png_read_update_info(png,
info );
383 png_get_IHDR( png,
info,
384 &imgWidth, &imgHeight,
385 &bitdepth, &color_type, &interlace,
388 if ( bitdepth != 8 ||
399 switch ( color_type )
405 png_set_read_user_transform_fn( png, premultiply_data );
410 png_set_read_user_transform_fn( png, convert_bytes_to_data );
414 if ( populate_map_and_metrics )
431 for (
i = 0;
i < (
FT_Int)imgHeight;
i++ )
432 rows[
i] =
map->buffer + ( y_offset +
i ) *
map->pitch + x_offset * 4;
434 png_read_image( png, rows );
438 png_read_end( png,
info );
441 png_destroy_read_struct( &png, &
info,
NULL );
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define FT_NEW_ARRAY(ptr, count)
ft_glyphslot_alloc_bitmap(FT_GlyphSlot slot, FT_ULong size)
#define FT_FRAME_ENTER(size)
FT_Stream_Close(FT_Stream stream)
FT_Stream_OpenMemory(FT_Stream stream, const FT_Byte *base, FT_ULong size)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
struct FT_StreamRec_ * FT_Stream
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLclampf GLclampf GLclampf alpha
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define PNG_COLOR_TYPE_RGB
#define PNG_COLOR_TYPE_RGB_ALPHA
#define PNG_COLOR_TYPE_GRAY_ALPHA
#define PNG_COLOR_TYPE_GRAY
#define PNG_COLOR_TYPE_PALETTE
static char memory[1024 *256]
png_voidp PNGAPI png_get_io_ptr(png_const_structrp png_ptr)
#define png_jmpbuf(png_ptr)
#define PNG_LIBPNG_VER_STRING
#define PNG_INTERLACE_NONE
const char * png_const_charp
static const WCHAR * error_msg[8]