w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

picttoppm.c File Reference
#include <string.h>
#include "ppm.h"
#include "pbmfont.h"
Include dependency graph for picttoppm.c:

Go to the source code of this file.

Classes

struct  Rect
 
struct  pixMap
 
struct  RGBColour
 
class  Point
 
struct  Pattern
 
struct  opdef
 
struct  blit_info
 
struct  const_name
 
struct  fontinfo
 

Macros

#define WORD_LEN   (-1)
 
#define res(length)   { "reserved", (length), NULL, "reserved for Apple use" }
 
#define resf(skipfunction)   { "reserved", NA, (skipfunction), "reserved for Apple use" }
 
#define RGB_LEN   (6)
 
#define NA   (0)
 
#define FNT_BOLD   (1)
 
#define FNT_ITALIC   (2)
 
#define FNT_ULINE   (4)
 
#define FNT_OUTLINE   (8)
 
#define FNT_SHADOW   (16)
 
#define FNT_CONDENSE   (32)
 
#define FNT_EXTEND   (64)
 
#define rgb_all_same(x, y)    ((x)->red == (y) && (x)->green == (y) && (x)->blue == (y))
 
#define rgb_is_white(x)   rgb_all_same((x), 0xffff)
 
#define rgb_is_black(x)   rgb_all_same((x), 0)
 
#define blend_component(cmp)
 
#define AMI_OP   !=
 
#define REDEPTH(c, oldmax)   ((c) * ((PPM_MAXMAXVAL) + 1) / (oldmax + 1))
 
#define grab_destination()
 
#define put_destination()
 
#define PIXEL_INDEX(x, y)   ((y) - picFrame.top) * rowlen + (x) - picFrame.left
 
#define ABS(a)   (((a)<0) ? -(a) : (a))
 
#define SGN(a)   (((a)<0) ? -1 : 1)
 
#define sign(x)   ((x) > 0 ? 1 : ((x)==0 ? 0:(-1)) )
 

Typedefs

typedef unsigned char byte
 
typedef char signed_byte
 
typedef unsigned short word
 
typedef unsigned long longword
 
typedef void(* transfer_func) ()
 

Functions

static void interpret_pict ()
 
static void alloc_planes ()
 
static void compact_plane ()
 
static void output_ppm ()
 
static void Opcode_9A ()
 
static void BitsRect ()
 
static void BitsRegion ()
 
static void do_bitmap ()
 
static void do_pixmap ()
 
static transfer_func transfer ()
 
static void draw_pixel ()
 
static int blit ()
 
static struct blit_infoadd_blit_list ()
 
static void do_blits ()
 
static byteunpackbits ()
 
static byteexpand_buf ()
 
static void Clip ()
 
static void read_pixmap ()
 
static struct RGBColourread_colour_table ()
 
static void BkPixPat ()
 
static void PnPixPat ()
 
static void FillPixPat ()
 
static void read_pattern ()
 
static void read_8x8_pattern ()
 
static void BkPat ()
 
static void PnPat ()
 
static void FillPat ()
 
static void PnSize ()
 
static void PnMode ()
 
static void OpColor ()
 
static void RGBFgCol ()
 
static void RGBBkCol ()
 
static void Line ()
 
static void LineFrom ()
 
static void ShortLine ()
 
static void ShortLineFrom ()
 
static void PnLocHFrac ()
 
static void TxFont ()
 
static void TxFace ()
 
static void TxMode ()
 
static void TxSize ()
 
static void skip_text ()
 
static void LongText ()
 
static void DHText ()
 
static void DVText ()
 
static void DHDVText ()
 
static void do_text ()
 
static void do_ps_text ()
 
static void rotate ()
 
static void skip_poly_or_region ()
 
static void LongComment ()
 
static void ShortComment ()
 
static int rectwidth ()
 
static int rectheight ()
 
static int rectsamesize ()
 
static void rectinter ()
 
static void rectscale ()
 
static void read_rect ()
 
static void dump_rect ()
 
static void do_paintRect ()
 
static void paintRect ()
 
static void paintSameRect ()
 
static void do_frameRect ()
 
static void frameRect ()
 
static void frameSameRect ()
 
static void paintPoly ()
 
static word get_op ()
 
static longword read_long ()
 
static word read_word ()
 
static byte read_byte ()
 
static signed_byte read_signed_byte ()
 
static void skip ()
 
static void read_n ()
 
static struct fontget_font ()
 
static int load_fontdir ()
 
static void read_rgb ()
 
static void draw_pen_rect ()
 
static void draw_pen ()
 
static void read_point ()
 
static void read_short_point ()
 
static void scan_line ()
 
static void scan_poly ()
 
static void poly_sort ()
 
static void picComment ()
 
static int abs_value ()
 
static char * const_name ()
 
int main (int argc, argv)
 
static void compact_plane (word *plane, int planelen)
 
static void output_ppm (int version)
 
static void Opcode_9A (int version)
 
static void BitsRect (int version)
 
static void BitsRegion (int version)
 
static void do_bitmap (int version, int rowBytes, int is_region)
 
static void do_pixmap (int version, word rowBytes, int is_region)
 
static void srcCopy (struct RGBColour *src, struct RGBColour *dst)
 
static void srcOr (struct RGBColour *src, struct RGBColour *dst)
 
static void srcXor (struct RGBColour *src, struct RGBColour *dst)
 
static void srcBic (struct RGBColour *src, struct RGBColour *dst)
 
static void notSrcCopy (struct RGBColour *src, struct RGBColour *dst)
 
static void notSrcOr (struct RGBColour *src, struct RGBColour *dst)
 
static void notSrcBic (struct RGBColour *src, struct RGBColour *dst)
 
static void notSrcXor (struct RGBColour *src, struct RGBColour *dst)
 
static void addOver (struct RGBColour *src, struct RGBColour *dst)
 
static void addPin (struct RGBColour *src, struct RGBColour *dst)
 
static void subOver (struct RGBColour *src, struct RGBColour *dst)
 
static void subPin (struct RGBColour *src, struct RGBColour *dst)
 
static void adMax (struct RGBColour *src, struct RGBColour *dst)
 
static void adMin (struct RGBColour *src, struct RGBColour *dst)
 
static void blend (struct RGBColour *src, struct RGBColour *dst)
 
static void transparent (struct RGBColour *src, struct RGBColour *dst)
 
static transfer_func transfer (int mode)
 
static int blit (struct Rect *srcRect, struct Rect *srcBounds, int srcwid, byte *srcplane, int pixSize, struct Rect *dstRect, struct Rect *dstBounds, int dstwid, struct RGBColour *colour_map, int mode)
 
static byteunpackbits (struct Rect *bounds, word rowBytes, int pixelSize)
 
static byteexpand_buf (byte *buf, int *len, int bits_per_pixel)
 
static void Clip (int version)
 
static void read_pixmap (struct pixMap *p, word *rowBytes)
 
static void OpColor (int version)
 
static void BkPixPat (int version)
 
static void PnPixPat (int version)
 
static void FillPixPat (int version)
 
static void BkPat (int version)
 
static void PnPat (int version)
 
static void FillPat (int version)
 
static void read_8x8_pattern (struct Pattern *pat)
 
static void PnSize (int version)
 
static void PnMode (int version)
 
static void read_rgb (struct RGBColour *rgb)
 
static void RGBFgCol (int v)
 
static void RGBBkCol (int v)
 
static void read_point (struct Point *p)
 
static void read_short_point (struct Point *p)
 
static void draw_pixel (int x, int y, struct RGBColour *clr, transfer_func trf)
 
static void draw_pen_rect (struct Rect *r)
 
static void draw_pen (int x, int y)
 
static void scan_line (short x1, short y1, short x2, short y2)
 
static void Line (int v)
 
static void LineFrom (int v)
 
static void ShortLine (int v)
 
static void ShortLineFrom (int v)
 
static void paintRect (int v)
 
static void paintSameRect (int v)
 
static void do_paintRect (struct Rect *prect)
 
static void frameRect (int v)
 
static void frameSameRect (int v)
 
static void do_frameRect (struct Rect *rect)
 
static void poly_sort (int sort_index, points)
 
static void scan_poly (int np, pts)
 
static void paintPoly (int v)
 
static void PnLocHFrac (int version)
 
static void TxMode (int version)
 
static void TxFont (int version)
 
static void TxFace (int version)
 
static void TxSize (int version)
 
static void LongText (int version)
 
static void DHText (int version)
 
static void DVText (int version)
 
static void DHDVText (int version)
 
static void do_text (word x, word y)
 
static void do_ps_text (word tx, word ty)
 
static void rotate (int *x, int *y)
 
static void skip_poly_or_region (int version)
 
static void picComment (word type, int length)
 
static void ShortComment (int version)
 
static void LongComment (int version)
 
static int rectwidth (struct Rect *r)
 
static int rectheight (struct Rect *r)
 
static int rectsamesize (struct Rect *r1, struct Rect *r2)
 
static void rectinter (struct Rect *r1, struct Rect *r2, struct Rect *r3)
 
static void rectscale (struct Rect *r, double xscale, double yscale)
 
static void read_rect (struct Rect *r)
 
static void dump_rect (char *s, struct Rect *r)
 
static char * const_name (struct const_name *table, int ct)
 
static word get_op (int version)
 
static void skip (int n)
 
static void read_n (int n, char *buf)
 
int load_fontdir (char *dirfile)
 
static int abs_value (int x)
 
static struct fontget_font (int font, int size, int style)
 

Variables

static char * stage
 
static struct Rect picFrame
 
static wordred
 
static wordgreen
 
static wordblue
 
static word rowlen
 
static word collen
 
static longword planelen
 
static int verbose
 
static int fullres
 
static int recognize_comment
 
static struct RGBColour black = { 0, 0, 0 }
 
static struct RGBColour white = { 0xffff, 0xffff, 0xffff }
 
static struct RGBColour foreground = { 0, 0, 0 }
 
static struct RGBColour background = { 0xffff, 0xffff, 0xffff }
 
static struct RGBColour op_colour
 
static struct Pattern bkpat
 
static struct Pattern fillpat
 
static struct Rect clip_rect
 
static struct Rect cur_rect
 
static struct Point current
 
static struct Pattern pen_pat
 
static word pen_width
 
static word pen_height
 
static word pen_mode
 
static transfer_func pen_trf
 
static word text_font
 
static byte text_face
 
static word text_mode
 
static transfer_func text_trf
 
static word text_size
 
static struct fonttfont
 
static int ps_text
 
static byte ps_just
 
static byte ps_flip
 
static word ps_rotation
 
static byte ps_linespace
 
static int ps_cent_x
 
static int ps_cent_y
 
static int ps_cent_set
 
static struct blit_infoblit_list = 0
 
static struct blit_info ** last_bl = &blit_list
 
static struct opdef optable []
 
struct const_name transfer_name []
 
struct const_name font_name []
 
struct const_name ps_just_name []
 
struct const_name ps_flip_name []
 
static int align = 0
 
static FILEifp
 
static struct fontinfofontlist = 0
 
static struct fontinfo ** fontlist_ins = &fontlist
 

Macro Definition Documentation

◆ ABS

#define ABS (   a)    (((a)<0) ? -(a) : (a))

Definition at line 2241 of file picttoppm.c.

◆ AMI_OP

#define AMI_OP   !=

Definition at line 1347 of file picttoppm.c.

◆ blend_component

#define blend_component (   cmp)
Value:
((long)src->cmp * (long)op_colour.cmp) / 65536 + \
((long)dst->cmp * (long)(65536 - op_colour.cmp) / 65536)
static struct RGBColour op_colour
Definition: picttoppm.c:129

◆ FNT_BOLD

#define FNT_BOLD   (1)

Definition at line 529 of file picttoppm.c.

◆ FNT_CONDENSE

#define FNT_CONDENSE   (32)

Definition at line 534 of file picttoppm.c.

◆ FNT_EXTEND

#define FNT_EXTEND   (64)

Definition at line 535 of file picttoppm.c.

◆ FNT_ITALIC

#define FNT_ITALIC   (2)

Definition at line 530 of file picttoppm.c.

◆ FNT_OUTLINE

#define FNT_OUTLINE   (8)

Definition at line 532 of file picttoppm.c.

◆ FNT_SHADOW

#define FNT_SHADOW   (16)

Definition at line 533 of file picttoppm.c.

◆ FNT_ULINE

#define FNT_ULINE   (4)

Definition at line 531 of file picttoppm.c.

◆ grab_destination

#define grab_destination ( )
Value:
dst_c.red = *reddst; \
dst_c.green = *greendst; \
dst_c.blue = *bluedst

◆ NA

#define NA   (0)

Definition at line 298 of file picttoppm.c.

◆ PIXEL_INDEX

#define PIXEL_INDEX (   x,
  y 
)    ((y) - picFrame.top) * rowlen + (x) - picFrame.left

Definition at line 2166 of file picttoppm.c.

◆ put_destination

#define put_destination ( )
Value:
*reddst++ = dst_c.red; \
*greendst++ = dst_c.green; \
*bluedst++ = dst_c.blue

◆ REDEPTH

#define REDEPTH (   c,
  oldmax 
)    ((c) * ((PPM_MAXMAXVAL) + 1) / (oldmax + 1))

◆ res

#define res (   length)    { "reserved", (length), NULL, "reserved for Apple use" }

Definition at line 287 of file picttoppm.c.

◆ resf

#define resf (   skipfunction)    { "reserved", NA, (skipfunction), "reserved for Apple use" }

Definition at line 291 of file picttoppm.c.

◆ rgb_all_same

#define rgb_all_same (   x,
  y 
)     ((x)->red == (y) && (x)->green == (y) && (x)->blue == (y))

Definition at line 1142 of file picttoppm.c.

◆ rgb_is_black

#define rgb_is_black (   x)    rgb_all_same((x), 0)

Definition at line 1145 of file picttoppm.c.

◆ rgb_is_white

#define rgb_is_white (   x)    rgb_all_same((x), 0xffff)

Definition at line 1144 of file picttoppm.c.

◆ RGB_LEN

#define RGB_LEN   (6)

Definition at line 296 of file picttoppm.c.

◆ SGN

#define SGN (   a)    (((a)<0) ? -1 : 1)

Definition at line 2243 of file picttoppm.c.

◆ sign

#define sign (   x)    ((x) > 0 ? 1 : ((x)==0 ? 0:(-1)) )

◆ WORD_LEN

#define WORD_LEN   (-1)

Definition at line 179 of file picttoppm.c.

Typedef Documentation

◆ byte

typedef unsigned char byte

Definition at line 62 of file picttoppm.c.

◆ longword

typedef unsigned long longword

Definition at line 65 of file picttoppm.c.

◆ signed_byte

typedef char signed_byte

Definition at line 63 of file picttoppm.c.

◆ transfer_func

typedef void(* transfer_func) ()

Definition at line 109 of file picttoppm.c.

◆ word

typedef unsigned short word

Definition at line 64 of file picttoppm.c.

Function Documentation

◆ abs_value() [1/2]

static int abs_value ( )
static

Referenced by get_font().

◆ abs_value() [2/2]

static int abs_value ( int  x)
static

Definition at line 3287 of file picttoppm.c.

References cordic::x.

◆ add_blit_list()

static struct blit_info * add_blit_list ( )
static

Definition at line 1119 of file picttoppm.c.

References last_bl, malloc, blit_info::next, and pm_error.

Referenced by blit().

◆ addOver()

static void addOver ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1217 of file picttoppm.c.

References link_confs::dst, and link_confs::src.

Referenced by transfer().

◆ addPin()

static void addPin ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1226 of file picttoppm.c.

References RGBColour::blue, link_confs::dst, RGBColour::green, op_colour, RGBColour::red, and link_confs::src.

Referenced by transfer().

◆ adMax()

static void adMax ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1276 of file picttoppm.c.

References link_confs::dst, and link_confs::src.

Referenced by transfer().

◆ adMin()

static void adMin ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1285 of file picttoppm.c.

References link_confs::dst, and link_confs::src.

Referenced by transfer().

◆ alloc_planes()

static void alloc_planes ( )
static

◆ BitsRect() [1/2]

static void BitsRect ( )
static

◆ BitsRect() [2/2]

static void BitsRect ( int  version)
static

Definition at line 990 of file picttoppm.c.

References do_bitmap(), do_pixmap(), pm_message, read_word(), stage, verbose, and version.

◆ BitsRegion() [1/2]

static void BitsRegion ( )
static

◆ BitsRegion() [2/2]

static void BitsRegion ( int  version)
static

Definition at line 1008 of file picttoppm.c.

References do_bitmap(), do_pixmap(), read_word(), stage, and version.

◆ BkPat() [1/2]

static void BkPat ( )
static

◆ BkPat() [2/2]

static void BkPat ( int  version)
static

Definition at line 2066 of file picttoppm.c.

References bkpat, and read_8x8_pattern().

◆ BkPixPat() [1/2]

static void BkPixPat ( )
static

◆ BkPixPat() [2/2]

static void BkPixPat ( int  version)
static

Definition at line 2012 of file picttoppm.c.

References read_pattern().

◆ blend()

◆ blit() [1/2]

static int blit ( )
static

◆ blit() [2/2]

◆ Clip() [1/2]

static void Clip ( )
static

◆ Clip() [2/2]

static void Clip ( int  version)
static

Definition at line 1895 of file picttoppm.c.

References clip_rect, dump_rect(), len, read_rect(), read_word(), skip(), and verbose.

◆ compact_plane() [1/2]

static void compact_plane ( )
static

Referenced by output_ppm().

◆ compact_plane() [2/2]

static void compact_plane ( word plane,
int  planelen 
)
static

Definition at line 759 of file picttoppm.c.

References p, and planelen.

◆ const_name() [1/2]

◆ const_name() [2/2]

static char* const_name ( struct const_name table,
int  ct 
)
static

Definition at line 3029 of file picttoppm.c.

References i, and sprintf.

◆ DHDVText() [1/2]

static void DHDVText ( )
static

◆ DHDVText() [2/2]

static void DHDVText ( int  version)
static

Definition at line 2653 of file picttoppm.c.

References current, dh, do_text(), dv, pm_message, read_byte(), verbose, Point::x, and Point::y.

◆ DHText() [1/2]

static void DHText ( )
static

◆ DHText() [2/2]

static void DHText ( int  version)
static

Definition at line 2637 of file picttoppm.c.

References current, do_text(), read_byte(), Point::x, and Point::y.

◆ do_bitmap() [1/2]

static void do_bitmap ( )
static

Referenced by BitsRect(), BitsRegion(), and main().

◆ do_bitmap() [2/2]

static void do_bitmap ( int  version,
int  rowBytes,
int  is_region 
)
static

◆ do_blits()

◆ do_frameRect() [1/2]

static void do_frameRect ( )
static

Referenced by frameRect(), and frameSameRect().

◆ do_frameRect() [2/2]

static void do_frameRect ( struct Rect rect)
static

Definition at line 2395 of file picttoppm.c.

References bottom, draw_pen(), dump_rect(), fullres, pen_height, pen_width, right, verbose, cordic::x, and y.

◆ do_paintRect() [1/2]

static void do_paintRect ( )
static

Referenced by paintRect(), and paintSameRect().

◆ do_paintRect() [2/2]

static void do_paintRect ( struct Rect prect)
static

Definition at line 2366 of file picttoppm.c.

References clip_rect, draw_pen_rect(), dump_rect(), fullres, rectinter(), and verbose.

◆ do_pixmap() [1/2]

static void do_pixmap ( )
static

Referenced by BitsRect(), and BitsRegion().

◆ do_pixmap() [2/2]

static void do_pixmap ( int  version,
word  rowBytes,
int  is_region 
)
static

◆ do_ps_text() [1/2]

static void do_ps_text ( )
static

Referenced by do_text().

◆ do_ps_text() [2/2]

◆ do_text() [1/2]

static void do_text ( )
static

Referenced by DHDVText(), DHText(), DVText(), and LongText().

◆ do_text() [2/2]

◆ draw_pen() [1/2]

static void draw_pen ( )
static

Referenced by do_frameRect(), and scan_line().

◆ draw_pen() [2/2]

static void draw_pen ( int  x,
int  y 
)
static

◆ draw_pen_rect() [1/2]

static void draw_pen_rect ( )
static

Referenced by do_paintRect(), and draw_pen().

◆ draw_pen_rect() [2/2]

static void draw_pen_rect ( struct Rect r)
static

Definition at line 2192 of file picttoppm.c.

References black, blue, bottom, link_confs::dst, green, i, pen_pat, pen_trf, Pattern::pix, PIXEL_INDEX, r, red, right, rowlen, white, cordic::x, and y.

◆ draw_pixel() [1/2]

static void draw_pixel ( )
static

Referenced by do_text().

◆ draw_pixel() [2/2]

static void draw_pixel ( int  x,
int  y,
struct RGBColour clr,
transfer_func  trf 
)
static

Definition at line 2168 of file picttoppm.c.

References blue, Rect::bottom, clip_rect, link_confs::dst, green, i, PIXEL_INDEX, red, Rect::right, cordic::x, and y.

◆ dump_rect() [1/2]

◆ dump_rect() [2/2]

static void dump_rect ( char*  s,
struct Rect r 
)
static

Definition at line 3020 of file picttoppm.c.

References pm_message, r, and s.

◆ DVText() [1/2]

static void DVText ( )
static

◆ DVText() [2/2]

static void DVText ( int  version)
static

Definition at line 2645 of file picttoppm.c.

References current, do_text(), read_byte(), Point::x, and Point::y.

◆ expand_buf() [1/2]

static byte* expand_buf ( )
static

Referenced by read_8x8_pattern(), and unpackbits().

◆ expand_buf() [2/2]

static byte* expand_buf ( byte buf,
int len,
int  bits_per_pixel 
)
static

Definition at line 1841 of file picttoppm.c.

References bits_per_pixel(), buf, link_confs::dst, i, len, pm_error, and link_confs::src.

◆ FillPat() [1/2]

static void FillPat ( )
static

◆ FillPat() [2/2]

static void FillPat ( int  version)
static

Definition at line 2078 of file picttoppm.c.

References fillpat, and read_8x8_pattern().

◆ FillPixPat() [1/2]

static void FillPixPat ( )
static

◆ FillPixPat() [2/2]

static void FillPixPat ( int  version)
static

Definition at line 2026 of file picttoppm.c.

References read_pattern().

◆ frameRect() [1/2]

static void frameRect ( )
static

◆ frameRect() [2/2]

static void frameRect ( int  v)
static

Definition at line 2382 of file picttoppm.c.

References cur_rect, do_frameRect(), and read_rect().

◆ frameSameRect() [1/2]

static void frameSameRect ( )
static

◆ frameSameRect() [2/2]

static void frameSameRect ( int  v)
static

Definition at line 2389 of file picttoppm.c.

References cur_rect, and do_frameRect().

◆ get_font() [1/2]

static struct font* get_font ( )
static

Referenced by do_text().

◆ get_font() [2/2]

static struct font* get_font ( int  font,
int  size,
int  style 
)
static

◆ get_op() [1/2]

static word get_op ( )
static

Referenced by interpret_pict().

◆ get_op() [2/2]

static word get_op ( int  version)
static

Definition at line 3049 of file picttoppm.c.

References align, read_byte(), read_word(), stage, and version.

◆ interpret_pict()

◆ Line() [1/2]

static void Line ( )
static

Definition at line 341 of file ParagraphLayout.h.

◆ Line() [2/2]

static void Line ( int  v)
static

Definition at line 2293 of file picttoppm.c.

References current, p1, pm_message, read_point(), scan_line(), verbose, Point::x, and Point::y.

◆ LineFrom() [1/2]

static void LineFrom ( )
static

◆ LineFrom() [2/2]

static void LineFrom ( int  v)
static

Definition at line 2305 of file picttoppm.c.

References current, fullres, p1, pm_message, read_point(), scan_line(), verbose, Point::x, and Point::y.

◆ load_fontdir() [1/2]

static int load_fontdir ( )
static

Referenced by main().

◆ load_fontdir() [2/2]

◆ LongComment() [1/2]

static void LongComment ( )
static

◆ LongComment() [2/2]

static void LongComment ( int  version)
static

Definition at line 2953 of file picttoppm.c.

References picComment(), read_word(), and type.

◆ LongText() [1/2]

static void LongText ( )
static

◆ LongText() [2/2]

static void LongText ( int  version)
static

Definition at line 2627 of file picttoppm.c.

References do_text(), p, and read_point().

◆ main()

◆ notSrcBic()

static void notSrcBic ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1200 of file picttoppm.c.

References background, link_confs::dst, rgb_is_white, and link_confs::src.

Referenced by transfer().

◆ notSrcCopy()

static void notSrcCopy ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1182 of file picttoppm.c.

References background, link_confs::dst, foreground, rgb_is_black, rgb_is_white, and link_confs::src.

Referenced by transfer().

◆ notSrcOr()

static void notSrcOr ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1192 of file picttoppm.c.

References link_confs::dst, foreground, rgb_is_white, and link_confs::src.

Referenced by transfer().

◆ notSrcXor()

static void notSrcXor ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1208 of file picttoppm.c.

References link_confs::dst, and link_confs::src.

Referenced by transfer().

◆ Opcode_9A() [1/2]

static void Opcode_9A ( )
static

◆ Opcode_9A() [2/2]

◆ OpColor() [1/2]

static void OpColor ( )
static

◆ OpColor() [2/2]

static void OpColor ( int  version)
static

Definition at line 2002 of file picttoppm.c.

References RGBColour::blue, RGBColour::green, op_colour, read_word(), and RGBColour::red.

◆ output_ppm() [1/2]

static void output_ppm ( )
static

Referenced by interpret_pict().

◆ output_ppm() [2/2]

◆ paintPoly() [1/2]

static void paintPoly ( )
static

◆ paintPoly() [2/2]

static void paintPoly ( int  v)
static

Definition at line 2556 of file picttoppm.c.

References fullres, i, np, read_point(), read_rect(), read_word(), and scan_poly().

◆ paintRect() [1/2]

static void paintRect ( )
static

◆ paintRect() [2/2]

static void paintRect ( int  v)
static

Definition at line 2353 of file picttoppm.c.

References cur_rect, do_paintRect(), and read_rect().

◆ paintSameRect() [1/2]

static void paintSameRect ( )
static

◆ paintSameRect() [2/2]

static void paintSameRect ( int  v)
static

Definition at line 2360 of file picttoppm.c.

References cur_rect, and do_paintRect().

◆ picComment() [1/2]

static void picComment ( )
static

Referenced by LongComment(), and ShortComment().

◆ picComment() [2/2]

◆ PnLocHFrac() [1/2]

static void PnLocHFrac ( )
static

◆ PnLocHFrac() [2/2]

static void PnLocHFrac ( int  version)
static

Definition at line 2572 of file picttoppm.c.

References pm_message, read_word(), and verbose.

◆ PnMode() [1/2]

static void PnMode ( )
static

◆ PnMode() [2/2]

static void PnMode ( int  version)
static

Definition at line 2112 of file picttoppm.c.

References const_name(), pen_mode, pen_trf, pm_message, read_word(), transfer(), transfer_name, and verbose.

◆ PnPat() [1/2]

static void PnPat ( )
static

◆ PnPat() [2/2]

static void PnPat ( int  version)
static

Definition at line 2072 of file picttoppm.c.

References pen_pat, and read_8x8_pattern().

◆ PnPixPat() [1/2]

static void PnPixPat ( )
static

◆ PnPixPat() [2/2]

static void PnPixPat ( int  version)
static

Definition at line 2019 of file picttoppm.c.

References read_pattern().

◆ PnSize() [1/2]

static void PnSize ( )
static

◆ PnSize() [2/2]

static void PnSize ( int  version)
static

Definition at line 2103 of file picttoppm.c.

References pen_height, pen_width, pm_message, read_word(), and verbose.

◆ poly_sort() [1/2]

static void poly_sort ( )
static

◆ poly_sort() [2/2]

static void poly_sort ( int  sort_index,
points   
)
static

Definition at line 2422 of file picttoppm.c.

◆ read_8x8_pattern() [1/2]

static void read_8x8_pattern ( )
static

Referenced by BkPat(), FillPat(), and PnPat().

◆ read_8x8_pattern() [2/2]

static void read_8x8_pattern ( struct Pattern pat)
static

Definition at line 2085 of file picttoppm.c.

References buf, exp(), expand_buf(), i, len, pat, pm_message, read_n(), and verbose.

◆ read_byte()

◆ read_colour_table()

static struct RGBColour * read_colour_table ( )
static

◆ read_long()

static longword read_long ( )
static

Definition at line 3066 of file picttoppm.c.

References i, and read_word().

Referenced by interpret_pict(), Opcode_9A(), read_colour_table(), and read_pixmap().

◆ read_n() [1/2]

static void read_n ( )
static

Referenced by read_8x8_pattern(), and unpackbits().

◆ read_n() [2/2]

static void read_n ( int  n,
char*  buf 
)
static

Definition at line 3116 of file picttoppm.c.

References align, buf, fread, ifp, n, pm_error, and stage.

◆ read_pattern()

static void read_pattern ( )
static

Definition at line 2036 of file picttoppm.c.

References free, p, pm_error, read_colour_table(), read_pixmap(), read_word(), skip(), stage, and unpackbits().

Referenced by BkPixPat(), FillPixPat(), and PnPixPat().

◆ read_pixmap() [1/2]

static void read_pixmap ( )
static

Referenced by do_pixmap(), and read_pattern().

◆ read_pixmap() [2/2]

static void read_pixmap ( struct pixMap p,
word rowBytes 
)
static

Definition at line 1913 of file picttoppm.c.

References NULL, p, pm_error, pm_message, read_long(), read_rect(), read_word(), stage, and verbose.

◆ read_point() [1/2]

static void read_point ( )
static

◆ read_point() [2/2]

static void read_point ( struct Point p)
static

Definition at line 2152 of file picttoppm.c.

References p, and read_word().

◆ read_rect() [1/2]

◆ read_rect() [2/2]

static void read_rect ( struct Rect r)
static

Definition at line 3010 of file picttoppm.c.

References r, and read_word().

◆ read_rgb() [1/2]

static void read_rgb ( )
static

Referenced by RGBBkCol(), and RGBFgCol().

◆ read_rgb() [2/2]

static void read_rgb ( struct RGBColour rgb)
static

Definition at line 2126 of file picttoppm.c.

References read_word().

◆ read_short_point() [1/2]

static void read_short_point ( )
static

Referenced by ShortLine(), and ShortLineFrom().

◆ read_short_point() [2/2]

static void read_short_point ( struct Point p)
static

Definition at line 2159 of file picttoppm.c.

References p, and read_signed_byte().

◆ read_signed_byte()

static signed_byte read_signed_byte ( )
static

Definition at line 3097 of file picttoppm.c.

References read_byte().

Referenced by read_short_point().

◆ read_word()

◆ rectheight() [1/2]

static int rectheight ( )
static

Referenced by blit(), and do_blits().

◆ rectheight() [2/2]

static int rectheight ( struct Rect r)
static

Definition at line 2970 of file picttoppm.c.

References r.

◆ rectinter() [1/2]

static void rectinter ( )
static

Referenced by blit(), do_paintRect(), and draw_pen().

◆ rectinter() [2/2]

static void rectinter ( struct Rect r1,
struct Rect r2,
struct Rect r3 
)
static

Definition at line 2986 of file picttoppm.c.

References max, min, r1, r2, and r3.

◆ rectsamesize() [1/2]

static int rectsamesize ( )
static

Referenced by blit().

◆ rectsamesize() [2/2]

static int rectsamesize ( struct Rect r1,
struct Rect r2 
)
static

Definition at line 2977 of file picttoppm.c.

References r1, and r2.

◆ rectscale() [1/2]

static void rectscale ( )
static

Referenced by do_blits().

◆ rectscale() [2/2]

static void rectscale ( struct Rect r,
double  xscale,
double  yscale 
)
static

Definition at line 2998 of file picttoppm.c.

References r, xscale, and yscale.

◆ rectwidth() [1/2]

static int rectwidth ( )
static

Referenced by blit(), and do_blits().

◆ rectwidth() [2/2]

static int rectwidth ( struct Rect r)
static

Definition at line 2963 of file picttoppm.c.

References r.

◆ RGBBkCol() [1/2]

static void RGBBkCol ( )
static

◆ RGBBkCol() [2/2]

static void RGBBkCol ( int  v)
static

◆ RGBFgCol() [1/2]

static void RGBFgCol ( )
static

◆ RGBFgCol() [2/2]

static void RGBFgCol ( int  v)
static

◆ rotate() [1/2]

static void rotate ( )
static

Referenced by do_ps_text().

◆ rotate() [2/2]

static void rotate ( int x,
int y 
)
static

Definition at line 2789 of file picttoppm.c.

References ps_cent_x, ps_cent_y, ps_rotation, cordic::x, and y.

◆ scan_line() [1/2]

static void scan_line ( )
static

◆ scan_line() [2/2]

static void scan_line ( short  x1,
short  y1,
short  x2,
short  y2 
)
static

Definition at line 2252 of file picttoppm.c.

References ABS, collen, d, draw_pen(), pen_height, pen_width, rowlen, SGN, cordic::x, x1, x2, y, y1, and y2.

◆ scan_poly() [1/2]

static void scan_poly ( )
static

Referenced by paintPoly().

◆ scan_poly() [2/2]

static void scan_poly ( int  np,
pts   
)
static

Definition at line 2455 of file picttoppm.c.

◆ ShortComment() [1/2]

static void ShortComment ( )
static

◆ ShortComment() [2/2]

static void ShortComment ( int  version)
static

Definition at line 2946 of file picttoppm.c.

References picComment(), and read_word().

◆ ShortLine() [1/2]

static void ShortLine ( )
static

◆ ShortLine() [2/2]

static void ShortLine ( int  v)
static

◆ ShortLineFrom() [1/2]

static void ShortLineFrom ( )
static

◆ ShortLineFrom() [2/2]

static void ShortLineFrom ( int  v)
static

Definition at line 2337 of file picttoppm.c.

References current, fullres, p1, pm_message, read_short_point(), scan_line(), verbose, Point::x, and Point::y.

◆ skip() [1/2]

◆ skip() [2/2]

static void skip ( int  n)
static

Definition at line 3103 of file picttoppm.c.

References align, buf, fread, ifp, n, pm_error, and stage.

◆ skip_poly_or_region() [1/2]

static void skip_poly_or_region ( )
static

Referenced by do_bitmap(), and do_pixmap().

◆ skip_poly_or_region() [2/2]

static void skip_poly_or_region ( int  version)
static

Definition at line 2819 of file picttoppm.c.

References read_word(), skip(), and stage.

◆ skip_text()

static void skip_text ( )
static

Definition at line 2621 of file picttoppm.c.

References read_byte(), and skip().

Referenced by do_text().

◆ srcBic()

static void srcBic ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1174 of file picttoppm.c.

References background, link_confs::dst, rgb_is_black, and link_confs::src.

Referenced by transfer().

◆ srcCopy()

static void srcCopy ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1147 of file picttoppm.c.

References background, link_confs::dst, foreground, rgb_is_black, and link_confs::src.

Referenced by transfer().

◆ srcOr()

static void srcOr ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1157 of file picttoppm.c.

References link_confs::dst, foreground, rgb_is_black, and link_confs::src.

Referenced by transfer().

◆ srcXor()

static void srcXor ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1165 of file picttoppm.c.

References link_confs::dst.

Referenced by transfer().

◆ subOver()

static void subOver ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1246 of file picttoppm.c.

References link_confs::dst, and link_confs::src.

Referenced by transfer().

◆ subPin()

static void subPin ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1256 of file picttoppm.c.

References RGBColour::blue, link_confs::dst, RGBColour::green, op_colour, RGBColour::red, and link_confs::src.

Referenced by transfer().

◆ transfer() [1/2]

◆ transfer() [2/2]

◆ transparent()

static void transparent ( struct RGBColour src,
struct RGBColour dst 
)
static

Definition at line 1307 of file picttoppm.c.

References background, RGBColour::blue, link_confs::dst, RGBColour::green, RGBColour::red, and link_confs::src.

Referenced by transfer().

◆ TxFace() [1/2]

static void TxFace ( )
static

◆ TxFace() [2/2]

static void TxFace ( int  version)
static

Definition at line 2604 of file picttoppm.c.

References pm_message, read_byte(), text_face, and verbose.

◆ TxFont() [1/2]

static void TxFont ( )
static

◆ TxFont() [2/2]

static void TxFont ( int  version)
static

Definition at line 2596 of file picttoppm.c.

References const_name(), font_name, pm_message, read_word(), text_font, and verbose.

◆ TxMode() [1/2]

static void TxMode ( )
static

◆ TxMode() [2/2]

static void TxMode ( int  version)
static

◆ TxSize() [1/2]

static void TxSize ( )
static

◆ TxSize() [2/2]

static void TxSize ( int  version)
static

Definition at line 2612 of file picttoppm.c.

References pm_message, read_word(), text_size, and verbose.

◆ unpackbits() [1/2]

static byte* unpackbits ( )
static

◆ unpackbits() [2/2]

static byte* unpackbits ( struct Rect bounds,
word  rowBytes,
int  pixelSize 
)
static

Variable Documentation

◆ align

int align = 0
static

Definition at line 537 of file picttoppm.c.

Referenced by get_op(), read_byte(), read_n(), and skip().

◆ background

struct RGBColour background = { 0xffff, 0xffff, 0xffff }
static

Definition at line 121 of file picttoppm.c.

Referenced by notSrcBic(), notSrcCopy(), RGBBkCol(), srcBic(), srcCopy(), and transparent().

◆ bkpat

struct Pattern bkpat
static

Definition at line 121 of file picttoppm.c.

Referenced by BkPat(), and interpret_pict().

◆ black

struct RGBColour black = { 0, 0, 0 }
static

Definition at line 121 of file picttoppm.c.

Referenced by do_text(), and draw_pen_rect().

◆ blit_list

struct blit_info* blit_list = 0
static

Definition at line 176 of file picttoppm.c.

Referenced by do_blits().

◆ blue

word* blue
static

◆ clip_rect

◆ collen

word collen
static

Definition at line 117 of file picttoppm.c.

Referenced by alloc_planes(), and scan_line().

◆ cur_rect

struct Rect cur_rect
static

Definition at line 121 of file picttoppm.c.

Referenced by frameRect(), frameSameRect(), paintRect(), and paintSameRect().

◆ current

struct Point current
static

Definition at line 121 of file picttoppm.c.

Referenced by _InterpretPS(), TableResource::add(), add_h_episema(), TextTrieMap::addChildNode(), double_conversion::AdvanceToNonspace(), array_write_java(), array_write_xml(), BlockComputeSNR(), build_command_line(), buildClassDef(), buildCoverageFormat(), Cache_Destroy(), Cache_New(), CalcDistortion(), cff_make_fdselect(), cff_numberSubroutines(), characterIteratorCurrent(), CheckForMailArriving(), CheckMonotonicClosed(), collective_note(), ComputeBDiffDCTs(), ComputeBlockColorDiff(), ComputeDiffDCTBlock(), ComputeDiffDCTs(), graphite2::json::context(), DelOld(), DHDVText(), DHText(), disposeFvar(), disposeGlyphOrder(), ThaiBreakEngine::divideUpDictionaryRange(), LaoBreakEngine::divideUpDictionaryRange(), BurmeseBreakEngine::divideUpDictionaryRange(), KhmerBreakEngine::divideUpDictionaryRange(), do_ps_text(), do_text(), DoBIntraCode(), dumpnewcolors(), DVIGetCommand(), DVText(), exception_strings(), find_post(), DictionaryBreakEngine::findBreaks(), FontDef(), FreeAllHereDocuments(), FT_GlyphLoader_Add(), FT_GlyphLoader_Adjust_Points(), FT_GlyphLoader_Adjust_Subglyphs(), FT_GlyphLoader_CheckPoints(), FT_GlyphLoader_CheckSubGlyphs(), FT_GlyphLoader_Prepare(), FT_GlyphLoader_Rewind(), GenIFrame(), GenPFrame(), TextTrieMap::getChildNode(), GfxICCBasedColorSpace::getRGBLine(), GfxICCBasedColorSpace::getRGBXLine(), GlyphGroupKernsFree(), GlyphGroupsFree(), gregorio_clone_characters(), ContainerResource::handlePreflightStrings(), TableResource::handleWrite(), ArrayResource::handleWrite16(), TableResource::handleWrite16(), hb_array_t< Type >::hash(), hhvvcurve_roll(), hvlineto_roll(), hvvhcurve_roll(), ordlist< T, Telem, COMPARATOR >::insert(), InsNew(), double_conversion::IsHexFloatString(), l_set_whatsit_data(), Line(), LineFrom(), lua_nodelib_direct_flatten_discretionaries(), lua_nodelib_direct_insert_after(), lua_nodelib_direct_insert_before(), lua_nodelib_direct_remove(), lua_nodelib_flatten_discretionaries(), lua_nodelib_insert_after(), lua_nodelib_insert_before(), lua_nodelib_remove(), numberASubroutine(), openfontfile(), OpenFontFile(), opop_roll(), orderGlyphs(), otfcc_dumpFvar(), Parse_Specifics_File_v1(), Parse_Specifics_File_v2(), pdf_dev_reset_xgstate(), pdf_dev_set_color(), pdf_dev_xgstate_pop(), pdf_dev_xgstate_push(), pfed_read_normal_contour(), png_set_option(), RuleBasedBreakIterator::DictionaryCache::populateDictionary(), RuleBasedBreakIterator::BreakCache::preceding(), ContainerResource::preWriteAllRes(), DVIToSVGActions::progress(), PSCharStringToBB(), PSCharStringToSplines(), pseudo_output_notes(), double_conversion::RadixStringToIeee(), restore_font(), restore_state(), save_font(), save_state(), FormFieldButton::setState(), SFDGetSplineSet(), ShortLine(), ShortLineFrom(), drvWMF::show_text(), SNumRead(), Sort(), spacing_note(), str_write_java(), double_conversion::StringToDoubleConverter::StringToIeee(), table_write_java(), table_write_xml(), translate(), TT_Process_Composite_Component(), uloc_kw_nextKeyword(), UNumRead(), Update(), OlsonTimeZone::useDaylightTime(), TextLine::visitSelection(), SRBRoot::write(), ContainerResource::writeAllRes(), ContainerResource::writeAllRes16(), ContainerResource::writeAllRes32(), ColorTable::~ColorTable(), and ContainerResource::~ContainerResource().

◆ fillpat

struct Pattern fillpat
static

Definition at line 121 of file picttoppm.c.

Referenced by FillPat(), interpret_pict(), drvTGIF::show_rectangle(), and drvTGIF::show_text().

◆ font_name

◆ fontlist

struct fontinfo* fontlist = 0
static

Definition at line 3246 of file picttoppm.c.

◆ fontlist_ins

struct fontinfo** fontlist_ins = &fontlist
static

Definition at line 3247 of file picttoppm.c.

Referenced by load_fontdir().

◆ foreground

◆ fullres

◆ green

word* green
static

◆ ifp

FILE* ifp
static

Definition at line 538 of file picttoppm.c.

Referenced by main(), Opcode_9A(), read_byte(), read_n(), and skip().

◆ last_bl

struct blit_info** last_bl = &blit_list
static

Definition at line 177 of file picttoppm.c.

Referenced by add_blit_list().

◆ op_colour

struct RGBColour op_colour
static

Definition at line 121 of file picttoppm.c.

Referenced by addPin(), OpColor(), and subPin().

◆ optable

struct opdef optable[]
static

Definition at line 278 of file picttoppm.c.

Referenced by interpret_pict(), and mrb_vm_exec().

◆ pen_height

word pen_height
static

Definition at line 137 of file picttoppm.c.

Referenced by do_frameRect(), draw_pen(), interpret_pict(), PnSize(), and scan_line().

◆ pen_mode

word pen_mode
static

Definition at line 138 of file picttoppm.c.

Referenced by interpret_pict(), and PnMode().

◆ pen_pat

struct Pattern pen_pat
static

Definition at line 121 of file picttoppm.c.

Referenced by draw_pen_rect(), interpret_pict(), and PnPat().

◆ pen_trf

transfer_func pen_trf
static

Definition at line 139 of file picttoppm.c.

Referenced by draw_pen_rect(), interpret_pict(), and PnMode().

◆ pen_width

word pen_width
static

Definition at line 136 of file picttoppm.c.

Referenced by do_frameRect(), draw_pen(), interpret_pict(), PnSize(), and scan_line().

◆ picFrame

struct Rect picFrame
static

◆ planelen

longword planelen
static

Definition at line 118 of file picttoppm.c.

Referenced by alloc_planes(), and compact_plane().

◆ ps_cent_set

int ps_cent_set
static

Definition at line 155 of file picttoppm.c.

Referenced by do_ps_text(), and picComment().

◆ ps_cent_x

int ps_cent_x
static

Definition at line 153 of file picttoppm.c.

Referenced by do_ps_text(), picComment(), and rotate().

◆ ps_cent_y

int ps_cent_y
static

Definition at line 154 of file picttoppm.c.

Referenced by do_ps_text(), picComment(), and rotate().

◆ ps_flip

byte ps_flip
static

Definition at line 150 of file picttoppm.c.

Referenced by picComment().

◆ ps_flip_name

struct const_name ps_flip_name[]
Initial value:
= {
{ 0, "no" },
{ 1, "horizontal" },
{ 2, "vertical" },
{ -1, 0 }
}

Definition at line 470 of file picttoppm.c.

Referenced by picComment().

◆ ps_just

byte ps_just
static

Definition at line 149 of file picttoppm.c.

Referenced by picComment().

◆ ps_just_name

struct const_name ps_just_name[]
Initial value:
= {
{ 0, "no" },
{ 1, "left" },
{ 2, "center" },
{ 3, "right" },
{ 4, "full" },
{ -1, 0 }
}

Definition at line 470 of file picttoppm.c.

Referenced by picComment().

◆ ps_linespace

byte ps_linespace
static

Definition at line 152 of file picttoppm.c.

Referenced by picComment().

◆ ps_rotation

word ps_rotation
static

Definition at line 151 of file picttoppm.c.

Referenced by picComment(), and rotate().

◆ ps_text

int ps_text
static

Definition at line 148 of file picttoppm.c.

Referenced by blit(), do_text(), and picComment().

◆ recognize_comment

int recognize_comment
static

Definition at line 121 of file picttoppm.c.

Referenced by main(), and picComment().

◆ red

word* red
static

◆ rowlen

◆ stage

◆ text_face

byte text_face
static

Definition at line 141 of file picttoppm.c.

Referenced by do_text(), and TxFace().

◆ text_font

word text_font
static

Definition at line 140 of file picttoppm.c.

Referenced by do_text(), and TxFont().

◆ text_mode

word text_mode ( void  )
static

Definition at line 142 of file picttoppm.c.

Referenced by interpret_pict(), and TxMode().

◆ text_size

word text_size
static

Definition at line 144 of file picttoppm.c.

Referenced by do_text(), and TxSize().

◆ text_trf

transfer_func text_trf
static

Definition at line 143 of file picttoppm.c.

Referenced by do_text(), interpret_pict(), and TxMode().

◆ tfont

struct font* tfont
static

Definition at line 145 of file picttoppm.c.

Referenced by do_ps_text(), do_text(), and drvPIC::show_text().

◆ transfer_name

struct const_name transfer_name[]
Initial value:
= {
{ 0, "srcCopy" },
{ 1, "srcOr" },
{ 2, "srcXor" },
{ 3, "srcBic" },
{ 4, "notSrcCopy" },
{ 5, "notSrcOr" },
{ 6, "notSrcXor" },
{ 7, "notSrcBic" },
{ 32, "blend" },
{ 33, "addPin" },
{ 34, "addOver" },
{ 35, "subPin" },
{ 36, "transparent" },
{ 37, "adMax" },
{ 38, "subOver" },
{ 39, "adMin" },
{ -1, 0 }
}

Definition at line 470 of file picttoppm.c.

Referenced by do_bitmap(), do_pixmap(), Opcode_9A(), PnMode(), transfer(), and TxMode().

◆ verbose

◆ white

struct RGBColour white = { 0xffff, 0xffff, 0xffff }
static

Definition at line 121 of file picttoppm.c.

Referenced by do_text(), and draw_pen_rect().