VLC 4.0.0-dev
image.c File Reference

This file contains the functions to handle the image_handler_t type. More...

Include dependency graph for image.c:

Data Structures

struct  decoder_owner
 

Functions

static struct decoder_ownerdec_get_owner (decoder_t *p_dec)
 
static picture_tImageRead (image_handler_t *, block_t *, const es_format_t *, video_format_t *)
 
static picture_tImageReadUrl (image_handler_t *, const char *, video_format_t *)
 
static block_tImageWrite (image_handler_t *p_image, picture_t *p_pic, const video_format_t *p_fmt_in, const video_format_t *p_fmt_out)
 Write an image. More...
 
static int ImageWriteUrl (image_handler_t *, picture_t *, const video_format_t *, const video_format_t *, const char *)
 
static picture_tImageConvert (image_handler_t *p_image, picture_t *p_pic, const video_format_t *p_fmt_in, video_format_t *p_fmt_out)
 Convert an image to a different format. More...
 
static decoder_tCreateDecoder (image_handler_t *, const es_format_t *)
 
static encoder_tCreateEncoder (vlc_object_t *, const video_format_t *, const video_format_t *)
 
static filter_tCreateConverter (vlc_object_t *, const es_format_t *, struct vlc_video_context *, const video_format_t *)
 
static void DeleteConverter (filter_t *)
 
vlc_fourcc_t image_Type2Fourcc (const char *)
 
vlc_fourcc_t image_Ext2Fourcc (const char *)
 
image_handler_timage_HandlerCreate (vlc_object_t *p_this)
 Create an image_handler_t instance. More...
 
void image_HandlerDelete (image_handler_t *p_image)
 Delete the image_handler_t instance. More...
 
static void ImageQueueVideo (decoder_t *p_dec, picture_t *p_pic)
 Read an image. More...
 
static bool BitMapFormatIsSimilar (const video_format_t *f1, const video_format_t *f2)
 
vlc_fourcc_t image_Mime2Fourcc (const char *psz_mime)
 
static vlc_decoder_deviceimage_get_device (decoder_t *p_dec)
 

Variables

struct {
   vlc_fourcc_t   i_codec
 
   const char   psz_ext [7]
 
ext_table []
 Misc functions. More...
 
struct {
   vlc_fourcc_t   i_codec
 
   const char *   psz_mime
 
mime_table []
 

Detailed Description

This file contains the functions to handle the image_handler_t type.

Function Documentation

◆ BitMapFormatIsSimilar()

◆ CreateConverter()

◆ CreateDecoder()

◆ CreateEncoder()

◆ dec_get_owner()

static struct decoder_owner * dec_get_owner ( decoder_t p_dec)
inlinestatic

◆ DeleteConverter()

◆ image_Ext2Fourcc()

vlc_fourcc_t image_Ext2Fourcc ( const char *  psz_name)

References image_Type2Fourcc(), and psz_name.

Referenced by ImageReadUrl(), and ImageWriteUrl().

◆ image_get_device()

static vlc_decoder_device * image_get_device ( decoder_t p_dec)
static

References VLC_UNUSED.

Referenced by CreateDecoder().

◆ image_HandlerCreate()

◆ image_HandlerDelete()

◆ image_Mime2Fourcc()

vlc_fourcc_t image_Mime2Fourcc ( const char *  psz_mime)

References mime_table, and psz_mime.

Referenced by ImageReadUrl().

◆ image_Type2Fourcc()

vlc_fourcc_t image_Type2Fourcc ( const char *  psz_type)

◆ ImageConvert()

◆ ImageQueueVideo()

static void ImageQueueVideo ( decoder_t p_dec,
picture_t p_pic 
)
static

◆ ImageRead()

◆ ImageReadUrl()

◆ ImageWrite()

◆ ImageWriteUrl()

Variable Documentation

◆ 

const struct { ... } ext_table[]
Initial value:
=
{
{ ( ((uint32_t) 'j' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'e' ) << 16 ) | ( ((uint32_t) 'g' ) << 24 ) ) , "jpeg" },
{ ( ((uint32_t) 'j' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'e' ) << 16 ) | ( ((uint32_t) 'g' ) << 24 ) ) , "jpg" },
{ ( ((uint32_t) 'M' ) | ( ((uint32_t) 'J' ) << 8 ) | ( ((uint32_t) 'L' ) << 16 ) | ( ((uint32_t) 'S' ) << 24 ) ) , "ljpg" },
{ ( ((uint32_t) 'B' ) | ( ((uint32_t) 'P' ) << 8 ) | ( ((uint32_t) 'G' ) << 16 ) | ( ((uint32_t) 0xFB ) << 24 ) ) , "bpg" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "png" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "pgm" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) 'y' ) << 24 ) ) , "pgmyuv" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'b' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "pbm" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'a' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "pam" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'a' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "tga" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "bmp" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "pnm" },
{ ( ((uint32_t) 'x' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "xpm" },
{ ( ((uint32_t) 'x' ) | ( ((uint32_t) 'c' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "xcf" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'c' ) << 8 ) | ( ((uint32_t) 'x' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "pcx" },
{ ( ((uint32_t) 'g' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "gif" },
{ ( ((uint32_t) 'q' ) | ( ((uint32_t) 'o' ) << 8 ) | ( ((uint32_t) 'i' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "qoi" },
{ ( ((uint32_t) 's' ) | ( ((uint32_t) 'v' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "svg" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "tif" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "tiff" },
{ ( ((uint32_t) 'W' ) | ( ((uint32_t) 'E' ) << 8 ) | ( ((uint32_t) 'B' ) << 16 ) | ( ((uint32_t) 'P' ) << 24 ) ) , "webp" },
{ ( ((uint32_t) 'l' ) | ( ((uint32_t) 'b' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "lbm" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "ppm" },
}

Misc functions.

Referenced by image_Type2Fourcc().

◆ i_codec

◆ 

const struct { ... } mime_table[]
Initial value:
=
{
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/bmp" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-bmp" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-bitmap" },
{ ( ((uint32_t) 'b' ) | ( ((uint32_t) 'm' ) << 8 ) | ( ((uint32_t) 'p' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-ms-bmp" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-anymap" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-bitmap" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-graymap" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-portable-pixmap" },
{ ( ((uint32_t) 'g' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/gif" },
{ ( ((uint32_t) 'j' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'e' ) << 16 ) | ( ((uint32_t) 'g' ) << 24 ) ) , "image/jpeg" },
{ ( ((uint32_t) 'B' ) | ( ((uint32_t) 'P' ) << 8 ) | ( ((uint32_t) 'G' ) << 16 ) | ( ((uint32_t) 0xFB ) << 24 ) ) , "image/bpg" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'c' ) << 8 ) | ( ((uint32_t) 'x' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/pcx" },
{ ( ((uint32_t) 'p' ) | ( ((uint32_t) 'n' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/png" },
{ ( ((uint32_t) 'q' ) | ( ((uint32_t) 'o' ) << 8 ) | ( ((uint32_t) 'i' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "image/qoi" },
{ ( ((uint32_t) 's' ) | ( ((uint32_t) 'v' ) << 8 ) | ( ((uint32_t) 'g' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/svg+xml" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'i' ) << 8 ) | ( ((uint32_t) 'f' ) << 16 ) | ( ((uint32_t) 'f' ) << 24 ) ) , "image/tiff" },
{ ( ((uint32_t) 't' ) | ( ((uint32_t) 'g' ) << 8 ) | ( ((uint32_t) 'a' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ) , "image/x-tga" },
{ ( ((uint32_t) 'W' ) | ( ((uint32_t) 'E' ) << 8 ) | ( ((uint32_t) 'B' ) << 16 ) | ( ((uint32_t) 'P' ) << 24 ) ) , "image/webp" },
{ ( ((uint32_t) 'x' ) | ( ((uint32_t) 'p' ) << 8 ) | ( ((uint32_t) 'm' ) << 16 ) | ( ((uint32_t) ' ' ) << 24 ) ), "image/x-xpixmap" },
{ 0, NULL }
}

Referenced by image_Mime2Fourcc().

◆ psz_ext

◆ psz_mime