Questions tagged [scanline]
47 questions
2
votes
1 answer
Paint PNG image on other PNG
How to merge two PNG's together? I know that you can't use PNGObject.Draw because it doesn't copy alpha transaperncy (I am not sure but it doesn't work anyway) so custom procedure/function is needed. I didn't come with empty hands, I have this…

Little Helper
- 2,419
- 9
- 37
- 67
1
vote
1 answer
Fast way of swapping Red/Blue bytes using ScanLine
Currently, I loop the Canvas.Pixels[] property and read each pixel on a canvas to swap Red/Blue bytes around (for specific reasons). However, it takes an average of 2 seconds per picture, and I have over 8,000 pictures I need to convert (overnight).…

Jerry Dodge
- 26,858
- 31
- 155
- 327
1
vote
1 answer
Task about pairs of points and segments
Can you help me with problem? Given N <= 10^5 pairs of points, suppose they are written in
array A, A[i][0] <= A[i][1]. Also, given M <= 10^5 pairs of segments, i-th pair given in form L_1[i], R_1[i], L_2[i], R_2[i]. For each pair of segments I need…

master
- 13
- 3
1
vote
1 answer
Inverting a bitmap in Embarcadero C++Builder
The same problem happens in Borland C++Builder 6 and Embarcadero C++Builder 2010.
When I try to invert an image, the form freezes for about 5 seconds and nothing happens. When I click again, the image is inverted within a blink of an eye, and again,…

hennep
- 545
- 4
- 12
1
vote
0 answers
How can I get the whole polygon colored from this code?
Following is code of computer graphics concept Scanline algorithm but instead of polygon the other plane is getting colored how can I fix it?
import javax.swing.*;
import java.awt.*;
public class CG4 extends JFrame {
int m1 = -1,m2 = 0,m3 = 2;
…

Prasenjit Hiwale
- 33
- 1
- 3
1
vote
2 answers
problem with graphics.h in visual studio 2010
i am writing a simple program actually implementing scan line algorithm in C++ using Visual Studio 2010. but i am getting an error saying graphics.h file can not be found. can anybody tell me how to solve that problem? or any other way(without using…

Keshan
- 14,251
- 10
- 48
- 72
1
vote
2 answers
How does this "common idiom" actually work?
Looking at documentation for golang's 2D slices and cannot understand the syntax used in the last example:
func main() {
XSize := 5
YSize := 5
// Allocate the top-level slice, the same as before.
picture := make([][]uint8, YSize) //…

Jonathan
- 5,736
- 2
- 24
- 22
1
vote
1 answer
Scanline algorithm: calculate x of edges
I'm trying to implement the scanline algorithm in Javascript. It looks like my calculation of x is wrong as the lines are to short or to long.
These edges should be filled:
This is how my scanline code fills it:
My edge table has these…

Michael
- 2,528
- 3
- 21
- 54
1
vote
1 answer
Scanline algorithm: how to calculate intersection points
I have to implement a scanline algorithm from our professor but I don't really understand how I get the intersection points from the scanline with a polygon.
Here is the algorithm:
I implemented my own polygon(with methods like paint(), contains()…

Peter
- 1,679
- 2
- 31
- 60
1
vote
1 answer
scanline: finding intersection points
I want to fill a polygon with the scanline algorith. for this I have to know all points where the scanline comes in contact with the polygon.
I wrote a loop for this, but its obviously not working (it never adds a point to the list which means it…

Peter
- 1,679
- 2
- 31
- 60
1
vote
1 answer
How to scanline in 1D barcode region?
I need to scanline the region of interest for my image to check that it includes 1D barcode or not. Can anyone help me in how to implement this?Any relevant function ?

user3979
- 23
- 1
- 3
1
vote
1 answer
Scanline Algorithm
I am stuck in the midway(or at the start you can say) while implementing scanline algo.
I follow parity test i.e.,
for each scanline
edgeCnt = 0;
for each pixel on scanline (l to r)
if (oldpixel->newpixel crosses edge)
edgeCnt ++;
// draw…

user1744119
- 21
- 5
0
votes
1 answer
I wants to read rows of gray scale Image into an array of integer for processing in Qt
I have one Gray scale image, which I wants to read row by row and process( to find the median)
I created one QImage by loading the file. Then I used scanline(x) to read the row. But I am getting some wrong values( hope values should be 0-256).…

Shibs
- 1
0
votes
1 answer
scanline function in qimage class
I'm developing application for editing raster graphic. In this application I have to create scanline function which will do same thing as scanline function in QImage class.
But I'm little confused with the way that scanline function works and with…

Mirzet
- 1
- 1
- 1
0
votes
0 answers
Reading compressed EXR scan-line files by loading one scanline at a time into memory
I have some compressed EXR scan-line files that are unable to be read using minexr (shows error assert self.compr == 0x00, 'Compression not supported.'). Additionally, I want to read them one scanline at a time, so as to not overload memory. On the…

Ahmad Uzzam Masood
- 23
- 6