Celartem::ImageWriteLock Class Reference

#include <pxl_imagewritable.h>

Inheritance diagram for Celartem::ImageWriteLock:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual u8getWritableBufferPtr (ssize_t *outRowStride, const Rect &inRect, bool inPreload=false)=0
virtual void write (const Rect &inRect, const void *inFirstLinePtr, ssize_t inRowStride)=0
virtual void flush ()=0


Detailed Description

ImageWriteLock manages the write (also read) access to an Image instance.
Any write access to the raw data of an Image instace should go through an ImageWriteLock instance.
Usually ImageWriteLock acquires exclusive access to the Image instance and no other ImageLock or ImageWriteLock can acquire access to the data of the
See also:
Image instance until the write lock is released. They are blocked until the release of write access.

ImageLock, Accessing to Raster Image Data, Image

Definition at line 27 of file pxl_imagewritable.h.


Member Function Documentation

virtual u8* Celartem::ImageWriteLock::getWritableBufferPtr ( ssize_t *  outRowStride,
const Rect inRect,
bool  inPreload = false 
) [pure virtual]

This method acquires the pointer to the raw data of the specified rectangle. You can access the raw data until the next any write or read access to the same ImageWriteLock instance. In some case, you want to reflect the changes immediately after your operations, then you can call flush method for that purpose.

Parameters:
outRowStride Pointer to the buffer that receives the row stride.
inRect This parameter specifies a portion to write/read.
inPreload If the value is false (the default), this function may not reflect the real raw data to the buffer returned; the buffer pointed by the returned pointer may be not initialized and you can not read any effective image data from that.
If the value is true, you can read the effective raw data from the buffer. With some type of Image implementation, it may take some time to load the image to the buffer.
If you don't have to see the original image, you had better let the value false (the default).
Returns:
Pointer to the raw data. You can not access to the data outside the rectangle specified by inRect parameter.
See also:
write, flush, Image::read

virtual void Celartem::ImageWriteLock::write ( const Rect inRect,
const void *  inFirstLinePtr,
ssize_t  inRowStride 
) [pure virtual]

This method writes the specified data directly to the internal buffer.

Parameters:
inRect This parameter specifies a portion to write/read.
inFirstLinePtr Pointer to the first line of the image data. For bottom-up images, it is not identical to the pointer to the memory block. See Accessing to Raster Image Data for more information.
inRowStride The number of bytes to be skipped to go to the next line. It could be a negative value and then the image is regarded as bottom-upped.

virtual void Celartem::ImageWriteLock::flush (  )  [pure virtual]

This method enforces any pending getWritableBufferPtr write operations.

See also:
getWritableBufferPtr


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:12 2008.