Just a quick question;
What is english term of:
In my dictionary it's: broad, vast, roomy, large, extent.Code:width * height
Seems not right.
Thanks in advance.
EDIT: It's width multiplied by height.
Printable View
Just a quick question;
What is english term of:
In my dictionary it's: broad, vast, roomy, large, extent.Code:width * height
Seems not right.
Thanks in advance.
EDIT: It's width multiplied by height.
Area (of a rectangle)?
It'll definitely be area of a rectangle.
Yeah, it's image.
So?Code:image.area = image.width * image.height
correct
Thank you very much! :D
Very weird tough in this context...
I thought it would be:Code:rgba_t *image = imageObject.getBits();
rgba_t *const imageEnd = image + imageObject.getArea();
while(image < imageEnd)
{
image++;
}
EDIT:Code:rgba_t *const imageEnd = image + imageObject.geSize();
Better?Code:rgba_t *const imageEnd = image + imageObject.geSize().getArea();
What is imageObject? It's kind of hard to speculate on how to call a method of an object without knowing its type. However, intuitively, there doesn't seem anything wrong with the first call... structurally they could all be wrong, though, for all I know.
Image object is...
Hell an instance of Image class which encapsulate image behaviours and properties, including low level image's raw data (linear array of bit -- getBits) which type unsigned char *, in this case it's RGBA color model image, so actually we need to cast it to rgba_t *.
And then to retrieve the end of image array we need to multiply width by height and is encapsulated in getArea method.
OK, stop!
We won't dig this example into deeper details. :D
Yeah, I assumed that much... however, I still couldn't suggest which of your examples is correct without seeing some class structures. If getArea is a method of class Image, then I'm sure the first example is fine. However, if getArea is, in fact, a method of another class that is returned by geSize, then the second example would be correct...
All in all... I don't really understand what you're asking. If these are your classes then why are you asking up how to call their methods?
Sorry for this misunderstanding..
I'm not asking how to call it but the name of method.
At #9, please look before the EDIT line.
Would it be getArea or getSize?
Since in low level term I think size would be more appropiate to describe width * height (that's size of array).
While in high level term, size contains both width and height, not width * height -- in this case what you guys tell me, area.
EDIT:
I got something to solve this naming method.
I think I will decoupling the Image class from ImageData class which have getSize method and Dimension which have getArea method. It's complex! Yeah!
Going with the way I have seen image files most often described, I think a normal english speaking programmer would assume this:
"size" would refer to the file size, eg in kB.
"area" would refer to width * height
"dimension" would refer to one of width or height (width is a dimension, height is a dimension).
So I don't know if having getArea as a sub-method of getSize is so appropriate...but not a big deal.