Posts

Showing posts from 2022

"climits" Header file in c++ programming language | Razsoft Education

 <climits> header file climits is a header file borrowed from c programing language limit.h header file. The header file is used to know the maximum and minimum value an integer data type can hold. The header file is implemented in C++ in standard namespace.  Here is the explanation of Macros used in climits header file char type :     CHAR_BIT - The macro represent number of bit in a  character.     CHAR_MIN -  For the minimum value a char can hold.      CHAR_MAX -  For the maximum value a char can hold.        CHAR_MIN -  For the minimum value a char can hold.     S CHAR_MIN -  For the minimum value a signed char can hold.     S CHAR_MAX -  For the maximum value a char can hold.     UCHAR_MAX - For the minimum value of unsigned char. short type :     SHRT_MIN - For the minimum value a short can hold.      SHRT_MAX - For the maximum value a short integer can hold.     U SHRT_MIN - For the maximum value a unsigned short integer can hold. int type :     INT _MIN - For the minimum

Integer data type in C++ programming language | Razsoft education

 Integer data type in C++ Integers are numbers with no fractional part. In C++ we represent integers in various type according to how big value they can store or what type of integer value they can store. All integer types has signed and unsigned type in C++. Signed type integer can store both positive and negative integer values. Unsigned type integer can store only positive values. 

Different data types in C++ | Razsoft Education

 Data types in C++ : As we know computer is a data oriented machine so, to work with data it need to store that different programming language handles it differently. But C++ programming language provide us more control on data. A data type is to tell the compiler that how much memory a variable or constant going to take and what is type of data stored inside them. There are mainly two types of data group in C++. Fundamental data types :   They are built in data type provided by C++ programming language to work with simple form of data like integer, floating points and characters inside the program. Compound data types :   They are not built in C++. Where as programmer's define them itself when ever needed according to their use. They are defined with the use of fundamental data types, So, it's often refer as user define data type of derived data type. For example array, class, structures, etc. Learn more about  Fundamental data types :     1. Integers     2.  Character     3.

What is Object Oriented Programming | Razsoft Education

 Object Oriented Programming : Object Oriented Programming (OOP’s) is a modern programming approach in which program is thinks as of set of objects communicates to each other to get a work done. Like in real life we have multiple objects that depend on each other for get a work done.             So, the idea was to design a data that has data and function that perform operation on that data. In C++ classes are the special data type that contains data called data member and function that perform operation on that data called member function. An object is instance of class.   Also Read about :    What is procedural programming paradigm ?   What is Structured programming paradigm ?    

What is structured programming paradigm | Razsoft education

 Structured programming                 Structured programming is a programming paradigm in which we use some predefine keywords to control the flow (branching) of the program. Unlike in procedural language we have goto keyword to control flow. In structured program we have for, while, do while if , else, these type of keywords to control the flow better and also have blocks to maintain the scope of the variable or to group a set of related code. These blocks are formed by curly braces ( { } ) in C++.

What is a Procedural programming paradigm | Razsoft Education

  Procedural programming :                As name suggest in procedural language we write procedures to get the result of given data. A program consists of data and algorithm, Algorithm is step by step procedures that work on data and give us the output. When we use a programming language to write down these step by step processes called procedural programming language. ALGOL, BASIC, COBOL and C are the example of procedural programming language.

History of C++ | Razsoft Education

 History of C++     C++ programming language was created by Bajarne Stroustrup in 1979. To support the Object Oriented Programming (OOP) approach while remaining as fast and compatible as C. Initially it’s called “C with classes”. Because it carries every feature of C but added OOP feature to it. Later in 1983 it’s renamed as C++. By seeing its popularity ANSI and ISO started standardizing it and created C++98, first international version of C++. It has feature of template for generic programming. In 2017, C++17 come out which added support for multithreading. At the time writing this blog C++20 is current version.  

What is C++? | Razsoft education

 What is C++ ?    C++ is a powerful high level computer programming language developed by Bjarne Stroustrup in 1979 at AT & T Bell’s lab . The language continue the legacy of C language to produce fast , efficient, reliable and portable code, But extended features for Object oriented programming and generic programming . So, programmers can write complex and large program easily but produce code as efficient as C does. 

Drawing shapes using java graphics API | Razsoft Education

Image
Shapes in java  To draw shape in java, It provides shape interface. Any class that implement the shape interface will be used to draw shapes. To draw shapes we need to pass object of the class which implements the shape interface in the draw() of fill() method of graphics object. Outline of shape is known as path.      Java has already a list of class that implement the Shape interface to draw some basic geometrical shapes. Which is defined in to two main category Rectangular shape and non Rectangular shape. We can also implement shape interface in our own class to create custom shapes.   Rectangular Shape  Rectangular shapes are those shape which Extends the RectangularShape class. The class doesn't define any geometrical shape but it provide a rectangular frame to all the class that extend it. Here is list of some class that extends the RectengularShape class                           * Rectangle2D  * RoundRectangle2D  * Arc2D   * Ellipse2D          Draw and fill  To paint any o

Accessing device coordinates in java graphics | Razsoft Education

 Java 2D API defines three level of configuration information to encapsulate conversion information from user to device coordinate. 1. Graphics Environment class :- GraphicsEnvironment class describe the collection of rendering device visible to the java application on a platform. Rendering device include screens, printers and image buffers. It also include all the fonts available to the device.  2. Graphics Device class :- GraphicsDevice class describe all the possible rendering device on the graphics environment. Such as screens or printers. 3. Graphics Configuration class :- A GraphicsConfiguration class contains all the different types of configuration supported by the graphics device. For example let a screen may have two different configuration such as 720 * 480 or 1920 * 1080 pixel resolution. We can change it's configuration as we want. Or a screen may have different color mode such as 16-bit, 32 - bit or 256 bit color mode. All such information about a device is stored in

Coordinate system of java | Graphics2D coordinate system | Razsoft Education

Image
   As we all know java follows WORA(Write Once Run Anywhere) principle. So, in this process it may encounter many different size and type of output devices. To give the same user experience to users across all devices java manages two different coordinate system.     1. User space coordinate system    2. Device space coordinate system 1. User space coordinate system :- It's a device independent coordinate system also called logical coordinate system. Which is used by developers to draw and set elements in application. It's relative to the application. In java to do all the graphical drawing we use this coordinate system.            In user space top left corner is 0,0 position. The x- coordinate goes horizontally from left to right, and y-coordinate moves from top to bottom. And a point is defined by first x - coordinate followed by y- coordinate.  2. Device space coordinate system :- It's a device dependent coordinate system. Defined by device i.e. how device manages it

Java 2D Rendering Pipeline | Rendering in java | Razsoft Education

Image
What is Rendering?                      When we draw anything on screen, it involves many step by step process to calculate where and how to produce each pixel on screen, These step by step process is known as Rendering Pipeline and process is known as Rendering .      In this process we first define our basic shapes also known as primitives(such as text, image and geometric shapes). Then these primitives' as passed to a rendering engine like Graphics2D, That perform the step by step process of rendering pipeline. Then output image is given to an output device like screen, printer or an image stored in memory.  Apart from rendering engine Graphics2D also work as a surface to draw primitives on it. Each time we draw a new primitive on surface it added on the surface. Which we can draw on a output device.  Graphics2D States :-  Graphics2D work as a state machine to draw the primitives. It manages an internal states for rendering. Untill we not change it will use it's default st

Graphics2D API an introduction to Java2D | Razsoft Education

Image
            To overcome problems with the Graphics class and to enhance some functionality. Java introduces new class called Graphics2D . Which allows to better control over graphics operations? Also java introduces a whole set of package to do 2D graphics operation including image manipulation , drawing and transformation and the package is backward compatible.                For example Java2D API has separate class for each type of basic shapes. All the shapes implements Shape interface . Also we can define our own shape by implementing shape interface in our own custom shape class.                Control the fill and line style with control on width of the line. The Stroke and Paint interface was introduced to make custom fill and drawing style.                AffineTransform allows us to linear transformation of 2D coordinates of shapes like translation , shear , rotation and scale .                A Font is defined by Glyphs , which is individual shapes to def

Computer graphics with java an introduction | Razsoft Education

Image
               Graphics is a way to represent visual element in application. Java provided us rich set of methods and class through Java2D API to deal with the graphics in java platform and application. Using AWT methods to draw and manipulated GUI interface.                Java2D comes with rich set of function to manipulate images, text, font, color, etc. It has capability to draw basic geometric shapes and curves. Java media framework allows us to work with media files and create animations. Java media framework depends upon Java2D framework for rendering purposes.                For basic drawing operation every java AWT component which is visible to screen contains a reference to graphics object, which is an object of abstract class Graphics. It comes with many useful methods to draw elements like rectangle, ellipses and lines on AWT components. To use this method we just need to override paint() method of AWT component.                In this example we are going to

Computer graphics an introduction | Razsoft education

Image
Computer graphics or CG Definition: Computer graphics is a field of computer science in which we study the creation and manipulation of images.   Computer graphics is an art of communicating to computer visually. Application: Movies: -  In movies they use VFX to create many scene like large explosion, plane crash or create entirely new environment like in Avengers and avatar. Cartoons: -  It’s used to create fictional characters and animate them to make animation videos like Doremon, Tom and Jerry and Motu-Patlu.   Video games: -  Video game is industry completely based on computer graphics. It’s used to create environment, character and interaction with them. Some popular computer games are like Vice city, Temple run, PUBG, etc. Simulation: -  Using computer we can describe behavior of object’s in computer then simulate  them in virtual environment to see the effect. It’s also used to teach people about complex machine operation like plane or train. Data visualization: -