Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgrayraster.c File Reference

(4d11d9fe9cf4da574d69d0a7d7252495c4777b6e)

#include <string.h>
#include <setjmp.h>
#include <limits.h>
#include <stddef.h>
#include <private/qrasterdefs_p.h>
#include <private/qgrayraster_p.h>
#include <qcompilerdetection.h>
#include <qtconfigmacros.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
Include dependency graph for qgrayraster.c:

Go to the source code of this file.

Classes

struct  TCell_
struct  TWorker_
struct  TRaster_
struct  TBand_

Macros

#define QT_FT_COMPONENT   trace_smooth
#define QT_FT_ERR_XCAT(x, y)
#define QT_FT_ERR_CAT(x, y)
#define QT_FT_BEGIN_STMNT   do {
#define QT_FT_END_STMNT   } while ( 0 )
#define QT_FT_MAX(a, b)
#define QT_FT_ABS(a)
#define QT_FT_HYPOT(x, y)
#define ErrRaster_MemoryOverflow   -4
#define QT_FT_UINT_MAX   UINT_MAX
#define qt_ft_memset   memset
#define qt_ft_setjmp   setjmp
#define qt_ft_longjmp   longjmp
#define qt_ft_jmp_buf   jmp_buf
#define ErrRaster_Invalid_Mode   -2
#define ErrRaster_Invalid_Outline   -1
#define ErrRaster_Invalid_Argument   -3
#define ErrRaster_Memory_Overflow   -4
#define ErrRaster_OutOfMemory   -6
#define QT_FT_BEGIN_HEADER
#define QT_FT_END_HEADER
#define QT_FT_UNUSED(x)
#define QT_FT_TRACE5(x)
#define QT_FT_TRACE7(x)
#define QT_FT_ERROR(x)
#define QT_FT_THROW(e)
#define QT_FT_MEM_SET(d, s, c)
#define QT_FT_MEM_ZERO(dest, count)
#define RAS_ARG   PWorker worker
#define RAS_ARG_   PWorker worker,
#define RAS_VAR   worker
#define RAS_VAR_   worker,
#define ras   (*worker)
#define PIXEL_BITS   8
#define ONE_PIXEL   ( 1L << PIXEL_BITS )
#define TRUNC(x)
#define FRACT(x)
#define UPSCALE(x)
#define DOWNSCALE(x)
#define QT_FT_DIV_MOD(type, dividend, divisor, quotient, remainder)
#define QT_FT_UDIVPREP(b)
#define QT_FT_UDIV(a, b)
#define QT_FT_MAX_GRAY_SPANS   256
#define SCALED(x)

Typedefs

typedef ptrdiff_t QT_FT_PtrDist
typedef long TCoord
typedef long TPos
typedef long TArea
typedef struct TCell_PCell
typedef struct TCell_ TCell
typedef struct TWorker_ TWorker
typedef struct TWorker_PWorker
typedef struct TRaster_ TRaster
typedef struct TRaster_PRaster
typedef struct TBand_ TBand

Functions

int QT_MANGLE_NAMESPACE q_gray_rendered_spans (TRaster *raster)
static void gray_init_cells (RAS_ARG_ void *buffer, long byte_size)
static void gray_compute_cbox (RAS_ARG)
static PCell gray_find_cell (RAS_ARG)
static void gray_record_cell (RAS_ARG)
static void gray_set_cell (RAS_ARG_ TCoord ex, TCoord ey)
static void gray_start_cell (RAS_ARG_ TCoord ex, TCoord ey)
static void gray_render_scanline (RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2)
static void gray_render_line (RAS_ARG_ TPos to_x, TPos to_y)
static void gray_split_conic (QT_FT_Vector *base)
static void gray_render_conic (RAS_ARG_ const QT_FT_Vector *control, const QT_FT_Vector *to)
static void gray_split_cubic (QT_FT_Vector *base)
static void gray_render_cubic (RAS_ARG_ const QT_FT_Vector *control1, const QT_FT_Vector *control2, const QT_FT_Vector *to)
static int gray_move_to (const QT_FT_Vector *to, PWorker worker)
static void gray_render_span (int count, const QT_FT_Span *spans, PWorker worker)
static void gray_hline (RAS_ARG_ TCoord x, TCoord y, TPos area, int acount)
static void gray_sweep (RAS_ARG_ const QT_FT_Bitmap *target)
static int QT_FT_Outline_Decompose (const QT_FT_Outline *outline, void *user)
static int gray_convert_glyph_inner (RAS_ARG)
static int gray_convert_glyph (RAS_ARG)
static int gray_raster_render (QT_FT_Raster raster, const QT_FT_Raster_Params *params)
static int gray_raster_new (QT_FT_Raster *araster)
static void gray_raster_done (QT_FT_Raster raster)
static void gray_raster_reset (QT_FT_Raster raster, char *pool_base, long pool_size)
const QT_FT_Raster_Funcs QT_MANGLE_NAMESPACE (qt_ft_grays_raster)

Macro Definition Documentation

◆ DOWNSCALE

#define DOWNSCALE ( x)
Value:
( (x) >> ( PIXEL_BITS - 6 ) )
#define PIXEL_BITS
GLint GLint GLint GLint GLint x

Definition at line 191 of file qgrayraster.c.

◆ ErrRaster_Invalid_Argument

#define ErrRaster_Invalid_Argument   -3

Definition at line 141 of file qgrayraster.c.

◆ ErrRaster_Invalid_Mode

#define ErrRaster_Invalid_Mode   -2

Definition at line 139 of file qgrayraster.c.

◆ ErrRaster_Invalid_Outline

#define ErrRaster_Invalid_Outline   -1

Definition at line 140 of file qgrayraster.c.

◆ ErrRaster_Memory_Overflow

#define ErrRaster_Memory_Overflow   -4

Definition at line 142 of file qgrayraster.c.

◆ ErrRaster_MemoryOverflow

#define ErrRaster_MemoryOverflow   -4

Definition at line 119 of file qgrayraster.c.

◆ ErrRaster_OutOfMemory

#define ErrRaster_OutOfMemory   -6

Definition at line 143 of file qgrayraster.c.

◆ FRACT

#define FRACT ( x)
Value:
(TCoord)( (x) & ( ONE_PIXEL - 1 ) )
long TCoord
#define ONE_PIXEL

Definition at line 187 of file qgrayraster.c.

◆ ONE_PIXEL

#define ONE_PIXEL   ( 1L << PIXEL_BITS )

Definition at line 185 of file qgrayraster.c.

◆ PIXEL_BITS

#define PIXEL_BITS   8

Definition at line 183 of file qgrayraster.c.

◆ QT_FT_ABS

#define QT_FT_ABS ( a)
Value:
( (a) < 0 ? -(a) : (a) )
GLboolean GLboolean GLboolean GLboolean a

Definition at line 105 of file qgrayraster.c.

◆ QT_FT_BEGIN_HEADER

#define QT_FT_BEGIN_HEADER

Definition at line 145 of file qgrayraster.c.

◆ QT_FT_BEGIN_STMNT

#define QT_FT_BEGIN_STMNT   do {

Definition at line 101 of file qgrayraster.c.

◆ QT_FT_COMPONENT

#define QT_FT_COMPONENT   trace_smooth

Definition at line 94 of file qgrayraster.c.

◆ QT_FT_DIV_MOD

#define QT_FT_DIV_MOD ( type,
dividend,
divisor,
quotient,
remainder )
Value:
(quotient) = (type)( (dividend) / (divisor) ); \
(remainder) = (type)( (dividend) % (divisor) ); \
if ( (remainder) < 0 ) \
{ \
(quotient)--; \
(remainder) += (type)(divisor); \
} \
#define QT_FT_BEGIN_STMNT
#define QT_FT_END_STMNT
GLenum type
GLuint divisor

Definition at line 200 of file qgrayraster.c.

◆ QT_FT_END_HEADER

#define QT_FT_END_HEADER

Definition at line 146 of file qgrayraster.c.

◆ QT_FT_END_STMNT

#define QT_FT_END_STMNT   } while ( 0 )

Definition at line 102 of file qgrayraster.c.

◆ QT_FT_ERR_CAT

#define QT_FT_ERR_CAT ( x,
y )
Value:
#define QT_FT_ERR_XCAT(x, y)
Definition qgrayraster.c:98
GLint y

Definition at line 99 of file qgrayraster.c.

◆ QT_FT_ERR_XCAT

#define QT_FT_ERR_XCAT ( x,
y )
Value:
x ## y

Definition at line 98 of file qgrayraster.c.

◆ QT_FT_ERROR

#define QT_FT_ERROR ( x)
Value:
do { } while ( 0 ) /* nothing */

Definition at line 162 of file qgrayraster.c.

◆ QT_FT_HYPOT

#define QT_FT_HYPOT ( x,
y )
Value:
( x = QT_FT_ABS( x ), \
y = QT_FT_ABS( y ), \
x > y ? x + ( 3 * y >> 3 ) \
: y + ( 3 * x >> 3 ) )
#define QT_FT_ABS(a)

Definition at line 113 of file qgrayraster.c.

◆ qt_ft_jmp_buf

#define qt_ft_jmp_buf   jmp_buf

Definition at line 134 of file qgrayraster.c.

◆ qt_ft_longjmp

#define qt_ft_longjmp   longjmp

Definition at line 133 of file qgrayraster.c.

◆ QT_FT_MAX

#define QT_FT_MAX ( a,
b )
Value:
( (a) > (b) ? (a) : (b) )
GLboolean GLboolean GLboolean b

Definition at line 104 of file qgrayraster.c.

◆ QT_FT_MAX_GRAY_SPANS

#define QT_FT_MAX_GRAY_SPANS   256

Definition at line 234 of file qgrayraster.c.

◆ QT_FT_MEM_SET

#define QT_FT_MEM_SET ( d,
s,
c )
Value:
#define qt_ft_memset
GLdouble s
[6]
Definition qopenglext.h:235
const GLubyte * c

Definition at line 166 of file qgrayraster.c.

◆ QT_FT_MEM_ZERO

#define QT_FT_MEM_ZERO ( dest,
count )
Value:
QT_FT_MEM_SET( dest, 0, count )
#define QT_FT_MEM_SET(d, s, c)
GLenum GLenum GLsizei count

Definition at line 170 of file qgrayraster.c.

◆ qt_ft_memset

#define qt_ft_memset   memset

Definition at line 130 of file qgrayraster.c.

◆ qt_ft_setjmp

#define qt_ft_setjmp   setjmp

Definition at line 132 of file qgrayraster.c.

◆ QT_FT_THROW

#define QT_FT_THROW ( e)
Value:
QT_FT_ERR_CAT( ErrRaster_, e )
#define QT_FT_ERR_CAT(x, y)
Definition qgrayraster.c:99

Definition at line 163 of file qgrayraster.c.

◆ QT_FT_TRACE5

#define QT_FT_TRACE5 ( x)
Value:
do { } while ( 0 ) /* nothing */

Definition at line 160 of file qgrayraster.c.

◆ QT_FT_TRACE7

#define QT_FT_TRACE7 ( x)
Value:
do { } while ( 0 ) /* nothing */

Definition at line 161 of file qgrayraster.c.

◆ QT_FT_UDIV

#define QT_FT_UDIV ( a,
b )
Value:
( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \
( sizeof( long ) * CHAR_BIT - PIXEL_BITS ) )

Definition at line 215 of file qgrayraster.c.

◆ QT_FT_UDIVPREP

#define QT_FT_UDIVPREP ( b)
Value:
long b ## _r = (long)( ULONG_MAX >> PIXEL_BITS ) / ( b )

Definition at line 213 of file qgrayraster.c.

◆ QT_FT_UINT_MAX

#define QT_FT_UINT_MAX   UINT_MAX

Definition at line 128 of file qgrayraster.c.

◆ QT_FT_UNUSED

#define QT_FT_UNUSED ( x)
Value:
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void

Definition at line 158 of file qgrayraster.c.

◆ ras

#define ras   (*worker)

Definition at line 180 of file qgrayraster.c.

◆ RAS_ARG

#define RAS_ARG   PWorker worker

Definition at line 174 of file qgrayraster.c.

◆ RAS_ARG_

#define RAS_ARG_   PWorker worker,

Definition at line 175 of file qgrayraster.c.

◆ RAS_VAR

#define RAS_VAR   worker

Definition at line 177 of file qgrayraster.c.

◆ RAS_VAR_

#define RAS_VAR_   worker,

Definition at line 178 of file qgrayraster.c.

◆ SCALED

#define SCALED ( x)
Value:
(x)

◆ TRUNC

#define TRUNC ( x)
Value:
(TCoord)( (x) >> PIXEL_BITS )

Definition at line 186 of file qgrayraster.c.

◆ UPSCALE

#define UPSCALE ( x)
Value:
( (x) * ( ONE_PIXEL >> 6 ) )

Definition at line 190 of file qgrayraster.c.

Typedef Documentation

◆ PCell

typedef struct TCell_ * PCell

Definition at line 237 of file qgrayraster.c.

◆ PRaster

typedef struct TRaster_ * PRaster

◆ PWorker

typedef struct TWorker_ * PWorker

◆ QT_FT_PtrDist

typedef ptrdiff_t QT_FT_PtrDist

Definition at line 137 of file qgrayraster.c.

◆ TArea

typedef long TArea

Definition at line 231 of file qgrayraster.c.

◆ TBand

typedef struct TBand_ TBand

◆ TCell

typedef struct TCell_ TCell

◆ TCoord

typedef long TCoord

Definition at line 229 of file qgrayraster.c.

◆ TPos

typedef long TPos

Definition at line 230 of file qgrayraster.c.

◆ TRaster

typedef struct TRaster_ TRaster

◆ TWorker

typedef struct TWorker_ TWorker

Function Documentation

◆ gray_compute_cbox()

void gray_compute_cbox ( RAS_ARG )
static

Definition at line 335 of file qgrayraster.c.

References TWorker_::max_ex, TWorker_::max_ey, TWorker_::min_ex, and TWorker_::min_ey.

Referenced by gray_convert_glyph().

Here is the caller graph for this function:

◆ gray_convert_glyph()

int gray_convert_glyph ( RAS_ARG )
static

Definition at line 1647 of file qgrayraster.c.

References TWorker_::band_shoot, TWorker_::band_size, TWorker_::buffer, TWorker_::buffer_size, TWorker_::cells, TWorker_::count_ex, TWorker_::count_ey, gray_compute_cbox(), gray_convert_glyph_inner(), TWorker_::invalid, TBand_::max, TWorker_::max_cells, TWorker_::max_ex, TWorker_::max_ey, TBand_::min, TWorker_::min_ex, TWorker_::min_ey, TWorker_::num_cells, TWorker_::num_gray_spans, TWorker_::render_span_data, TWorker_::skip_spans, TWorker_::ycells, and TWorker_::ycount.

Referenced by gray_raster_render().

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

◆ gray_convert_glyph_inner()

int gray_convert_glyph_inner ( RAS_ARG )
static

Definition at line 1627 of file qgrayraster.c.

References gray_record_cell(), and TWorker_::invalid.

Referenced by gray_convert_glyph().

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

◆ gray_find_cell()

PCell gray_find_cell ( RAS_ARG )
static

Definition at line 379 of file qgrayraster.c.

References TCell_::area, TWorker_::cells, TWorker_::count_ex, TCell_::cover, TWorker_::ex, TWorker_::ey, TWorker_::jump_buffer, TWorker_::max_cells, TCell_::next, TWorker_::num_cells, TCell_::x, and TWorker_::ycells.

Referenced by gray_record_cell().

Here is the caller graph for this function:

◆ gray_hline()

void gray_hline ( RAS_ARG_ TCoord x,
TCoord y,
TPos area,
int acount )
static

Definition at line 1184 of file qgrayraster.c.

References TWorker_::min_ex, TWorker_::min_ey, TWorker_::num_gray_spans, TWorker_::render_span_data, and TWorker_::skip_spans.

Referenced by gray_sweep().

Here is the caller graph for this function:

◆ gray_init_cells()

void gray_init_cells ( RAS_ARG_ void * buffer,
long byte_size )
static

◆ gray_move_to()

int gray_move_to ( const QT_FT_Vector * to,
PWorker worker )
static

Definition at line 1117 of file qgrayraster.c.

References gray_record_cell(), gray_start_cell(), TWorker_::invalid, TWorker_::x, and TWorker_::y.

Here is the call graph for this function:

◆ gray_raster_done()

void gray_raster_done ( QT_FT_Raster raster)
static

Definition at line 1915 of file qgrayraster.c.

◆ gray_raster_new()

int gray_raster_new ( QT_FT_Raster * araster)
static

Definition at line 1901 of file qgrayraster.c.

◆ gray_raster_render()

int gray_raster_render ( QT_FT_Raster raster,
const QT_FT_Raster_Params * params )
static

Definition at line 1796 of file qgrayraster.c.

References TWorker_::band_size, gray_convert_glyph(), TWorker_::invalid, TWorker_::num_cells, and TWorker_::render_span_data.

Here is the call graph for this function:

◆ gray_raster_reset()

void gray_raster_reset ( QT_FT_Raster raster,
char * pool_base,
long pool_size )
static

◆ gray_record_cell()

void gray_record_cell ( RAS_ARG )
static

Definition at line 418 of file qgrayraster.c.

References TCell_::area, TWorker_::area, TCell_::cover, TWorker_::cover, and gray_find_cell().

Referenced by gray_convert_glyph_inner(), gray_move_to(), and gray_set_cell().

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

◆ gray_render_conic()

void gray_render_conic ( RAS_ARG_ const QT_FT_Vector * control,
const QT_FT_Vector * to )
static

Definition at line 928 of file qgrayraster.c.

References TWorker_::max_ey, TWorker_::min_ey, TWorker_::x, and TWorker_::y.

◆ gray_render_cubic()

void gray_render_cubic ( RAS_ARG_ const QT_FT_Vector * control1,
const QT_FT_Vector * control2,
const QT_FT_Vector * to )
static

Definition at line 1021 of file qgrayraster.c.

References TWorker_::max_ey, TWorker_::min_ey, TWorker_::x, and TWorker_::y.

◆ gray_render_line()

void gray_render_line ( RAS_ARG_ TPos to_x,
TPos to_y )
static

Definition at line 604 of file qgrayraster.c.

References TWorker_::area, TWorker_::count_ey, TWorker_::cover, gray_render_scanline(), gray_set_cell(), TWorker_::max_ey, TWorker_::min_ey, TWorker_::x, and TWorker_::y.

Here is the call graph for this function:

◆ gray_render_scanline()

void gray_render_scanline ( RAS_ARG_ TCoord ey,
TPos x1,
TCoord y1,
TPos x2,
TCoord y2 )
static

Definition at line 509 of file qgrayraster.c.

References TWorker_::area, TWorker_::cover, and gray_set_cell().

Referenced by gray_render_line().

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

◆ gray_render_span()

void gray_render_span ( int count,
const QT_FT_Span * spans,
PWorker worker )
static

Definition at line 1139 of file qgrayraster.c.

◆ gray_set_cell()

void gray_set_cell ( RAS_ARG_ TCoord ex,
TCoord ey )
static

Definition at line 436 of file qgrayraster.c.

References TWorker_::area, TWorker_::count_ex, TWorker_::count_ey, TWorker_::cover, TWorker_::ex, TWorker_::ey, gray_record_cell(), TWorker_::invalid, TWorker_::max_ex, TWorker_::min_ex, and TWorker_::min_ey.

Referenced by gray_render_line(), gray_render_scanline(), and gray_start_cell().

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

◆ gray_split_conic()

void gray_split_conic ( QT_FT_Vector * base)
static

Definition at line 908 of file qgrayraster.c.

◆ gray_split_cubic()

void gray_split_cubic ( QT_FT_Vector * base)
static

Definition at line 993 of file qgrayraster.c.

◆ gray_start_cell()

void gray_start_cell ( RAS_ARG_ TCoord ex,
TCoord ey )
static

Definition at line 483 of file qgrayraster.c.

References TWorker_::area, TWorker_::cover, TWorker_::ex, TWorker_::ey, gray_set_cell(), TWorker_::invalid, TWorker_::max_ex, TWorker_::min_ex, and TWorker_::min_ey.

Referenced by gray_move_to().

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

◆ gray_sweep()

void gray_sweep ( RAS_ARG_ const QT_FT_Bitmap * target)
static

Definition at line 1322 of file qgrayraster.c.

References TCell_::area, TWorker_::count_ex, TCell_::cover, gray_hline(), TCell_::next, TWorker_::num_cells, TCell_::x, TWorker_::ycells, and TWorker_::ycount.

Here is the call graph for this function:

◆ q_gray_rendered_spans()

int QT_MANGLE_NAMESPACE q_gray_rendered_spans ( TRaster * raster)

Definition at line 302 of file qgrayraster.c.

References TWorker_::skip_spans, and TRaster_::worker.

◆ QT_FT_Outline_Decompose()

int QT_FT_Outline_Decompose ( const QT_FT_Outline * outline,
void * user )
static

Definition at line 1397 of file qgrayraster.c.

◆ QT_MANGLE_NAMESPACE()

const QT_FT_Raster_Funcs QT_MANGLE_NAMESPACE ( qt_ft_grays_raster )
Initial value:
=
{
QT_FT_GLYPH_FORMAT_OUTLINE,
}
static void gray_raster_done(QT_FT_Raster raster)
static int gray_raster_new(QT_FT_Raster *araster)
static int gray_raster_render(QT_FT_Raster raster, const QT_FT_Raster_Params *params)
static void gray_raster_reset(QT_FT_Raster raster, char *pool_base, long pool_size)
#define QT_FT_Raster_Reset_Func
#define QT_FT_Raster_New_Func
#define QT_FT_Raster_Render_Func
#define QT_FT_Raster_Set_Mode_Func
#define QT_FT_Raster_Done_Func