C++ :: Some Algorithms For Compressing Images?

Feb 16, 2014

RLE(Run Length Encoding)
using namespace std;
class Bitwriter{
private:

[Code]....

View 1 Replies


ADVERTISEMENT

C/C++ :: Analysis And Evaluation Algorithms?

Mar 25, 2015

#include <iostream>
#include <vector>
#include <list>

[Code].....

The problem is it's not finding the shortest path.

View 1 Replies View Related

C :: Time Scheduling Algorithms Program

Jan 20, 2014

I am an IT college student and this is a self-assigned project i have done in an attempt to learn programming in C AND at the same time how time scheduling of an OS works (Both done in order to prepare for upcoming semester exams) using FCFS ,SJF, RR and PS algorithms (planning on adding SRT too sometime soon). (took me 9 hours total work time including validations). What i wanna know is from more seasoned coders if i am on the right track. *cross fingers*

Code:

#include <stdio.h>
#include <stdlib.h>
#define P_Q 1000

int main(int argc, char *argv[])
{
float min_value,
}

[code]....

View 11 Replies View Related

C++ :: Text Editor Printing Algorithms?

Mar 26, 2013

They should apply for: backspace, return, regular char input, vertical scrolling. There is only one buffer, and it is not allowed to side scroll past max col, instead it must scroll down, appending the line cur_y + 1.

View 4 Replies View Related

C/C++ :: Sorting Algorithms And Comparison Count

Jan 30, 2014

I am trying to count the number of comparisons for each of the following sorting algorithms, Selection, Insertion, Bubble, Merge, and Quick sort. This is using an array of numbers that are sorted, reversed, and randomly arranged.

I currently increment the "number of comparison" variable before every conditional statement that compares two numbers and am getting the following results:

Number of Items in Array = 100
Selection: random = 5049; reverse = 5049; sorted = 5049;
Insertion: random = 2640; reverse = 5049; sorted = 99;
Bubble: random = 9207; reverse = 9900; sorted = 99;
Merge: random = 1221; revere = 988; sorted = 1028;
Quick: random = 690; revere = 587; sorted = 636;

View 1 Replies View Related

Visual C++ :: Analysis And Evaluation Algorithms

Mar 25, 2015

Undirected graph G = {V, E} is given by the list next to the DS. Let u, v of V. Construction of two paths algorithm A1 (u, v) and A2 (u, v) such that no edge in common and have the shortest total length.

View 1 Replies View Related

C++ :: Multi-level Algorithms For Date-driven Scheduling

Apr 18, 2012

What is Multi-level algorithms for date-driven scheduling?

View 8 Replies View Related

C++ :: Output Compiled Script Into Binary File - Scripting Tool Algorithms

Dec 25, 2014

I am working on a script compiler that must output compiled script into binary file. Compiling etc is not a problem. The problem is detecting some specific cases. Nothing seems to work. If it works, then it breaks as soon as i modify the script.

Here is example "script1":

Code:
1VAR1 c1 = 44
2VAR2 c2 = 66
3beginscript
4if(c1=44)
5do_nothing

[Code] ....

Second example "script2", when there can be also some command between ENDIF and ENDIF. In this case: do_nothing command.

Code:
1VAR1 c1 = 44
2VAR2 c2 = 66
3beginscript
4if(c1=44)
5do_nothing

[Code] ....

The INDEXES before each line are not in actual script. They are just to point YOU to specific lines. Although the INDEXes are in compiled script!! This is very important. As you see there can be simple IF_ENDIF and nested (more complex) IF_ENDIF.

i.e IF_ENDIF inside another IF_ENDIF.

There are also IF_ELSE_ENDIF and some other ones, but im trying to make simple IF_ENDIF work first.

ENDIF is "SPECIAL" command, the IF, DO_NOTHING are "usual" commands.

"Usual" commands must always jump over(!) the ENDIF. ALWAYS!!

They must "ignore" them!

One strong RULE is like this for usual commands: always jump over any ENDIF, not matter what. If there is one, two or more ENDIF's in a row, then just jump over them to the closest NEXT usual block command. If there is some "usual" block command between multiple ENDIFs, then jump to this command and this command must therefore check whats next command right after it. And do the same: check if next command is ENDIF, if yes, jump over it, until "usual" block command is found.

This is the place im stuck. When i some time ago thinked about some ideas, i saw some patterns. One of them was that: Seems like if its nested IF_ENDIF, then every usual block command jumps out of it, i.e. right after the final ENDIF of this current nested IF_ENDIF.

But as soon as i added do_nothing between the two ENDIFs the so called "pattern" broke. In script2 above you see index 11 is do_nothing. Ok its in nested IF_ENDIF it should jump out to command index 17. But no, because there is do_nothing between index 13 and 16. If we jump out at index 11, the command 14 would never execute. This is a BIG NO. One idea i was thinking and trying was to use STL::FIND, STL::FIND_IF to find next "usual" command after specific index. But my code seems to crash sometimes and not work always.

Code:
bool NextNonENDIF(int i) {
return (i!=98);
}
int findNextBlockCmd(vector<int>&vec, int curidx)

[Code] ....

Here i pass him the vector that contains all the command TYPES in current script. Each command has its own TYPE or better called unique ID in which way compiler knows what is what. So in this case im trying to find a command thats NOT "ENDIF", in other words im trying to find next usual command after specific type of command. Lets just say the TYPE or unique ID of do_nothing is 555, im trying to find it.

How i should continue with this? What to use maybe stl::stack, some custom command indexing, some sort of labelling for usual commands in nested IF_ENDIFs or what?

In general, look script2, and i ask: There is index 11, this guy should look if there is any usual block command left for him before the final ENDIF at index 16. If there is, jump to it. If there is none, jump out of this nested IF_ENDIF to index 17.

Question: how to do it? What algorithms to use? I can use STL, BOOST, whatever. And i can use C++11.

View 1 Replies View Related

C++ :: Images Don't Display?

Oct 6, 2013

My code is:

#include <iostream>
#include <string>
#include <cstdlib>

[Code]....

The problem is that the images don't display and the window doesn't respond.

View 5 Replies View Related

C :: Library For Loading Images In PNG?

Jan 29, 2015

What's the best performance library for loading images in PNG?

View 5 Replies View Related

C :: How To Import Images In Program

Feb 21, 2013

I want to import images in my program and what function I will use.

Compiler: Turboc 3.0

View 2 Replies View Related

C++ :: How Does SDL Load Bitmap Images

Apr 8, 2013

I don't mean how do I load a bmp, I mean how does SDL manage to do this?

View 2 Replies View Related

C++ :: SDL Rotating Images Function

Jun 9, 2013

Since SDL doesn't have it's own function for rotating images and I'm tired of storing multiple angles of the same sprite in a file, I created my own function for doing so:

//XY Class
class XY {
public:
XY(){}
XY(float x, float y);

[Code] ....

The problem is while Spin does spin the surface correctly, some pixels are rotated to the same new position so gaps appear in the returned surface. I need a way of filling in the gaps so the returned image looks better. A link to a program I made that uses this function is below so you can see the problem that I'm talking about. [URL] ....

I currently use SDL 1.2. Could my problem be fixed if I used 2.0? For example, does SDL 2.0 have a built in function for rotating surfaces?

View 3 Replies View Related

C++ :: Read Images From Database

May 3, 2013

I have a database of images and I want to store paths of all those images to a text file (lets say "images.txt"). I can then use this text file in c++ to extract images one by one by using getline() in a loop.

I don't know how to store image paths to a text file.

View 4 Replies View Related

C# :: How To Store Images In Folder

Nov 24, 2014

I want to store the images in folder.... but I don't know how to do it

View 7 Replies View Related

C++ :: Can Integrate Images Into Program?

Sep 10, 2013

The question is pretty simple. I'd like to integrate an image into a C++ program.

View 11 Replies View Related

C/C++ :: How To Send Many Images Through Socket

Jun 25, 2012

I have written a socket witch send an image 256x256 and now i want to send many images and i don't know what loop to write to make the socket after have sent the first image to send another and not to write the same program many times for every image ......

this is the part that read the binary image

if( !(fp=fopen("Anemos.bmp","rb"))) {
            printf("Unable to load bin file: %s...
","Anemos.bmp");

[Code] ....

View 2 Replies View Related

Visual C++ :: How To Read Images In GDI Or GDI+

Jul 3, 2014

I am working on application to work with images. How to open/read images, whether it is jpeg, png, bmp or tiff and get it to bitmap. Is there some universal command for this or I will need more commands, every time testing the extension or format and then to use different method to read the image? Best would be to do it automatically, but I don't know such command.

View 8 Replies View Related

C++ :: How To Assign A Rectangle To Images

Apr 26, 2012

I am making a game Pong, and have been struggling with the collision aspect between the baal hitting off the paddle. I have created a Class, to draw a rectangle, to work with collision however I dont know how to assign the rectangle to the images of the ball and paddle.

#include "stdafx.h"
#include <iostream>
#include <time.h>
#include <vector>
#include <cmath>
#include "gwin.h"
const int NUMBEROFBALLS = 1;

[Code] .....

View 1 Replies View Related

C++ :: Extract Some Images From ADF Files

Jul 31, 2013

Its to extract some images from .adf files, I have had it working about 2 years ago but now i cant figure out the right directory.

Code:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
namespace ADFReader{
class Program {
public static int ApplyOffset(int data, int offset)
[Code] ...

The main problem is

Code:
static void Main(string[] args) {
foreach (string file in Directory.GetFiles(@"data", "*.adf")) ;
{
byte[] bytes = File.ReadAllBytes(file);

[Code] .....

View 1 Replies View Related

C++ :: Compile Images (PNG Files) Into Application

Jun 19, 2014

I am currently coding a 2D game in Visual Studio 2013. All of the .png graphics are saved in an absolute directory (for example, "C:/gfx/example.png"). Although this works for testing the application on my own system, I would one day like to release it (although it won't be commercial, as I am just learning). I could put all the of the image files in a relative folder, but I do not like the idea of my graphics being out in the open like that.

Is it possible to compile these images into the application itself? I had been researching resource files on Google, but I am still not completely sure if this is what I need to be using. Even if it is, I am using the express version of VS, so I do not have access to the editor. If resource files are what I am looking for, do I have to purchase an upgraded version of Visual Studio, or can I use another editor?

View 9 Replies View Related

C++ :: Transfer Files (mainly Images) Between 2 Computers?

Oct 1, 2014

I need to transfer files(mainly images) between 2 computers using their RAM with some kind of FTP. I'm using C++. I guess it's pretty a lot to explain so if you have a clear and detailed articles/videos

View 8 Replies View Related

C# :: Manipulating Images Colors With ColorMatrix?

Feb 6, 2015

I found this elegant looking code on the net that claims to be able to manipulate an images colors using ColorMatrix.

When I run it, it does nothing! I used the code exactly as is with no editing, except to feed it my own image to do its work.

private void ApplySaturation(float saturation) {
float rWeight = 0.3086f;
float gWeight = 0.6094f;
float bWeight = 0.0820f;
float a = (1.0f - saturation) * rWeight + saturation;

[code].....

View 8 Replies View Related

C# :: Store Images In Database As Well As In Folder

Nov 10, 2014

storing images in database as well as in folder...Images are loaded FROM URL...and after that i want to display Images from folder which is in given below code: but this code is not running...it shows sql connection problem.....but connection is perfect...This code runs properly but it doesn't shows the images from folder...and It doesn't save the images...

using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;

[code]....

View 2 Replies View Related

C Sharp :: How To Add Forward And Back Images

Feb 14, 2013

I want to change this code in c#.net.. But I am unable to do this.. i get error when i tried to session in some variable and when try to + it.

Code id (
Dim A As Integer = Session("Id")  
        p.Value = A + 1)

complete code is
cmd.CommandType = Data.CommandType.StoredProcedure
        cmd.CommandText = "[Netx_Image]"  
        Dim p As New SqlParameter

[Code] .....

View 1 Replies View Related

C++ :: Save Images In Database Or File System?

Aug 22, 2014

Which is best option to save images in database or file system, I am developing c++ server client app. I want to save the images in server using file system or database. I am confusing to choose which option?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved