Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
image.hh
Go to the documentation of this file.
1/*
2 * File: image.hh
3 *
4 * Copyright (C) 2005-2007 Jorge Arellano Cid <jcid@dillo.org>,
5 * Sebastian Geerken <sgeerken@dillo.org>
6 * Copyright (C) 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __IMAGE_HH__
15#define __IMAGE_HH__
16
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
25
26#include "bitvec.h"
27#include "url.h"
28
29/*
30 * Defines
31 */
32
34#define IMAGE_MAX_AREA (6000 * 6000)
35
36/*
37 * Types
38 */
39
40typedef struct _DilloImage DilloImage;
41
49
50/* These will reflect the Image's "state" */
59
62
63 /* Parameters as told by image data */
66
67 float dpi;
68 int32_t bg_color;
69 int32_t fg_color;
75};
76
77
78/*
79 * Function prototypes
80 */
81DilloImage *a_Image_new(void *layout, void *img_rndr,
82 int32_t bg_color, int32_t fg_color);
83DilloImage *a_Image_new_with_dw(void *layout, const char *alt_text,
84 int32_t bg_color, int32_t fg_color);
85void *a_Image_get_dw(DilloImage *Image);
86void a_Image_ref(DilloImage *Image);
87void a_Image_unref(DilloImage *Image);
88
89void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url,
90 int version, uint_t width, uint_t height,
91 DilloImgType type);
92void a_Image_write(DilloImage *Image, uint_t y);
93void a_Image_close(DilloImage *Image);
94void a_Image_abort(DilloImage *Image);
95
96
97#ifdef __cplusplus
98}
99#endif /* __cplusplus */
100
101#endif /* __IMAGE_HH__ */
102
unsigned int uint_t
Definition d_size.h:20
static Layout * layout
DilloImgType
Definition image.hh:42
@ DILLO_IMG_TYPE_GRAY
Definition image.hh:45
@ DILLO_IMG_TYPE_CMYK_INV
Definition image.hh:46
@ DILLO_IMG_TYPE_RGB
Definition image.hh:44
@ DILLO_IMG_TYPE_INDEXED
Definition image.hh:43
@ DILLO_IMG_TYPE_NOTSET
Definition image.hh:47
void a_Image_ref(DilloImage *Image)
Add a reference to an Image struct Do nothing if the argument is NULL.
Definition image.cc:100
void a_Image_unref(DilloImage *Image)
Unref and free if necessary Do nothing if the argument is NULL.
Definition image.cc:89
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 image.cc:59
void * a_Image_get_dw(DilloImage *Image)
Return the image renderer as a widget.
Definition image.cc:72
ImageState
Definition image.hh:51
@ IMG_Write
Feeding the entry.
Definition image.hh:55
@ IMG_Abort
Image transfer aborted.
Definition image.hh:57
@ IMG_SetParms
Parameters set.
Definition image.hh:53
@ IMG_SetCmap
Color map set.
Definition image.hh:54
@ IMG_Empty
Just created the entry.
Definition image.hh:52
@ IMG_Close
Whole image got!
Definition image.hh:56
void a_Image_abort(DilloImage *Image)
Implement the abort method.
Definition image.cc:153
void a_Image_write(DilloImage *Image, uint_t y)
Implement the write method.
Definition image.cc:130
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 image.cc:34
void a_Image_close(DilloImage *Image)
Implement the close method.
Definition image.cc:144
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 image.cc:109
Definition url.h:88
float dpi
Dots per inch.
Definition image.hh:67
void * layout
Definition image.hh:61
uint_t ScanNumber
Current decoding scan.
Definition image.hh:71
int32_t fg_color
Foreground color.
Definition image.hh:69
uint_t height
Definition image.hh:65
bitvec_t * BitVec
Bit vector for decoded rows.
Definition image.hh:70
void * img_rndr
Definition image.hh:61
int RefCount
Reference counter.
Definition image.hh:74
int32_t bg_color
Background color.
Definition image.hh:68
ImageState State
Processing status.
Definition image.hh:72
uint_t width
Definition image.hh:64
Parse and normalize all URL's inside Dillo.