BBitmapStream

Derived From:BPositionIO
Mix-in Classes:
Declared In:translation/BitmapStream.h
Library:libtranslation.so
Allocation:
Class Overview

Constructor and Destructor

BBitmapStream()

BBitmapStream(BBitmapmap = NULL);

Creates a new instance of BBitmapStream. If map is NULL, the stream is initialized to be empty. Otherwise, the BBitmap is converted to a translator bitmap and placed in the stream. The application shares the BBitmap with the BBitmapStream object. It therefore shouldn't delete the BBitmap without first calling DetachBitmap().

~BBitmapStream()

~BBitmapStream();

Frees all memory allocated by the BTranslatorRoster.


Member Functions

DetachBitmap()

status_t DetachBitmap(BBitmap** outMap);

Returns, in outMap, a BBitmap representing the image contained in the BBitmapStream. Once DetachBitmap() has been called, no further operations should be performed on the BBitmapStream.

Return CodeDescription

B_NO_ERROR.

Success.

B_BAD_VALUE.

outMap is NULL.

B_ERROR.

There is no BBitmap available.

Position(), ReadAt(), Seek(), SetSize(), WriteAt()

off_t Position() const;ssize_t ReadAt(off_t position,
               void* buffer,
               size_t size);
off_t Seek(off_t position,
           int32 whence);
status_t SetSize(off_t size) const;ssize_t WriteAt(off_t pos,
                const void* data,
                size_t size);

These methods provide the implementation for the BPositionIO. The class functions identically to BPositionIO with the exception of ReadAt() and WriteAt(), which read and write only translator bitmaps as described in the class introduction.

Size()

off_t Size() const;

Returns the number of bytes in the translator bitmap in the stream.

Creative Commons License
Legal Notice
This work is licensed under a Creative Commons Attribution-Non commercial-No Derivative Works 3.0 License.