Character Generation Techniques
Computer Graphics
Characters Generation in CG
– In computer graphics character can be generated using software.
– In hardware implementation of character generation limited faces of
character can be generated.
– A wide variety of faces of character can be generated with software
implementation.
– There are three methods for generating characters using software
implementation.
– Stroke method
– Vector method or bitmap method.
– Star bust method
Stoke method
•
•
•
In this method we use a sequence of line drawing function and arc
functions to generate characters.
We can generate a sequence of character by assigning starting and
end point of line or arc.
By using this method various faces of character can be generated
by changing the values (parameters) in line and arc function.
Stoke method
• The main disadvantage of this method is when we draw a diagonal line it
produce aliased character.
Bitmap Method
Program For Bitmap Method
• #include<stdio.h>
• #include<conio.h>
• #include<graphics.h>
• main()
• {
• int gd,gm,i,j;
{ 0, 0, 0, 0, 1, 0, 0, 0, 0},
{ 0, 0, 0, 1, 0, 1, 0, 0, 0},
{ 0, 0, 1, 0, 0, 0, 1, 0, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 1, 1, 1, 1, 1, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
{ 0, 1, 0, 0, 0, 0, 0, 1, 0},
int a[13][9] = {
•
•
•
•
•
•
•
•
•
•
•
•
•
• };
/* Initialise graphics mode */
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"c:tcbgi");
•
•
•
•
for(i=0;i<13;i++)
{
for(j=0;j<9;j++)
{
putpixel(200+j,200+i,15*a[i][j]);
}
}
getch();
closegraph();
}
Bitmap Method
• This method is suitable for producing various
character.
• Font size of character can be increased by
increasing the size of array.
• The main draw back of this method is this
method produce aliased character.
Starbust Method
1. In this method a fixed pattern of line is used to generate the
character.
2. In this method we use a combination of 24 bit line segment.
3. In 24 bit line segment code each bit represent a single line.
4. To highlight a line we put corresponding bit 1 in 24 bit line
segment code and 0 otherwise.
Starbust Method
Disadvantages of starbust method
24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
0 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 0 1 0 1
24 bit line segment code
1. Here in this method 24 bit segment code is required to put in
memory for generating character. Hence extra memory is
required in this method.
2. Character quality is poor due to limited face.
THANK YOU!!

Character generation

  • 1.
  • 2.
    Characters Generation inCG – In computer graphics character can be generated using software. – In hardware implementation of character generation limited faces of character can be generated. – A wide variety of faces of character can be generated with software implementation. – There are three methods for generating characters using software implementation. – Stroke method – Vector method or bitmap method. – Star bust method
  • 3.
    Stoke method • • • In thismethod we use a sequence of line drawing function and arc functions to generate characters. We can generate a sequence of character by assigning starting and end point of line or arc. By using this method various faces of character can be generated by changing the values (parameters) in line and arc function.
  • 4.
    Stoke method • Themain disadvantage of this method is when we draw a diagonal line it produce aliased character.
  • 5.
  • 6.
    Program For BitmapMethod • #include<stdio.h> • #include<conio.h> • #include<graphics.h> • main() • { • int gd,gm,i,j; { 0, 0, 0, 0, 1, 0, 0, 0, 0}, { 0, 0, 0, 1, 0, 1, 0, 0, 0}, { 0, 0, 1, 0, 0, 0, 1, 0, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 1, 1, 1, 1, 1, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, { 0, 1, 0, 0, 0, 0, 0, 1, 0}, int a[13][9] = { • • • • • • • • • • • • • • }; /* Initialise graphics mode */ detectgraph(&gd,&gm); initgraph(&gd,&gm,"c:tcbgi"); • • • • for(i=0;i<13;i++) { for(j=0;j<9;j++) { putpixel(200+j,200+i,15*a[i][j]); } } getch(); closegraph(); }
  • 7.
    Bitmap Method • Thismethod is suitable for producing various character. • Font size of character can be increased by increasing the size of array. • The main draw back of this method is this method produce aliased character.
  • 8.
    Starbust Method 1. Inthis method a fixed pattern of line is used to generate the character. 2. In this method we use a combination of 24 bit line segment. 3. In 24 bit line segment code each bit represent a single line. 4. To highlight a line we put corresponding bit 1 in 24 bit line segment code and 0 otherwise.
  • 9.
    Starbust Method Disadvantages ofstarbust method 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 0 1 0 1 24 bit line segment code 1. Here in this method 24 bit segment code is required to put in memory for generating character. Hence extra memory is required in this method. 2. Character quality is poor due to limited face.
  • 10.