2017-06-27 19:26:15 +02:00
|
|
|
#include <stdio.h>
|
2017-07-08 08:26:59 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2017-06-27 19:26:15 +02:00
|
|
|
#include <ft2build.h>
|
2017-07-08 08:26:59 +02:00
|
|
|
|
2017-06-27 19:26:15 +02:00
|
|
|
#include "murmur3.h" // MurmurHash3_x64_128 header file
|
|
|
|
|
2017-07-08 08:26:59 +02:00
|
|
|
#include <png.h>
|
|
|
|
|
|
|
|
|
2017-06-27 19:26:15 +02:00
|
|
|
#include FT_FREETYPE_H
|
|
|
|
#include FT_MODULE_H
|
|
|
|
#include FT_LCD_FILTER_H
|
|
|
|
#include FT_BITMAP_H
|
|
|
|
|
2017-07-08 08:26:59 +02:00
|
|
|
#define BITS_PER_PIXEL_RGBA 32
|
2017-06-27 19:26:15 +02:00
|
|
|
|
|
|
|
typedef struct { // To store 32bit Hash
|
2017-07-08 08:26:59 +02:00
|
|
|
FT_UInt32 hash[1];
|
2017-06-27 19:26:15 +02:00
|
|
|
}HASH_32;
|
|
|
|
|
|
|
|
typedef struct { // To store 128bit Hash
|
2017-07-08 08:26:59 +02:00
|
|
|
FT_UInt32 hash[4];
|
2017-06-27 19:26:15 +02:00
|
|
|
}HASH_128;
|
|
|
|
|
2017-07-08 08:26:59 +02:00
|
|
|
typedef struct {
|
|
|
|
unsigned char red;
|
|
|
|
unsigned char green;
|
|
|
|
unsigned char blue;
|
|
|
|
unsigned char alpha;
|
|
|
|
} PIXEL;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned char red;
|
|
|
|
unsigned char green;
|
|
|
|
unsigned char blue;
|
|
|
|
unsigned char alpha;
|
|
|
|
} PIXEL_BGRA;
|
|
|
|
|
|
|
|
/* A picture. */
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
PIXEL *pixels;
|
|
|
|
size_t width;
|
|
|
|
size_t height;
|
|
|
|
} IMAGE;
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2017-06-27 19:26:15 +02:00
|
|
|
|
|
|
|
HASH_32 * Generate_Hash_x86_32(FT_Bitmap * bitmap, HASH_32 * murmur);
|
|
|
|
HASH_128 * Generate_Hash_x86_128(FT_Bitmap * bitmap, HASH_128 * murmur);
|
|
|
|
HASH_128 * Generate_Hash_x64_128(FT_Bitmap * bitmap, HASH_128 * murmur);
|
|
|
|
|
2017-07-08 08:26:59 +02:00
|
|
|
//------------------------------------------------------------------------------
|
2017-06-27 19:26:15 +02:00
|
|
|
|
2017-07-08 08:26:59 +02:00
|
|
|
PIXEL * Pixel_At (IMAGE * bitmap, int x, int y); // Returns a pointer to pixel
|
|
|
|
// at (x,y) co-ordinate
|
|
|
|
// buffer to image
|
|
|
|
void Make_PNG(FT_Bitmap* bitmap,char* name,int i,int render_mode);
|
|
|
|
// Image to file
|
|
|
|
int Generate_PNG (IMAGE *bitmap, const char *path,int render_mode);
|
2017-06-27 19:26:15 +02:00
|
|
|
|