All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fpchop.h
Go to the documentation of this file.
1 /**********************************************************************
2  * File: fpchop.h (Formerly fp_chop.h)
3  * Description: Code to chop fixed pitch text into character cells.
4  * Author: Ray Smith
5  * Created: Thu Sep 16 11:14:15 BST 1993
6  *
7  * (C) Copyright 1993, Hewlett-Packard Ltd.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  *
18  **********************************************************************/
19 
20 #ifndef FPCHOP_H
21 #define FPCHOP_H
22 
23 #include "params.h"
24 #include "blobbox.h"
25 
27 {
28  public:
29  C_OUTLINE_FRAG() { //empty constructor
30  steps = NULL;
31  stepcount = 0;
32  }
34  if (steps != NULL)
35  delete [] steps;
36  }
37  //start coord
38  C_OUTLINE_FRAG(ICOORD start_pt,
39  ICOORD end_pt, //end coord
40  C_OUTLINE *outline, //source of steps
41  inT16 start_index,
42  inT16 end_index);
43  //other end
45  C_OUTLINE *close(); //copy to outline
46  C_OUTLINE_FRAG & operator= ( //assign
47  const C_OUTLINE_FRAG & src);
48 
49  ICOORD start; //start coord
50  ICOORD end; //end coord
51  DIR128 *steps; //step array
52  inT32 stepcount; //no of steps
53  C_OUTLINE_FRAG *other_end; //head if a tail
54  inT16 ycoord; //coord of cut pt
55 
56  private:
57 };
58 
60 
61 extern
63 "Max allowed bending of chop cells");
64 extern
66 "Max distance of chop pt from vertex");
67 ROW *fixed_pitch_words( //find lines
68  TO_ROW *row, //row to do
69  FCOORD rotation //for drawing
70  );
71 WERD *add_repeated_word( //move repeated word
72  WERD_IT *rep_it, //repeated words
73  inT16 &rep_left, //left edge of word
74  inT16 &prev_chop_coord, //previous word end
75  uinT8 &blanks, //no of blanks
76  float pitch, //char cell size
77  WERD_IT *word_it //list of words
78  );
79 void split_to_blob( //split the blob
80  BLOBNBOX *blob, //blob to split
81  inT16 chop_coord, //place to chop
82  float pitch_error, //allowed deviation
83  C_OUTLINE_LIST *left_coutlines, //for cblobs
84  C_OUTLINE_LIST *right_coutlines);
85 void fixed_chop_cblob( //split the blob
86  C_BLOB *blob, //blob to split
87  inT16 chop_coord, //place to chop
88  float pitch_error, //allowed deviation
89  C_OUTLINE_LIST *left_outlines, //left half of chop
90  C_OUTLINE_LIST *right_outlines //right half of chop
91  );
92 void fixed_split_coutline( //chop the outline
93  C_OUTLINE *srcline, //source outline
94  inT16 chop_coord, //place to chop
95  float pitch_error, //allowed deviation
96  C_OUTLINE_IT *left_it, //left half of chop
97  C_OUTLINE_IT *right_it //right half of chop
98  );
99 BOOL8 fixed_chop_coutline( //chop the outline
100  C_OUTLINE *srcline, //source outline
101  inT16 chop_coord, //place to chop
102  float pitch_error, //allowed deviation
103  C_OUTLINE_FRAG_LIST *left_frags, //left half of chop
104  C_OUTLINE_FRAG_LIST *right_frags //right half of chop
105  );
106 void save_chop_cfragment( //chop the outline
107  inT16 head_index, //head of fragment
108  ICOORD head_pos, //head of fragment
109  inT16 tail_index, //tail of fragment
110  ICOORD tail_pos, //tail of fragment
111  C_OUTLINE *srcline, //source of edgesteps
112  C_OUTLINE_FRAG_LIST *frags //fragment list
113  );
114 void add_frag_to_list( //ordered add
115  C_OUTLINE_FRAG *frag, //fragment to add
116  C_OUTLINE_FRAG_LIST *frags //fragment list
117  );
118 void close_chopped_cfragments( //chop the outline
119  C_OUTLINE_FRAG_LIST *frags, //list to clear
120  C_OUTLINE_LIST *children, //potential children
121  float pitch_error, //allowed shrinkage
122  C_OUTLINE_IT *dest_it //output list
123  );
124 C_OUTLINE *join_chopped_fragments( //join pieces
125  C_OUTLINE_FRAG *bottom, //bottom of cut
126  C_OUTLINE_FRAG *top //top of cut
127  );
128 void join_segments( //join pieces
129  C_OUTLINE_FRAG *bottom, //bottom of cut
130  C_OUTLINE_FRAG *top //top of cut
131  );
132 #endif
void fixed_split_coutline(C_OUTLINE *srcline, inT16 chop_coord, float pitch_error, C_OUTLINE_IT *left_it, C_OUTLINE_IT *right_it)
Definition: fpchop.cpp:319
C_OUTLINE_FRAG * other_end
Definition: fpchop.h:53
WERD * add_repeated_word(WERD_IT *rep_it, inT16 &rep_left, inT16 &prev_chop_coord, uinT8 &blanks, float pitch, WERD_IT *word_it)
Definition: fpchop.cpp:207
int textord_fp_chop_error
Definition: fpchop.cpp:39
head_table head
Definition: GlyphLessFont.c:29
inT16 ycoord
Definition: fpchop.h:54
void fixed_chop_cblob(C_BLOB *blob, inT16 chop_coord, float pitch_error, C_OUTLINE_LIST *left_outlines, C_OUTLINE_LIST *right_outlines)
Definition: fpchop.cpp:273
#define INT_VAR_H(name, val, comment)
Definition: params.h:265
ICOORD end
Definition: fpchop.h:50
C_OUTLINE * join_chopped_fragments(C_OUTLINE_FRAG *bottom, C_OUTLINE_FRAG *top)
Definition: fpchop.cpp:703
unsigned char BOOL8
Definition: host.h:113
C_OUTLINE * close()
Definition: fpchop.cpp:779
EndParamDesc of
Definition: featdefs.cpp:108
BOOL8 fixed_chop_coutline(C_OUTLINE *srcline, inT16 chop_coord, float pitch_error, C_OUTLINE_FRAG_LIST *left_frags, C_OUTLINE_FRAG_LIST *right_frags)
Definition: fpchop.cpp:401
Definition: ocrrow.h:32
C_OUTLINE_FRAG()
Definition: fpchop.h:29
~C_OUTLINE_FRAG()
Definition: fpchop.h:33
Definition: mod128.h:29
ICOORD start
Definition: fpchop.h:49
#define double_VAR_H(name, val, comment)
Definition: params.h:274
#define ELISTIZEH(CLASSNAME)
Definition: elst.h:981
Definition: werd.h:60
integer coordinate
Definition: points.h:30
double textord_fp_chop_snap
Definition: fpchop.cpp:41
C_OUTLINE_FRAG & operator=(const C_OUTLINE_FRAG &src)
Definition: fpchop.cpp:813
void join_segments(C_OUTLINE_FRAG *bottom, C_OUTLINE_FRAG *top)
Definition: fpchop.cpp:741
void close_chopped_cfragments(C_OUTLINE_FRAG_LIST *frags, C_OUTLINE_LIST *children, float pitch_error, C_OUTLINE_IT *dest_it)
Definition: fpchop.cpp:642
DIR128 * steps
Definition: fpchop.h:51
#define NULL
Definition: host.h:144
ROW * fixed_pitch_words(TO_ROW *row, FCOORD rotation)
Definition: fpchop.cpp:51
inT32 stepcount
Definition: fpchop.h:52
void split_to_blob(BLOBNBOX *blob, inT16 chop_coord, float pitch_error, C_OUTLINE_LIST *left_coutlines, C_OUTLINE_LIST *right_coutlines)
Definition: fpchop.cpp:243
void add_frag_to_list(C_OUTLINE_FRAG *frag, C_OUTLINE_FRAG_LIST *frags)
Definition: fpchop.cpp:613
void save_chop_cfragment(inT16 head_index, ICOORD head_pos, inT16 tail_index, ICOORD tail_pos, C_OUTLINE *srcline, C_OUTLINE_FRAG_LIST *frags)
Definition: fpchop.cpp:522
Definition: points.h:189
short inT16
Definition: host.h:100
int inT32
Definition: host.h:102
unsigned char uinT8
Definition: host.h:99