basti_help
Grünschnabel
mhh die werte sollen ja automatisch weitergegeben werden vom einlese eines Bilder
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
unsigned char byte;
float r, g, b;
while (true) {
if (file >> byte) r = byte;
else break;
if (file >> byte) g = byte;
else break;
if (file >> byte) b = byte;
else break;
if (!file >> byte) break; /* ein Byte muß man überlesen, da auf 4 Byte ausgerichtet ist */
RGBtoHSV (r, g, b, h, s, v);
}
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int x, y;
double R, G, B, Max, Min, H, S, V, r, g, b;
unsigned char* pData;
// read the image
bool bSuccess = ReadBmp( "C:/P1000825.bmp", x, y, pData );
if ( bSuccess == false )
{
cout << "*Error loading image!*" << endl;
return 1;
}
cout<<"R Wert";
cin>>r;
cout<<"G Wert";
cin>>g;
cout<<"B Wert";
cin>>b;
R = r / 256.0;
G = g / 256.0;
B = b / 256.0;
if(R > G && R > B)Max = R;
if(G > R && G > B)Max = G;
if(B > G && B > R)Max = B;
if(R < G && R < B)Min = R;
if(G < R && G < B)Min = G;
if(B < G && B < R)Min = B;
if(R = Max)H = 0 + (G - B) / (Max - Min);
if(G = Max)H = 2 + (B - R) / (Max - Min);
if(B = Max)H = 4 + (R - G) / (Max - Min);
if(H < 0) H = H + 360;
S = (Max- Min) / Max;
V = Max;
cout<<H<< endl;
cout<<S<< endl;
cout<<V<< endl;
// write the image
if ( WriteBmp( "output.bmp", x, y, pData ) == false )
{
cout << "*Error writing image!*" << endl;
return 1;
}
fgetchar ();
return 0;
}