FreeRDP
image.c File Reference
#include <stdlib.h>
#include <winpr/config.h>
#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/file.h>
#include <winpr/image.h>
#include <winpr/stream.h>
#include "image.h"
#include "../log.h"

Macros

#define TAG   WINPR_TAG("utils.image")
 

Functions

static SSIZE_T winpr_convert_from_jpeg (const BYTE *comp_data, size_t comp_data_bytes, UINT32 *width, UINT32 *height, UINT32 *bpp, BYTE **ppdecomp_data)
 
static SSIZE_T winpr_convert_from_png (const BYTE *comp_data, size_t comp_data_bytes, UINT32 *width, UINT32 *height, UINT32 *bpp, BYTE **ppdecomp_data)
 
static SSIZE_T winpr_convert_from_webp (const BYTE *comp_data, size_t comp_data_bytes, UINT32 *width, UINT32 *height, UINT32 *bpp, BYTE **ppdecomp_data)
 
BOOL writeBitmapFileHeader (wStream *s, const WINPR_BITMAP_FILE_HEADER *bf)
 
BOOL readBitmapFileHeader (wStream *s, WINPR_BITMAP_FILE_HEADER *bf)
 
BOOL writeBitmapInfoHeader (wStream *s, const WINPR_BITMAP_INFO_HEADER *bi)
 
BOOL readBitmapInfoHeader (wStream *s, WINPR_BITMAP_INFO_HEADER *bi, size_t *poffset)
 
BYTEwinpr_bitmap_construct_header (size_t width, size_t height, size_t bpp)
 
static void * winpr_bitmap_write_buffer (const BYTE *data, size_t size, UINT32 width, UINT32 height, UINT32 stride, UINT32 bpp, UINT32 *pSize)
 
int winpr_bitmap_write (const char *filename, const BYTE *data, size_t width, size_t height, size_t bpp)
 
int winpr_bitmap_write_ex (const char *filename, const BYTE *data, size_t stride, size_t width, size_t height, size_t bpp)
 
static int write_and_free (const char *filename, void *data, size_t size)
 
int winpr_image_write (wImage *image, const char *filename)
 
int winpr_image_write_ex (wImage *image, UINT32 format, const char *filename)
 
static int winpr_image_bitmap_read_buffer (wImage *image, const BYTE *buffer, size_t size)
 
int winpr_image_read (wImage *image, const char *filename)
 
int winpr_image_read_buffer (wImage *image, const BYTE *buffer, size_t size)
 
wImagewinpr_image_new (void)
 
void winpr_image_free (wImage *image, BOOL bFreeBuffer)
 
static void * winpr_convert_to_jpeg (const void *data, size_t size, UINT32 width, UINT32 height, UINT32 stride, UINT32 bpp, UINT32 *pSize)
 
static void * winpr_convert_to_webp (const void *data, size_t size, UINT32 width, UINT32 height, UINT32 stride, UINT32 bpp, UINT32 *pSize)
 
static void * winpr_convert_to_png (const void *data, size_t size, UINT32 width, UINT32 height, UINT32 stride, UINT32 bpp, UINT32 *pSize)
 
BOOL winpr_image_format_is_supported (UINT32 format)
 
static BYTEconvert (const wImage *image, size_t *pstride, UINT32 flags)
 
static BOOL compare_byte_relaxed (BYTE a, BYTE b, UINT32 flags)
 
static BOOL compare_pixel (const BYTE *pa, const BYTE *pb, UINT32 flags)
 
BOOL winpr_image_equal (const wImage *imageA, const wImage *imageB, UINT32 flags)
 
const char * winpr_image_format_mime (UINT32 format)
 
const char * winpr_image_format_extension (UINT32 format)
 
void * winpr_image_write_buffer (wImage *image, UINT32 format, size_t *psize)
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("utils.image")

WinPR: Windows Portable Runtime Image Utils

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2016 Inuvika Inc. Copyright 2016 David PHAM-VAN d.pha.nosp@m.mvan.nosp@m.@inuv.nosp@m.ika..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ compare_byte_relaxed()

static BOOL compare_byte_relaxed ( BYTE  a,
BYTE  b,
UINT32  flags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare_pixel()

static BOOL compare_pixel ( const BYTE pa,
const BYTE pb,
UINT32  flags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert()

static BYTE* convert ( const wImage image,
size_t *  pstride,
UINT32  flags 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitmapFileHeader()

BOOL readBitmapFileHeader ( wStream s,
WINPR_BITMAP_FILE_HEADER bf 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBitmapInfoHeader()

BOOL readBitmapInfoHeader ( wStream s,
WINPR_BITMAP_INFO_HEADER bi,
size_t *  poffset 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_bitmap_construct_header()

BYTE* winpr_bitmap_construct_header ( size_t  width,
size_t  height,
size_t  bpp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_bitmap_write()

int winpr_bitmap_write ( const char *  filename,
const BYTE data,
size_t  width,
size_t  height,
size_t  bpp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_bitmap_write_buffer()

static void* winpr_bitmap_write_buffer ( const BYTE data,
size_t  size,
UINT32  width,
UINT32  height,
UINT32  stride,
UINT32  bpp,
UINT32 *  pSize 
)
static

Refer to "Compressed Image File Formats: JPEG, PNG, GIF, XBM, BMP" book

Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_bitmap_write_ex()

int winpr_bitmap_write_ex ( const char *  filename,
const BYTE data,
size_t  stride,
size_t  width,
size_t  height,
size_t  bpp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_convert_from_jpeg()

SSIZE_T winpr_convert_from_jpeg ( const BYTE comp_data,
size_t  comp_data_bytes,
UINT32 *  width,
UINT32 *  height,
UINT32 *  bpp,
BYTE **  ppdecomp_data 
)
static
Here is the caller graph for this function:

◆ winpr_convert_from_png()

SSIZE_T winpr_convert_from_png ( const BYTE comp_data,
size_t  comp_data_bytes,
UINT32 *  width,
UINT32 *  height,
UINT32 *  bpp,
BYTE **  ppdecomp_data 
)
static
Here is the caller graph for this function:

◆ winpr_convert_from_webp()

SSIZE_T winpr_convert_from_webp ( const BYTE comp_data,
size_t  comp_data_bytes,
UINT32 *  width,
UINT32 *  height,
UINT32 *  bpp,
BYTE **  ppdecomp_data 
)
static
Here is the caller graph for this function:

◆ winpr_convert_to_jpeg()

static void* winpr_convert_to_jpeg ( const void *  data,
size_t  size,
UINT32  width,
UINT32  height,
UINT32  stride,
UINT32  bpp,
UINT32 *  pSize 
)
static
Here is the caller graph for this function:

◆ winpr_convert_to_png()

static void* winpr_convert_to_png ( const void *  data,
size_t  size,
UINT32  width,
UINT32  height,
UINT32  stride,
UINT32  bpp,
UINT32 *  pSize 
)
static
Here is the caller graph for this function:

◆ winpr_convert_to_webp()

static void* winpr_convert_to_webp ( const void *  data,
size_t  size,
UINT32  width,
UINT32  height,
UINT32  stride,
UINT32  bpp,
UINT32 *  pSize 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_bitmap_read_buffer()

static int winpr_image_bitmap_read_buffer ( wImage image,
const BYTE buffer,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_equal()

BOOL winpr_image_equal ( const wImage imageA,
const wImage imageB,
UINT32  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_format_extension()

const char* winpr_image_format_extension ( UINT32  format)
Here is the caller graph for this function:

◆ winpr_image_format_is_supported()

BOOL winpr_image_format_is_supported ( UINT32  format)
Here is the caller graph for this function:

◆ winpr_image_format_mime()

const char* winpr_image_format_mime ( UINT32  format)

◆ winpr_image_free()

void winpr_image_free ( wImage image,
BOOL  bFreeBuffer 
)
Here is the caller graph for this function:

◆ winpr_image_new()

wImage* winpr_image_new ( void  )
Here is the caller graph for this function:

◆ winpr_image_read()

int winpr_image_read ( wImage image,
const char *  filename 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_read_buffer()

int winpr_image_read_buffer ( wImage image,
const BYTE buffer,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_write()

int winpr_image_write ( wImage image,
const char *  filename 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_write_buffer()

void* winpr_image_write_buffer ( wImage image,
UINT32  format,
size_t *  psize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_image_write_ex()

int winpr_image_write_ex ( wImage image,
UINT32  format,
const char *  filename 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_and_free()

static int write_and_free ( const char *  filename,
void *  data,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitmapFileHeader()

BOOL writeBitmapFileHeader ( wStream s,
const WINPR_BITMAP_FILE_HEADER bf 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBitmapInfoHeader()

BOOL writeBitmapInfoHeader ( wStream s,
const WINPR_BITMAP_INFO_HEADER bi 
)
Here is the call graph for this function:
Here is the caller graph for this function: