Method and system for managing color specification using attachable palettes and palettes that refer to other palettes
First Claim
Patent Images
1. In a computer including a processor, system memory, and a display controller, a method for managing color palettes, the method comprising:
- creating a first palette having n entries representing colors that are a subset of a color space comprising k colors;
creating a second palette having m entries representing colors that are a subset of the color space, where n, m, and k are integers, m is less than k, and n is less than m;
associating the second palette with a primary surface comprising an array of indices to the second palette that are read by the display controller and converted to a display image, wherein the second palette includes plural numbered entries, and wherein an index to the second palette is a number of one of said plural numbered entries of the second palette;
copying the entries in the second palette to a color table in the display controller;
storing indices to the second palette in the first palette, wherein the colors represented in the first palette are a subset of the colors represented in the second palette, and whereby an entry in the first palette has the same format as an index to the second palette;
associating the first palette with a first pixmap, where the first pixmap comprises an array of pixels values that are indices into the first palette;
transferring at least part of the first pixmap to a specified location in the primary surface;
during the transferring step, converting pixel values in the part of the first pixmap being transferred to indices into the second palette by using the pixel values in the first pixmap as indices to look up entries in the first palette that store indices to the second palette and replacing the pixel values from the first pixmap with the indices to the second palette obtained from the entries of the first palette; and
during the transferring step, storing converted pixel values into the specified location in the primary surface.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for managing color specification in a display device interface for a computer. The display device interface includes services to create palettes, to associate palettes with on or off screen surfaces such as sprites, overlays and textures, and to manipulate the entries in palettes. A method for managing color specification includes creating a palette that stores indices to another palette.
-
Citations
14 Claims
-
1. In a computer including a processor, system memory, and a display controller, a method for managing color palettes, the method comprising:
-
creating a first palette having n entries representing colors that are a subset of a color space comprising k colors; creating a second palette having m entries representing colors that are a subset of the color space, where n, m, and k are integers, m is less than k, and n is less than m; associating the second palette with a primary surface comprising an array of indices to the second palette that are read by the display controller and converted to a display image, wherein the second palette includes plural numbered entries, and wherein an index to the second palette is a number of one of said plural numbered entries of the second palette; copying the entries in the second palette to a color table in the display controller; storing indices to the second palette in the first palette, wherein the colors represented in the first palette are a subset of the colors represented in the second palette, and whereby an entry in the first palette has the same format as an index to the second palette; associating the first palette with a first pixmap, where the first pixmap comprises an array of pixels values that are indices into the first palette; transferring at least part of the first pixmap to a specified location in the primary surface; during the transferring step, converting pixel values in the part of the first pixmap being transferred to indices into the second palette by using the pixel values in the first pixmap as indices to look up entries in the first palette that store indices to the second palette and replacing the pixel values from the first pixmap with the indices to the second palette obtained from the entries of the first palette; and during the transferring step, storing converted pixel values into the specified location in the primary surface. - View Dependent Claims (2, 3, 4)
-
-
5. A display device interface in a computer for controlling a display controller, wherein the display controller has a color table for storing color values and is operable to convert indexed pixel values into color values while generating a display image, the display device interface comprising:
-
a create surface function responsive to a function call from an application program for creating surface structures representing surface memory for storing pixmaps, the surface structures including a primary surface structure representing a region in memory that is read by the display controller to generate the display image, the surface structures further comprising one or more secondary surface structures for storing pixmaps; a create palette function responsive to a function call from the application program for creating palette structures for representing palettes; and a set palette function responsive to a function call from the application program for attaching the palette structures created by the create palette function to a specified surface structure created by the create surface function, the set palette function operable to set entries in the color table of the display controller to entries in a palette associated with the primary surface structure. - View Dependent Claims (9)
-
-
6. In a display device interface for controlling a display controller in a computer, where the display controller has a color table for converting pixel values in a primary surface to color values while generating a display image on a display monitor from the primary surface, a computer implemented method for managing palettes comprising:
-
in response to a first create surface call, creating a surface structure representing the primary surface; in response to a first create palette call, creating a first palette structure to represent a first palette having m entries; storing color values in the m entries of the first palette; in response to a first set palette call, specifying the first surface structure and the first palette structure, attaching the first palette structure to the surface structure and setting entries in the color table to correspond to entries in the first palette; in response to a second create palette call creating a second palette structure to represent a second palette, where the second palette has n entries; storing indices to the first palette in the n entries; in reponse to a second create surface call, creating a second surface structure representing a surface; in reponse to a second set palette call specifying the second surface structure and the second palette structure, attaching the second palette to the second surface structure; and in response to a request to bit block transfer a region in the second surface to the primary surface, decoding pixel values in the region of the second surface by using the pixel values in the second surface to look up entries in the second palette that store indices to the first palette, replacing the pixel values from the second pixmap with the indices to the first palette obtained from the entries of the second palette and placing the decoded pixel values in the primary surface, where the decoded pixel values represent indices to entries in the second palette. - View Dependent Claims (8, 10, 11)
-
-
7. In a display device interface for controlling a display controller in a computer, where the display controller has a color table for converting pixel values in a primary surface to color values while generating a display image on a display monitor from the primary surface, a computer implemented method for managing palettes comprising:
-
creating a primary surface structure to represent the primary surface; storing a pointer to the primary surface in the primary surface structure; in response to a request from an application to create a surface, allocating a region of pixel memory, creating a surface structure to represent the region, and storing a pointer to the pixel memory in the surface structure; in response to a request from the application to create a palette, creating a palette, creating a palette structure to represent the palette, and storing entries in the palette; in response to a request from the application to associate the palette with the primary surface, attaching the palette structure to the primary surface structure, and setting entries in the color table to correspond to the entries in the palette; and in response to a request to transfer pixels in the surface to the primary surface, determining whether the surface has an associated palette, and when the surface does not have an associated palette, transferring the pixels in the surface to the primary surface using the palette associated with the primary surface as a default palette. - View Dependent Claims (12, 13)
-
-
14. In a computer including a processor, system memory, and a display controller, a method for managing color palettes, the method comprising:
-
creating a first source palette having n entries representing colors that are a first subset of a color space; creating a second source palette having p entries representing colors that are a second subset of the color space, wherein the second subset is different from the first subset; creating an intermediate palette having m entries representing colors that are a subset of the color space, where n, p, and m are integers, n is less than m, and p is less than m; associating the intermediate palette with a primary surface comprising an array of indices to the intermediate palette that are read by the display controller and converted to a display image, wherein the intermediate palette includes plural numbered entries, and wherein an index to the intermediate palette is a number of one of said plural numbered entries of the intermediate palette; copying the entries in the intermediate palette to a color table in the display controller; storing indices to the intermediate palette in the first and second source palettes, wherein the colors represented in the source palettes are also represented in the intermediate palette, and whereby entries in the source palettes have the same format as indices to the intermediate palette; associating the first source palette with a first pixmap, where the first pixmap comprises an array of pixels values that are indices into the first source palette; associating the second source palette with a second pixmap, where the second pixmap comprises an array of pixels values that are indices into the second source palette; transferring at least part of the first pixmap to a first specified location in the primary surface; during the transferring step, converting pixel values in the part of the first pixmap being transferred to indices into the intermediate palette by using the pixel values in the first pixmap as indices to look up entries in the first source palette that store indices to the intermediate palette, and replacing the pixel values from the first pixmap with the indices to the intermediate palette obtained from the entries of the first source palette; during the transferring step, storing converted pixel values into the first specified location in the primary surface; transferring at least part of the second pixmap to a second specified location in the primary surface; during the transferring step, converting pixel values in the part of the second pixmap being transferred to indices into the intermediate palette by using the pixel values in the second pixmap as indices to look up entries in the second source palette that store indices to the intermediate palette, and replacing the pixel values from the second pixmap with the indices to the intermediate palette obtained from the entries of the second source palette; and during the transferring step, storing converted pixel values into the second specified location in the primary surface.
-
Specification