NetSurf
|
#include <stdbool.h>
#include <errno.h>
#include <stdio.h>
#include <png.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Macros | |
#define | png_set_expand_gray_1_2_4_to_8(png) png_set_gray_1_2_4_to_8(png) |
#define | WIDTH (is_cursor?raw_width-1:raw_width) |
#define | HEIGHT (is_cursor?raw_height-1:raw_height) |
#define | HOT_X (is_cursor?raw_hot_x-1:0) |
#define | HOT_Y (is_cursor?raw_hot_y-1:0) |
#define | REAL(v) (is_cursor?v+1:v) |
#define | PPIX_AT(x, y) ((bitmap_data + (rowstride * y)) + (x * 4)) |
#define | R_OFF 2 |
#define | G_OFF 1 |
#define | B_OFF 0 |
#define | A_OFF 3 |
#define | R_AT(x, y) *(PPIX_AT(x,y) + R_OFF) |
#define | G_AT(x, y) *(PPIX_AT(x,y) + G_OFF) |
#define | B_AT(x, y) *(PPIX_AT(x,y) + B_OFF) |
#define | A_AT(x, y) *(PPIX_AT(x,y) + A_OFF) |
Functions | |
static void | usage (void) |
static void | detect_hotspot (void) |
static void | info_callback (png_structp png, png_infop info) |
static void | row_callback (png_structp png, png_bytep new_row, png_uint_32 row_num, int pass) |
static void | end_callback (png_structp png, png_infop info) |
int | main (int argc, char **argv) |
Normal entry point from OS. More... | |
Variables | |
static png_structp | png |
static png_infop | info |
static int | interlace |
static size_t | rowbytes |
static int | raw_width |
static int | raw_height |
static int | rowstride |
static unsigned char * | bitmap_data |
static bool | is_cursor = true |
static int | raw_hot_x |
static int | raw_hot_y |
static unsigned int | interlace_start [8] = {0, 16, 0, 8, 0, 4, 0} |
static unsigned int | interlace_step [8] = {28, 28, 12, 12, 4, 4, 0} |
static unsigned int | interlace_row_start [8] = {0, 0, 4, 0, 2, 0, 1} |
static unsigned int | interlace_row_step [8] = {8, 8, 8, 4, 4, 2, 2} |
Definition at line 58 of file convert_image.c.
Referenced by detect_hotspot().
#define A_OFF 3 |
Definition at line 53 of file convert_image.c.
Definition at line 57 of file convert_image.c.
Referenced by detect_hotspot().
#define B_OFF 0 |
Definition at line 52 of file convert_image.c.
Definition at line 56 of file convert_image.c.
Referenced by detect_hotspot().
#define G_OFF 1 |
Definition at line 51 of file convert_image.c.
#define HEIGHT (is_cursor?raw_height-1:raw_height) |
Definition at line 41 of file convert_image.c.
Referenced by main().
Definition at line 43 of file convert_image.c.
Referenced by main().
Definition at line 44 of file convert_image.c.
Referenced by main().
Definition at line 27 of file convert_image.c.
Referenced by info_callback().
#define PPIX_AT | ( | x, | |
y | |||
) | ((bitmap_data + (rowstride * y)) + (x * 4)) |
Definition at line 48 of file convert_image.c.
Definition at line 55 of file convert_image.c.
Referenced by detect_hotspot().
#define R_OFF 2 |
Definition at line 50 of file convert_image.c.
#define REAL | ( | v | ) | (is_cursor?v+1:v) |
Definition at line 46 of file convert_image.c.
Definition at line 40 of file convert_image.c.
Referenced by main().
|
static |
|
static |
Definition at line 205 of file convert_image.c.
Referenced by main().
|
static |
Definition at line 119 of file convert_image.c.
References bitmap_data, height, interlace, png_set_expand_gray_1_2_4_to_8, raw_height, raw_width, rowbytes, rowstride, and width.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Normal entry point from OS.
Normal entry point from OS.
/param argc The number of arguments in the string vector. /param argv The argument string vector. /return The return code to the OS
Normal entry point from OS.
Definition at line 211 of file convert_image.c.
References bitmap_data, buffer, detect_hotspot(), end_callback(), HEIGHT, HOT_X, HOT_Y, info, info_callback(), is_cursor, png, row_callback(), rowstride, usage(), and WIDTH.
|
static |
Definition at line 174 of file convert_image.c.
References bitmap_data, interlace, interlace_row_start, interlace_row_step, interlace_start, interlace_step, rowbytes, and rowstride.
Referenced by main().
|
static |
Definition at line 62 of file convert_image.c.
Referenced by main().
|
static |
Definition at line 36 of file convert_image.c.
Referenced by info_callback(), main(), and row_callback().
|
static |
Definition at line 31 of file convert_image.c.
Referenced by fetch_filetype(), free_ns_cert_info(), gui_window_scroll_start(), gui_window_update_extent(), NSBaseView::Instantiate(), main(), nsbeos_find_app_path(), nsbeos_replicant_main_thread(), nsgtk_download_dialog_show(), nsgtk_download_store_update_item(), nsgtk_menu_help_submenu(), nsgtk_menu_initialise(), ro_cw_invalidate(), ro_gui_theme_get_available_in_dir(), and ro_gui_window_invalidate_area().
|
static |
Definition at line 32 of file convert_image.c.
Referenced by info_callback(), and row_callback().
|
static |
Definition at line 170 of file convert_image.c.
Referenced by row_callback().
|
static |
Definition at line 171 of file convert_image.c.
Referenced by row_callback().
|
static |
Definition at line 168 of file convert_image.c.
Referenced by row_callback().
|
static |
Definition at line 169 of file convert_image.c.
Referenced by row_callback().
|
static |
Definition at line 37 of file convert_image.c.
Referenced by detect_hotspot(), and main().
|
static |
Definition at line 30 of file convert_image.c.
Referenced by main().
|
static |
Definition at line 34 of file convert_image.c.
Referenced by detect_hotspot(), and info_callback().
|
static |
Definition at line 38 of file convert_image.c.
Referenced by detect_hotspot().
|
static |
Definition at line 38 of file convert_image.c.
Referenced by detect_hotspot().
|
static |
Definition at line 34 of file convert_image.c.
Referenced by detect_hotspot(), and info_callback().
|
static |
Definition at line 33 of file convert_image.c.
Referenced by info_callback(), and row_callback().
|
static |
Definition at line 35 of file convert_image.c.
Referenced by atari_bitmap_create_ex(), atari_bitmap_realloc(), info_callback(), jpeg_cache_convert(), main(), row_callback(), rsvg_argb_to_abgr(), and webp_cache_convert().