API java : ImageConsumer


java.awt.image
Interface ImageConsumer

All Known Implementing Classes:
AreaAveragingScaleFilter, BufferedImageFilter, CropImageFilter, GrayFilter, ImageFilter, PixelGrabber, ReplicateScaleFilter, RGBImageFilter

public interface ImageConsumer

The interface for objects expressing interest in image data through the ImageProducer interfaces. When a consumer is added to an image producer, the producer delivers all of the data about the image using the method calls defined in this interface.

See Also:
ImageProducer

Field Summary
static int COMPLETESCANLINES
          The pixels will be delivered in (multiples of) complete scanlines at a time.
static int IMAGEABORTED
          The image creation process was deliberately aborted.
static int IMAGEERROR
          An error was encountered while producing the image.
static int RANDOMPIXELORDER
          The pixels will be delivered in a random order.
static int SINGLEFRAME
          The image contain a single static image.
static int SINGLEFRAMEDONE
          One frame of the image is complete but there are more frames to be delivered.
static int SINGLEPASS
          The pixels will be delivered in a single pass.
static int STATICIMAGEDONE
          The image is complete and there are no more pixels or frames to be delivered.
static int TOPDOWNLEFTRIGHT
          The pixels will be delivered in top-down, left-to-right order.
 
Method Summary
 void imageComplete(int status)
          The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the image has occured.
 void setColorModel(ColorModel model)
          Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls.
 void setDimensions(int width, int height)
          The dimensions of the source image are reported using the setDimensions method call.
 void setHints(int hintflags)
          Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer.
 void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)
          Delivers the pixels of the image with one or more calls to this method.
 void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)
          The pixels of the image are delivered using one or more calls to the setPixels method.
 void setProperties(Hashtable<?,?> props)
          Sets the extensible list of properties associated with this image.
 

Field Detail

RANDOMPIXELORDER

static final int RANDOMPIXELORDER
The pixels will be delivered in a random order. This tells the ImageConsumer not to use any optimizations that depend on the order of pixel delivery, which should be the default assumption in the absence of any call to the setHints method.

See Also:
setHints(int), Constant Field Values

TOPDOWNLEFTRIGHT

static final int TOPDOWNLEFTRIGHT
The pixels will be delivered in top-down, left-to-right order.

See Also:
setHints(int), Constant Field Values

COMPLETESCANLINES

static final int COMPLETESCANLINES
The pixels will be delivered in (multiples of) complete scanlines at a time.

See Also:
setHints(int), Constant Field Values

SINGLEPASS

static final int SINGLEPASS
The pixels will be delivered in a single pass. Each pixel will appear in only one call to any of the setPixels methods. An example of an image format which does not meet this criterion is a progressive JPEG image which defines pixels in multiple passes, each more refined than the previous.

See Also:
setHints(int), Constant Field Values

SINGLEFRAME

static final int SINGLEFRAME
The image contain a single static image. The pixels will be defined in calls to the setPixels methods and then the imageComplete method will be called with the STATICIMAGEDONE flag after which no more image data will be delivered. An example of an image type which would not meet these criteria would be the output of a video feed, or the representation of a 3D rendering being manipulated by the user. The end of each frame in those types of images will be indicated by calling imageComplete with the SINGLEFRAMEDONE flag.

See Also:
setHints(int), imageComplete(int), Constant Field Values

IMAGEERROR

static final int IMAGEERROR
An error was encountered while producing the image.

See Also:
imageComplete(int), Constant Field Values

SINGLEFRAMEDONE

static final int SINGLEFRAMEDONE
One frame of the image is complete but there are more frames to be delivered.

See Also:
imageComplete(int), Constant Field Values

STATICIMAGEDONE

static final int STATICIMAGEDONE
The image is complete and there are no more pixels or frames to be delivered.

See Also:
imageComplete(int), Constant Field Values

IMAGEABORTED

static final int IMAGEABORTED
The image creation process was deliberately aborted.

See Also:
imageComplete(int), Constant Field Values
Method Detail

setDimensions

void setDimensions(int width,
                   int height)
The dimensions of the source image are reported using the setDimensions method call.

Parameters:
width - the width of the source image
height - the height of the source image

setProperties

void setProperties(Hashtable<?,?> props)
Sets the extensible list of properties associated with this image.

Parameters:
props - the list of properties to be associated with this image

setColorModel

void setColorModel(ColorModel model)
Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls. Note that each set of pixels delivered using setPixels contains its own ColorModel object, so no assumption should be made that this model will be the only one used in delivering pixel values. A notable case where multiple ColorModel objects may be seen is a filtered image when for each set of pixels that it filters, the filter determines whether the pixels can be sent on untouched, using the original ColorModel, or whether the pixels should be modified (filtered) and passed on using a ColorModel more convenient for the filtering process.

Parameters:
model - the specified ColorModel
See Also:
ColorModel

setHints

void setHints(int hintflags)
Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer. The ImageProducer can deliver the pixels in any order, but the ImageConsumer may be able to scale or convert the pixels to the destination ColorModel more efficiently or with higher quality if it knows some information about how the pixels will be delivered up front. The setHints method should be called before any calls to any of the setPixels methods with a bit mask of hints about the manner in which the pixels will be delivered. If the ImageProducer does not follow the guidelines for the indicated hint, the results are undefined.

Parameters:
hintflags - a set of hints that the ImageConsumer uses to process the pixels

setPixels

void setPixels(int x,
               int y,
               int w,
               int h,
               ColorModel model,
               byte[] pixels,
               int off,
               int scansize)
Delivers the pixels of the image with one or more calls to this method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m,n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as bytes.

Parameters:
x, y - the coordinates of the upper-left corner of the area of pixels to be set
w - the width of the area of pixels
h - the height of the area of pixels
model - the specified ColorModel
pixels - the array of pixels
off - the offset into the pixels array
scansize - the distance from one row of pixels to the next in the pixels array
See Also:
ColorModel

setPixels

void setPixels(int x,
               int y,
               int w,
               int h,
               ColorModel model,
               int[] pixels,
               int off,
               int scansize)
The pixels of the image are delivered using one or more calls to the setPixels method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m,n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as ints. this method are all stored as ints.

Parameters:
x, y - the coordinates of the upper-left corner of the area of pixels to be set
w - the width of the area of pixels
h - the height of the area of pixels
model - the specified ColorModel
pixels - the array of pixels
off - the offset into the pixels array
scansize - the distance from one row of pixels to the next in the pixels array
See Also:
ColorModel

imageComplete

void imageComplete(int status)
The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the image has occured. The ImageConsumer should remove itself from the list of consumers registered with the ImageProducer at this time, unless it is interested in successive frames.

Parameters:
status - the status of image loading
See Also:
ImageProducer.removeConsumer(java.awt.image.ImageConsumer)

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

7 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1886
Document créé le 31/08/06 00:00, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/awt/image/ImageConsumer.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,63 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Les experts sont formels et unanimes : en règle générale, l'ordinateur le mieux adapté à vos besoins est commercialisé environ deux jours après que vous ayez acheté un autre modèle !

Dave Barry
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 14:54, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)