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.getInstance(ColorSpace.TYPE_CMYK);
ColorSpace cE=ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
// to go from RGB to CIEXYZ color spaces, and then, from this to CMYK
rbg.getColorComponents(cE,xyz);
Color cie=new Color(cE,xyz,0);
cie.getColorComponents(cS,cmk);
}catch(InterruptedException e){
System.out.println("no va");
}
finally{
System.out.println("RGB..."+rbg.toString()); // shows rgb values
System.out.print("CIE...");
System.out.println(xyz[0]+"\t"+xyz[1]+"\t"+xyz[2]+"\t"+xyz[3]);
shows 0.0 0.0 0.0 0.0 ...
System.out.print("CMYK...");
System.out.println(cmk[0]+"\t"+cmk[1]+"\t"+cmk[2]+"\t"+cmk[3]);
shows 0.0 0.0 0.0 0.0 ...
}
----------------------------------------------------- ; (thanks in
advance) 2 2687
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
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.getInstance(ColorSpace.TYPE_CMYK);
ColorSpace cE=ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
// to go from RGB to CIEXYZ color spaces, and then, from this to CMYK
rbg.getColorComponents(cE,xyz);
Color cie=new Color(cE,xyz,0);
cie.getColorComponents(cS,cmk);
}catch(InterruptedException e){
System.out.println("no va");
}
finally{
System.out.println("RGB..."+rbg.toString()); // shows rgb values
System.out.print("CIE...");
System.out.println(xyz[0]+"\t"+xyz[1]+"\t"+xyz[2]+"\t"+xyz[3]);
file://shows 0.0 0.0 0.0 0.0 ...
System.out.print("CMYK...");
System.out.println(cmk[0]+"\t"+cmk[1]+"\t"+cmk[2]+"\t"+cmk[3]);
file://shows 0.0 0.0 0.0 0.0 ...
}
----------------------------------------------------- (thanks in advance) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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++...
|
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...
|
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:
...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |