473,791 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please, I need a little help of a "coloured guru".

rmn
Hi,

I'm looking for the translation betwen the color spaces, but I must be
mistaken with the methods to use, losing the values.
Please, I need a little help of a "coloured guru".
-----------------------------------------------------
import java.awt.*;
import java.awt.image. ColorModel;
import java.awt.color. ColorSpace;
.... ....
.... ...

float[] xyz={0,0,0,0};
float[] cmk={0,0,0,0};
Color rbg=new Color(0.5f,0.5f ,0.5f);
try{

ColorSpace cS=ColorSpace.g etInstance(Colo rSpace.TYPE_CMY K);
ColorSpace cE=ColorSpace.g etInstance(Colo rSpace.CS_CIEXY Z);
// to go from RGB to CIEXYZ color spaces, and then, from this to CMYK

rbg.getColorCom ponents(cE,xyz) ;
Color cie=new Color(cE,xyz,0) ;
cie.getColorCom ponents(cS,cmk) ;

}catch(Interrup tedException e){
System.out.prin tln("no va");
}
finally{
System.out.prin tln("RGB..."+rb g.toString()); // shows rgb values
System.out.prin t("CIE...");
System.out.prin tln(xyz[0]+"\t"+xyz[1]+"\t"+xyz[2]+"\t"+xyz[3]);
shows 0.0 0.0 0.0 0.0 ...
System.out.prin t("CMYK...");
System.out.prin tln(cmk[0]+"\t"+cmk[1]+"\t"+cmk[2]+"\t"+cmk[3]);
shows 0.0 0.0 0.0 0.0 ...
}
----------------------------------------------------- ; (thanks in
advance)




Jul 17 '05 #1
2 2706
rmn wrote:
Hi,

I'm looking for the translation betwen the color spaces, but I must be
mistaken with the methods to use, losing the values.
Please, I need a little help of a "coloured guru".


Hey! Caucasians are smart too!

-Peter
Jul 17 '05 #2
rmn

Hi,

I'm looking for the translation betwen the color spaces, but I must be
mistaken with the methods to use, losing the values.

ramon.
----------------------------------------------------- (thanks in advance)
import java.awt.*;
import java.awt.image. ColorModel;
import java.awt.color. ColorSpace;
.... ....
.... ...

float[] xyz={0,0,0,0};
float[] cmk={0,0,0,0};
Color rbg=new Color(0.5f,0.5f ,0.5f);
try{

ColorSpace cS=ColorSpace.g etInstance(Colo rSpace.TYPE_CMY K);
ColorSpace cE=ColorSpace.g etInstance(Colo rSpace.CS_CIEXY Z);
// to go from RGB to CIEXYZ color spaces, and then, from this to CMYK

rbg.getColorCom ponents(cE,xyz) ;
Color cie=new Color(cE,xyz,0) ;
cie.getColorCom ponents(cS,cmk) ;

}catch(Interrup tedException e){
System.out.prin tln("no va");
}
finally{
System.out.prin tln("RGB..."+rb g.toString()); // shows rgb values
System.out.prin t("CIE...");
System.out.prin tln(xyz[0]+"\t"+xyz[1]+"\t"+xyz[2]+"\t"+xyz[3]);
file://shows 0.0 0.0 0.0 0.0 ...
System.out.prin t("CMYK...");
System.out.prin tln(cmk[0]+"\t"+cmk[1]+"\t"+cmk[2]+"\t"+cmk[3]);
file://shows 0.0 0.0 0.0 0.0 ...
}
----------------------------------------------------- (thanks in advance)

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
6406
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but something I'll need in this case is some experience-based set of rules about how to use python in this context. For example... is defining readonly attributes in classes worth the hassle ? Does duck-typing scale well in complex
24
2571
by: Alf P. Steinbach | last post by:
The eighth chapter (chapter 2.1) of my attempted Correct C++ tutorial is now available, although for now only in Word format -- comments welcome! Use the free & system-independent Open Office if you don't have Word. Classes <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_02_01.zip> Introduces the C++ language feature used to define new types, namely classes. The focus in on creating safe and reusable classes. As a main
8
19267
by: H. S. | last post by:
I am getting this error if I try to compile the file demarcated below. What I am missing here? I am using g++ (GCC) 3.3.5 (Debian 1:3.3.5-8). {tp2}> g++ -ansi -g -Wall tp2.cc -o tp2 tp2.cc: In member function `void Other::DoSomething()': tp2.cc:11: error: `int Base::iX' is protected tp2.cc:29: error: within this context // %< %< ----------------------------------- %< %<
4
2766
by: cpptutor2000 | last post by:
Could some C++ guru help me please? I am trying to build an application using gcc 3.2.3, that has a some classes using functions defined in some C files in the same directory. If inside the C++ source file I use: extern "C"{ // C function declarations } //C++ code
6
5512
by: Allan Koch | last post by:
Dear NG, I would like to format a record in a subform, dependent on a value in one field. If one field in the record I show in a subform (datasheet view) is true I like to view that particular row in green, all other rows just as they are normal. Is that possible ? regards Allan
32
2218
by: Axel Bock | last post by:
Hi all, I am trying to get my head around what happens if I return a class object from a function. It seems C++ (MinGW) does not invoke the copy constructor if I do something like this: SomeObj foo() { SomeObj X;
1
3268
by: tkpmep | last post by:
I write data to Excel files using PyExcelerator 0.6.3.a and have done so successfully for small files (10-15 cells). I'm experiencing an error when writing a big chunk of data (10,000 cells) to Excel. By way of comparison, the same data writes perfectly well to a csv file using Python's built in csv module. I run the program in PyScripter, and the traceback shows the following sequence of calls: main (my routine)...
4
1457
by: kimiraikkonen | last post by:
Hi, I have a odd but a known question about listbox. I know listbox control can provide multi-select, multi-extendend selections. But i wonder if this selection type belongs to them or it has another tecnique. As you may know, in softwares like Windows Media Player or Winamp playlist has a listbox and it can be selected in 2 types. First type refers to player's own selection and second selection type can be done by user to look for...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.