GPC  v1.0.0-2516
Gorman Print Control
IJB Class Referencefinal
Collaboration diagram for IJB:

Classes

struct  RecIJB
 Structure that represents the IBJ bimaps. More...
 

Public Member Functions

 IJB (void)
 Empty constructor. More...
 
 ~IJB (void)
 Destructor. More...
 
 IJB (const IJB &rhs)
 
IJBoperator= (const IJB &rhs)
 
IJBload (const File &filename)
 Load the given .ijb file. More...
 
std::string summary (void) const
 Summarize the .ijb as a text message for the user. More...
 
Image extract_image () const
 Extract the image data from contents, and re-build a new user-viewable image. More...
 
IJBset_new_image (const Image &new_image)
 
IJBrotate_image_180 (void)
 
const IJBcreate_browseable_image (const bool force=false) const
 Create a PNG file in the same directory as the IJB, and name it so it is obvious which image corresponds with each .ijb. More...
 

Public Attributes

VBytes contents
 The entire contents of the file is loaded into this vector. More...
 
const RecIJBrec
 Pointer to the bitmap record. Should point to nullptr or the first byte of contents. More...
 
File file
 .ijb file. More...
 
Image img
 The image file extracted, rotated, and flipped from the .ijb file. More...
 

Constructor & Destructor Documentation

◆ IJB()

IJB::IJB ( void  )

Empty constructor.

See also
load()

Referenced by ~IJB().

Here is the caller graph for this function:

◆ ~IJB()

IJB::~IJB ( void  )

Destructor.

References contents, extract_image(), file, IJB(), img, and rec.

Here is the call graph for this function:

Member Function Documentation

◆ load()

IJB & IJB::load ( const File &  filename)

Load the given .ijb file.

Exceptions
Lox::Exceptionif the file does not exist
Lox::Exceptionif the file is impossibly small (no content?)
Lox::Exceptionif the file cannot be opened (permission problem?)
Lox::Exceptionif the file is not a valid .ijb bitmap
Lox::Exceptionif the file has an invalid size (width, height, or length)

References contents, extract_image(), file, IJB::RecIJB::height, img, IJB::RecIJB::len, rec, and IJB::RecIJB::width.

Referenced by SessionComponent::buttonClicked(), and PrintJob::load_ijb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ summary()

std::string IJB::summary ( void  ) const

Summarize the .ijb as a text message for the user.

References contents, file, IJB::RecIJB::height, IJB::RecIJB::len, IJB::RecIJB::long_filename, rec, IJB::RecIJB::short_name, and IJB::RecIJB::width.

Referenced by PrintJob::load_ijb().

Here is the caller graph for this function:

◆ extract_image()

Image IJB::extract_image ( ) const

Extract the image data from contents, and re-build a new user-viewable image.

Instead of calling this directly, see the image stored as img.

References IJB::RecIJB::data, IJB::RecIJB::height, rec, and IJB::RecIJB::width.

Referenced by load(), and ~IJB().

Here is the caller graph for this function:

◆ set_new_image()

IJB & IJB::set_new_image ( const Image &  new_image)
Exceptions
Lox::Exceptionif the file cannot be replaced

References contents, create_browseable_image(), file, IJB::RecIJB::height, img, rec, IJB::RecIJB::short_name, and IJB::RecIJB::width.

Referenced by SessionComponent::buttonClicked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_browseable_image()

const IJB & IJB::create_browseable_image ( const bool  force = false) const

Create a PNG file in the same directory as the IJB, and name it so it is obvious which image corresponds with each .ijb.

Parameters
forceImages are only written if they don't already on disk, unless true is passed in which forces the image to be re-written.

References file, img, rec, and IJB::RecIJB::short_name.

Referenced by PrintJob::load_ijb(), and set_new_image().

Here is the caller graph for this function:

Member Data Documentation

◆ contents

VBytes IJB::contents

The entire contents of the file is loaded into this vector.

Referenced by load(), set_new_image(), summary(), and ~IJB().

◆ rec

const RecIJB* IJB::rec

Pointer to the bitmap record. Should point to nullptr or the first byte of contents.

Referenced by create_browseable_image(), SessionComponent::edit_description_field(), extract_image(), load(), SessionComponent::paintCell(), set_new_image(), summary(), and ~IJB().

◆ file

File IJB::file

◆ img

Image IJB::img

The image file extracted, rotated, and flipped from the .ijb file.

This is automatically done by extract_image() when the .ibj file is first loaded in load().

Referenced by SessionComponent::buttonClicked(), create_browseable_image(), load(), SessionComponent::paintCell(), set_new_image(), and ~IJB().