1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/screendriver/inc/BITDRAW.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,548 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __BITDRAW_H__
1.20 +#define __BITDRAW_H__
1.21 +
1.22 +#include <gdi.h>
1.23 +#include <e32event_private.h>
1.24 +
1.25 +/**
1.26 +@publishedPartner
1.27 +@released
1.28 +*/
1.29 +enum TScreenDriverPanic
1.30 + {
1.31 + EScreenDriverPanicNoDevicePresent=1,
1.32 + EScreenDriverPanicInvalidParameter,
1.33 + EScreenDriverPanicInvalidDisplayMode,
1.34 + EScreenDriverPanicInvalidWindowHandle,
1.35 + EScreenDriverPanicOutOfBounds,
1.36 + EScreenDriverPanicZeroLength,
1.37 + EScreenDriverPanicNullPointer,
1.38 + EScreenDriverPanicInvalidPointer,
1.39 + EScreenDriverPanicAlphaBlendInvariant,
1.40 + EScreenDriverPanicIvalidMethodCall,
1.41 + EScreenDriverPanicInvalidSize,
1.42 + EScreenDriverPanicInvalidHalValue,
1.43 + EScreenDriverPanicInvalidScreenNo,
1.44 + EScreenDriverPanicIncompatiblePreviousDevice //<The previous device in SetDisplayMode was not compatible
1.45 + };
1.46 +
1.47 +/**
1.48 +@publishedPartner
1.49 +@released
1.50 +*/
1.51 +GLREF_C void Panic(TScreenDriverPanic aPanicCode);
1.52 +
1.53 +
1.54 +/**
1.55 +@publishedPartner
1.56 +@released
1.57 +*/
1.58 +class CFbsDrawDevice : public CBase
1.59 + {
1.60 +public:
1.61 + /**
1.62 + Defines possible Shadowmode values
1.63 + */
1.64 + enum TShadowMode
1.65 + {
1.66 + /** No Shadow mode is supported.
1.67 + */
1.68 + ENoShadow = 0x0,
1.69 + /** Shadow mode is supported.
1.70 + */
1.71 + EShadow = 0x1,
1.72 + /** Faded mode is supported.
1.73 + */
1.74 + EFade = 0x2,
1.75 + /** Shadow and faded mode is supported.
1.76 + */
1.77 + EShadowFade = 0x3
1.78 + };
1.79 + /**
1.80 + Defines possible rotation values
1.81 + */
1.82 + enum TOrientation
1.83 + {
1.84 + /** Normal orientation is supported.
1.85 + */
1.86 + EOrientationNormal,
1.87 + /** A 90 degree rotation is supported.
1.88 + */
1.89 + EOrientationRotated90,
1.90 + /** A 180 degree rotation is supported.
1.91 + */
1.92 + EOrientationRotated180,
1.93 + /** A 270 degree rotation is supported.
1.94 + */
1.95 + EOrientationRotated270
1.96 + };
1.97 +public:
1.98 + /**
1.99 + DEPRECATED: Use NewScreenDeviceL(TInt aScreenNo, TDisplayMode aDispMode)
1.100 +
1.101 + @deprecated
1.102 + */
1.103 + IMPORT_C static CFbsDrawDevice* NewScreenDeviceL(TScreenInfoV01 aInfo,TDisplayMode aDispMode);
1.104 +
1.105 + /**
1.106 + Creates a new screen device instance, which implements CFbsDrawDevice interface.
1.107 + The method has to be implemented for each type of supported video hardware.
1.108 + @param aScreenNo Screen number
1.109 + @param aDispMode Requested display mode
1.110 + @return A pointer to just created screen device, which implements CFbsDrawDevice interface
1.111 + @leave KErrNoMemory Not enough memory
1.112 + KErrNotSupported The requested screen device type is not supported
1.113 + */
1.114 + IMPORT_C static CFbsDrawDevice* NewScreenDeviceL(TInt aScreenNo, TDisplayMode aDispMode);
1.115 +
1.116 + /**
1.117 + DEPRECATED: Use NewBitmapDeviceL(const TSize& aSize, TDisplayMode aDispMode, TInt aDataStride)
1.118 +
1.119 + @deprecated
1.120 + */
1.121 + IMPORT_C static CFbsDrawDevice* NewBitmapDeviceL(TScreenInfoV01 aInfo, TDisplayMode aDispMode, TInt aDataStride);
1.122 +
1.123 + /**
1.124 + Creates a new bitmap device instance, which implements CFbsDrawDevice interface.
1.125 +
1.126 + @param aSize Bitmap device size
1.127 + @param aDispMode Bitmap display mode
1.128 + @param aDataStride Bitmap data stride
1.129 + @return A pointer to just created bitmap device, which implements CFbsDrawDevice interface
1.130 + @leave KErrNoMemory Not enough memory
1.131 + KErrArgument Invalid aSize value
1.132 + */
1.133 + IMPORT_C static CFbsDrawDevice* NewBitmapDeviceL(const TSize& aSize, TDisplayMode aDispMode, TInt aDataStride);
1.134 +
1.135 + /**
1.136 + Depending on current graphics hardware the method will return one of
1.137 + two possible 16M video modes:
1.138 + EColor16M or EColor16MU. If the hardware doesn't support EColor16M
1.139 + or EColor16MU mode, the return value will be ENone.
1.140 +
1.141 + @return EColor16M, EColor16MU or ENone.
1.142 + ENone - it means that current hardware doesn't support 16M color mode.
1.143 + */
1.144 + IMPORT_C static TDisplayMode DisplayMode16M();
1.145 +
1.146 + /**
1.147 + Return the display mode of the device.
1.148 + @return Display mode
1.149 + */
1.150 + virtual TDisplayMode DisplayMode() const = 0;
1.151 +
1.152 + /**
1.153 + Scanline width in pixels.
1.154 + The return value can be greater or equal than iSize.iWidth, because
1.155 + the scan line memory is allocated in 32-bit words and can be rounded up, if
1.156 + the display mode allows more than 1 pixel to be stored in a single byte.
1.157 + @return The (adjusted) width in pixels.
1.158 + */
1.159 + virtual TInt LongWidth() const = 0;
1.160 +
1.161 + /**
1.162 + Alter the colours within a defined rectangle according to the supplied mapping.
1.163 + The colour map is supplied as pairs of TRgb objects. One member of the pair defines a colour value
1.164 + to match, the other defines a colour to replace that value by.
1.165 + Note that, for comparison purposes, smaller gamuts (e.g. 64K colour) are mapped to TRgb form before
1.166 + comparison, so a colour that is not representable in the current display mode will not be matched.
1.167 + Pixels in the original that do not match an entry in the colour map are unchanged.
1.168 + @param aRect Area of the device/bitmap to be mapped in logical coordinates
1.169 + @param aColors Colour map. This should be provided as a set of TRgb pairs, one to be matched
1.170 + and the other to provide a replacement.
1.171 + @param aNumPairs Number of pairs of colours in aColors.
1.172 + @param aMapForwards If ETrue, match the first colour of a pair and replace by the second, otherwise
1.173 + match the second and replace by the first.
1.174 + @panic EScreenDriverPanicOutOfBounds if aRect transforms back to illegal physical coordinates.
1.175 + @panic EScreenDriverPanicNullPointer if aColors == NULL
1.176 + @panic EScreenDriverPanicZeroLength if aNumPairs == 0
1.177 + */
1.178 + virtual void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs,TBool aMapForwards) = 0;
1.179 +
1.180 + /**
1.181 + Reads a line of aLength pixels starting at [aX, aY] (in logical coordinates). The direction of reading
1.182 + is affected by the current orientation, and the "stride" taken in sampling pixels is affected by
1.183 + any scaling currently in force. Pixels are converted (if necessary) to the form specified by
1.184 + aDispMode before being written to the buffer. The entire line to be read must be within the
1.185 + physical bounds of the bitmap or device
1.186 + @param aX X coordinate of the pixel to start reading from (logical coordinates)
1.187 + @param aY Y coordinate of the pixel to start reading from(logical coordinates)
1.188 + @param aLength Number of pixels to read
1.189 + @param aBuffer Buffer to receive the pixel data (must be large enough)
1.190 + @param aDispMode Format to use for writing pixels into the buffer.
1.191 + @panic EScreenDriverPanicOutOfBounds if either end of the line is out of bounds
1.192 + @panic EScreenDriverPanicNullPointer if aBuffer == NULL
1.193 + @panic EScreenDriverPanicZeroLength if aLength == 0
1.194 + */
1.195 + virtual void ReadLine(TInt aX,TInt aY,TInt aLength,TAny* aBuffer,TDisplayMode aDispMode) const = 0;
1.196 +
1.197 + /**
1.198 + Get the colour of the pixel at the logical position [aX,aY]
1.199 + @param aX X-coordinate of pixel to read (logical coordinates)
1.200 + @param aY Y-coordinate of pixel to read (logical coordinates)
1.201 + @return The colour pf the pixel at [aX,aY]
1.202 + @panic EScreenDriverPanicOutOfBounds if [aX,aY] transforms back to illegal physical coordinates.
1.203 + */
1.204 + virtual TRgb ReadPixel(TInt aX,TInt aY) const = 0;
1.205 +
1.206 + /**
1.207 + Returns a pointer to a buffer large enough to read a line of pixels of maximum length. Ownership of
1.208 + the buffer is retained by the bitmap or device object. Repeated calls to this function will return
1.209 + the same buffer.
1.210 + @return A pointer to a scan line buffer
1.211 + */
1.212 + virtual TUint32* ScanLineBuffer() const = 0;
1.213 +
1.214 + /**
1.215 + Scanline width in bytes. The return value may be greater than the actual number of bytes needed
1.216 + to store the pixels, since scan line memory is allocated in 32-bit words and can be rounded up.
1.217 + @return The (adjusted) width in bytes.
1.218 + */
1.219 + virtual TInt ScanLineBytes() const = 0;
1.220 +
1.221 + /**
1.222 + Return the display mode to be used when passing pixel data to the device using the scanline buffer.
1.223 + @return Display mode
1.224 + @see CFbsDrawDevice::DisplayMode
1.225 + */
1.226 + virtual TDisplayMode ScanLineDisplayMode() const = 0;
1.227 +
1.228 + /**
1.229 + Returns the screen size in pixels, taking the orientation into account.
1.230 + Always prefer GetDrawRect() to SizeInPixels() call.
1.231 + GetDrawRect() will take into account possible non-[0,0] top-left corner of the drawing
1.232 + rectangle if the device is scaled.
1.233 + @return TSize Screen size in pixels
1.234 + */
1.235 + virtual TSize SizeInPixels() const = 0;
1.236 +
1.237 + /**
1.238 + Allows the caller to calculate the physical size of a bitmap on the current hardware
1.239 + by calculating how many twips a 1000-pixel wide bitmap would be. Only applicable to
1.240 + screen-based devices; bitmap devices return 0.
1.241 + @return Twips per 1000 pixels
1.242 + */
1.243 + virtual TInt HorzTwipsPerThousandPixels() const = 0;
1.244 +
1.245 + /**
1.246 + Allows the caller to calculate the physical size of a bitmap on the current hardware
1.247 + by calculating how many twips a 1000-pixel high bitmap would be. Only applicable to
1.248 + screen-based devices; bitmap devices return 0.
1.249 + @return Twips per 1000 pixels
1.250 + */
1.251 + virtual TInt VertTwipsPerThousandPixels() const = 0;
1.252 +
1.253 + /**
1.254 + Reports on which orientations are available on the device/bitmap.
1.255 + @param aOrientation Array to receive the capability (use CFbsDrawDevice::TOrientation as an index)
1.256 + */
1.257 + virtual void OrientationsAvailable(TBool aOrientation[4]) = 0;
1.258 +
1.259 + /**
1.260 + Set the orientation of the device
1.261 + @param aOrientation Orientation to set
1.262 + @return ETrue if the new orientation was set successfully, EFalse otherwise
1.263 + */
1.264 + virtual TBool SetOrientation(TOrientation aOrientation) = 0;
1.265 +
1.266 + /**
1.267 + Combines the current content of the device/bitmap with a supplied colour, based on a bitmask and
1.268 + a draw mode. The bitmask is supplied as an array of TUint32s, one for each line (so there should
1.269 + be aHeight entries in the array). Since one word is used per line, aLength must be <= 32. Each bit
1.270 + of the mask controls one pixel - if the bit is 1, the pixel is combined with aColor, if the bit
1.271 + is 0, the pixel is left unchanged. Note that bits in the bitmask are examined in low-high order,
1.272 + so bit0 affects the pixel at aX, bit1 affects the pixel at aX+1 and so forth.
1.273 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.274 + @param aX Left edge of the rectangle (logical coordinates)
1.275 + @param aY Top edge of the rectangle (logical coordinates)
1.276 + @param aBuffer Array of bitmasks - one per line
1.277 + @param aLength Width of the rectangle (must be >0 and <= 32)
1.278 + @param aHeight Height of the rectangle (== number of entries in aBuffer)
1.279 + @param aColor Colour to combine with the existing pixel data
1.280 + @param aDrawMode Combination function for source and destination pixels.
1.281 + @panic EScreenDriverPanicOutOfBounds If any part of the rectangle maps to an illegal physical coordinate
1.282 + or if aLength > 32.
1.283 + @panic EScreenDriverPanicNullPointer If aBuffer == NULL
1.284 + @panic EScreenDriverPanicZeroLength If aLength <= 0
1.285 + */
1.286 + virtual void WriteBinary(TInt aX,TInt aY,TUint32* aBuffer,TInt aLength,TInt aHeight,TRgb aColor,CGraphicsContext::TDrawMode aDrawMode) = 0;
1.287 +
1.288 + /**
1.289 + Combines the current content of the device/bitmap with a supplied colour, based on a bitmask and
1.290 + a draw mode. This function differs from WriteBinary, in that aLength can be greater than 32, and
1.291 + the height is implicitly 1. aBuffer must contain sufficient elements to hold aLength bits
1.292 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.293 + @param aX Starting X coordinate (logical coordinates)
1.294 + @param aY Starting Y coordinate (logical coordinates)
1.295 + @param aBuffer Array of bitmasks
1.296 + @param aLength Number of pixels
1.297 + @param aColor Colour to combine with existing pixels
1.298 + @param aDrawMode Combination function for source and destination pixels.
1.299 + @panic EScreenDriverPanicOutOfBounds If any part of the line maps to an illegal physical coordinate
1.300 + @panic EScreenDriverPanicNullPointer If aBuffer == NULL
1.301 + @panic EScreenDriverPanicZeroLength If aLength <= 0
1.302 + @see WriteBinary
1.303 + */
1.304 + virtual void WriteBinaryLine(TInt aX,TInt aY,TUint32* aBuffer,TInt aLength,TRgb aColor,CGraphicsContext::TDrawMode aDrawMode) = 0;
1.305 +
1.306 + /**
1.307 + Similar to WriteBinaryLine, but writes a vertical, rather than a horizontal line. LIne is drawn upward
1.308 + (decreasing Y) if aUp == ETrue.
1.309 + @see WriteBinaryLine
1.310 + */
1.311 + virtual void WriteBinaryLineVertical(TInt aX,TInt aY,TUint32* aBuffer,TInt aHeight,TRgb aColor,CGraphicsContext::TDrawMode aDrawMode,TBool aUp) = 0;
1.312 +
1.313 + /**
1.314 + Write the given colour to the location [aX,aY], combining it with the existing pixel
1.315 + using aDrawMode
1.316 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.317 + @param aX X coordinate (logical coordinates)
1.318 + @param aY Y coordinate (logical coordinates)
1.319 + @param aColor Colour to write
1.320 + @param aDrawMode Combination function for source and destination pixels.
1.321 + @panic EScreenDriverPanicOutOfBounds If [aX,aY] maps to an illegal physical address
1.322 + */
1.323 + virtual void WriteRgb(TInt aX,TInt aY,TRgb aColor,CGraphicsContext::TDrawMode aDrawMode) = 0;
1.324 +
1.325 + /**
1.326 + Write the given colour to the rectangle [aX,aY] - [aX+aLength,aY+aHeight], combining it
1.327 + with the exiasting pixels using aDrawMode
1.328 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.329 + @param aX X coordinate (logical coordinates)
1.330 + @param aY Y coordinate (logical coordinates)
1.331 + @param aLength Width of the rectangle (logical coordinates)
1.332 + @param aHeight Height of the rectangle (logical coordinates)
1.333 + @param aColor Colour to write
1.334 + @param aDrawMode Combination function for source and destination pixels.
1.335 + @panic EScreenDriverPanicOutOfBounds If any part of the rectangle maps to an illegal physical address
1.336 + */
1.337 + virtual void WriteRgbMulti(TInt aX,TInt aY,TInt aLength,TInt aHeight,TRgb aColor,CGraphicsContext::TDrawMode aDrawMode) = 0;
1.338 +
1.339 + /**
1.340 + The method performs an alpha blending of the source data - aRgbBuffer and screen pixels, using
1.341 + the data from aMaskBuffer buffer as an alpha blending factor.
1.342 + The formula used for that, is:
1.343 + (C1 * A + C2 * (255 - A)) / 255, where:
1.344 + - C1 - a pixel from aRgbBuffer;
1.345 + - C2 - a pixel from the sceen;
1.346 + - A - a pixel from aMaskBuffer;
1.347 + The content of source and mask buffers is preserved.
1.348 + The calculated alpha blended pixel is written to the destination - the screen or a bitmap.
1.349 + If the shadowing/fading flag is set, a shadow/fade copy of the source bitmap will be used.
1.350 + @param aX Logical X coordinate of the start of the line.
1.351 + @param aY Logical Y coordinate of the line.
1.352 + @param aLength Source data - length in pixels.
1.353 + @param aRgbBuffer A pointer to a line of the source bitmap data.
1.354 + Must be in ERgb format.
1.355 + @param aMaskBuffer Buffer containing the data which should be used as an
1.356 + alpha blending factor. Must be in EGray256 format.
1.357 + @param aDrawMode Combination function for source and destination pixels.
1.358 + @panic EScreenDriverPanicOutOfBounds If any part of the line maps to an illegal physical address
1.359 + */
1.360 + virtual void WriteRgbAlphaLine(TInt aX,TInt aY,TInt aLength,TUint8* aRgbBuffer,TUint8* aMaskBuffer, CGraphicsContext::TDrawMode aDrawMode) = 0;
1.361 +
1.362 + /**
1.363 + Combine the data in aBuffer with existing pixels along the line [aX,aY]-[aX+aLength,aY],
1.364 + using aDrawMode as the combining function.
1.365 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.366 + @param aX Logical X coordinate of the start of the line.
1.367 + @param aY Logical Y coordinate of the line.
1.368 + @param aLength Source data - length in pixels.
1.369 + @param aBuffer Source data. Must be in the format returned by ScanLineDisplayMode().
1.370 + @param aDrawMode Combination function for source and destination pixels.
1.371 + @panic EScreenDriverPanicOutOfBounds If any part of the line maps to an illegal physical address
1.372 + */
1.373 + virtual void WriteLine(TInt aX,TInt aY,TInt aLength,TUint32* aBuffer,CGraphicsContext::TDrawMode aDrawMode) = 0;
1.374 +public:
1.375 +
1.376 + /**
1.377 + Do any necessary initialisation on screen devices (default applies to bitmaps)
1.378 + @return Success/failure code
1.379 + */
1.380 + virtual TInt InitScreen() {return(KErrNone);}
1.381 +
1.382 + /** Sets or unsets auto-update for the screen.
1.383 +
1.384 + @param aValue ETrue, if the screen is set to auto-update; EFalse, otherwise.
1.385 + */
1.386 + virtual void SetAutoUpdate(TBool aValue) {(void) aValue;} // To avoid compiler warning for unused parameter
1.387 +
1.388 + /**
1.389 + Set the internal data buffer to point to the supplied buffer. No checks are made that the buffer
1.390 + is appropriate for the purpose. Ownership is not taken.
1.391 + @param aBits A buffer of sufficient size.
1.392 + */
1.393 + virtual void SetBits(TAny*) {}
1.394 +
1.395 + /**
1.396 + Set up a custom palette for those bit formats that support palettised colour
1.397 + @param aPalette Palette to use
1.398 + @return Success/failure code
1.399 + */
1.400 + virtual TInt SetCustomPalette(const CPalette*) { return KErrNotSupported; }
1.401 +
1.402 + /**
1.403 + Retrieve a custom palette, if the bit format supports it.
1.404 + @param aPalette Pointer to a CPalette. The palette will be created by this function.
1.405 + @return Success/failure code
1.406 + */
1.407 + virtual TInt GetCustomPalette(CPalette*&) { return KErrNotSupported; }
1.408 +
1.409 + /**
1.410 + Copies all settings (scaling, orientation, etc.) from the supplied device
1.411 + and reinitialised the current device.
1.412 + @param aDrawDevice Device to get settings from
1.413 + */
1.414 + virtual void SetDisplayMode(CFbsDrawDevice*) {}
1.415 +
1.416 + /**
1.417 + Set the origin point of the dither matrix (if appropriate)
1.418 + @param aPoint Dither origin (logical coordiantes)
1.419 + */
1.420 + virtual void SetDitherOrigin(const TPoint&) {}
1.421 +
1.422 + /**
1.423 + Sets the user display mode - used for certain colour mapping functions
1.424 + */
1.425 + virtual void SetUserDisplayMode(TDisplayMode) {}
1.426 +
1.427 + /**
1.428 + Sets the current shadowing mode
1.429 + @see TShadowMode
1.430 + */
1.431 + virtual void SetShadowMode(TShadowMode) {}
1.432 +
1.433 + /**
1.434 + Set the current fading parameters
1.435 + @param aBlackMap Black point
1.436 + @param aWhiteMap White point
1.437 + */
1.438 + virtual void SetFadingParameters(TUint8 /*aBlackMap*/,TUint8 /*aWhiteMap*/) {}
1.439 +
1.440 + /**
1.441 + Apply shadow processing to all the pixels in the supplied rectangle
1.442 + @param aRect Area to apply shadow processing to (logical coordinates)
1.443 + @panic EScreenDriverPanicOutOfBounds If any part of the rectangle maps to an illegal physical address
1.444 + */
1.445 + virtual void ShadowArea(const TRect&) {} // Obeys shadow mode
1.446 +
1.447 + /**
1.448 + Applies shadow processing to the supplied buffer
1.449 + @param aLength Length of buffer in pixels
1.450 + @param aBuffer Buffer to process in the format returned by ScanLineDisplayMode()
1.451 + @panic EScreenDriverPanicZeroLength If aLength <= 0
1.452 + @panic EScreenDriverPanicNullPointer If aBuffer == NULL
1.453 + */
1.454 + virtual void ShadowBuffer(TInt,TUint32*) {} // Obeys shadow mode
1.455 +
1.456 + /**
1.457 + Update the screen with the update region.
1.458 + */
1.459 + virtual void Update() {}
1.460 +
1.461 + /**
1.462 + Update the screen with the union of the update and specified regions.
1.463 + @param aRegion Region to update (logical coordinates)
1.464 + */
1.465 + virtual void Update(const TRegion&) {}
1.466 +
1.467 + /**
1.468 + Update the update region.
1.469 + @param aRegion Region to update (logical coordinates)
1.470 + */
1.471 + virtual void UpdateRegion(const TRect&) {}
1.472 +public:
1.473 +
1.474 + /**
1.475 + Blend aColor with the pixels along the line [aX,aY]-[aX+aLength,aY], using aMaskBuffer
1.476 + as alpha data
1.477 + If the shadowing/fading flag is set, a shadow/fade copy of the source bitmap will be used.
1.478 + @param aX Logical X coordinate of the start of the line
1.479 + @param aY Logical Y coordinate of the line.
1.480 + @param aLength Length of line to modify
1.481 + @param aColor Colour to blend with existing pixels
1.482 + @param aMaskBuffer Buffer containing the data which should be used as an
1.483 + alpha blending factor.
1.484 + @panic EScreenDriverPanicOutOfBounds If any part of the line maps to an illegal physical address
1.485 + */
1.486 + virtual void WriteRgbAlphaMulti(TInt aX,TInt aY,TInt aLength,TRgb aColor,const TUint8* aMaskBuffer) = 0;
1.487 +
1.488 + /**
1.489 + The method performs an alpha blending of the source data - aRgbBuffer1 and aBuffer2, using
1.490 + the data from aMaskBuffer buffer as an alpha blending factor.
1.491 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.492 + The formula used for that, is:
1.493 + (C1 * A + C2 * (255 - A)) / 255, where:
1.494 + - C1 - a pixel from aRgbBuffer1;
1.495 + - C2 - a pixel from aBuffer2;
1.496 + - A - a pixel from aMaskBuffer;
1.497 + The content of source and mask buffers is preserved.
1.498 + The calculated alpha blended pixel is written to the destination - the screen or a bitmap.
1.499 + If the shadowing/fading flag is set, the resulting pixels will be shadowed/faded.
1.500 + @param aX Logical X coordinate of the position in the target the result should be drawn to.
1.501 + @param aY Logical Y coordinate of the position in the target the result should be drawn to.
1.502 + @param aLength Source data - length in pixels.
1.503 + @param aRgbBuffer1 A pointer to a line of the source bitmap data 1.
1.504 + Must be in ERgb format.
1.505 + @param aBuffer2 A pointer to a line of the source bitmap data 2.
1.506 + Must be in the format returned by ScanLineDisplayMode().
1.507 + @param aMaskBuffer Buffer containing the data which should be used as an
1.508 + alpha blending factor. Must be in EGray256 format.
1.509 + @param aDrawMode Drawing mode
1.510 + */
1.511 + virtual void WriteRgbAlphaLine(TInt aX,TInt aY,TInt aLength,
1.512 + const TUint8* aRgbBuffer1,
1.513 + const TUint8* aBuffer2,
1.514 + const TUint8* aMaskBuffer,
1.515 + CGraphicsContext::TDrawMode aDrawMode) = 0;
1.516 + /**
1.517 + Retrieves a pointer to the specified CFbsDrawDevice interface extension.
1.518 + @param aInterfaceId Interface identifier of the interface to be retrieved.
1.519 + @param aInterface Address of pointer variable that retrieves the specified interface.
1.520 + @return KErrNone If the interface is supported, KErrNotSupported otherwise.
1.521 + @see BitDrawInterfaceId.h file for the IDs of supported interfaces
1.522 + */
1.523 + virtual TInt GetInterface(TInt aInterfaceId, TAny*& aInterface) = 0;
1.524 +
1.525 + /**
1.526 + Gets logical coordinates of the drawing rectangle.
1.527 + If the device is not scaled and with zero origin, logocal coordinates of
1.528 + the drawing rectangle are the same as its physical coordinates.
1.529 + If the device is rotated, drawing rectangle width and height are swapped.
1.530 + Always prefer GetDrawRect() to SizeInPixels() call. SizeInPixels() will return
1.531 + drawing rectangle width and height. But if the device is scaled or with nonzero origin,
1.532 + GetDrawRect() will take into account and the top-left corner of the drawing rectangle too,
1.533 + which may not be [0, 0].
1.534 + @param aDrawRect Upon return aRect contains drawing rectangle logical coordinates.
1.535 + */
1.536 + virtual void GetDrawRect(TRect& aDrawRect) const = 0;
1.537 +
1.538 + /**
1.539 + The method swaps bitmap device's width and height.
1.540 + For example: if the size is (40, 20), the swapped size will be (20, 40).
1.541 + The device's content is not preserved.
1.542 + The method leaves CDrawBitmap object in a consistent state -
1.543 + scaling settings will be set with their default values (the scaling is switched off),
1.544 + iDitherOrigin will be set to (0,0), iOrigin to (0,0).
1.545 + Note: This method is used internally by BITGDI component. Do not call it!
1.546 + */
1.547 + virtual void SwapWidthAndHeight() = 0;
1.548 + };
1.549 +
1.550 +#endif
1.551 +