File Coverage

blib/lib/STIX/Observable/Extension/RasterImage.pm
Criterion Covered Total %
statement 26 26 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod n/a
total 35 35 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::Extension::RasterImage;
2              
3 24     24   600 use 5.010001;
  24         108  
4 24     24   165 use strict;
  24         70  
  24         754  
5 24     24   130 use warnings;
  24         55  
  24         1344  
6 24     24   172 use utf8;
  24         82  
  24         278  
7              
8 24     24   1283 use Types::Standard qw(Int HashRef);
  24         68  
  24         261  
9              
10 24     24   49916 use Moo;
  24         65  
  24         199  
11 24     24   12142 use namespace::autoclean;
  24         98  
  24         291  
12              
13             extends 'STIX::Object';
14              
15 24         2612 use constant PROPERTIES => (qw[
16             image_height
17             image_width
18             bits_per_pixel
19             exif_tags
20 24     24   4025 ]);
  24         119  
21              
22 24     24   208 use constant EXTENSION_TYPE => 'raster-image-ext';
  24         70  
  24         4305  
23              
24             has image_height => (is => 'rw', isa => Int);
25             has image_width => (is => 'rw', isa => Int);
26             has bits_per_pixel => (is => 'rw', isa => Int);
27             has exif_tags => (is => 'rw', isa => HashRef);
28              
29             1;
30              
31             =encoding utf-8
32              
33             =head1 NAME
34              
35             STIX::Observable::Extension::RasterImage - STIX Cyber-observable Object (SCO) - Raster Image File Extension
36              
37             =head1 SYNOPSIS
38              
39             use STIX::Observable::Extension::RasterImage;
40              
41             my $raster_image_ext = STIX::Observable::Extension::RasterImage->new();
42              
43              
44             =head1 DESCRIPTION
45              
46             The Raster Image file extension specifies a default extension for
47             capturing properties specific to image files.
48              
49             =head2 METHODS
50              
51             L inherits all methods from L
52             and implements the following new ones.
53              
54             =over
55              
56             =item STIX::Observable::Extension::RasterImage->new(%properties)
57              
58             Create a new instance of L.
59              
60             =item $raster_image->image_height
61              
62             Specifies the height of the image in the image file, in pixels.
63              
64             =item $raster_image->image_width
65              
66             Specifies the width of the image in the image file, in pixels.
67              
68             =item $raster_image->bits_per_pixel
69              
70             Specifies the sum of bits used for each color channel in the image in the image file,
71             and thus the total number of pixels used for expressing the color depth of the image.
72              
73             =item $raster_image->exif_tags
74              
75             Specifies the set of EXIF tags found in the image file, as a dictionary.
76             Each key/value pair in the dictionary represents the name/value of a single EXIF tag.
77              
78             =back
79              
80              
81             =head2 HELPERS
82              
83             =over
84              
85             =item $raster_image_ext->TO_JSON
86              
87             Helper for JSON encoders.
88              
89             =item $raster_image_ext->to_hash
90              
91             Return the object HASH.
92              
93             =item $raster_image_ext->to_string
94              
95             Encode the object in JSON.
96              
97             =item $raster_image_ext->validate
98              
99             Validate the object using JSON Schema (see L).
100              
101             =back
102              
103              
104             =head1 SUPPORT
105              
106             =head2 Bugs / Feature Requests
107              
108             Please report any bugs or feature requests through the issue tracker
109             at L.
110             You will be notified automatically of any progress on your issue.
111              
112             =head2 Source Code
113              
114             This is open source software. The code repository is available for
115             public review and contribution under the terms of the license.
116              
117             L
118              
119             git clone https://github.com/giterlizzi/perl-STIX.git
120              
121              
122             =head1 AUTHOR
123              
124             =over 4
125              
126             =item * Giuseppe Di Terlizzi
127              
128             =back
129              
130              
131             =head1 LICENSE AND COPYRIGHT
132              
133             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
134              
135             This is free software; you can redistribute it and/or modify it under
136             the same terms as the Perl 5 programming language system itself.
137              
138             =cut