Dillo v3.1.1-91-g6d5b3ee3
Loading...
Searching...
No Matches
image.hh File Reference

The DilloImage data-structure and methods. More...

#include "bitvec.h"
#include "url.h"
Include dependency graph for image.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DilloImage
 

Macros

#define IMAGE_MAX_AREA   (6000 * 6000)
 Arbitrary maximum for image size.
 

Typedefs

typedef struct _DilloImage DilloImage
 

Enumerations

enum  DilloImgType {
  DILLO_IMG_TYPE_INDEXED , DILLO_IMG_TYPE_RGB , DILLO_IMG_TYPE_GRAY , DILLO_IMG_TYPE_CMYK_INV ,
  DILLO_IMG_TYPE_NOTSET
}
 
enum  ImageState {
  IMG_Empty , IMG_SetParms , IMG_SetCmap , IMG_Write ,
  IMG_Close , IMG_Abort
}
 

Functions

DilloImagea_Image_new (void *layout, void *img_rndr, int32_t bg_color, int32_t fg_color)
 Create and initialize a new image structure.
 
DilloImagea_Image_new_with_dw (void *layout, const char *alt_text, int32_t bg_color, int32_t fg_color)
 Create and initialize a new image structure with an image widget.
 
void * a_Image_get_dw (DilloImage *Image)
 Return the image renderer as a widget.
 
void a_Image_ref (DilloImage *Image)
 Add a reference to an Image struct Do nothing if the argument is NULL.
 
void a_Image_unref (DilloImage *Image)
 Unref and free if necessary Do nothing if the argument is NULL.
 
void a_Image_set_parms (DilloImage *Image, void *v_imgbuf, DilloUrl *url, int version, uint_t width, uint_t height, DilloImgType type)
 Set initial parameters of the image.
 
void a_Image_write (DilloImage *Image, uint_t y)
 Implement the write method.
 
void a_Image_close (DilloImage *Image)
 Implement the close method.
 
void a_Image_abort (DilloImage *Image)
 Implement the abort method.
 

Detailed Description

The DilloImage data-structure and methods.

Definition in file image.hh.

Macro Definition Documentation

◆ IMAGE_MAX_AREA

#define IMAGE_MAX_AREA   (6000 * 6000)

Arbitrary maximum for image size.

To avoid image size-crafting attacks.

Definition at line 34 of file image.hh.

Typedef Documentation

◆ DilloImage

typedef struct _DilloImage DilloImage

Definition at line 40 of file image.hh.

Enumeration Type Documentation

◆ DilloImgType

Enumerator
DILLO_IMG_TYPE_INDEXED 
DILLO_IMG_TYPE_RGB 
DILLO_IMG_TYPE_GRAY 
DILLO_IMG_TYPE_CMYK_INV 
DILLO_IMG_TYPE_NOTSET 

Definition at line 42 of file image.hh.

◆ ImageState

enum ImageState
Enumerator
IMG_Empty 

Just created the entry.

IMG_SetParms 

Parameters set.

IMG_SetCmap 

Color map set.

IMG_Write 

Feeding the entry.

IMG_Close 

Whole image got!

IMG_Abort 

Image transfer aborted.

Definition at line 51 of file image.hh.

Function Documentation

◆ a_Image_abort()

void a_Image_abort ( DilloImage Image)

Implement the abort method.

Definition at line 153 of file image.cc.

References _MSG, and I2IR.

Referenced by a_Dicache_callback().

◆ a_Image_close()

void a_Image_close ( DilloImage Image)

Implement the close method.

Definition at line 144 of file image.cc.

References _MSG, and I2IR.

Referenced by a_Dicache_callback().

◆ a_Image_get_dw()

void * a_Image_get_dw ( DilloImage Image)

Return the image renderer as a widget.

This is somewhat tricky, since simple casting leads to wrong (and hard to debug) results, because of multiple inheritance. This function can be used from C code, where only access to void* is possible.

Definition at line 72 of file image.cc.

Referenced by Dicache_image().

◆ a_Image_new()

DilloImage * a_Image_new ( void *  layout,
void *  img_rndr,
int32_t  bg_color,
int32_t  fg_color 
)

Create and initialize a new image structure.

Definition at line 34 of file image.cc.

References dNew, IMG_Empty, dw::core::Widget::layout, and layout.

Referenced by a_Html_image_new(), a_Image_new_with_dw(), and StyleEngine::apply().

◆ a_Image_new_with_dw()

DilloImage * a_Image_new_with_dw ( void *  layout,
const char *  alt_text,
int32_t  bg_color,
int32_t  fg_color 
)

Create and initialize a new image structure with an image widget.

Definition at line 59 of file image.cc.

References a_Image_new(), and layout.

Referenced by Dicache_image().

◆ a_Image_ref()

void a_Image_ref ( DilloImage Image)

Add a reference to an Image struct Do nothing if the argument is NULL.

Definition at line 100 of file image.cc.

Referenced by a_Html_image_new(), StyleEngine::apply(), Dicache_image(), and Html_load_image().

◆ a_Image_set_parms()

void a_Image_set_parms ( DilloImage Image,
void *  v_imgbuf,
DilloUrl url,
int  version,
uint_t  width,
uint_t  height,
DilloImgType  type 
)

Set initial parameters of the image.

Definition at line 109 of file image.cc.

References _MSG, a_Bitvec_new(), I2IR, and IMG_SetParms.

Referenced by a_Dicache_callback().

◆ a_Image_unref()

void a_Image_unref ( DilloImage Image)

Unref and free if necessary Do nothing if the argument is NULL.

Definition at line 89 of file image.cc.

References _MSG, and Image_free().

Referenced by a_Html_image_new(), a_Web_free(), DilloHtml::loadImages(), and DilloHtml::~DilloHtml().

◆ a_Image_write()

void a_Image_write ( DilloImage Image,
uint_t  y 
)

Implement the write method.

Definition at line 130 of file image.cc.

References _MSG, a_Bitvec_set_bit(), dReturn_if_fail, I2IR, and IMG_Write.

Referenced by a_Dicache_callback().