33#define FT_COMPONENT bitmap
73 FT_Int source_pitch_sign, target_pitch_sign;
77 return FT_THROW( Invalid_Library_Handle );
85 source_pitch_sign =
source->pitch < 0 ? -1 : 1;
86 target_pitch_sign =
target->pitch < 0 ? -1 : 1;
91 if ( source_pitch_sign != target_pitch_sign )
110 if ( target_pitch < 0 )
111 target_pitch = -target_pitch;
114 if ( target_size !=
size )
129 if ( source_pitch_sign == target_pitch_sign )
166 unsigned int new_pitch;
176 switch (
bitmap->pixel_mode )
180 new_pitch = (
width + xpixels + 7 ) >> 3;
184 new_pitch = (
width + xpixels + 3 ) >> 2;
188 new_pitch = (
width + xpixels + 1 ) >> 1;
194 new_pitch =
width + xpixels;
197 return FT_THROW( Invalid_Glyph_Format );
201 if ( ypixels == 0 && new_pitch <= pitch )
208 if ( bit_last < bit_width )
249 unsigned int delta = new_pitch -
len;
253 out += new_pitch * ypixels;
275 unsigned int delta = new_pitch -
len;
320 return FT_THROW( Invalid_Library_Handle );
323 return FT_THROW( Invalid_Argument );
327 return FT_THROW( Invalid_Argument );
332 if ( xstr == 0 && ystr == 0 )
334 else if ( xstr < 0 || ystr < 0 )
335 return FT_THROW( Invalid_Argument );
337 switch (
bitmap->pixel_mode )
382 p =
bitmap->buffer + pitch * ystr;
398 for (
x = pitch - 1;
x >= 0;
x-- )
404 for (
i = 1;
i <= xstr;
i++ )
412 p[
x] |=
p[
x - 1] << ( 8 -
i );
431 if (
p[
x] ==
bitmap->num_grays - 1 )
446 for (
x = 1;
x <= ystr;
x++ )
452 for (
i = 0;
i < pitch;
i++ )
491 l = ( 4732UL * bgra[0] * bgra[0] +
492 46871UL * bgra[1] * bgra[1] +
493 13933UL * bgra[2] * bgra[2] ) >> 16;
537 return FT_THROW( Invalid_Library_Handle );
540 return FT_THROW( Invalid_Argument );
544 switch (
source->pixel_mode )
554 FT_Int pad, old_target_pitch, target_pitch;
558 old_target_pitch =
target->pitch;
559 if ( old_target_pitch < 0 )
560 old_target_pitch = -old_target_pitch;
578 if ( target_pitch > 0 &&
580 return FT_THROW( Invalid_Argument );
586 target->pitch =
target->pitch < 0 ? -target_pitch : target_pitch;
603 switch (
source->pixel_mode )
620 for (
j =
source->width >> 3;
j > 0;
j-- )
628 tt[0] = (
FT_Byte)( (
val & 0x80 ) ? 0xff : 0);
629 tt[1] = (
FT_Byte)( (
val & 0x40 ) ? 0xff : 0);
630 tt[2] = (
FT_Byte)( (
val & 0x20 ) ? 0xff : 0);
631 tt[3] = (
FT_Byte)( (
val & 0x10 ) ? 0xff : 0);
632 tt[4] = (
FT_Byte)( (
val & 0x08 ) ? 0xff : 0);
633 tt[5] = (
FT_Byte)( (
val & 0x04 ) ? 0xff : 0);
634 tt[6] = (
FT_Byte)( (
val & 0x02 ) ? 0xff : 0);
635 tt[7] = (
FT_Byte)( (
val & 0x01 ) ? 0xff : 0);
667 tt[0] = (
FT_Byte)( (
val & 0x80 ) ? 0xff : 0);
719 for (
j =
source->width >> 2;
j > 0;
j-- )
769 for (
j =
source->width >> 1;
j > 0;
j-- )
782 tt[0] = (
FT_Byte)( (
ss[0] & 0xF0 ) >> 4 );
856 FT_Bool free_source_bitmap = 0;
857 FT_Bool free_target_bitmap_on_error = 0;
859 FT_Pos source_llx, source_lly, source_urx, source_ury;
860 FT_Pos target_llx, target_lly, target_urx, target_ury;
861 FT_Pos final_llx, final_lly, final_urx, final_ury;
863 unsigned int final_rows, final_width;
868 return FT_THROW( Invalid_Argument );
875 return FT_THROW( Invalid_Argument );
882 ( source_->pitch ^
target->pitch ) < 0 )
883 return FT_THROW( Invalid_Argument );
885 if ( !( source_->width && source_->rows ) )
895 source_llx = source_offset.
x;
899 "FT_Bitmap_Blend: y coordinate overflow in source bitmap\n" ));
900 return FT_THROW( Invalid_Argument );
902 source_lly = source_offset.
y - ( source_->rows << 6 );
907 "FT_Bitmap_Blend: x coordinate overflow in source bitmap\n" ));
908 return FT_THROW( Invalid_Argument );
910 source_urx = source_llx + ( source_->width << 6 );
911 source_ury = source_offset.
y;
916 target_llx = target_offset.
x;
920 "FT_Bitmap_Blend: y coordinate overflow in target bitmap\n" ));
921 return FT_THROW( Invalid_Argument );
923 target_lly = target_offset.
y - (
target->rows << 6 );
928 "FT_Bitmap_Blend: x coordinate overflow in target bitmap\n" ));
929 return FT_THROW( Invalid_Argument );
931 target_urx = target_llx + (
target->width << 6 );
932 target_ury = target_offset.
y;
943 final_llx =
FT_MIN( source_llx, target_llx );
944 final_lly =
FT_MIN( source_lly, target_lly );
945 final_urx =
FT_MAX( source_urx, target_urx );
946 final_ury =
FT_MAX( source_ury, target_ury );
948 final_width = ( final_urx - final_llx ) >> 6;
949 final_rows = ( final_ury - final_lly ) >> 6;
951#ifdef FT_DEBUG_LEVEL_TRACE
953 " source bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
954 source_llx / 64, source_lly / 64,
955 source_urx / 64, source_ury / 64,
956 source_->width, source_->rows ));
959 FT_TRACE5((
" target bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
960 target_llx / 64, target_lly / 64,
961 target_urx / 64, target_ury / 64,
964 FT_TRACE5((
" target bitmap: empty\n" ));
966 if ( final_width && final_rows )
967 FT_TRACE5((
" final bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
968 final_llx / 64, final_lly / 64,
969 final_urx / 64, final_ury / 64,
970 final_width, final_rows ));
975 if ( !( final_width && final_rows ) )
980 source_llx -= final_llx;
981 source_lly -= final_lly;
985 target_llx -= final_llx;
986 target_lly -= final_lly;
993 target->width = final_width;
994 target->rows = final_rows;
1001 FT_TRACE5((
"FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
1002 final_width, final_rows ));
1003 return FT_THROW( Invalid_Argument );
1009 free_target_bitmap_on_error = 1;
1011 else if (
target->width != final_width ||
1012 target->rows != final_rows )
1015 int pitch, new_pitch;
1025 new_pitch = (
int)final_width * 4;
1029 FT_TRACE5((
"FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
1030 final_width, final_rows ));
1031 return FT_THROW( Invalid_Argument );
1040 x = target_llx >> 6;
1041 y = target_lly >> 6;
1055 ( final_rows -
y -
target->rows ) * new_pitch +
1057 unsigned char* limit_p =
1072 target->width = final_width;
1073 target->rows = final_rows;
1076 target->pitch = -new_pitch;
1078 target->pitch = new_pitch;
1092 free_source_bitmap = 1;
1099 x = source_llx >> 6;
1100 y = source_lly >> 6;
1116 unsigned char* limit_p =
1120 while (
p < limit_p )
1122 unsigned char*
r =
p;
1123 unsigned char*
s =
q;
1124 unsigned char* limit_r =
r +
source->width;
1127 while (
r < limit_r )
1130 int fa =
color.alpha * aa / 255;
1132 int fb =
color.blue *
fa / 255;
1133 int fg =
color.green *
fa / 255;
1134 int fr =
color.red *
fa / 255;
1144 *
s++ = (
unsigned char)( bb * ba2 / 255 + fb );
1145 *
s++ = (
unsigned char)( bg * ba2 / 255 + fg );
1146 *
s++ = (
unsigned char)( br * ba2 / 255 + fr );
1147 *
s++ = (
unsigned char)( ba * ba2 / 255 +
fa );
1155 atarget_offset->x = final_llx;
1156 atarget_offset->y = final_lly + ( final_rows << 6 );
1159 if (
error && free_target_bitmap_on_error )
1162 if ( free_source_bitmap )
1174 if (
slot &&
slot->format == FT_GLYPH_FORMAT_BITMAP &&
1204 return FT_THROW( Invalid_Library_Handle );
1207 return FT_THROW( Invalid_Argument );
_Check_return_ _Ret_maybenull_ _In_ size_t alignment
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
FT_GlyphSlot_Own_Bitmap(FT_GlyphSlot slot)
FT_Bitmap_Convert(FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment)
FT_Bitmap_New(FT_Bitmap *abitmap)
FT_Bitmap_Done(FT_Library library, FT_Bitmap *bitmap)
static const FT_Bitmap null_bitmap
FT_Bitmap_Embolden(FT_Library library, FT_Bitmap *bitmap, FT_Pos xStrength, FT_Pos yStrength)
FT_Bitmap_Copy(FT_Library library, const FT_Bitmap *source, FT_Bitmap *target)
FT_Bitmap_Blend(FT_Library library, const FT_Bitmap *source_, const FT_Vector source_offset_, FT_Bitmap *target, FT_Vector *atarget_offset, FT_Color color)
FT_Bitmap_Init(FT_Bitmap *abitmap)
static FT_Error ft_bitmap_assure_buffer(FT_Memory memory, FT_Bitmap *bitmap, FT_UInt xpixels, FT_UInt ypixels)
static FT_Byte ft_gray_for_premultiplied_srgb_bgra(const FT_Byte *bgra)
FT_BEGIN_HEADER struct FT_Color_ FT_Color
#define FT_TRACE5(varformat)
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_QALLOC_MULT(ptr, count, item_size)
#define FT_QREALLOC(ptr, cursz, newsz)
#define FT_ALLOC(ptr, size)
#define FT_ARRAY_COPY(dest, source, count)
#define FT_QALLOC(ptr, size)
#define FT_MEM_COPY(dest, source, count)
#define FT_MEM_ZERO(dest, count)
#define FT_GLYPH_OWN_BITMAP
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble q
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
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 GLint GLint j
static char memory[1024 *256]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out