Beatmup
image_resolution.cpp
Go to the documentation of this file.
1 /*
2  Beatmup image and signal processing library
3  Copyright (C) 2019, lnstadrum
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "image_resolution.h"
20 
21 using namespace Beatmup;
22 
24 
26 
28  return (obj.width == width) && (obj.height == height);
29 }
30 
32  return !(*this == obj);
33 }
34 
35 
37  return width*height;
38 }
39 
41  return width*height / 1000000.0f;
42 }
43 
45  return (float)width / height;
46 }
47 
49  return (float)height / width;
50 }
51 
52 bool ImageResolution::fat() const {
53  return width >= height;
54 }
55 
56 void ImageResolution::set(unsigned int width, unsigned int height) {
57  this->width = width;
58  this->height = height;
59 }
Represents image size in pixels.
unsigned int height
width and height in pixels
bool operator==(const ImageResolution &) const
void set(unsigned int width, unsigned int height)
bool operator!=(const ImageResolution &) const
uint32_t msize
memory size
Definition: basic_types.h:30
jlong jint width
jlong jint jint height