Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 1007 of 2109
How to apply a 3×3 convolution matrix using imageconvolution() in PHP?
The imageconvolution() function is an inbuilt function in PHP that applies a 3×3 convolution matrix to an image using coefficients and offset values. This function is commonly used for image filtering effects like blur, sharpening, and edge detection. Syntax bool imageconvolution($image, $matrix, $div, $offset) Parameters The imageconvolution() function accepts four parameters: $image − A GD image resource created using image creation functions like imagecreatetruecolor() $matrix − A 3×3 array containing float values representing the convolution kernel $div − The divisor used for normalization ...
Read MoreHow does the compilation/linking process work in C/C++?
The compilation of a C program involves several distinct phases that transform source code into an executable program. Understanding this process helps debug compilation errors and optimize build workflows. Compilation Process Overview Source Code (main.c) Preprocessor (main.i) Compiler (main.s) Assembler (main.o) Linker (executable) ...
Read MoreHow to apply a gamma correction to a Graphics Draw (GD) image in PHP?
The imagegammacorrect() function is an inbuilt PHP function that applies gamma correction to a Graphics Draw (GD) image. Gamma correction adjusts the brightness and contrast of an image by modifying the relationship between input and output pixel values. Syntax bool imagegammacorrect(resource $image, float $inputgamma, float $outputgamma) Parameters The imagegammacorrect() function takes three parameters ? $image − The image resource to apply gamma correction to $inputgamma − The input gamma value (typically between 0.1 and 10.0) $outputgamma − The output gamma value (typically between 0.1 and 10.0) Return Values Returns ...
Read MoreHow to enable or disable interlace using imageinterlace() function in PHP?
The imageinterlace() function is a built-in PHP function used to enable or disable interlacing in images. Interlacing encodes bitmap images so that partially loaded images display as degraded copies of the entire image, allowing users to see portions as the image loads progressively. Non-interlaced JPEGs appear line-by-line during loading, while interlaced images show a blurred version that becomes clearer. This function controls this behavior by setting the interlace parameter to 1 (enable) or 0 (disable). Syntax int imageinterlace(resource $image, int $interlace) Parameters The imageinterlace() function accepts two parameters: ...
Read MoreWhat is a segmentation fault in C/C++?
A segmentation fault (commonly called "segfault") occurs when your program attempts to access an area of memory that it is not allowed to access. In other words, when your program tries to access memory that is beyond the limits that the operating system allocated for your program. Segmentation faults are one of the most common runtime errors in C programming and cause the program to terminate immediately with an error message. Common Causes Seg faults are mostly caused by pointers that are − Used without being properly initialized. Used after the memory they point to ...
Read MoreHow to set a single pixel using imagesetpixel() function in PHP?
The imagesetpixel() function is an inbuilt PHP function used to set a single pixel at a specified coordinate in an image. It's part of the GD library extension and requires the image to be an image resource. Installation: Ensure the GD extension is enabled in your PHP installation. Most PHP installations include it by default. Syntax bool imagesetpixel(resource $image, int $x, int $y, int $color) Parameters The imagesetpixel() function accepts four parameters: $image − The image resource to work on, created by functions like imagecreate() or imagecreatefromjpeg(). $x − ...
Read MoreHow to debug a core in C/C++?
A process dumps core when it is terminated by the operating system due to a fault in the program. The most typical reason this occurs is that the program accessed an invalid pointer value like NULL or some value out of its memory area. As part of that process, the operating system tries to write debugging information to a file to allow us to analyze what happened. Prerequisites Installation Requirements: Install GDB debugger: sudo apt-get install gdb (Ubuntu/Debian) or yum install gdb (CentOS/RHEL) Enable core dumps: ulimit -c unlimited Compile programs with debug symbols: gcc -g ...
Read MoreHow to set the image thickness for line drawing using imgesetthickness() function in PHP?
imagesetthickness() is an inbuilt function in PHP that is used to set the thickness for line drawing. Syntax bool imagesetthickness($image, $thickness) Parameters imagesetthickness() accepts two parameters − $image and $thickness. $image − This parameter is returned by an image creation function such as imagecreatetruecolor(). It is used to create the size of an image. $thickness − This parameter sets the thickness ...
Read MoreWhat does int argc, char *argv[] mean in C/C++?
In C programming, int argc and char *argv[] are parameters of the main function that allow your program to receive command-line arguments when executed. argc stands for argument count and argv stands for argument vector (or argument values). Syntax int main(int argc, char *argv[]) { // Program code return 0; } Parameters argc − An integer representing the number of command-line arguments passed to the program (including the program name itself) argv[] − An array of character pointers (strings) containing the actual command-line arguments ...
Read MoreHow to draw a text string image horizontally by using imagestring() function in PHP?
The imagestring() function is a built-in PHP function used to draw a text string horizontally on an image. It requires the GD extension to be enabled for image manipulation. Installation: Ensure PHP GD extension is installed and enabled in your PHP configuration. Syntax bool imagestring($image, $font, $x, $y, $string, $color) Parameters The imagestring() function accepts six parameters − $image − An image resource created by functions like imagecreate() or imagecreatetruecolor(). $font − Font size ranging from 1 to 5 for built-in fonts (1 is smallest, 5 is largest). $x ...
Read More