« PrécédentContinuer »
DATA AS COLOR COMPONENTS FOR A GIVEN PIXEL OR PIXELS BASED ON COLOR MODEL
OPERATE ON PIXELS COIDR COMPONENTS
TO GENERATE DESTINATION BUFFERED IMAGE
METHOD AND APPARATUS FOR
SEPARATING IMAGE DATA FROM A
COLOR SYSTEM IN IMAGE PROCESSING
BACKGROUND OF THE INVENTION
1. Field of the Invention
This invention relates to the fields of graphics, image processing and object-oriented programming. More particularly, the invention relates to a method and apparatus for separating image data from an image's color system.
2. Background Art
In a computer system, a graphic image is typically comprised of a plurality of individual pixels. Each pixel is assigned a data value that defines the color of a pixel according to a particular color system associated with an image. A color system provides a mechanism for specifying color, and chromaticity, associated with each pixel in the graphic image. A color system consists of a set of components that specify a color in the color system. Each component is assigned a numeric value to express a color. For example, the RGB (Red, Green, Blue) color system consists of red, green and blue components. Three data values are used to express the degree of red, green and blue contributions for each color in the RGB color system. Images are either tightly coupled to a color system such that image data cannot be manipulated independent of the image's color system, or images are expressed independent of its color system until the image is rendered thereby making it impossible to manipulate an image in its color system.
Current software image processing applications or programs do not facilitate manipulation of an image based on the requirements of each particular image processing operation. That is, current systems either always associate the color system with image data or always disregard the color system during image processing. This causes inefficiencies in processing in that certain operations are more efficient when performed in terms of a color system while others are more efficient when the color system is ignored. Where the color system is not necessary for the image processing operation, it is wasted overhead. Further, where the color system is unavailable to an image processing operation that uses the color system, unexpected and erroneous results can occur.
Two examples of prior art software image processing systems are the Microsoft Windows and Xll windowing systems. In these systems, an image is defined in terms of an RGB color system which is used to interpret pixel data as color. It is impossible to create an image in these windowing systems without first identifying which portions of pixel data represent which component of the RGB color system.
In Xll, for example, an image may be expressed in the RGB color system using 24-bit image data. That is, the color data for each pixel is stored in 24 bits with each component of the RGB color system being represented in 8 bits. To manipulate an image data in Xll, it is first necessary to define which set of 8 bits represents which component of the color system. For example, the first 8 bits of the 24-bit value associated with a pixel may be assigned to the red component, the next 8 bits to the blue component and the last 8 bits to the green component. Similarly, an image may be expressed in terms of the RGB color system in Microsoft Windows. That is, the image data represents components in a color system. The image data in the Xll and Windows systems cannot be operated upon independent of the color system.
In XIL version 1.2 (a cross-platform C language image processing foundation library containing low-level image
manipulation operators developed by Sun Microsystems, Inc.), a mechanism for associating a color system with image data as the image data is being processed is recognized by only one function (i.e., xil color convert). Thus,
5 for all other operations, it is necessary for the developer to be aware of what operation is being performed and the effect that the operation has on the image's color system. There is no general way, for example, for the developer to guarantee the effect that an operation will have on a component of the
10 image's color system since the operation has no knowledge of the associations between the image data and components of a color system. In XIL version 1.3, a new mechanism to represent a color system is supported, but the color system data is maintained separately from the image data at all
Thus, in prior art image processing systems, the color system is either always tightly coupled to an image, or is always disassociated from the image during image processing operations. This is problematic in that some operations
20 that are to be performed on an image use the color system while other image processing operations can be performed independent of the color system. Prior art systems have no mechanism for processing an image such that it is possible to reference the image in terms of or independent of its color
25 system based on the requirements of the image processing operation.
There is nothing apparent in a particular image operation that indicates whether it operates on input that is tied to the color system. Thus, the developer of an image processing
30 application must be aware of which image processing operations use the color system (e.g., a color conversion) and which operations do not (e.g., rotation). Further, certain operations may be performed more efficiently with a particular color system. Therefore, there are inefficiencies in
35 forcing the developer into a particular color system to process an image. However, as previously discussed, there are drawbacks to having a system in which the image is processed using operations that do not take the color system into account.
In summary, current software image processing applications either tightly couple the color system with the image or disregard the color system during image processing. This causes inefficiencies in processing and causes erroneous
SUMMARY OF THE INVENTION
According to one or more embodiments of the invention, raw image data is separated from the color system used to
50 interpret the image data. Accordingly, for certain image processing operations, image data can be operated on independently of a color system (a technique for specifying colors such as describing a color in terms of red, green and blue components or cyan, magenta, yellow, and black
55 components). Alternatively, image data can be associated with a color system and image processing operations can operate on the image data in terms of the color system.
No color system is presupposed for a given image. When an image processing operation uses a color system, a color
60 system can be selected according to which the operation is performed. Different color systems can be associated with the same image data for different processing operations. For example, a color system may be chosen for performing an operation that allows the operation to be performed more
65 efficiently. Where it is not necessary to perform an image processing operation using a color system, the operation can access the image data independent of any color system.
In an embodiment of the invention, a Tile object class is comprised of an array of Channel objects. A Channel object is associated with one or more bands of image data. A ColorModel object class identifies a color system and specifies a mapping between the raw image data and the color and 5 alpha components of a color system. ABufferedlmage object class is defined that associates a ColorModel with a Tile.
According to one or more embodiments of the invention, a color image is generated from raw image data via the Bufferedlmage object that combines the raw data associated 1° with a Tile object with a ColorModel used to interpret the raw data in terms of a color system. A ColorModel interprets the color meaning of the data such that it is possible to determine which band from the raw data represents which color component of a color system. For example, in the RGB 15 color system, the ColorModel indicates which band or channel of data represents the red component, the green component and the blue component.
An image processing operation that operates on the raw data outside (or independent of) a color system can access 20 the data via the Tile object. An image processing operation that operates within a color system can access the image data via the Bufferedlmage object. One or more classes of objects implement a filter method that operates on either a Bufferedlmage or a Tile. 25
An image operator performs the alterations specified by the particular filtering or image processing operation (e.g., amplitude, scaling, look-up table modification, linear channel combination, color conversion, and convolution). The filtering operation uses a source as input and produces a destination. When performing an operation within a color system, the source and destination are instances of the Bufferedlmage class. The source and destination are instances of the Tile class when the operation is performed outside of a color system.
Two interfaces are defined in embodiments of the invention that are implemented by image processing or filtering object classes. A BufferedlmageOp interface is used for filtering operations performed within a color system. The 4Q BufferedlmageOp interface includes a filter method that identifies a source and destination Bufferedlmage object. Filtering operations that are performed outside a color system use the TileOp interface. The TileOp interface includes a filter method that identifies a source and destination Tile object. An image filter is therefore aware of whether it is operating inside or outside a color system, and can provide either one or both of the BufferedlmageOp and TileOp interfaces.
BRIEF DESCRIPTION OF THE DRAWINGS 50
FIG. 1 provides an example of a general purpose computer that can be used in an embodiment of the invention.
FIG. 2 provides an example of object classes used in embodiments of the invention.
FIG. 3 provides an example of the use of an arbitrary number of channels according to an embodiment of the invention.
FIG. 4 provides an overview of an image processing operation according to an embodiment of the invention. g0
FIG. 5 illustrates an image processing flow according to an embodiment of the invention.
FIG. 6 illustrates an image processing flow within a color system according to an embodiment of the invention.
FIG. 7 illustrates a flow for performing an image pro- 65 cessing operation outside a color system according to an embodiment of the invention.
DETAILED DESCRIPTION OF THE
A method and apparatus for separating image data from a color system in image processing is described. In the following description, numerous specific details are set forth in order to provide a more thorough description of the present invention. It will be apparent, however, to one skilled in the art, that the present invention may be practiced without these specific details. In other instances, well-known features have not been described in detail so as not to obscure the invention.
Embodiment of Computer Execution Environment (Hardware)
An embodiment of the invention can be implemented as computer software in the form of computer readable program code executed on a general purpose computer such as computer 100 illustrated in FIG. 1. A keyboard 110 and mouse 111 are coupled to a bi-directional system bus 118. The keyboard and mouse are for introducing user input to the computer system and communicating that user input to central processing unit (CPU) 113. Other suitable input devices may be used in addition to, or in place of, the mouse 111 and keyboard 110. I/O (input/output) unit 119 coupled to bi-directional system bus 118 represents such I/O elements as a printer, A/V (audio/video) I/O, etc.
Computer 100 includes a video memory 114, main memory 115 and mass storage 112, all coupled to bidirectional system bus 118 along with keyboard 110, mouse 111 and CPU 113. The mass storage 112 may include both fixed and removable media, such as magnetic, optical or magnetic optical storage systems or any other available mass storage technology. Bus 118 may contain, for example, thirty-two address lines for addressing video memory 114 or main memory 115. The system bus 118 also includes, for example, a 32-bit data bus for transferring data between and among the components, such as CPU 113, main memory 115, video memory 114 and mass storage 112. Alternatively, multiplex data/address lines may be used instead of separate data and address lines.
In one embodiment of the invention, the CPU 113 is a microprocessor manufactured by Motorola, such as the 680X0 processor or a microprocessor manufactured by Intel, such as the 80X86, or Pentium processor, or a SPARC microprocessor from Sun Microsystems. However, any other suitable microprocessor or microcomputer may be utilized. Main memory 115 is comprised of dynamic random access memory (DRAM). Video memory 114 is a dualported video random access memory. One port of the video memory 114 is coupled to video amplifier 116. The video amplifier 116 is used to drive the cathode ray tube (CRT) raster monitor 117. Video amplifier 116 is well known in the art and may be implemented by any suitable apparatus. This circuitry converts pixel data stored in video memory 114 to a raster signal suitable for use by monitor 117. Monitor 117 is a type of monitor suitable for displaying graphic images.
Computer 100 may also include a communication interface 120 coupled to bus 118. Communication interface 120 provides a two-way data communication coupling via a network link 121 to a local network 122. For example, if communication interface 120 is an integrated services digital network (ISDN) card or a modem, communication interface
120 provides a data communication connection to the corresponding type of telephone line, which comprises part of network link 121. If communication interface 120 is a local area network (LAN) card, communication interface 120 provides a data communication connection via network link
121 to a compatible LAN. Wireless links are also possible.